]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_shared.c
removed GL_NV_blend_square detection because it is no longer used
[xonotic/darkplaces.git] / vid_shared.c
index d3884eaf86e6c6bd2e4e1fa6c7508096ead48bc1..54d63291b7dbbe4f88e40b4f944b6ca580bed91a 100644 (file)
@@ -54,7 +54,6 @@ cvar_t vid_mouse = {CVAR_SAVE, "vid_mouse", "1", "whether to use the mouse in wi
 cvar_t vid_grabkeyboard = {CVAR_SAVE, "vid_grabkeyboard", "0", "whether to grab the keyboard when mouse is active (prevents use of volume control keys, music player keys, etc on some keyboards)"};
 cvar_t vid_minwidth = {0, "vid_minwidth", "0", "minimum vid_width that is acceptable (to be set in default.cfg in mods)"};
 cvar_t vid_minheight = {0, "vid_minheight", "0", "minimum vid_height that is acceptable (to be set in default.cfg in mods)"};
-cvar_t gl_combine = {0, "gl_combine", "1", "enables faster rendering using GL_ARB_texture_env_combine extension (part of OpenGL 1.3 and above)"};
 cvar_t vid_gl13 = {0, "vid_gl13", "1", "enables faster rendering using OpenGL 1.3 features (such as GL_ARB_texture_env_combine extension)"};
 cvar_t vid_gl20 = {0, "vid_gl20", "1", "enables faster rendering using OpenGL 2.0 features (such as GL_ARB_fragment_shader extension)"};
 cvar_t gl_finish = {0, "gl_finish", "0", "make the cpu wait for the graphics processor at the end of each rendered frame (can help with strange input or video lag problems on some machines)"};
@@ -813,15 +812,14 @@ void VID_CheckExtensions(void)
        vid.support.ext_texture_3d = GL_CheckExtension("GL_EXT_texture3D", texture3dextfuncs, "-notexture3d", false);
        vid.support.ext_texture_edge_clamp = GL_CheckExtension("GL_EXT_texture_edge_clamp", NULL, "-noedgeclamp", false) || GL_CheckExtension("GL_SGIS_texture_edge_clamp", NULL, "-noedgeclamp", false);
        vid.support.ext_texture_filter_anisotropic = GL_CheckExtension("GL_EXT_texture_filter_anisotropic", NULL, "-noanisotropy", false);
-       vid.support.nv_blend_square = GL_CheckExtension("GL_NV_blend_square", NULL, "-noblendsquare", false);
 // COMMANDLINEOPTION: GL: -noanisotropy disables GL_EXT_texture_filter_anisotropic (allows higher quality texturing)
 // COMMANDLINEOPTION: GL: -noblendminmax disables GL_EXT_blend_minmax
-// COMMANDLINEOPTION: GL: -noblendsquare disables GL_NV_blend_square
 // COMMANDLINEOPTION: GL: -noblendsubtract disables GL_EXT_blend_subtract
 // COMMANDLINEOPTION: GL: -nocombine disables GL_ARB_texture_env_combine or GL_EXT_texture_env_combine (required for bumpmapping and faster map rendering)
 // COMMANDLINEOPTION: GL: -nocubemap disables GL_ARB_texture_cube_map (required for bumpmapping)
 // COMMANDLINEOPTION: GL: -nocva disables GL_EXT_compiled_vertex_array (renders faster)
 // COMMANDLINEOPTION: GL: -nodepthtexture disables use of GL_ARB_depth_texture (required for shadowmapping)
+// COMMANDLINEOPTION: GL: -nodot3 disables use of GL_ARB_texture_env_dot3
 // COMMANDLINEOPTION: GL: -nodrawrangeelements disables GL_EXT_draw_range_elements (renders faster)
 // COMMANDLINEOPTION: GL: -noedgeclamp disables GL_EXT_texture_edge_clamp or GL_SGIS_texture_edge_clamp (recommended, some cards do not support the other texture clamp method)
 // COMMANDLINEOPTION: GL: -nofbo disables GL_EXT_framebuffer_object (which accelerates rendering), only used if GL_ARB_fragment_shader is also available
@@ -883,7 +881,9 @@ void VID_CheckExtensions(void)
        }
 
        vid.texunits = vid.teximageunits = vid.texarrayunits = 1;
-       if (vid.support.arb_fragment_shader && vid_gl20.integer)
+       if (vid.support.arb_multitexture)
+               qglGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&vid.texunits);
+       if (vid_gl20.integer && vid.support.arb_fragment_shader && vid.support.arb_vertex_shader && vid.support.arb_shader_objects)
        {
                qglGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&vid.texunits);
                qglGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, (int *)&vid.teximageunits);CHECKGLERROR
@@ -905,8 +905,6 @@ void VID_CheckExtensions(void)
        }
        else
        {
-               if (vid.support.arb_multitexture)
-                       qglGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&vid.texunits);
                vid.texunits = bound(1, vid.texunits, MAX_TEXTUREUNITS);
                vid.teximageunits = vid.texunits;
                vid.texarrayunits = vid.texunits;
@@ -1000,8 +998,16 @@ void VID_UpdateGamma(qboolean force, int rampsize)
                return;
 
        wantgamma = v_hwgamma.integer;
-       if(r_glsl.integer && v_glslgamma.integer)
-               wantgamma = 0;
+       switch(vid.renderpath)
+       {
+       case RENDERPATH_GL20:
+               if (v_glslgamma.integer)
+                       wantgamma = 0;
+               break;
+       case RENDERPATH_GL13:
+       case RENDERPATH_GL11:
+               break;
+       }
        if(!vid_activewindow)
                wantgamma = 0;
 #define BOUNDCVAR(cvar, m1, m2) c = &(cvar);f = bound(m1, c->value, m2);if (c->value != f) Cvar_SetValueQuick(c, f);
@@ -1172,7 +1178,6 @@ void VID_Shared_Init(void)
        Cvar_RegisterVariable(&vid_resizable);
        Cvar_RegisterVariable(&vid_minwidth);
        Cvar_RegisterVariable(&vid_minheight);
-       Cvar_RegisterVariable(&gl_combine);
        Cvar_RegisterVariable(&vid_gl13);
        Cvar_RegisterVariable(&vid_gl20);
        Cvar_RegisterVariable(&gl_finish);