GraphicsDevice throw if backend invalid

custom_video_shaders
cosmonaut 2022-09-29 19:21:47 -07:00
parent 07c0b1b9a2
commit b66e077376
1 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,11 @@ namespace MoonWorks.Graphics
{ {
Backend = (Backend) Refresh.Refresh_SelectBackend((Refresh.Backend) preferredBackend, out windowFlags); Backend = (Backend) Refresh.Refresh_SelectBackend((Refresh.Backend) preferredBackend, out windowFlags);
if (Backend == Backend.Invalid)
{
throw new System.Exception("Could not set graphics backend!");
}
Handle = Refresh.Refresh_CreateDevice( Handle = Refresh.Refresh_CreateDevice(
Conversions.BoolToByte(debugMode) Conversions.BoolToByte(debugMode)
); );