2 Copyright (C) 1996-1997 Id Software, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 // vid.h -- video driver defs
25 extern int cl_available;
27 typedef struct viddef_s
29 // these are set by VID_Mode
40 extern void (*vid_menudrawfn)(void);
41 extern void (*vid_menukeyfn)(int key);
43 extern qboolean vid_hidden;
44 extern qboolean vid_activewindow;
45 extern cvar_t vid_hardwaregammasupported;
46 extern qboolean vid_usinghwgamma;
47 extern qboolean vid_supportrefreshrate;
49 extern cvar_t vid_fullscreen;
50 extern cvar_t vid_width;
51 extern cvar_t vid_height;
52 extern cvar_t vid_bitsperpixel;
53 extern cvar_t vid_refreshrate;
54 extern cvar_t vid_vsync;
55 extern cvar_t vid_mouse;
56 extern cvar_t vid_grabkeyboard;
57 extern cvar_t vid_minwidth;
58 extern cvar_t vid_minheight;
60 extern cvar_t gl_combine;
61 extern cvar_t gl_finish;
63 extern cvar_t v_gamma;
64 extern cvar_t v_contrast;
65 extern cvar_t v_brightness;
66 extern cvar_t v_color_enable;
67 extern cvar_t v_color_black_r;
68 extern cvar_t v_color_black_g;
69 extern cvar_t v_color_black_b;
70 extern cvar_t v_color_grey_r;
71 extern cvar_t v_color_grey_g;
72 extern cvar_t v_color_grey_b;
73 extern cvar_t v_color_white_r;
74 extern cvar_t v_color_white_g;
75 extern cvar_t v_color_white_b;
76 extern cvar_t v_hwgamma;
78 extern int gl_stencil;
80 // brand of graphics chip
81 extern const char *gl_vendor;
82 // graphics chip model and other information
83 extern const char *gl_renderer;
84 // begins with 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.3.1, or 1.4.0
85 extern const char *gl_version;
86 // extensions list, space separated
87 extern const char *gl_extensions;
89 extern const char *gl_platform;
90 // another extensions list, containing platform-specific extensions that are
91 // not in the main list
92 extern const char *gl_platformextensions;
93 // name of driver library (opengl32.dll, libGL.so.1, or whatever)
94 extern char gl_driver[256];
96 // compatibility hacks
97 extern qboolean isG200;
98 extern qboolean isRagePro;
100 // LordHavoc: GLX_SGI_swap_control and WGL_EXT_swap_control
101 extern int gl_videosyncavailable;
103 void *GL_GetProcAddress(const char *name);
104 int GL_CheckExtension(const char *name, const dllfunction_t *funcs, const char *disableparm, int silent);
106 void VID_Shared_Init(void);
110 void VID_CheckExtensions(void);
112 void VID_Init (void);
115 void VID_Shutdown (void);
116 // Called at shutdown
118 int VID_SetMode (int modenum);
119 // sets the mode; only used by the Quake engine for resetting to mode 0 (the
120 // base mode) on memory allocation failures
122 int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate, int stereobuffer);
123 // allocates and opens an appropriate OpenGL context (and its window)
126 // sets hardware gamma correction, returns false if the device does not
127 // support gamma control
128 // (ONLY called by VID_UpdateGamma and VID_RestoreSystemGamma)
129 int VID_SetGamma(unsigned short *ramps, int rampsize);
130 // gets hardware gamma correction, returns false if the device does not
131 // support gamma control
132 // (ONLY called by VID_UpdateGamma and VID_RestoreSystemGamma)
133 int VID_GetGamma(unsigned short *ramps, int rampsize);
134 // makes sure ramp arrays are big enough and calls VID_GetGamma/VID_SetGamma
135 // (ONLY to be called from VID_Finish!)
136 void VID_UpdateGamma(qboolean force, int rampsize);
137 // turns off hardware gamma ramps immediately
138 // (called from various shutdown/deactivation functions)
139 void VID_RestoreSystemGamma(void);
141 void VID_Finish (qboolean allowmousegrab);
143 void VID_Restart_f(void);
145 void VID_Start(void);