From a5422fecedfe9a0a7647e540c6c81648322e8d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 4 May 2014 11:26:55 +0200 Subject: [PATCH] only query for the extension we need --- OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs b/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs index 35cda16564..cf5dadc280 100755 --- a/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs +++ b/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs @@ -31,15 +31,6 @@ namespace OpenRA.Renderer.Sdl2 public class Sdl2GraphicsDevice : IGraphicsDevice { - static string[] requiredExtensions = - { - // TODO: not ARB anymore - "GL_ARB_vertex_shader", - "GL_ARB_fragment_shader", - "GL_ARB_vertex_buffer_object", - "GL_EXT_framebuffer_object" - }; - Size size; Sdl2Input input; IntPtr context, window; @@ -90,15 +81,11 @@ namespace OpenRA.Renderer.Sdl2 GL.LoadAll(); ErrorHandler.CheckGlError(); - var extensions = GL.GetString(StringName.Extensions); - if (extensions == null) - Console.WriteLine("Failed to fetch GL_EXTENSIONS, this is bad."); - - var missingExtensions = requiredExtensions.Where(r => !extensions.Contains(r)).ToArray(); - if (missingExtensions.Any()) + if (SDL.SDL_GL_ExtensionSupported("GL_EXT_framebuffer_object") == SDL.SDL_bool.SDL_FALSE) { - ErrorHandler.WriteGraphicsLog("Unsupported GPU: Missing extensions: {0}".F(missingExtensions.JoinWith(","))); - throw new InvalidProgramException("Unsupported GPU. See graphics.log for details."); + ErrorHandler.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."); } GL.EnableClientState(ArrayCap.VertexArray);