Move CheckGlVersion to OpenGL.

This commit is contained in:
Paul Chote
2015-12-28 10:59:43 +00:00
parent d96a32a89f
commit 4372ed650e
3 changed files with 34 additions and 32 deletions

View File

@@ -76,16 +76,7 @@ namespace OpenRA.Platforms.Default
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()));
OpenGL.LoadDelegates();
ErrorHandler.CheckGlVersion();
ErrorHandler.CheckGlError();
if (SDL.SDL_GL_ExtensionSupported("GL_EXT_framebuffer_object") == SDL.SDL_bool.SDL_FALSE)
{
OpenGL.WriteGraphicsLog("OpenRA requires the OpenGL extension GL_EXT_framebuffer_object.\n"
+ "Please try updating your GPU driver to the latest version provided by the manufacturer.");
throw new InvalidProgramException("Missing OpenGL extension GL_EXT_framebuffer_object. See graphics.log for details.");
}
OpenGL.Initialize();
OpenGL.glEnableVertexAttribArray(Shader.VertexPosAttributeIndex);
ErrorHandler.CheckGlError();