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