Merge pull request #9474 from obrakmann/pr9217

Ensure that we have a working OpenGL context.
This commit is contained in:
Oliver Brakmann
2015-09-28 18:26:51 +02:00

View File

@@ -75,7 +75,9 @@ namespace OpenRA.Platforms.Default
}
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;
GL.LoadAll();