Ensure that we have a working OpenGL context.

This commit is contained in:
Guido L
2015-09-06 01:48:42 +02:00
committed by Oliver Brakmann
parent 3175ef4d67
commit d0447fd97e

View File

@@ -75,7 +75,9 @@ namespace OpenRA.Platforms.Default
} }
context = SDL.SDL_GL_CreateContext(window); context = SDL.SDL_GL_CreateContext(window);
SDL.SDL_GL_MakeCurrent(window, context); if (context == IntPtr.Zero || SDL.SDL_GL_MakeCurrent(window, context) < 0)
throw new InvalidOperationException("Can not create OpenGL context. (Error: {0})".F(SDL.SDL_GetError()));
GraphicsContext.CurrentContext = context; GraphicsContext.CurrentContext = context;
GL.LoadAll(); GL.LoadAll();