]> icculus.org git repositories - divverent/darkplaces.git/blob - vid.h
darkplaces.dsp
[divverent/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
28 {
29         // these are set by VID_Mode
30         int width;
31         int height;
32         int bitsperpixel;
33         int fullscreen;
34 } viddef_t;
35
36 // global video state
37 extern viddef_t vid;
38 extern void (*vid_menudrawfn)(void);
39 extern void (*vid_menukeyfn)(int key);
40
41 extern qboolean vid_hidden;
42 extern qboolean vid_activewindow;
43 extern cvar_t vid_hardwaregammasupported;
44 extern qboolean vid_usinghwgamma;
45
46 extern cvar_t vid_fullscreen;
47 extern cvar_t vid_width;
48 extern cvar_t vid_height;
49 extern cvar_t vid_bitsperpixel;
50 extern cvar_t vid_vsync;
51 extern cvar_t vid_mouse;
52
53 extern cvar_t gl_combine;
54 extern cvar_t gl_finish;
55
56 extern cvar_t v_gamma;
57 extern cvar_t v_contrast;
58 extern cvar_t v_brightness;
59 extern cvar_t v_color_enable;
60 extern cvar_t v_color_black_r;
61 extern cvar_t v_color_black_g;
62 extern cvar_t v_color_black_b;
63 extern cvar_t v_color_grey_r;
64 extern cvar_t v_color_grey_g;
65 extern cvar_t v_color_grey_b;
66 extern cvar_t v_color_white_r;
67 extern cvar_t v_color_white_g;
68 extern cvar_t v_color_white_b;
69 extern cvar_t v_hwgamma;
70
71 extern int gl_stencil;
72
73 // brand of graphics chip
74 extern const char *gl_vendor;
75 // graphics chip model and other information
76 extern const char *gl_renderer;
77 // begins with 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.3.1, or 1.4.0
78 extern const char *gl_version;
79 // extensions list, space separated
80 extern const char *gl_extensions;
81 // WGL, GLX, or AGL
82 extern const char *gl_platform;
83 // another extensions list, containing platform-specific extensions that are
84 // not in the main list
85 extern const char *gl_platformextensions;
86 // name of driver library (opengl32.dll, libGL.so.1, or whatever)
87 extern char gl_driver[256];
88
89 // compatibility hacks
90 extern qboolean isG200;
91 extern qboolean isRagePro;
92
93 // LordHavoc: GLX_SGI_swap_control and WGL_EXT_swap_control
94 extern int gl_videosyncavailable;
95
96 void *GL_GetProcAddress(const char *name);
97 int GL_CheckExtension(const char *name, const dllfunction_t *funcs, const char *disableparm, int silent);
98
99 // this attempts to use vendor extensions to allocate faster vertex memory if
100 // the fast parameter is true, if unsuccessful it uses Mem_Alloc instead
101 void *VID_AllocVertexArrays(mempool_t *pool, int size, int fast, float readfrequency, float writefrequency, float priority);
102 void VID_FreeVertexArrays(void *pointer);
103
104 void VID_Shared_Init(void);
105
106 void GL_Init (void);
107
108 void VID_CheckExtensions(void);
109
110 void VID_Init (void);
111 // Called at startup
112
113 void VID_Shutdown (void);
114 // Called at shutdown
115
116 int VID_SetMode (int modenum);
117 // sets the mode; only used by the Quake engine for resetting to mode 0 (the
118 // base mode) on memory allocation failures
119
120 int VID_InitMode(int fullscreen, int width, int height, int bpp);
121 // allocates and opens an appropriate OpenGL context (and its window)
122
123
124 // sets hardware gamma correction, returns false if the device does not
125 // support gamma control
126 int VID_SetGamma (unsigned short *ramps);
127 // gets hardware gamma correction, returns false if the device does not
128 // support gamma control
129 int VID_GetGamma (unsigned short *ramps);
130
131 void VID_UpdateGamma(qboolean force);
132 void VID_RestoreSystemGamma(void);
133
134 void VID_Finish (void);
135
136 void VID_Restart_f(void);
137
138 void VID_Start(void);
139
140 #endif
141