]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_shared.c
added support for GL_ARB_texture_env_combine, currently only used on wall rendering...
[xonotic/darkplaces.git] / vid_shared.c
index 8852c35942bcd4c3e9948ee0154d76b8c9256d66..f799f7dbc8af3d9498849480835fe787b0de6977 100644 (file)
@@ -10,10 +10,13 @@ qboolean gl_supportslockarrays = false;
 // LordHavoc: ARB multitexture support
 qboolean gl_mtexable = false;
 int gl_mtex_enum = 0;
+// LordHavoc: ARB texture_env_combine support
+qboolean gl_combine_extension = false;
 
 cvar_t vid_mode = {0, "vid_mode", "0"};
 cvar_t vid_mouse = {CVAR_SAVE, "vid_mouse", "1"};
 cvar_t vid_fullscreen = {0, "vid_fullscreen", "1"};
+cvar_t gl_combine = {0, "gl_combine", "0"};
 
 void (GLAPIENTRY *qglMTexCoord2f) (GLenum, GLfloat, GLfloat);
 void (GLAPIENTRY *qglSelectTexture) (GLenum);
@@ -25,10 +28,30 @@ void Force_CenterView_f (void)
        cl.viewangles[PITCH] = 0;
 }
 
+void VID_CheckCombine(void)
+{
+       // LordHavoc: although texture_env_combine doesn't require multiple TMUs
+       // (it does require the multitexture extension however), it is useless to
+       // darkplaces without multiple TMUs...
+       if (gl_mtexable && strstr(gl_extensions, "GL_ARB_texture_env_combine "))
+       {
+               gl_combine_extension = true;
+               Cvar_SetValue("gl_combine", true);
+               Con_Printf("GL_ARB_texture_env_combine detected\n");
+       }
+       else
+       {
+               gl_combine_extension = false;
+               Cvar_SetValue("gl_combine", false);
+               Con_Printf("GL_ARB_texture_env_combine not detected\n");
+       }
+}
+
 void VID_InitCvars(void)
 {
        Cvar_RegisterVariable(&vid_mode);
        Cvar_RegisterVariable(&vid_mouse);
        Cvar_RegisterVariable(&vid_fullscreen);
+       Cvar_RegisterVariable(&gl_combine);
        Cmd_AddCommand("force_centerview", Force_CenterView_f);
 }