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);
}
}
-static gl_extensionfunctionlist_t opengl110funcs[] =
+static dllfunction_t opengl110funcs[] =
{
{"glClearColor", (void **) &qglClearColor},
{"glClear", (void **) &qglClear},
{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},
{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},
int vid_commandlinecheck = true;
void VID_Open(void)
{
- int i;
+ int i, width, height;
if (vid_commandlinecheck)
{
// interpret command-line parameters
Cvar_SetValueQuick(&vid_fullscreen, false);
if ((i = COM_CheckParm("-fullscreen")) != 0)
Cvar_SetValueQuick(&vid_fullscreen, true);
+ width = 0;
+ height = 0;
if ((i = COM_CheckParm("-width")) != 0)
- Cvar_SetQuick(&vid_width, com_argv[i+1]);
+ width = atoi(com_argv[i+1]);
if ((i = COM_CheckParm("-height")) != 0)
- Cvar_SetQuick(&vid_height, com_argv[i+1]);
+ height = atoi(com_argv[i+1]);
+ if (width == 0)
+ width = height * 4 / 3;
+ if (height == 0)
+ height = width * 3 / 4;
+ if (width)
+ Cvar_SetValueQuick(&vid_width, width);
+ if (height)
+ Cvar_SetValueQuick(&vid_height, height);
if ((i = COM_CheckParm("-bpp")) != 0)
Cvar_SetQuick(&vid_bitsperpixel, com_argv[i+1]);
if ((i = COM_CheckParm("-nostencil")) != 0)
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))
{