]> icculus.org git repositories - divverent/darkplaces.git/blob - vid_shared.c
corrected a typo in a comment referring to the e4 hall in start as e1m4
[divverent/darkplaces.git] / vid_shared.c
1
2 #include "quakedef.h"
3
4 // LordHavoc: these are only set in wgl
5 qboolean isG200 = false; // LordHavoc: the Matrox G200 can't do per pixel alpha, and it uses a D3D driver for GL... ugh...
6 qboolean isRagePro = false; // LordHavoc: the ATI Rage Pro has limitations with per pixel alpha (the color scaler does not apply to per pixel alpha images...), although not as bad as a G200.
7
8 // LordHavoc: compiled vertex array support
9 qboolean gl_supportslockarrays = false;
10 // LordHavoc: ARB multitexture support
11 qboolean gl_mtexable = false;
12 int gl_mtex_enum = 0;
13 // LordHavoc: ARB texture_env_combine support
14 qboolean gl_combine_extension = false;
15
16 cvar_t vid_mode = {0, "vid_mode", "0"};
17 cvar_t vid_mouse = {CVAR_SAVE, "vid_mouse", "1"};
18 cvar_t vid_fullscreen = {0, "vid_fullscreen", "1"};
19 cvar_t gl_combine = {0, "gl_combine", "0"};
20
21 void (GLAPIENTRY *qglMTexCoord2f) (GLenum, GLfloat, GLfloat);
22 void (GLAPIENTRY *qglSelectTexture) (GLenum);
23 void (GLAPIENTRY *qglLockArraysEXT) (GLint first, GLint count);
24 void (GLAPIENTRY *qglUnlockArraysEXT) (void);
25
26 void Force_CenterView_f (void)
27 {
28         cl.viewangles[PITCH] = 0;
29 }
30
31 void VID_CheckCombine(void)
32 {
33         // LordHavoc: although texture_env_combine doesn't require multiple TMUs
34         // (it does require the multitexture extension however), it is useless to
35         // darkplaces without multiple TMUs...
36         if (gl_mtexable && strstr(gl_extensions, "GL_ARB_texture_env_combine "))
37         {
38                 gl_combine_extension = true;
39                 Cvar_SetValue("gl_combine", true);
40                 Con_Printf("GL_ARB_texture_env_combine detected\n");
41         }
42         else
43         {
44                 gl_combine_extension = false;
45                 Cvar_SetValue("gl_combine", false);
46                 Con_Printf("GL_ARB_texture_env_combine not detected\n");
47         }
48 }
49
50 void VID_InitCvars(void)
51 {
52         Cvar_RegisterVariable(&vid_mode);
53         Cvar_RegisterVariable(&vid_mouse);
54         Cvar_RegisterVariable(&vid_fullscreen);
55         Cvar_RegisterVariable(&gl_combine);
56         Cmd_AddCommand("force_centerview", Force_CenterView_f);
57 }