Throw extension if context creation fails

This aligns behavior with that of the other platforms.
This commit is contained in:
Stefanos A 2013-10-03 17:22:13 +02:00
parent 80845315db
commit 913c4f16e6

View file

@ -68,7 +68,9 @@ namespace OpenTK.Platform.SDL2
} }
if (SdlContext == ContextHandle.Zero) 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(); Handle = GraphicsContext.GetCurrentContext();
} }