]> icculus.org git repositories - divverent/darkplaces.git/blob - glquake.h
major cleanup to pusher and SV_Move code, major fixes to pusher code (everything...
[divverent/darkplaces.git] / glquake.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 // disable data conversion warnings
21
22 #ifdef _MSC_VER
23 //#pragma warning(disable : 4244)     // MIPS
24 //#pragma warning(disable : 4136)     // X86
25 //#pragma warning(disable : 4051)     // ALPHA
26 #pragma warning(disable : 4244)     // LordHavoc: MSVC++ 4 x86, double/float
27 #pragma warning(disable : 4305)         // LordHavoc: MSVC++ 6 x86, double/float
28 #pragma warning(disable : 4018)         // LordHavoc: MSVC++ 4 x86, signed/unsigned mismatch
29 #endif
30
31 #ifdef _WIN32
32 #include <windows.h>
33 #define strcasecmp stricmp
34 #define strncasecmp strnicmp
35 #endif
36
37 #include <GL/gl.h>
38 //#include <GL/glu.h>
39
40 extern qboolean isG200;
41 extern qboolean isRagePro;
42
43 extern float gldepthmin, gldepthmax;
44
45 //====================================================
46
47 extern const char *gl_vendor;
48 extern const char *gl_renderer;
49 extern const char *gl_version;
50 extern const char *gl_extensions;
51
52 #ifndef _WIN32
53 #define APIENTRY /* */
54 #endif
55
56 // for platforms (wgl) that do not use GLAPIENTRY
57 #ifndef GLAPIENTRY
58 #define GLAPIENTRY APIENTRY
59 #endif
60
61 // GL_ARB_multitexture
62 extern int gl_textureunits;
63 extern void (GLAPIENTRY *qglMultiTexCoord2f) (GLenum, GLfloat, GLfloat);
64 extern void (GLAPIENTRY *qglActiveTexture) (GLenum);
65 extern void (GLAPIENTRY *qglClientActiveTexture) (GLenum);
66 #ifndef GL_ACTIVE_TEXTURE_ARB
67 #define GL_ACTIVE_TEXTURE_ARB                   0x84E0
68 #define GL_CLIENT_ACTIVE_TEXTURE_ARB    0x84E1
69 #define GL_MAX_TEXTURE_UNITS_ARB                0x84E2
70 #define GL_TEXTURE0_ARB                                 0x84C0
71 #define GL_TEXTURE1_ARB                                 0x84C1
72 #define GL_TEXTURE2_ARB                                 0x84C2
73 #define GL_TEXTURE3_ARB                                 0x84C3
74 #define GL_TEXTURE4_ARB                                 0x84C4
75 #define GL_TEXTURE5_ARB                                 0x84C5
76 #define GL_TEXTURE6_ARB                                 0x84C6
77 #define GL_TEXTURE7_ARB                                 0x84C7
78 #define GL_TEXTURE8_ARB                                 0x84C8
79 #define GL_TEXTURE9_ARB                                 0x84C9
80 #define GL_TEXTURE10_ARB                                0x84CA
81 #define GL_TEXTURE11_ARB                                0x84CB
82 #define GL_TEXTURE12_ARB                                0x84CC
83 #define GL_TEXTURE13_ARB                                0x84CD
84 #define GL_TEXTURE14_ARB                                0x84CE
85 #define GL_TEXTURE15_ARB                                0x84CF
86 #define GL_TEXTURE16_ARB                                0x84D0
87 #define GL_TEXTURE17_ARB                                0x84D1
88 #define GL_TEXTURE18_ARB                                0x84D2
89 #define GL_TEXTURE19_ARB                                0x84D3
90 #define GL_TEXTURE20_ARB                                0x84D4
91 #define GL_TEXTURE21_ARB                                0x84D5
92 #define GL_TEXTURE22_ARB                                0x84D6
93 #define GL_TEXTURE23_ARB                                0x84D7
94 #define GL_TEXTURE24_ARB                                0x84D8
95 #define GL_TEXTURE25_ARB                                0x84D9
96 #define GL_TEXTURE26_ARB                                0x84DA
97 #define GL_TEXTURE27_ARB                                0x84DB
98 #define GL_TEXTURE28_ARB                                0x84DC
99 #define GL_TEXTURE29_ARB                                0x84DD
100 #define GL_TEXTURE30_ARB                                0x84DE
101 #define GL_TEXTURE31_ARB                                0x84DF
102 #endif
103
104 // GL_EXT_compiled_vertex_array
105 extern int gl_supportslockarrays;
106 extern void (GLAPIENTRY *qglLockArraysEXT) (GLint first, GLint count);
107 extern void (GLAPIENTRY *qglUnlockArraysEXT) (void);
108
109 // GL_ARB_texture_env_combine
110 extern int gl_combine_extension;
111 #ifndef GL_COMBINE_ARB
112 #define GL_COMBINE_ARB                                  0x8570
113 #define GL_COMBINE_RGB_ARB                              0x8571
114 #define GL_COMBINE_ALPHA_ARB                    0x8572
115 #define GL_SOURCE0_RGB_ARB                              0x8580
116 #define GL_SOURCE1_RGB_ARB                              0x8581
117 #define GL_SOURCE2_RGB_ARB                              0x8582
118 #define GL_SOURCE0_ALPHA_ARB                    0x8588
119 #define GL_SOURCE1_ALPHA_ARB                    0x8589
120 #define GL_SOURCE2_ALPHA_ARB                    0x858A
121 #define GL_OPERAND0_RGB_ARB                             0x8590
122 #define GL_OPERAND1_RGB_ARB                             0x8591
123 #define GL_OPERAND2_RGB_ARB                             0x8592
124 #define GL_OPERAND0_ALPHA_ARB                   0x8598
125 #define GL_OPERAND1_ALPHA_ARB                   0x8599
126 #define GL_OPERAND2_ALPHA_ARB                   0x859A
127 #define GL_RGB_SCALE_ARB                                0x8573
128 #define GL_ADD_SIGNED_ARB                               0x8574
129 #define GL_INTERPOLATE_ARB                              0x8575
130 #define GL_SUBTRACT_ARB                                 0x84E7
131 #define GL_CONSTANT_ARB                                 0x8576
132 #define GL_PRIMARY_COLOR_ARB                    0x8577
133 #define GL_PREVIOUS_ARB                                 0x8578
134 #endif
135
136 extern cvar_t gl_combine;
137
138 #ifdef WIN32
139 #else
140 //#ifndef MESA
141 //extern void (GLAPIENTRY *glColorTableEXT)(int, int, int, int, int, const void*);
142 //#endif
143
144 #endif
145
146 #define DEBUGGL
147
148 #ifdef DEBUGGL
149 #define CHECKGLERROR if ((errornumber = glGetError())) GL_PrintError(errornumber, __FILE__, __LINE__);
150 extern int errornumber;
151 void GL_PrintError(int errornumber, char *filename, int linenumber);
152 #else
153 #define CHECKGLERROR
154 #endif