]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - vid.h
forgot to commit this
[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
28 {
29         // these are set with VID_GetWindowSize and can change from frame to frame
30         int realx;
31         int realy;
32         int realwidth;
33         int realheight;
34
35         int conwidth;
36         int conheight;
37 } viddef_t;
38
39 // global video state
40 extern viddef_t vid;
41 extern void (*vid_menudrawfn)(void);
42 extern void (*vid_menukeyfn)(int key);
43
44 extern int vid_hidden;
45 extern int vid_activewindow;
46
47 extern cvar_t vid_fullscreen;
48 extern cvar_t vid_width;
49 extern cvar_t vid_height;
50 extern cvar_t vid_bitsperpixel;
51 extern cvar_t vid_mouse;
52 extern cvar_t vid_stencil;
53
54 extern int gl_stencil;
55
56 // brand of graphics chip
57 extern const char *gl_vendor;
58 // graphics chip model and other information
59 extern const char *gl_renderer;
60 // begins with 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.3.1, or 1.4.0
61 extern const char *gl_version;
62 // extensions list, space separated
63 extern const char *gl_extensions;
64 // WGL, GLX, or AGL
65 extern const char *gl_platform;
66 // another extensions list, containing platform-specific extensions that are
67 // not in the main list
68 extern const char *gl_platformextensions;
69 // name of driver library (opengl32.dll, libGL.so.1, or whatever)
70 extern char gl_driver[256];
71
72 // compatibility hacks
73 extern qboolean isG200;
74 extern qboolean isRagePro;
75
76 // LordHavoc: GLX_SGI_video_sync and WGL_EXT_swap_control
77 extern int gl_videosyncavailable;
78
79 typedef struct
80 {
81         const char *name;
82         void **funcvariable;
83 }
84 gl_extensionfunctionlist_t;
85
86 typedef struct
87 {
88         const char *name;
89         const gl_extensionfunctionlist_t *funcs;
90         int *enablevariable;
91         const char *disableparm;
92 }
93 gl_extensioninfo_t;
94
95 int GL_OpenLibrary(const char *name);
96 void GL_CloseLibrary(void);
97 void *GL_GetProcAddress(const char *name);
98 int GL_CheckExtension(const char *name, const gl_extensionfunctionlist_t *funcs, const char *disableparm, int silent);
99
100 void VID_Shared_Init(void);
101
102 void GL_Init (void);
103
104 void VID_CheckExtensions(void);
105
106 void VID_Init (void);
107 // Called at startup
108
109 void VID_Shutdown (void);
110 // Called at shutdown
111
112 int VID_SetMode (int modenum);
113 // sets the mode; only used by the Quake engine for resetting to mode 0 (the
114 // base mode) on memory allocation failures
115
116 // sets hardware gamma correction, returns false if the device does not
117 // support gamma control
118 int VID_SetGamma (float prescale, float gamma, float scale, float base);
119
120 void VID_GetWindowSize (int *x, int *y, int *width, int *height);
121
122 void VID_Finish (void);
123
124 void VID_Restart_f(void);
125
126 void VID_Open (void);
127 void VID_Close (void);
128
129 #endif
130