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