FosterFramework / Foster

A small C# game framework
MIT License
422 stars 37 forks source link

App keeps running after the platform throws an error. #65

Closed cerealpxl closed 6 months ago

cerealpxl commented 6 months ago

Hello When the application creates a window with (0, 0) size, the console logs an error but the app keeps running and throwing more errors.

image

You can replicate it writing something like:

App.Run("app", 0, 0);
kuujoo commented 6 months ago

0,0 is invalid value for size, causing the platform library to fail to start.

if (fstate.desc.width <= 0 || fstate.desc.height <= 0)
{
  FosterLogError("Foster invalid application width/height (%i, %i)", desc.width, desc.height);
  return;
}

Perhaps C# side could check if the platform library is running after the 'FosterStartup' call. If not throw C# exception or early exit.

NoelFB commented 6 months ago

Should be fixed now with #66, will throw an exception and stop.