]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_shared.c
Add "originscale" parameter to r_editlights (may be useful if map was scaled)
[xonotic/darkplaces.git] / vid_shared.c
index 43d5e698683f8de6a10ee6ae4c525669ea76ca10..b092f4872aa28f94f8e570a81b4ef5627a267b3a 100644 (file)
@@ -835,13 +835,23 @@ void VID_CheckExtensions(void)
                Sys_Error("OpenGL 1.1.0 functions not found");
        vid.support.gl20shaders = GL_CheckExtension("2.0", gl20shaderfuncs, "-noshaders", false);
 
-       // this one is purely optional, needed for GLSL 1.3 support (#version 130), so we don't even check the return value of GL_CheckExtension
-       GL_CheckExtension("2.0", glsl130funcs, "-noglsl130", false);
-
        CHECKGLERROR
 
        Con_DPrint("Checking OpenGL extensions...\n");
 
+       // this one is purely optional, needed for GLSL 1.3 support (#version 130), so we don't even check the return value of GL_CheckExtension
+       vid.support.gl20shaders130 = GL_CheckExtension("2.0", glsl130funcs, "-noglsl130", false);
+       if(vid.support.gl20shaders130)
+       {
+               char *s = (char *) qglGetString(GL_SHADING_LANGUAGE_VERSION);
+               if(!s || atof(s) < 1.30 - 0.00001)
+                       vid.support.gl20shaders130 = 0;
+       }
+       if(vid.support.gl20shaders130)
+               Con_DPrintf("Using GLSL 1.30\n");
+       else
+               Con_DPrintf("Using GLSL 1.00\n");
+
        vid.support.amd_texture_texture4 = GL_CheckExtension("GL_AMD_texture_texture4", NULL, "-notexture4", false);
        vid.support.arb_depth_texture = GL_CheckExtension("GL_ARB_depth_texture", NULL, "-nodepthtexture", false);
        vid.support.arb_draw_buffers = GL_CheckExtension("GL_ARB_draw_buffers", drawbuffersfuncs, "-nodrawbuffers", false);