X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=vid_shared.c;h=2b1b370cdd695d52a8699165d1244d5cc2bb6b0d;hb=a2abf4addfa875d01c2775098277fea38ee99e24;hp=a65d5a72f3ea3890e5c92479dc4cf7abbd511221;hpb=23c506a3c99de3aea806132979ab8f8abd0208da;p=xonotic%2Fdarkplaces.git diff --git a/vid_shared.c b/vid_shared.c index a65d5a72..2b1b370c 100644 --- a/vid_shared.c +++ b/vid_shared.c @@ -179,11 +179,14 @@ void (GLAPIENTRY *qglTexImage3D)(GLenum target, GLint level, GLenum internalForm void (GLAPIENTRY *qglTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); void (GLAPIENTRY *qglCopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +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); @@ -221,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}, @@ -303,22 +306,24 @@ static gl_extensionfunctionlist_t opengl110funcs[] = {"glCopyTexImage2D", (void **) &qglCopyTexImage2D}, {"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}, @@ -326,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}, @@ -536,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)) {