]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_shared.c
Elric's changes:
[xonotic/darkplaces.git] / vid_shared.c
index 2743742d0bd61a0ccc3c3ef5164d850b856ce8ed..2b1b370cdd695d52a8699165d1244d5cc2bb6b0d 100644 (file)
@@ -183,10 +183,10 @@ void (GLAPIENTRY *qglScissor)(GLint x, GLint y, GLsizei width, GLsizei height);
 
 void (GLAPIENTRY *qglPolygonOffset)(GLfloat factor, GLfloat units);
 
-int GL_CheckExtension(const char *name, const gl_extensionfunctionlist_t *funcs, const char *disableparm, int silent)
+int GL_CheckExtension(const char *name, const dllfunction_t *funcs, const char *disableparm, int silent)
 {
        int failed = false;
-       const gl_extensionfunctionlist_t *func;
+       const dllfunction_t *func;
 
        Con_Printf("checking for %s...  ", name);
 
@@ -224,7 +224,7 @@ int GL_CheckExtension(const char *name, const gl_extensionfunctionlist_t *funcs,
        }
 }
 
-static gl_extensionfunctionlist_t opengl110funcs[] =
+static dllfunction_t opengl110funcs[] =
 {
        {"glClearColor", (void **) &qglClearColor},
        {"glClear", (void **) &qglClear},
@@ -311,19 +311,19 @@ static gl_extensionfunctionlist_t opengl110funcs[] =
        {NULL, NULL}
 };
 
-static gl_extensionfunctionlist_t drawrangeelementsfuncs[] =
+static dllfunction_t drawrangeelementsfuncs[] =
 {
        {"glDrawRangeElements", (void **) &qglDrawRangeElements},
        {NULL, NULL}
 };
 
-static gl_extensionfunctionlist_t drawrangeelementsextfuncs[] =
+static dllfunction_t drawrangeelementsextfuncs[] =
 {
        {"glDrawRangeElementsEXT", (void **) &qglDrawRangeElementsEXT},
        {NULL, NULL}
 };
 
-static gl_extensionfunctionlist_t multitexturefuncs[] =
+static dllfunction_t multitexturefuncs[] =
 {
        {"glMultiTexCoord2fARB", (void **) &qglMultiTexCoord2f},
        {"glActiveTextureARB", (void **) &qglActiveTexture},
@@ -331,14 +331,14 @@ static gl_extensionfunctionlist_t multitexturefuncs[] =
        {NULL, NULL}
 };
 
-static gl_extensionfunctionlist_t compiledvertexarrayfuncs[] =
+static dllfunction_t compiledvertexarrayfuncs[] =
 {
        {"glLockArraysEXT", (void **) &qglLockArraysEXT},
        {"glUnlockArraysEXT", (void **) &qglUnlockArraysEXT},
        {NULL, NULL}
 };
 
-static gl_extensionfunctionlist_t texture3dextfuncs[] =
+static dllfunction_t texture3dextfuncs[] =
 {
        {"glTexImage3DEXT", (void **) &qglTexImage3D},
        {"glTexSubImage3DEXT", (void **) &qglTexSubImage3D},
@@ -541,6 +541,12 @@ void VID_Open(void)
                        Cvar_SetValueQuick(&vid_stencil, 1);
        }
 
+       if (vid_stencil.integer && vid_bitsperpixel.integer != 32)
+       {
+               Con_Printf("vid_stencil not allowed without vid_bitsperpixel 32, turning off vid_stencil\n");
+               Cvar_SetValueQuick(&vid_stencil, 0);
+       }
+
        Con_Printf("Starting video system\n");
        if (!VID_Mode(vid_fullscreen.integer, vid_width.integer, vid_height.integer, vid_bitsperpixel.integer, vid_stencil.integer))
        {