From b66e077376c1475b0ad8e93cd6ea28a0d3c2a73d Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Thu, 29 Sep 2022 19:21:47 -0700 Subject: [PATCH] GraphicsDevice throw if backend invalid --- src/Graphics/GraphicsDevice.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Graphics/GraphicsDevice.cs b/src/Graphics/GraphicsDevice.cs index 0f9fcbb..97fd954 100644 --- a/src/Graphics/GraphicsDevice.cs +++ b/src/Graphics/GraphicsDevice.cs @@ -29,6 +29,11 @@ namespace MoonWorks.Graphics { 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( Conversions.BoolToByte(debugMode) );