From 913c4f16e6b5841a2593ea06758de243f02f892c Mon Sep 17 00:00:00 2001 From: Stefanos A Date: Thu, 3 Oct 2013 17:22:13 +0200 Subject: [PATCH] Throw extension if context creation fails This aligns behavior with that of the other platforms. --- Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs b/Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs index 5dee13f7..7bd759bb 100644 --- a/Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs +++ b/Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs @@ -68,7 +68,9 @@ namespace OpenTK.Platform.SDL2 } if (SdlContext == ContextHandle.Zero) { - Debug.Print("SDL2 failed to create OpenGL context: {0}", SDL.SDL_GetError()); + var error = SDL.SDL_GetError(); + Debug.Print("SDL2 failed to create OpenGL context: {0}", error); + throw new GraphicsContextException(error); } Handle = GraphicsContext.GetCurrentContext(); }