]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_shared.c
fix which crosshair texture is used
[xonotic/darkplaces.git] / vid_shared.c
index 88f2dbb8418820e0ec3c7579c8c7120e8e613aaa..2b1b370cdd695d52a8699165d1244d5cc2bb6b0d 100644 (file)
@@ -181,10 +181,12 @@ void (GLAPIENTRY *qglCopyTexSubImage3D)(GLenum target, GLint level, GLint xoffse
 
 void (GLAPIENTRY *qglScissor)(GLint x, GLint y, GLsizei width, GLsizei height);
 
-int GL_CheckExtension(const char *name, const gl_extensionfunctionlist_t *funcs, const char *disableparm, int silent)
+void (GLAPIENTRY *qglPolygonOffset)(GLfloat factor, GLfloat units);
+
+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);
 
@@ -222,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},
@@ -305,22 +307,23 @@ static gl_extensionfunctionlist_t opengl110funcs[] =
        {"glCopyTexSubImage1D", (void **) &qglCopyTexSubImage1D},
        {"glCopyTexSubImage2D", (void **) &qglCopyTexSubImage2D},
        {"glScissor", (void **) &qglScissor},
+       {"glPolygonOffset", (void **) &qglPolygonOffset},
        {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},
@@ -328,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},
@@ -538,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))
        {