]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - vid.h
update Blub's SDL patch
[xonotic/darkplaces.git] / vid.h
1 /*
2 Copyright (C) 1996-1997 Id Software, Inc.
3
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.
8
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.
12
13 See the GNU General Public License for more details.
14
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.
18
19 */
20 // vid.h -- video driver defs
21
22 #ifndef VID_H
23 #define VID_H
24
25 extern int cl_available;
26
27 typedef struct viddef_s
28 {
29         // these are set by VID_Mode
30         int width;
31         int height;
32         int bitsperpixel;
33         int fullscreen;
34         int refreshrate;
35         int stereobuffer;
36 } viddef_t;
37
38 // global video state
39 extern viddef_t vid;
40 extern void (*vid_menudrawfn)(void);
41 extern void (*vid_menukeyfn)(int key);
42
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;
48
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_stick_mouse;
58 extern cvar_t vid_resizable;
59 extern cvar_t vid_minwidth;
60 extern cvar_t vid_minheight;
61
62 extern cvar_t gl_combine;
63 extern cvar_t gl_finish;
64
65 extern cvar_t v_gamma;
66 extern cvar_t v_contrast;
67 extern cvar_t v_brightness;
68 extern cvar_t v_color_enable;
69 extern cvar_t v_color_black_r;
70 extern cvar_t v_color_black_g;
71 extern cvar_t v_color_black_b;
72 extern cvar_t v_color_grey_r;
73 extern cvar_t v_color_grey_g;
74 extern cvar_t v_color_grey_b;
75 extern cvar_t v_color_white_r;
76 extern cvar_t v_color_white_g;
77 extern cvar_t v_color_white_b;
78 extern cvar_t v_hwgamma;
79
80 extern int gl_stencil;
81
82 // brand of graphics chip
83 extern const char *gl_vendor;
84 // graphics chip model and other information
85 extern const char *gl_renderer;
86 // begins with 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.3.1, or 1.4.0
87 extern const char *gl_version;
88 // extensions list, space separated
89 extern const char *gl_extensions;
90 // WGL, GLX, or AGL
91 extern const char *gl_platform;
92 // another extensions list, containing platform-specific extensions that are
93 // not in the main list
94 extern const char *gl_platformextensions;
95 // name of driver library (opengl32.dll, libGL.so.1, or whatever)
96 extern char gl_driver[256];
97
98 // compatibility hacks
99 extern qboolean isG200;
100 extern qboolean isRagePro;
101
102 // LordHavoc: GLX_SGI_swap_control and WGL_EXT_swap_control
103 extern int gl_videosyncavailable;
104
105 void *GL_GetProcAddress(const char *name);
106 int GL_CheckExtension(const char *name, const dllfunction_t *funcs, const char *disableparm, int silent);
107
108 void VID_Shared_Init(void);
109
110 void GL_Init (void);
111
112 void VID_CheckExtensions(void);
113
114 void VID_Init (void);
115 // Called at startup
116
117 void VID_Shutdown (void);
118 // Called at shutdown
119
120 int VID_SetMode (int modenum);
121 // sets the mode; only used by the Quake engine for resetting to mode 0 (the
122 // base mode) on memory allocation failures
123
124 int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate, int stereobuffer);
125 // allocates and opens an appropriate OpenGL context (and its window)
126
127
128 // sets hardware gamma correction, returns false if the device does not
129 // support gamma control
130 // (ONLY called by VID_UpdateGamma and VID_RestoreSystemGamma)
131 int VID_SetGamma(unsigned short *ramps, int rampsize);
132 // gets hardware gamma correction, returns false if the device does not
133 // support gamma control
134 // (ONLY called by VID_UpdateGamma and VID_RestoreSystemGamma)
135 int VID_GetGamma(unsigned short *ramps, int rampsize);
136 // makes sure ramp arrays are big enough and calls VID_GetGamma/VID_SetGamma
137 // (ONLY to be called from VID_Finish!)
138 void VID_UpdateGamma(qboolean force, int rampsize);
139 // turns off hardware gamma ramps immediately
140 // (called from various shutdown/deactivation functions)
141 void VID_RestoreSystemGamma(void);
142
143 void VID_Finish (qboolean allowmousegrab);
144
145 void VID_Restart_f(void);
146
147 void VID_Start(void);
148
149 #endif
150