Quake II RTX doxygen  1.0 dev
gl.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2003-2006 Andrey Nazarov
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (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. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18 
19 #include "shared/shared.h"
20 #include "common/bsp.h"
21 #include "common/cmd.h"
22 #include "common/common.h"
23 #include "common/cvar.h"
24 #include "common/files.h"
25 #include "common/math.h"
26 #include "client/video.h"
27 #include "client/client.h"
28 #include "refresh/refresh.h"
29 #include "refresh/images.h"
30 #include "refresh/models.h"
31 #include "system/hunk.h"
32 
33 #if USE_FIXED_LIBGL
34 #include "qgl/fixed.h"
35 #else
36 #include "qgl/dynamic.h"
37 #endif
38 
39 /*
40  * gl_main.c
41  *
42  */
43 
44 #ifdef GL_VERSION_ES_CM_1_0
45 #define QGL_INDEX_TYPE GLushort
46 #define QGL_INDEX_ENUM GL_UNSIGNED_SHORT
47 #else
48 #define QGL_INDEX_TYPE GLuint
49 #define QGL_INDEX_ENUM GL_UNSIGNED_INT
50 #endif
51 
52 #define MAX_TMUS 2
53 
54 #define TAB_SIN(x) gl_static.sintab[(x) & 255]
55 #define TAB_COS(x) gl_static.sintab[((x) + 64) & 255]
56 
57 #define NUM_TEXNUMS 6
58 
59 typedef struct {
60  qboolean registering;
61  struct {
62  bsp_t *cache;
63  memhunk_t hunk;
64  vec_t *vertices;
65  GLuint bufnum;
66  vec_t size;
67  } world;
68  GLuint prognum_warp;
69  GLuint texnums[NUM_TEXNUMS];
70  GLbitfield stencil_buffer_bit;
75  float sintab[256];
76  byte latlngtab[NUMVERTEXNORMALS][2];
77  byte lightstylemap[MAX_LIGHTSTYLES];
78 } glStatic_t;
79 
80 typedef struct {
81  refdef_t fd;
82  vec3_t viewaxis[3];
83  GLfloat viewmatrix[16];
84  int visframe;
85  int drawframe;
86 #if USE_DLIGHTS
87  int dlightframe;
88 #endif
91  cplane_t frustumPlanes[4];
92  entity_t *ent;
93  qboolean entrotated;
94  vec3_t entaxis[3];
95  GLfloat entmatrix[16];
96  lightpoint_t lightpoint;
97  int num_beams;
98 } glRefdef_t;
99 
100 typedef struct {
101  qboolean es_profile;
102 
105 
106  unsigned ext_supported;
107  unsigned ext_enabled;
108 
112 
116 } glConfig_t;
117 
118 #define AT_LEAST_OPENGL_ANY(major, minor) \
119  (gl_config.version_major > major || (gl_config.version_major == major && gl_config.version_minor >= minor))
120 
121 #define AT_LEAST_OPENGL(major, minor) \
122  (!gl_config.es_profile && AT_LEAST_OPENGL_ANY(major, minor))
123 
124 #define AT_LEAST_OPENGL_ES(major, minor) \
125  (gl_config.es_profile && AT_LEAST_OPENGL_ANY(major, minor))
126 
127 extern glStatic_t gl_static;
128 extern glConfig_t gl_config;
129 extern glRefdef_t glr;
130 
131 extern entity_t gl_world;
132 
133 typedef struct {
151 
152 extern statCounters_t c;
153 
154 // regular variables
155 extern cvar_t *gl_partscale;
156 extern cvar_t *gl_partstyle;
157 extern cvar_t *gl_celshading;
158 extern cvar_t *gl_dotshading;
159 extern cvar_t *gl_shadows;
160 extern cvar_t *gl_modulate;
161 extern cvar_t *gl_modulate_world;
162 extern cvar_t *gl_coloredlightmaps;
163 extern cvar_t *gl_brightness;
164 extern cvar_t *gl_dynamic;
165 #if USE_DLIGHTS
166 extern cvar_t *gl_dlight_falloff;
167 #endif
168 extern cvar_t *gl_modulate_entities;
169 extern cvar_t *gl_doublelight_entities;
170 extern cvar_t *gl_fragment_program;
171 extern cvar_t *gl_fontshadow;
172 
173 // development variables
174 extern cvar_t *gl_znear;
175 extern cvar_t *gl_drawsky;
176 extern cvar_t *gl_showtris;
177 #ifdef _DEBUG
178 extern cvar_t *gl_nobind;
179 extern cvar_t *gl_test;
180 #endif
181 extern cvar_t *gl_cull_nodes;
182 extern cvar_t *gl_hash_faces;
183 extern cvar_t *gl_clear;
184 extern cvar_t *gl_novis;
185 extern cvar_t *gl_lockpvs;
186 extern cvar_t *gl_lightmap;
187 extern cvar_t *gl_fullbright;
188 extern cvar_t *gl_vertexlight;
189 
190 typedef enum {
195 
196 glCullResult_t GL_CullBox(vec3_t bounds[2]);
197 glCullResult_t GL_CullSphere(const vec3_t origin, float radius);
198 glCullResult_t GL_CullLocalBox(const vec3_t origin, vec3_t bounds[2]);
199 
200 //void GL_DrawBox(const vec3_t origin, vec3_t bounds[2]);
201 
202 qboolean GL_AllocBlock(int width, int height, int *inuse,
203  int w, int h, int *s, int *t);
204 
205 void GL_MultMatrix(GLfloat *out, const GLfloat *a, const GLfloat *b);
206 void GL_RotateForEntity(vec3_t origin, float scale);
207 
208 void QGL_ClearErrors(void);
209 qboolean GL_ShowErrors(const char *func);
210 
211 /*
212  * gl_model.c
213  *
214  */
215 
216 typedef struct maliastc_s {
217  float st[2];
218 } maliastc_t;
219 
220 typedef struct masliasvert_s {
221  short pos[3];
222  byte norm[2]; // lat, lng
223 } maliasvert_t;
224 
225 typedef struct maliasframe_s {
226  vec3_t scale;
227  vec3_t translate;
228  vec3_t bounds[2];
229  vec_t radius;
230 } maliasframe_t;
231 
232 typedef struct maliasmesh_s {
233  int numverts;
234  int numtris;
239  image_t *skins[MAX_ALIAS_SKINS];
240  int numskins;
241 } maliasmesh_t;
242 
243 // xyz[3] | color[1] | st[2] | lmst[2]
244 // xyz[3] | unused[1] | color[4]
245 #define VERTEX_SIZE 8
246 
247 /*
248  * gl_surf.c
249  *
250  */
251 #define LIGHT_STYLE(surf, i) \
252  &glr.fd.lightstyles[gl_static.lightstylemap[(surf)->styles[i]]]
253 
254 #define LM_MAX_LIGHTMAPS 32
255 #define LM_BLOCK_WIDTH 256
256 #define LM_BLOCK_HEIGHT 256
257 
258 typedef struct {
259  int inuse[LM_BLOCK_WIDTH];
260  byte buffer[LM_BLOCK_WIDTH * LM_BLOCK_HEIGHT * 4];
261  qboolean dirty;
262  int comp;
263  float add, modulate, scale;
264  int nummaps;
265  GLuint texnums[LM_MAX_LIGHTMAPS];
267 
268 extern lightmap_builder_t lm;
269 
270 void GL_AdjustColor(vec3_t color);
271 void GL_PushLights(mface_t *surf);
272 
273 void GL_RebuildLighting(void);
274 void GL_FreeWorld(void);
275 void GL_LoadWorld(const char *name);
276 
277 /*
278  * gl_state.c
279  *
280  */
281 typedef enum {
285  GLS_BLEND_BLEND = (1 << 2),
286  GLS_BLEND_ADD = (1 << 3),
287  GLS_BLEND_MODULATE = (1 << 4),
290  GLS_FLOW_ENABLE = (1 << 7),
292  GLS_WARP_ENABLE = (1 << 9),
293  GLS_CULL_DISABLE = (1 << 10),
294  GLS_SHADE_SMOOTH = (1 << 11)
295 } glStateBits_t;
296 
297 #define GLS_BLEND_MASK (GLS_BLEND_BLEND | GLS_BLEND_ADD | GLS_BLEND_MODULATE)
298 
299 typedef enum {
300  GLA_NONE = 0,
301  GLA_VERTEX = (1 << 0),
302  GLA_TC = (1 << 1),
303  GLA_LMTC = (1 << 2),
304  GLA_COLOR = (1 << 3),
305 } glArrayBits_t;
306 
307 typedef struct {
308  GLuint client_tmu;
309  GLuint server_tmu;
310  GLuint texnums[MAX_TMUS];
313  const GLfloat *currentmatrix;
314 } glState_t;
315 
316 extern glState_t gls;
317 
318 static inline void GL_ActiveTexture(GLuint tmu)
319 {
320  if (gls.server_tmu != tmu) {
321  qglActiveTextureARB(GL_TEXTURE0_ARB + tmu);
322  gls.server_tmu = tmu;
323  }
324 }
325 
326 static inline void GL_ClientActiveTexture(GLuint tmu)
327 {
328  if (gls.client_tmu != tmu) {
329  qglClientActiveTextureARB(GL_TEXTURE0_ARB + tmu);
330  gls.client_tmu = tmu;
331  }
332 }
333 
334 static inline void GL_VertexPointer(GLint size, GLsizei stride, const GLfloat *pointer)
335 {
336  qglVertexPointer(size, GL_FLOAT, sizeof(GLfloat) * stride, pointer);
337 }
338 
339 static inline void GL_TexCoordPointer(GLint size, GLsizei stride, const GLfloat *pointer)
340 {
342  qglTexCoordPointer(size, GL_FLOAT, sizeof(GLfloat) * stride, pointer);
343 }
344 
345 static inline void GL_LightCoordPointer(GLint size, GLsizei stride, const GLfloat *pointer)
346 {
348  qglTexCoordPointer(size, GL_FLOAT, sizeof(GLfloat) * stride, pointer);
349 }
350 
351 static inline void GL_ColorBytePointer(GLint size, GLsizei stride, const GLubyte *pointer)
352 {
353  qglColorPointer(size, GL_UNSIGNED_BYTE, sizeof(GLfloat) * stride, pointer);
354 }
355 
356 static inline void GL_ColorFloatPointer(GLint size, GLsizei stride, const GLfloat *pointer)
357 {
358  qglColorPointer(size, GL_FLOAT, sizeof(GLfloat) * stride, pointer);
359 }
360 
361 static inline void GL_LockArrays(GLsizei count)
362 {
363  if (qglLockArraysEXT) {
364  qglLockArraysEXT(0, count);
365  }
366 }
367 
368 static inline void GL_UnlockArrays(void)
369 {
370  if (qglUnlockArraysEXT) {
372  }
373 }
374 
375 static inline void GL_LoadMatrix(const GLfloat *matrix)
376 {
377  if (gls.currentmatrix != matrix) {
378  qglLoadMatrixf(matrix);
379  gls.currentmatrix = matrix;
380  }
381 }
382 
383 void GL_ForceTexture(GLuint tmu, GLuint texnum);
384 void GL_BindTexture(GLuint tmu, GLuint texnum);
385 void GL_StateBits(glStateBits_t bits);
386 void GL_ArrayBits(glArrayBits_t bits);
387 void GL_LoadMatrix(const GLfloat *matrix);
388 void GL_Ortho(GLfloat xmin, GLfloat xmax, GLfloat ymin, GLfloat ymax, GLfloat znear, GLfloat zfar);
389 void GL_Setup2D(void);
390 void GL_Setup3D(void);
391 void GL_SetDefaultState(void);
392 void GL_InitPrograms(void);
393 void GL_ShutdownPrograms(void);
394 void GL_EnableOutlines(void);
395 void GL_DisableOutlines(void);
396 
397 /*
398  * gl_draw.c
399  *
400  */
401 typedef struct {
402  color_t colors[2]; // 0 - actual color, 1 - transparency (for text drawing)
403  qboolean scissor;
404  float scale;
405 } drawStatic_t;
406 
407 extern drawStatic_t draw;
408 
409 #ifdef _DEBUG
410 void Draw_Stringf(int x, int y, const char *fmt, ...);
411 void Draw_Stats(void);
412 void Draw_Lightmaps(void);
413 void Draw_Scrap(void);
414 #endif
415 
416 void GL_Blend(void);
417 
418 void R_ClearColor_GL(void);
419 void R_SetAlpha_GL(float alpha);
420 void R_SetAlphaScale_GL(float alpha);
421 void R_SetColor_GL(uint32_t color);
422 void R_SetClipRect_GL(const clipRect_t *clip);
423 float R_ClampScaleGL(cvar_t *var);
424 void R_SetScale_GL(float scale);
425 void R_DrawStretchPic_GL(int x, int y, int w, int h, qhandle_t pic);
426 void R_DrawPic_GL(int x, int y, qhandle_t pic);
427 void R_TileClear_GL(int x, int y, int w, int h, qhandle_t pic);
428 void R_DrawFill8_GL(int x, int y, int w, int h, int c);
429 void R_DrawFill32_GL(int x, int y, int w, int h, uint32_t color);
430 void R_DrawChar_GL(int x, int y, int flags, int c, qhandle_t font);
431 int R_DrawString_GL(int x, int y, int flags, size_t maxlen, const char *s, qhandle_t font);
432 
433 /*
434  * gl_images.c
435  *
436  */
437 
438 // auto textures
439 #define TEXNUM_DEFAULT gl_static.texnums[0]
440 #define TEXNUM_SCRAP gl_static.texnums[1]
441 #define TEXNUM_PARTICLE gl_static.texnums[2]
442 #define TEXNUM_BEAM gl_static.texnums[3]
443 #define TEXNUM_WHITE gl_static.texnums[4]
444 #define TEXNUM_BLACK gl_static.texnums[5]
445 
446 void Scrap_Upload(void);
447 
448 void GL_InitImages(void);
449 void GL_ShutdownImages(void);
450 
451 void IMG_Load_GL(image_t *image, byte *pic);
452 void IMG_Unload_GL(image_t *image);
453 byte *IMG_ReadPixels_GL(int *width, int *height, int *rowbytes);
454 
455 /*
456  * gl_tess.c
457  *
458  */
459 #define TESS_MAX_VERTICES 4096
460 #define TESS_MAX_INDICES (3 * TESS_MAX_VERTICES)
461 
462 typedef struct {
463  GLfloat vertices[VERTEX_SIZE * TESS_MAX_VERTICES];
465  GLubyte colors[4 * TESS_MAX_VERTICES];
466  GLuint texnum[MAX_TMUS];
467  int numverts;
469  int flags;
470 } tesselator_t;
471 
472 extern tesselator_t tess;
473 
474 void GL_Flush2D(void);
475 void GL_DrawParticles(void);
476 void GL_DrawBeams(void);
477 
478 void GL_BindArrays(void);
479 void GL_Flush3D(void);
480 void GL_DrawFace(mface_t *surf);
481 
482 void GL_AddAlphaFace(mface_t *face);
483 void GL_AddSolidFace(mface_t *face);
484 void GL_DrawAlphaFaces(void);
485 void GL_DrawSolidFaces(void);
486 void GL_ClearSolidFaces(void);
487 
488 /*
489  * gl_world.c
490  *
491  */
492 void GL_DrawBspModel(mmodel_t *model);
493 void GL_DrawWorld(void);
494 void GL_SampleLightPoint(vec3_t color);
495 void GL_LightPoint(vec3_t origin, vec3_t color);
496 void R_LightPoint_GL(vec3_t origin, vec3_t color);
497 
498 /*
499  * gl_sky.c
500  *
501  */
502 void R_AddSkySurface(mface_t *surf);
503 void R_ClearSkyBox(void);
504 void R_DrawSkyBox(void);
505 void R_SetSky_GL(const char *name, float rotate, vec3_t axis);
506 
507 /*
508  * gl_mesh.c
509  *
510  */
511 void GL_DrawAliasModel(model_t *model);
512 
513 /*
514  * hq2x.c
515  *
516  */
517 void HQ2x_Render(uint32_t *output, const uint32_t *input, int width, int height);
518 void HQ4x_Render(uint32_t *output, const uint32_t *input, int width, int height);
519 void HQ2x_Init(void);
520 
521 /* models.c */
522 
523 qerror_t MOD_LoadMD2_GL(model_t *model, const void *rawdata, size_t length);
524 qerror_t MOD_LoadMD3_GL(model_t *model, const void *rawdata, size_t length);
525 void MOD_Reference_GL(model_t *model);
R_DrawFill32_GL
void R_DrawFill32_GL(int x, int y, int w, int h, uint32_t color)
Definition: draw.c:202
R_DrawStretchPic_GL
void R_DrawStretchPic_GL(int x, int y, int w, int h, qhandle_t pic)
Definition: draw.c:171
GLS_BLEND_MODULATE
@ GLS_BLEND_MODULATE
Definition: gl.h:287
gl_partscale
cvar_t * gl_partscale
Definition: main.c:37
GLS_SHADE_SMOOTH
@ GLS_SHADE_SMOOTH
Definition: gl.h:294
maliasmesh_s
Definition: gl.h:232
qglColorPointer
#define qglColorPointer
Definition: fixed.h:46
gl_fullbright
cvar_t * gl_fullbright
Definition: main.c:79
statCounters_t::nodesCulled
int nodesCulled
Definition: gl.h:144
TESS_MAX_INDICES
#define TESS_MAX_INDICES
Definition: gl.h:460
statCounters_t::facesDrawn
int facesDrawn
Definition: gl.h:138
glStatic_t::entity_modulate
float entity_modulate
Definition: gl.h:71
qglClientActiveTextureARB
PFNGLCLIENTACTIVETEXTUREARBPROC qglClientActiveTextureARB
Definition: fixed.c:39
glConfig_t::version_major
int version_major
Definition: gl.h:103
maliasmesh_s::numindices
int numindices
Definition: gl.h:235
gl_celshading
cvar_t * gl_celshading
Definition: main.c:39
masliasvert_s::norm
byte norm[2]
Definition: gl.h:222
GLS_DEPTHTEST_DISABLE
@ GLS_DEPTHTEST_DISABLE
Definition: gl.h:284
GL_InitPrograms
void GL_InitPrograms(void)
Definition: state.c:477
GL_InitImages
void GL_InitImages(void)
Definition: images.c:855
gl_showtris
cvar_t * gl_showtris
Definition: main.c:61
GL_AdjustColor
void GL_AdjustColor(vec3_t color)
Definition: surf.c:94
gl_dotshading
cvar_t * gl_dotshading
Definition: main.c:40
lm
lightmap_builder_t lm
Definition: surf.c:25
statCounters_t
Definition: gl.h:133
glArrayBits_t
glArrayBits_t
Definition: gl.h:299
maliasmesh_s::tcoords
maliastc_t * tcoords
Definition: gl.h:238
dynamic.h
height
static int height
Definition: physical_sky.c:39
gl_coloredlightmaps
cvar_t * gl_coloredlightmaps
Definition: main.c:44
GL_AllocBlock
qboolean GL_AllocBlock(int width, int height, int *inuse, int w, int h, int *s, int *t)
Definition: main.c:252
maliasframe_s::scale
vec3_t scale
Definition: gl.h:226
NUM_TEXNUMS
#define NUM_TEXNUMS
Definition: gl.h:57
glState_t::array_bits
glArrayBits_t array_bits
Definition: gl.h:312
image_t
struct image_s image_t
Definition: material.h:27
statCounters_t::batchesDrawn2D
int batchesDrawn2D
Definition: gl.h:149
GL_ColorFloatPointer
static void GL_ColorFloatPointer(GLint size, GLsizei stride, const GLfloat *pointer)
Definition: gl.h:356
lightmap_builder_t::comp
int comp
Definition: gl.h:262
GLS_CULL_DISABLE
@ GLS_CULL_DISABLE
Definition: gl.h:293
tesselator_t::numindices
int numindices
Definition: gl.h:468
MOD_LoadMD3_GL
qerror_t MOD_LoadMD3_GL(model_t *model, const void *rawdata, size_t length)
GL_PushLights
void GL_PushLights(mface_t *surf)
Definition: surf.c:271
input
static in_state_t input
Definition: input.c:71
glConfig_t::maxTextureSize
int maxTextureSize
Definition: gl.h:109
maliastc_s
Definition: gl.h:216
gl_cull_nodes
cvar_t * gl_cull_nodes
Definition: main.c:71
glStatic_t::cache
bsp_t * cache
Definition: gl.h:62
GL_Ortho
void GL_Ortho(GLfloat xmin, GLfloat xmax, GLfloat ymin, GLfloat ymax, GLfloat znear, GLfloat zfar)
Definition: state.c:230
qglLockArraysEXT
PFNGLLOCKARRAYSEXTPROC qglLockArraysEXT
Definition: fixed.c:49
IMG_Load_GL
void IMG_Load_GL(image_t *image, byte *pic)
Definition: images.c:618
glRefdef_t::entrotated
qboolean entrotated
Definition: gl.h:93
glConfig_t::depthbits
int depthbits
Definition: gl.h:114
glConfig_t::version_minor
int version_minor
Definition: gl.h:104
MOD_Reference_GL
void MOD_Reference_GL(model_t *model)
Definition: models.c:425
glState_t
Definition: gl.h:307
GL_DrawParticles
void GL_DrawParticles(void)
Definition: tess.c:79
gl_lightmap
cvar_t * gl_lightmap
Definition: main.c:78
maliasframe_t
struct maliasframe_s maliasframe_t
glStatic_t::hunk
memhunk_t hunk
Definition: gl.h:63
glStatic_t::size
vec_t size
Definition: gl.h:66
GL_AddAlphaFace
void GL_AddAlphaFace(mface_t *face)
Definition: tess.c:476
statCounters_t::trisDrawn
int trisDrawn
Definition: gl.h:142
lightmap_builder_t::scale
float scale
Definition: gl.h:263
R_DrawString_GL
int R_DrawString_GL(int x, int y, int flags, size_t maxlen, const char *s, qhandle_t font)
Definition: draw.c:247
glRefdef_t
Definition: gl.h:80
GL_BindTexture
void GL_BindTexture(GLuint tmu, GLuint texnum)
Definition: state.c:40
gl_drawsky
cvar_t * gl_drawsky
Definition: main.c:60
GLS_TEXTURE_REPLACE
@ GLS_TEXTURE_REPLACE
Definition: gl.h:289
LM_BLOCK_HEIGHT
#define LM_BLOCK_HEIGHT
Definition: gl.h:256
GL_ClearSolidFaces
void GL_ClearSolidFaces(void)
Definition: tess.c:427
GL_CullSphere
glCullResult_t GL_CullSphere(const vec3_t origin, float radius)
Definition: main.c:145
GL_ShutdownPrograms
void GL_ShutdownPrograms(void)
Definition: state.c:518
GL_ClientActiveTexture
static void GL_ClientActiveTexture(GLuint tmu)
Definition: gl.h:326
glRefdef_t::num_beams
int num_beams
Definition: gl.h:97
gl_clear
cvar_t * gl_clear
Definition: main.c:73
GLS_WARP_ENABLE
@ GLS_WARP_ENABLE
Definition: gl.h:292
R_DrawFill8_GL
void R_DrawFill8_GL(int x, int y, int w, int h, int c)
Definition: draw.c:195
GLS_BLEND_BLEND
@ GLS_BLEND_BLEND
Definition: gl.h:285
GLS_LIGHTMAP_ENABLE
@ GLS_LIGHTMAP_ENABLE
Definition: gl.h:291
statCounters_t::nodesDrawn
int nodesDrawn
Definition: gl.h:135
R_ClampScaleGL
float R_ClampScaleGL(cvar_t *var)
R_SetSky_GL
void R_SetSky_GL(const char *name, float rotate, vec3_t axis)
Definition: sky.c:382
maliasmesh_s::indices
QGL_INDEX_TYPE * indices
Definition: gl.h:236
glConfig_t::ext_supported
unsigned ext_supported
Definition: gl.h:106
GL_LockArrays
static void GL_LockArrays(GLsizei count)
Definition: gl.h:361
gl_vertexlight
cvar_t * gl_vertexlight
Definition: main.c:80
glConfig_t::numTextureUnits
int numTextureUnits
Definition: gl.h:110
qglVertexPointer
#define qglVertexPointer
Definition: fixed.h:112
statCounters_t::boxesCulled
int boxesCulled
Definition: gl.h:146
glStatic_t::inverse_intensity_100
uint32_t inverse_intensity_100
Definition: gl.h:74
gl_world
entity_t gl_world
Definition: main.c:32
GLA_VERTEX
@ GLA_VERTEX
Definition: gl.h:301
GL_UnlockArrays
static void GL_UnlockArrays(void)
Definition: gl.h:368
GL_DrawAlphaFaces
void GL_DrawAlphaFaces(void)
Definition: tess.c:445
maliasmesh_s::verts
maliasvert_t * verts
Definition: gl.h:237
masliasvert_s::pos
short pos[3]
Definition: gl.h:221
gl_hash_faces
cvar_t * gl_hash_faces
Definition: main.c:75
glStatic_t::stencil_buffer_bit
GLbitfield stencil_buffer_bit
Definition: gl.h:70
GL_Flush2D
void GL_Flush2D(void)
Definition: tess.c:31
GL_MultMatrix
void GL_MultMatrix(GLfloat *out, const GLfloat *a, const GLfloat *b)
Definition: main.c:290
statCounters_t::facesMarked
int facesMarked
Definition: gl.h:137
gl_config
glConfig_t gl_config
Definition: main.c:29
R_DrawPic_GL
void R_DrawPic_GL(int x, int y, qhandle_t pic)
Definition: draw.c:179
maliasframe_s::translate
vec3_t translate
Definition: gl.h:227
maliasmesh_s::numverts
int numverts
Definition: gl.h:233
maliasmesh_s::skins
image_t * skins[MAX_ALIAS_SKINS]
Definition: gl.h:239
GL_LightCoordPointer
static void GL_LightCoordPointer(GLint size, GLsizei stride, const GLfloat *pointer)
Definition: gl.h:345
gls
glState_t gls
Definition: state.c:22
width
static int width
Definition: physical_sky.c:38
statCounters_t::texUploads
int texUploads
Definition: gl.h:141
HQ4x_Render
void HQ4x_Render(uint32_t *output, const uint32_t *input, int width, int height)
Definition: hq2x.c:405
TESS_MAX_VERTICES
#define TESS_MAX_VERTICES
Definition: gl.h:459
MOD_LoadMD2_GL
qerror_t MOD_LoadMD2_GL(model_t *model, const void *rawdata, size_t length)
Definition: models.c:32
GLS_FLOW_ENABLE
@ GLS_FLOW_ENABLE
Definition: gl.h:290
VERTEX_SIZE
#define VERTEX_SIZE
Definition: gl.h:245
R_SetAlphaScale_GL
void R_SetAlphaScale_GL(float alpha)
Definition: draw.c:104
gl_lockpvs
cvar_t * gl_lockpvs
Definition: main.c:77
gl_modulate_entities
cvar_t * gl_modulate_entities
Definition: main.c:50
maliastc_s::st
float st[2]
Definition: gl.h:217
glRefdef_t::visframe
int visframe
Definition: gl.h:84
GL_ArrayBits
void GL_ArrayBits(glArrayBits_t bits)
Definition: state.c:185
qglTexCoordPointer
#define qglTexCoordPointer
Definition: fixed.h:104
GL_DrawWorld
void GL_DrawWorld(void)
Definition: world.c:552
maliasframe_s::bounds
vec3_t bounds[2]
Definition: gl.h:228
GLS_BLEND_ADD
@ GLS_BLEND_ADD
Definition: gl.h:286
Scrap_Upload
void Scrap_Upload(void)
Definition: images.c:220
R_SetColor_GL
void R_SetColor_GL(uint32_t color)
Definition: draw.c:109
GL_RotateForEntity
void GL_RotateForEntity(vec3_t origin, float scale)
Definition: main.c:305
GL_DrawFace
void GL_DrawFace(mface_t *surf)
Definition: tess.c:367
QGL_ClearErrors
void QGL_ClearErrors(void)
Definition: main.c:531
maliasframe_s::radius
vec_t radius
Definition: gl.h:229
GL_LightPoint
void GL_LightPoint(vec3_t origin, vec3_t color)
Definition: world.c:233
statCounters_t::texSwitches
int texSwitches
Definition: gl.h:140
maliastc_t
struct maliastc_s maliastc_t
R_AddSkySurface
void R_AddSkySurface(mface_t *surf)
Definition: sky.c:234
GL_RebuildLighting
void GL_RebuildLighting(void)
Definition: surf.c:836
statCounters_t::leavesDrawn
int leavesDrawn
Definition: gl.h:136
glConfig_t
Definition: gl.h:100
GL_ColorBytePointer
static void GL_ColorBytePointer(GLint size, GLsizei stride, const GLubyte *pointer)
Definition: gl.h:351
glStateBits_t
glStateBits_t
Definition: gl.h:281
GL_Setup3D
void GL_Setup3D(void)
Definition: state.c:362
glConfig_t::colorbits
int colorbits
Definition: gl.h:113
GL_TexCoordPointer
static void GL_TexCoordPointer(GLint size, GLsizei stride, const GLfloat *pointer)
Definition: gl.h:339
origin
static vec3_t origin
Definition: mesh.c:27
GL_CullLocalBox
glCullResult_t GL_CullLocalBox(const vec3_t origin, vec3_t bounds[2])
Definition: main.c:185
GL_DrawBspModel
void GL_DrawBspModel(mmodel_t *model)
Definition: world.c:358
GL_SampleLightPoint
void GL_SampleLightPoint(vec3_t color)
Definition: world.c:21
GL_DisableOutlines
void GL_DisableOutlines(void)
Definition: state.c:471
glStatic_t
Definition: gl.h:59
glRefdef_t::lightpoint
lightpoint_t lightpoint
Definition: gl.h:96
R_SetClipRect_GL
void R_SetClipRect_GL(const clipRect_t *clip)
Definition: draw.c:115
lightmap_builder_t::dirty
qboolean dirty
Definition: gl.h:261
CULL_IN
@ CULL_IN
Definition: gl.h:192
maliasvert_t
struct masliasvert_s maliasvert_t
GL_AddSolidFace
void GL_AddSolidFace(mface_t *face)
Definition: tess.c:462
GL_ActiveTexture
static void GL_ActiveTexture(GLuint tmu)
Definition: gl.h:318
GL_DrawSolidFaces
void GL_DrawSolidFaces(void)
Definition: tess.c:436
R_DrawSkyBox
void R_DrawSkyBox(void)
Definition: sky.c:337
R_ClearColor_GL
void R_ClearColor_GL(void)
Definition: draw.c:92
GLS_DEFAULT
@ GLS_DEFAULT
Definition: gl.h:282
R_SetScale_GL
void R_SetScale_GL(float scale)
Definition: draw.c:157
GL_BindArrays
void GL_BindArrays(void)
Definition: tess.c:255
qglLoadMatrixf
#define qglLoadMatrixf
Definition: fixed.h:80
GL_Setup2D
void GL_Setup2D(void)
Definition: state.c:263
qglActiveTextureARB
PFNGLACTIVETEXTUREARBPROC qglActiveTextureARB
Definition: fixed.c:38
gl_partstyle
cvar_t * gl_partstyle
Definition: main.c:38
GL_ForceTexture
void GL_ForceTexture(GLuint tmu, GLuint texnum)
Definition: state.c:25
GLA_LMTC
@ GLA_LMTC
Definition: gl.h:303
gl_znear
cvar_t * gl_znear
Definition: main.c:57
MAX_TMUS
#define MAX_TMUS
Definition: gl.h:52
gl_static
glStatic_t gl_static
Definition: main.c:28
GL_DrawBeams
void GL_DrawBeams(void)
Definition: tess.c:164
HQ2x_Render
void HQ2x_Render(uint32_t *output, const uint32_t *input, int width, int height)
Definition: hq2x.c:357
lightmap_builder_t
Definition: gl.h:258
draw
drawStatic_t draw
Definition: draw.c:21
GLA_TC
@ GLA_TC
Definition: gl.h:302
tesselator_t::flags
int flags
Definition: gl.h:469
c
statCounters_t c
Definition: main.c:30
lightmap_builder_t::nummaps
int nummaps
Definition: gl.h:264
LM_MAX_LIGHTMAPS
#define LM_MAX_LIGHTMAPS
Definition: gl.h:254
gl_dynamic
cvar_t * gl_dynamic
Definition: main.c:46
gl_modulate_world
cvar_t * gl_modulate_world
Definition: main.c:43
glr
glRefdef_t glr
Definition: main.c:27
drawStatic_t
Definition: gl.h:401
fixed.h
glStatic_t::prognum_warp
GLuint prognum_warp
Definition: gl.h:68
GL_Flush3D
void GL_Flush3D(void)
Definition: tess.c:284
GL_VertexPointer
static void GL_VertexPointer(GLint size, GLsizei stride, const GLfloat *pointer)
Definition: gl.h:334
world
#define world
Definition: g_local.h:550
masliasvert_s
Definition: gl.h:220
glConfig_t::ext_enabled
unsigned ext_enabled
Definition: gl.h:107
tess
tesselator_t tess
Definition: tess.c:21
GL_ShutdownImages
void GL_ShutdownImages(void)
Definition: images.c:940
GL_SetDefaultState
void GL_SetDefaultState(void)
Definition: state.c:377
glState_t::client_tmu
GLuint client_tmu
Definition: gl.h:308
gl_doublelight_entities
cvar_t * gl_doublelight_entities
Definition: main.c:51
GLA_NONE
@ GLA_NONE
Definition: gl.h:300
GL_LoadMatrix
static void GL_LoadMatrix(const GLfloat *matrix)
Definition: gl.h:375
GLA_COLOR
@ GLA_COLOR
Definition: gl.h:304
glRefdef_t::viewcluster1
int viewcluster1
Definition: gl.h:89
glStatic_t::inverse_intensity_33
uint32_t inverse_intensity_33
Definition: gl.h:72
glStatic_t::registering
qboolean registering
Definition: gl.h:60
client.h
maliasmesh_t
struct maliasmesh_s maliasmesh_t
maliasmesh_s::numtris
int numtris
Definition: gl.h:234
R_ClearSkyBox
void R_ClearSkyBox(void)
Definition: sky.c:274
statCounters_t::facesTris
int facesTris
Definition: gl.h:139
gl_fragment_program
cvar_t * gl_fragment_program
Definition: main.c:52
R_LightPoint_GL
void R_LightPoint_GL(vec3_t origin, vec3_t color)
Definition: world.c:254
gl_shadows
cvar_t * gl_shadows
Definition: main.c:41
GL_Blend
void GL_Blend(void)
Definition: draw.c:79
statCounters_t::batchesDrawn
int batchesDrawn
Definition: gl.h:143
statCounters_t::rotatedBoxesCulled
int rotatedBoxesCulled
Definition: gl.h:148
GLS_ALPHATEST_ENABLE
@ GLS_ALPHATEST_ENABLE
Definition: gl.h:288
color
static vec4_t color
Definition: mesh.c:33
statCounters_t::spheresCulled
int spheresCulled
Definition: gl.h:147
drawStatic_t::scale
float scale
Definition: gl.h:404
glStatic_t::bufnum
GLuint bufnum
Definition: gl.h:65
QGL_INDEX_TYPE
#define QGL_INDEX_TYPE
Definition: gl.h:48
gl_brightness
cvar_t * gl_brightness
Definition: main.c:45
glState_t::currentmatrix
const GLfloat * currentmatrix
Definition: gl.h:313
GL_LoadWorld
void GL_LoadWorld(const char *name)
Definition: surf.c:876
qglUnlockArraysEXT
PFNGLUNLOCKARRAYSEXTPROC qglUnlockArraysEXT
Definition: fixed.c:50
GL_CullBox
glCullResult_t GL_CullBox(vec3_t bounds[2])
Definition: main.c:122
glCullResult_t
glCullResult_t
Definition: gl.h:190
tesselator_t
Definition: gl.h:462
GLS_DEPTHMASK_FALSE
@ GLS_DEPTHMASK_FALSE
Definition: gl.h:283
IMG_Unload_GL
void IMG_Unload_GL(image_t *image)
Definition: images.c:679
LM_BLOCK_WIDTH
#define LM_BLOCK_WIDTH
Definition: gl.h:255
gl_modulate
cvar_t * gl_modulate
Definition: main.c:42
glRefdef_t::viewcluster2
int viewcluster2
Definition: gl.h:90
GL_EnableOutlines
void GL_EnableOutlines(void)
Definition: state.c:460
gl_novis
cvar_t * gl_novis
Definition: main.c:76
IMG_ReadPixels_GL
byte * IMG_ReadPixels_GL(int *width, int *height, int *rowbytes)
Definition: state.c:427
GL_StateBits
void GL_StateBits(glStateBits_t bits)
Definition: state.c:60
R_SetAlpha_GL
void R_SetAlpha_GL(float alpha)
Definition: draw.c:98
CULL_CLIP
@ CULL_CLIP
Definition: gl.h:193
maliasframe_s
Definition: gl.h:225
drawStatic_t::scissor
qboolean scissor
Definition: gl.h:403
glStatic_t::vertices
vec_t * vertices
Definition: gl.h:64
GL_DrawAliasModel
void GL_DrawAliasModel(model_t *model)
Definition: mesh.c:623
glStatic_t::inverse_intensity_66
uint32_t inverse_intensity_66
Definition: gl.h:73
gl_fontshadow
cvar_t * gl_fontshadow
Definition: main.c:54
R_DrawChar_GL
void R_DrawChar_GL(int x, int y, int flags, int c, qhandle_t font)
Definition: draw.c:242
HQ2x_Init
void HQ2x_Init(void)
Definition: hq2x.c:459
glConfig_t::es_profile
qboolean es_profile
Definition: gl.h:101
glConfig_t::stencilbits
int stencilbits
Definition: gl.h:115
R_TileClear_GL
void R_TileClear_GL(int x, int y, int w, int h, qhandle_t pic)
Definition: draw.c:189
GL_ShowErrors
qboolean GL_ShowErrors(const char *func)
Definition: main.c:539
GL_FreeWorld
void GL_FreeWorld(void)
Definition: surf.c:859
statCounters_t::nodesVisible
int nodesVisible
Definition: gl.h:134
glState_t::state_bits
glStateBits_t state_bits
Definition: gl.h:311
glRefdef_t::drawframe
int drawframe
Definition: gl.h:85
glRefdef_t::ent
entity_t * ent
Definition: gl.h:92
maliasmesh_s::numskins
int numskins
Definition: gl.h:240
glState_t::server_tmu
GLuint server_tmu
Definition: gl.h:309
CULL_OUT
@ CULL_OUT
Definition: gl.h:191
glConfig_t::maxAnisotropy
float maxAnisotropy
Definition: gl.h:111
glRefdef_t::fd
refdef_t fd
Definition: gl.h:81
tesselator_t::numverts
int numverts
Definition: gl.h:467
statCounters_t::facesCulled
int facesCulled
Definition: gl.h:145