Quake II RTX doxygen  1.0 dev
gl.h File Reference
#include "shared/shared.h"
#include "common/bsp.h"
#include "common/cmd.h"
#include "common/common.h"
#include "common/cvar.h"
#include "common/files.h"
#include "common/math.h"
#include "client/video.h"
#include "client/client.h"
#include "refresh/refresh.h"
#include "refresh/images.h"
#include "refresh/models.h"
#include "system/hunk.h"
#include "qgl/dynamic.h"

Go to the source code of this file.

Classes

struct  glStatic_t
 
struct  glRefdef_t
 
struct  glConfig_t
 
struct  statCounters_t
 
struct  maliastc_s
 
struct  masliasvert_s
 
struct  maliasframe_s
 
struct  maliasmesh_s
 
struct  lightmap_builder_t
 
struct  glState_t
 
struct  drawStatic_t
 
struct  tesselator_t
 

Macros

#define QGL_INDEX_TYPE   GLuint
 
#define QGL_INDEX_ENUM   GL_UNSIGNED_INT
 
#define MAX_TMUS   2
 
#define TAB_SIN(x)   gl_static.sintab[(x) & 255]
 
#define TAB_COS(x)   gl_static.sintab[((x) + 64) & 255]
 
#define NUM_TEXNUMS   6
 
#define AT_LEAST_OPENGL_ANY(major, minor)   (gl_config.version_major > major || (gl_config.version_major == major && gl_config.version_minor >= minor))
 
#define AT_LEAST_OPENGL(major, minor)   (!gl_config.es_profile && AT_LEAST_OPENGL_ANY(major, minor))
 
#define AT_LEAST_OPENGL_ES(major, minor)   (gl_config.es_profile && AT_LEAST_OPENGL_ANY(major, minor))
 
#define VERTEX_SIZE   8
 
#define LIGHT_STYLE(surf, i)   &glr.fd.lightstyles[gl_static.lightstylemap[(surf)->styles[i]]]
 
#define LM_MAX_LIGHTMAPS   32
 
#define LM_BLOCK_WIDTH   256
 
#define LM_BLOCK_HEIGHT   256
 
#define GLS_BLEND_MASK   (GLS_BLEND_BLEND | GLS_BLEND_ADD | GLS_BLEND_MODULATE)
 
#define TEXNUM_DEFAULT   gl_static.texnums[0]
 
#define TEXNUM_SCRAP   gl_static.texnums[1]
 
#define TEXNUM_PARTICLE   gl_static.texnums[2]
 
#define TEXNUM_BEAM   gl_static.texnums[3]
 
#define TEXNUM_WHITE   gl_static.texnums[4]
 
#define TEXNUM_BLACK   gl_static.texnums[5]
 
#define TESS_MAX_VERTICES   4096
 
#define TESS_MAX_INDICES   (3 * TESS_MAX_VERTICES)
 

Typedefs

typedef struct maliastc_s maliastc_t
 
typedef struct masliasvert_s maliasvert_t
 
typedef struct maliasframe_s maliasframe_t
 
typedef struct maliasmesh_s maliasmesh_t
 

Enumerations

enum  glCullResult_t { CULL_OUT, CULL_IN, CULL_CLIP }
 
enum  glStateBits_t {
  GLS_DEFAULT = 0, GLS_DEPTHMASK_FALSE = (1 << 0), GLS_DEPTHTEST_DISABLE = (1 << 1), GLS_BLEND_BLEND = (1 << 2),
  GLS_BLEND_ADD = (1 << 3), GLS_BLEND_MODULATE = (1 << 4), GLS_ALPHATEST_ENABLE = (1 << 5), GLS_TEXTURE_REPLACE = (1 << 6),
  GLS_FLOW_ENABLE = (1 << 7), GLS_LIGHTMAP_ENABLE = (1 << 8), GLS_WARP_ENABLE = (1 << 9), GLS_CULL_DISABLE = (1 << 10),
  GLS_SHADE_SMOOTH = (1 << 11)
}
 
enum  glArrayBits_t {
  GLA_NONE = 0, GLA_VERTEX = (1 << 0), GLA_TC = (1 << 1), GLA_LMTC = (1 << 2),
  GLA_COLOR = (1 << 3)
}
 

Functions

glCullResult_t GL_CullBox (vec3_t bounds[2])
 
glCullResult_t GL_CullSphere (const vec3_t origin, float radius)
 
glCullResult_t GL_CullLocalBox (const vec3_t origin, vec3_t bounds[2])
 
qboolean GL_AllocBlock (int width, int height, int *inuse, int w, int h, int *s, int *t)
 
void GL_MultMatrix (GLfloat *out, const GLfloat *a, const GLfloat *b)
 
void GL_RotateForEntity (vec3_t origin, float scale)
 
void QGL_ClearErrors (void)
 
qboolean GL_ShowErrors (const char *func)
 
void GL_AdjustColor (vec3_t color)
 
void GL_PushLights (mface_t *surf)
 
void GL_RebuildLighting (void)
 
void GL_FreeWorld (void)
 
void GL_LoadWorld (const char *name)
 
static void GL_ActiveTexture (GLuint tmu)
 
static void GL_ClientActiveTexture (GLuint tmu)
 
static void GL_VertexPointer (GLint size, GLsizei stride, const GLfloat *pointer)
 
static void GL_TexCoordPointer (GLint size, GLsizei stride, const GLfloat *pointer)
 
static void GL_LightCoordPointer (GLint size, GLsizei stride, const GLfloat *pointer)
 
static void GL_ColorBytePointer (GLint size, GLsizei stride, const GLubyte *pointer)
 
static void GL_ColorFloatPointer (GLint size, GLsizei stride, const GLfloat *pointer)
 
static void GL_LockArrays (GLsizei count)
 
static void GL_UnlockArrays (void)
 
static void GL_LoadMatrix (const GLfloat *matrix)
 
void GL_ForceTexture (GLuint tmu, GLuint texnum)
 
void GL_BindTexture (GLuint tmu, GLuint texnum)
 
void GL_StateBits (glStateBits_t bits)
 
void GL_ArrayBits (glArrayBits_t bits)
 
void GL_Ortho (GLfloat xmin, GLfloat xmax, GLfloat ymin, GLfloat ymax, GLfloat znear, GLfloat zfar)
 
void GL_Setup2D (void)
 
void GL_Setup3D (void)
 
void GL_SetDefaultState (void)
 
void GL_InitPrograms (void)
 
void GL_ShutdownPrograms (void)
 
void GL_EnableOutlines (void)
 
void GL_DisableOutlines (void)
 
void GL_Blend (void)
 
void R_ClearColor_GL (void)
 
void R_SetAlpha_GL (float alpha)
 
void R_SetAlphaScale_GL (float alpha)
 
void R_SetColor_GL (uint32_t color)
 
void R_SetClipRect_GL (const clipRect_t *clip)
 
float R_ClampScaleGL (cvar_t *var)
 
void R_SetScale_GL (float scale)
 
void R_DrawStretchPic_GL (int x, int y, int w, int h, qhandle_t pic)
 
void R_DrawPic_GL (int x, int y, qhandle_t pic)
 
void R_TileClear_GL (int x, int y, int w, int h, qhandle_t pic)
 
void R_DrawFill8_GL (int x, int y, int w, int h, int c)
 
void R_DrawFill32_GL (int x, int y, int w, int h, uint32_t color)
 
void R_DrawChar_GL (int x, int y, int flags, int c, qhandle_t font)
 
int R_DrawString_GL (int x, int y, int flags, size_t maxlen, const char *s, qhandle_t font)
 
void Scrap_Upload (void)
 
void GL_InitImages (void)
 
void GL_ShutdownImages (void)
 
void IMG_Load_GL (image_t *image, byte *pic)
 
void IMG_Unload_GL (image_t *image)
 
byte * IMG_ReadPixels_GL (int *width, int *height, int *rowbytes)
 
void GL_Flush2D (void)
 
void GL_DrawParticles (void)
 
void GL_DrawBeams (void)
 
void GL_BindArrays (void)
 
void GL_Flush3D (void)
 
void GL_DrawFace (mface_t *surf)
 
void GL_AddAlphaFace (mface_t *face)
 
void GL_AddSolidFace (mface_t *face)
 
void GL_DrawAlphaFaces (void)
 
void GL_DrawSolidFaces (void)
 
void GL_ClearSolidFaces (void)
 
void GL_DrawBspModel (mmodel_t *model)
 
void GL_DrawWorld (void)
 
void GL_SampleLightPoint (vec3_t color)
 
void GL_LightPoint (vec3_t origin, vec3_t color)
 
void R_LightPoint_GL (vec3_t origin, vec3_t color)
 
void R_AddSkySurface (mface_t *surf)
 
void R_ClearSkyBox (void)
 
void R_DrawSkyBox (void)
 
void R_SetSky_GL (const char *name, float rotate, vec3_t axis)
 
void GL_DrawAliasModel (model_t *model)
 
void HQ2x_Render (uint32_t *output, const uint32_t *input, int width, int height)
 
void HQ4x_Render (uint32_t *output, const uint32_t *input, int width, int height)
 
void HQ2x_Init (void)
 
qerror_t MOD_LoadMD2_GL (model_t *model, const void *rawdata, size_t length)
 
qerror_t MOD_LoadMD3_GL (model_t *model, const void *rawdata, size_t length)
 
void MOD_Reference_GL (model_t *model)
 

Variables

glStatic_t gl_static
 
glConfig_t gl_config
 
glRefdef_t glr
 
entity_t gl_world
 
statCounters_t c
 
cvar_t * gl_partscale
 
cvar_t * gl_partstyle
 
cvar_t * gl_celshading
 
cvar_t * gl_dotshading
 
cvar_t * gl_shadows
 
cvar_t * gl_modulate
 
cvar_t * gl_modulate_world
 
cvar_t * gl_coloredlightmaps
 
cvar_t * gl_brightness
 
cvar_t * gl_dynamic
 
cvar_t * gl_modulate_entities
 
cvar_t * gl_doublelight_entities
 
cvar_t * gl_fragment_program
 
cvar_t * gl_fontshadow
 
cvar_t * gl_znear
 
cvar_t * gl_drawsky
 
cvar_t * gl_showtris
 
cvar_t * gl_cull_nodes
 
cvar_t * gl_hash_faces
 
cvar_t * gl_clear
 
cvar_t * gl_novis
 
cvar_t * gl_lockpvs
 
cvar_t * gl_lightmap
 
cvar_t * gl_fullbright
 
cvar_t * gl_vertexlight
 
lightmap_builder_t lm
 
glState_t gls
 
drawStatic_t draw
 
tesselator_t tess
 

Macro Definition Documentation

◆ AT_LEAST_OPENGL

#define AT_LEAST_OPENGL (   major,
  minor 
)    (!gl_config.es_profile && AT_LEAST_OPENGL_ANY(major, minor))

Definition at line 121 of file gl.h.

◆ AT_LEAST_OPENGL_ANY

#define AT_LEAST_OPENGL_ANY (   major,
  minor 
)    (gl_config.version_major > major || (gl_config.version_major == major && gl_config.version_minor >= minor))

Definition at line 118 of file gl.h.

◆ AT_LEAST_OPENGL_ES

#define AT_LEAST_OPENGL_ES (   major,
  minor 
)    (gl_config.es_profile && AT_LEAST_OPENGL_ANY(major, minor))

Definition at line 124 of file gl.h.

◆ GLS_BLEND_MASK

#define GLS_BLEND_MASK   (GLS_BLEND_BLEND | GLS_BLEND_ADD | GLS_BLEND_MODULATE)

Definition at line 297 of file gl.h.

◆ LIGHT_STYLE

#define LIGHT_STYLE (   surf,
 
)    &glr.fd.lightstyles[gl_static.lightstylemap[(surf)->styles[i]]]

Definition at line 251 of file gl.h.

◆ LM_BLOCK_HEIGHT

#define LM_BLOCK_HEIGHT   256

Definition at line 256 of file gl.h.

◆ LM_BLOCK_WIDTH

#define LM_BLOCK_WIDTH   256

Definition at line 255 of file gl.h.

◆ LM_MAX_LIGHTMAPS

#define LM_MAX_LIGHTMAPS   32

Definition at line 254 of file gl.h.

◆ MAX_TMUS

#define MAX_TMUS   2

Definition at line 52 of file gl.h.

◆ NUM_TEXNUMS

#define NUM_TEXNUMS   6

Definition at line 57 of file gl.h.

◆ QGL_INDEX_ENUM

#define QGL_INDEX_ENUM   GL_UNSIGNED_INT

Definition at line 49 of file gl.h.

◆ QGL_INDEX_TYPE

#define QGL_INDEX_TYPE   GLuint

Definition at line 48 of file gl.h.

◆ TAB_COS

#define TAB_COS (   x)    gl_static.sintab[((x) + 64) & 255]

Definition at line 55 of file gl.h.

◆ TAB_SIN

#define TAB_SIN (   x)    gl_static.sintab[(x) & 255]

Definition at line 54 of file gl.h.

◆ TESS_MAX_INDICES

#define TESS_MAX_INDICES   (3 * TESS_MAX_VERTICES)

Definition at line 460 of file gl.h.

◆ TESS_MAX_VERTICES

#define TESS_MAX_VERTICES   4096

Definition at line 459 of file gl.h.

◆ TEXNUM_BEAM

#define TEXNUM_BEAM   gl_static.texnums[3]

Definition at line 442 of file gl.h.

◆ TEXNUM_BLACK

#define TEXNUM_BLACK   gl_static.texnums[5]

Definition at line 444 of file gl.h.

◆ TEXNUM_DEFAULT

#define TEXNUM_DEFAULT   gl_static.texnums[0]

Definition at line 439 of file gl.h.

◆ TEXNUM_PARTICLE

#define TEXNUM_PARTICLE   gl_static.texnums[2]

Definition at line 441 of file gl.h.

◆ TEXNUM_SCRAP

#define TEXNUM_SCRAP   gl_static.texnums[1]

Definition at line 440 of file gl.h.

◆ TEXNUM_WHITE

#define TEXNUM_WHITE   gl_static.texnums[4]

Definition at line 443 of file gl.h.

◆ VERTEX_SIZE

#define VERTEX_SIZE   8

Definition at line 245 of file gl.h.

Typedef Documentation

◆ maliasframe_t

typedef struct maliasframe_s maliasframe_t

◆ maliasmesh_t

typedef struct maliasmesh_s maliasmesh_t

◆ maliastc_t

typedef struct maliastc_s maliastc_t

◆ maliasvert_t

typedef struct masliasvert_s maliasvert_t

Enumeration Type Documentation

◆ glArrayBits_t

Enumerator
GLA_NONE 
GLA_VERTEX 
GLA_TC 
GLA_LMTC 
GLA_COLOR 

Definition at line 299 of file gl.h.

299  {
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;

◆ glCullResult_t

Enumerator
CULL_OUT 
CULL_IN 
CULL_CLIP 

Definition at line 190 of file gl.h.

190  {
191  CULL_OUT,
192  CULL_IN,
193  CULL_CLIP

◆ glStateBits_t

Enumerator
GLS_DEFAULT 
GLS_DEPTHMASK_FALSE 
GLS_DEPTHTEST_DISABLE 
GLS_BLEND_BLEND 
GLS_BLEND_ADD 
GLS_BLEND_MODULATE 
GLS_ALPHATEST_ENABLE 
GLS_TEXTURE_REPLACE 
GLS_FLOW_ENABLE 
GLS_LIGHTMAP_ENABLE 
GLS_WARP_ENABLE 
GLS_CULL_DISABLE 
GLS_SHADE_SMOOTH 

Definition at line 281 of file gl.h.

281  {
282  GLS_DEFAULT = 0,
283  GLS_DEPTHMASK_FALSE = (1 << 0),
284  GLS_DEPTHTEST_DISABLE = (1 << 1),
285  GLS_BLEND_BLEND = (1 << 2),
286  GLS_BLEND_ADD = (1 << 3),
287  GLS_BLEND_MODULATE = (1 << 4),
288  GLS_ALPHATEST_ENABLE = (1 << 5),
289  GLS_TEXTURE_REPLACE = (1 << 6),
290  GLS_FLOW_ENABLE = (1 << 7),
291  GLS_LIGHTMAP_ENABLE = (1 << 8),
292  GLS_WARP_ENABLE = (1 << 9),
293  GLS_CULL_DISABLE = (1 << 10),
294  GLS_SHADE_SMOOTH = (1 << 11)
295 } glStateBits_t;

Function Documentation

◆ GL_ActiveTexture()

static void GL_ActiveTexture ( GLuint  tmu)
inlinestatic

Definition at line 318 of file gl.h.

319 {
320  if (gls.server_tmu != tmu) {
321  qglActiveTextureARB(GL_TEXTURE0_ARB + tmu);
322  gls.server_tmu = tmu;
323  }
324 }

Referenced by GL_BindTexture(), GL_ForceTexture(), and GL_StateBits().

◆ GL_AddAlphaFace()

void GL_AddAlphaFace ( mface_t *  face)

Definition at line 476 of file tess.c.

477 {
478  // draw back-to-front
479  face->next = faces_alpha;
480  faces_alpha = face;
481 }

Referenced by GL_DrawBspModel(), and GL_DrawNode().

◆ GL_AddSolidFace()

void GL_AddSolidFace ( mface_t *  face)

Definition at line 462 of file tess.c.

463 {
464  unsigned hash;
465 
466  hash = face->texnum[0] ^ face->texnum[1] ^ face->statebits;
467  hash ^= hash >> FACE_HASH_BITS;
468  hash &= FACE_HASH_MASK;
469 
470  // preserve front-to-back ordering
471  face->next = NULL;
472  *faces_next[hash] = face;
473  faces_next[hash] = &face->next;
474 }

Referenced by GL_DrawNode().

◆ GL_AdjustColor()

void GL_AdjustColor ( vec3_t  color)

Definition at line 94 of file surf.c.

95 {
97  VectorScale(color, (1.0f / 255), color);
98 }

Referenced by _GL_LightPoint().

◆ GL_AllocBlock()

qboolean GL_AllocBlock ( int  width,
int  height,
int inuse,
int  w,
int  h,
int s,
int t 
)

Definition at line 252 of file main.c.

254 {
255  int i, j, k, x, y, max_inuse, min_inuse;
256 
257  x = 0; y = height;
258  min_inuse = height;
259  for (i = 0; i < width - w; i++) {
260  max_inuse = 0;
261  for (j = 0; j < w; j++) {
262  k = inuse[i + j];
263  if (k >= min_inuse) {
264  break;
265  }
266  if (max_inuse < k) {
267  max_inuse = k;
268  }
269  }
270  if (j == w) {
271  x = i;
272  y = min_inuse = max_inuse;
273  }
274  }
275 
276  if (y + h > height) {
277  return qfalse;
278  }
279 
280  for (i = 0; i < w; i++) {
281  inuse[x + i] = y + h;
282  }
283 
284  *s = x;
285  *t = y;
286  return qtrue;
287 }

◆ GL_ArrayBits()

void GL_ArrayBits ( glArrayBits_t  bits)

Definition at line 185 of file state.c.

186 {
187  glArrayBits_t diff = bits ^ gls.array_bits;
188 
189  if (!diff) {
190  return;
191  }
192 
193  if (diff & GLA_VERTEX) {
194  if (bits & GLA_VERTEX) {
195  qglEnableClientState(GL_VERTEX_ARRAY);
196  } else {
197  qglDisableClientState(GL_VERTEX_ARRAY);
198  }
199  }
200 
201  if (diff & GLA_TC) {
203  if (bits & GLA_TC) {
204  qglEnableClientState(GL_TEXTURE_COORD_ARRAY);
205  } else {
206  qglDisableClientState(GL_TEXTURE_COORD_ARRAY);
207  }
208  }
209 
210  if (diff & GLA_LMTC) {
212  if (bits & GLA_LMTC) {
213  qglEnableClientState(GL_TEXTURE_COORD_ARRAY);
214  } else {
215  qglDisableClientState(GL_TEXTURE_COORD_ARRAY);
216  }
217  }
218 
219  if (diff & GLA_COLOR) {
220  if (bits & GLA_COLOR) {
221  qglEnableClientState(GL_COLOR_ARRAY);
222  } else {
223  qglDisableClientState(GL_COLOR_ARRAY);
224  }
225  }
226 
227  gls.array_bits = bits;
228 }

Referenced by draw_alias_mesh(), draw_celshading(), draw_shadow(), GL_DrawBeams(), GL_DrawNullModel(), GL_DrawParticles(), GL_EnableOutlines(), GL_Flush2D(), GL_Flush3D(), and R_DrawSkyBox().

◆ GL_BindArrays()

void GL_BindArrays ( void  )

Definition at line 255 of file tess.c.

256 {
257  vec_t *ptr;
258 
259  if (gl_static.world.vertices) {
260  ptr = tess.vertices;
261  } else {
262  ptr = NULL;
263  qglBindBufferARB(GL_ARRAY_BUFFER_ARB, gl_static.world.bufnum);
264  }
265 
266  GL_VertexPointer(3, VERTEX_SIZE, ptr + 0);
267 
268  if (gl_lightmap->integer) {
269  GL_TexCoordPointer(2, VERTEX_SIZE, ptr + 6);
270  } else {
271  GL_TexCoordPointer(2, VERTEX_SIZE, ptr + 4);
272  if (lm.nummaps) {
273  GL_LightCoordPointer(2, VERTEX_SIZE, ptr + 6);
274  }
275  }
276 
277  GL_ColorBytePointer(4, VERTEX_SIZE, (GLubyte *)(ptr + 3));
278 
279  if (!gl_static.world.vertices) {
280  qglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
281  }
282 }

Referenced by GL_DrawAlphaFaces(), GL_DrawBspModel(), and GL_DrawWorld().

◆ GL_BindTexture()

void GL_BindTexture ( GLuint  tmu,
GLuint  texnum 
)

Definition at line 40 of file state.c.

41 {
42 #ifdef _DEBUG
43  if (gl_nobind->integer && !tmu) {
44  texnum = TEXNUM_DEFAULT;
45  }
46 #endif
47 
48  if (gls.texnums[tmu] == texnum) {
49  return;
50  }
51 
52  GL_ActiveTexture(tmu);
53 
54  qglBindTexture(GL_TEXTURE_2D, texnum);
55  gls.texnums[tmu] = texnum;
56 
57  c.texSwitches++;
58 }

Referenced by draw_alias_mesh(), draw_celshading(), draw_shadow(), GL_DrawBeams(), GL_DrawNullModel(), GL_DrawParticles(), GL_EnableOutlines(), GL_Flush2D(), GL_Flush3D(), and R_DrawSkyBox().

◆ GL_Blend()

void GL_Blend ( void  )

Definition at line 79 of file draw.c.

80 {
81  color_t color;
82 
83  color.u8[0] = glr.fd.blend[0] * 255;
84  color.u8[1] = glr.fd.blend[1] * 255;
85  color.u8[2] = glr.fd.blend[2] * 255;
86  color.u8[3] = glr.fd.blend[3] * 255;
87 
88  _GL_StretchPic(glr.fd.x, glr.fd.y, glr.fd.width, glr.fd.height, 0, 0, 1, 1,
89  color.u32, TEXNUM_WHITE, 0);
90 }

Referenced by R_RenderFrame_GL().

◆ GL_ClearSolidFaces()

void GL_ClearSolidFaces ( void  )

Definition at line 427 of file tess.c.

428 {
429  int i;
430 
431  for (i = 0; i < FACE_HASH_SIZE; i++) {
432  faces_next[i] = &faces_head[i];
433  }
434 }

Referenced by GL_DrawWorld().

◆ GL_ClientActiveTexture()

static void GL_ClientActiveTexture ( GLuint  tmu)
inlinestatic

Definition at line 326 of file gl.h.

327 {
328  if (gls.client_tmu != tmu) {
329  qglClientActiveTextureARB(GL_TEXTURE0_ARB + tmu);
330  gls.client_tmu = tmu;
331  }
332 }

Referenced by GL_ArrayBits(), GL_LightCoordPointer(), and GL_TexCoordPointer().

◆ GL_ColorBytePointer()

static void GL_ColorBytePointer ( GLint  size,
GLsizei  stride,
const GLubyte *  pointer 
)
inlinestatic

Definition at line 351 of file gl.h.

352 {
353  qglColorPointer(size, GL_UNSIGNED_BYTE, sizeof(GLfloat) * stride, pointer);
354 }

Referenced by GL_BindArrays(), GL_DrawBeams(), GL_DrawNullModel(), GL_DrawParticles(), and GL_Flush2D().

◆ GL_ColorFloatPointer()

static void GL_ColorFloatPointer ( GLint  size,
GLsizei  stride,
const GLfloat *  pointer 
)
inlinestatic

Definition at line 356 of file gl.h.

357 {
358  qglColorPointer(size, GL_FLOAT, sizeof(GLfloat) * stride, pointer);
359 }

Referenced by draw_alias_mesh().

◆ GL_CullBox()

glCullResult_t GL_CullBox ( vec3_t  bounds[2])

Definition at line 122 of file main.c.

123 {
124  int i, bits;
125  glCullResult_t cull;
126 
127  if (!gl_cull_models->integer) {
128  return CULL_IN;
129  }
130 
131  cull = CULL_IN;
132  for (i = 0; i < 4; i++) {
133  bits = BoxOnPlaneSide(bounds[0], bounds[1], &glr.frustumPlanes[i]);
134  if (bits == BOX_BEHIND) {
135  return CULL_OUT;
136  }
137  if (bits != BOX_INFRONT) {
138  cull = CULL_CLIP;
139  }
140  }
141 
142  return cull;
143 }

Referenced by cull_lerped_model(), cull_static_model(), and GL_DrawBspModel().

◆ GL_CullLocalBox()

glCullResult_t GL_CullLocalBox ( const vec3_t  origin,
vec3_t  bounds[2] 
)

Definition at line 185 of file main.c.

186 {
187  vec3_t points[8];
188  cplane_t *p;
189  int i, j;
190  vec_t dot;
191  qboolean infront;
192  glCullResult_t cull;
193 
194  if (!gl_cull_models->integer) {
195  return CULL_IN;
196  }
197 
198  make_box_points(origin, bounds, points);
199 
200  cull = CULL_IN;
201  for (i = 0, p = glr.frustumPlanes; i < 4; i++, p++) {
202  infront = qfalse;
203  for (j = 0; j < 8; j++) {
204  dot = DotProduct(points[j], p->normal);
205  if (dot >= p->dist) {
206  infront = qtrue;
207  if (cull == CULL_CLIP) {
208  break;
209  }
210  } else {
211  cull = CULL_CLIP;
212  if (infront) {
213  break;
214  }
215  }
216  }
217  if (!infront) {
218  return CULL_OUT;
219  }
220  }
221 
222  return cull;
223 }

Referenced by cull_lerped_model(), cull_static_model(), and GL_DrawBspModel().

◆ GL_CullSphere()

glCullResult_t GL_CullSphere ( const vec3_t  origin,
float  radius 
)

Definition at line 145 of file main.c.

146 {
147  float dist;
148  cplane_t *p;
149  int i;
150  glCullResult_t cull;
151 
152  if (!gl_cull_models->integer) {
153  return CULL_IN;
154  }
155 
156  cull = CULL_IN;
157  for (i = 0, p = glr.frustumPlanes; i < 4; i++, p++) {
158  dist = PlaneDiff(origin, p);
159  if (dist < -radius) {
160  return CULL_OUT;
161  }
162  if (dist <= radius) {
163  cull = CULL_CLIP;
164  }
165  }
166 
167  return cull;
168 }

Referenced by cull_lerped_model(), cull_static_model(), and GL_DrawBspModel().

◆ GL_DisableOutlines()

void GL_DisableOutlines ( void  )

Definition at line 471 of file state.c.

472 {
473  qglDepthRange(0, 1);
474  qglPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
475 }

Referenced by draw_alias_mesh(), GL_DrawParticles(), GL_Flush2D(), and GL_Flush3D().

◆ GL_DrawAliasModel()

void GL_DrawAliasModel ( model_t *  model)

Definition at line 623 of file mesh.c.

624 {
625  entity_t *ent = glr.ent;
626  glCullResult_t cull;
627  int i;
628 
629  newframenum = ent->frame;
630  if (newframenum < 0 || newframenum >= model->numframes) {
631  Com_DPrintf("%s: no such frame %d\n", __func__, newframenum);
632  newframenum = 0;
633  }
634 
635  oldframenum = ent->oldframe;
636  if (oldframenum < 0 || oldframenum >= model->numframes) {
637  Com_DPrintf("%s: no such oldframe %d\n", __func__, oldframenum);
638  oldframenum = 0;
639  }
640 
641  backlerp = ent->backlerp;
642  frontlerp = 1.0f - backlerp;
643 
644  // optimized case
645  if (backlerp == 0)
647 
648  // interpolate origin, if necessarry
649  if (ent->flags & RF_FRAMELERP)
650  LerpVector2(ent->oldorigin, ent->origin,
652  else
653  VectorCopy(ent->origin, origin);
654 
655  // cull the model, setup scale and translate vectors
656  if (newframenum == oldframenum)
657  cull = cull_static_model(model);
658  else
659  cull = cull_lerped_model(model);
660  if (cull == CULL_OUT)
661  return;
662 
663  // setup parameters common for all meshes
664  setup_color();
667  setup_shadow();
668 
669  // select proper tessfunc
670  if (ent->flags & RF_SHELL_MASK) {
671  shellscale = (ent->flags & RF_WEAPONMODEL) ?
672  WEAPONSHELL_SCALE : POWERSUIT_SCALE;
675  } else if (shadelight) {
678  } else {
681  }
682 
683  float scale = 1.f;
684  if (ent->scale > 0.f)
685  scale = ent->scale;
686 
687  GL_RotateForEntity(origin, scale);
688 
689  if ((ent->flags & (RF_WEAPONMODEL | RF_LEFTHAND)) ==
690  (RF_WEAPONMODEL | RF_LEFTHAND)) {
691  qglMatrixMode(GL_PROJECTION);
692  qglScalef(-1, 1, 1);
693  qglMatrixMode(GL_MODELVIEW);
694  qglFrontFace(GL_CCW);
695  }
696 
697  if (ent->flags & RF_DEPTHHACK)
698  qglDepthRange(0, 0.25f);
699 
700  // draw all the meshes
701  for (i = 0; i < model->nummeshes; i++)
702  draw_alias_mesh(&model->meshes[i]);
703 
704  if (ent->flags & RF_DEPTHHACK)
705  qglDepthRange(0, 1);
706 
707  if ((ent->flags & (RF_WEAPONMODEL | RF_LEFTHAND)) ==
708  (RF_WEAPONMODEL | RF_LEFTHAND)) {
709  qglMatrixMode(GL_PROJECTION);
710  qglScalef(-1, 1, 1);
711  qglMatrixMode(GL_MODELVIEW);
712  qglFrontFace(GL_CW);
713  }
714 }

Referenced by GL_DrawEntities().

◆ GL_DrawAlphaFaces()

void GL_DrawAlphaFaces ( void  )

Definition at line 445 of file tess.c.

446 {
447  if (!faces_alpha) {
448  return;
449  }
450 
451  glr.ent = &gl_world;
452 
454 
455  GL_BindArrays();
456 
458 
459  GL_Flush3D();
460 }

Referenced by R_RenderFrame_GL().

◆ GL_DrawBeams()

void GL_DrawBeams ( void  )

Definition at line 164 of file tess.c.

165 {
166  vec3_t d1, d2, d3;
167  vec_t *start, *end;
168  color_t color;
169  vec_t *dst_vert;
170  uint32_t *dst_color;
171  QGL_INDEX_TYPE *dst_indices;
172  vec_t length;
173  int numverts;
174  int numindices;
175  entity_t *ent;
176  int i;
177 
178  if (!glr.num_beams) {
179  return;
180  }
181 
186 
188  GL_TexCoordPointer(2, 5, tess.vertices + 3);
190 
191  numverts = numindices = 0;
192  for (i = 0, ent = glr.fd.entities; i < glr.fd.num_entities; i++, ent++) {
193  if (!(ent->flags & RF_BEAM)) {
194  continue;
195  }
196 
197  start = ent->origin;
198  end = ent->oldorigin;
199  VectorSubtract(end, start, d1);
200  VectorSubtract(glr.fd.vieworg, start, d2);
201  CrossProduct(d1, d2, d3);
202  length = VectorLength(d3);
203  length = ent->frame * 1.2f / length;
204  VectorScale(d3, length, d3);
205 
206  length = VectorLength(d1);
207 
208  if (ent->skinnum == -1) {
209  color.u32 = ent->rgba.u32;
210  } else {
211  color.u32 = d_8to24table[ent->skinnum & 0xff];
212  color.u8[3] = 255 * ent->alpha;
213  }
214 
215  if (numverts + 4 > TESS_MAX_VERTICES ||
216  numindices + 6 > TESS_MAX_INDICES) {
217  qglDrawElements(GL_TRIANGLES, numindices,
219  numverts = numindices = 0;
220  }
221 
222  dst_vert = tess.vertices + numverts * 5;
223  VectorAdd(start, d3, dst_vert);
224  VectorSubtract(start, d3, dst_vert + 5);
225  VectorSubtract(end, d3, dst_vert + 10);
226  VectorAdd(end, d3, dst_vert + 15);
227 
228  dst_vert[3] = 0; dst_vert[4] = 0;
229  dst_vert[8] = 1; dst_vert[9] = 0;
230  dst_vert[13] = 1; dst_vert[14] = length;
231  dst_vert[18] = 0; dst_vert[19] = length;
232 
233  dst_color = (uint32_t *)tess.colors + numverts;
234  dst_color[0] = color.u32;
235  dst_color[1] = color.u32;
236  dst_color[2] = color.u32;
237  dst_color[3] = color.u32;
238 
239  dst_indices = tess.indices + numindices;
240  dst_indices[0] = numverts + 0;
241  dst_indices[1] = numverts + 2;
242  dst_indices[2] = numverts + 3;
243  dst_indices[3] = numverts + 0;
244  dst_indices[4] = numverts + 1;
245  dst_indices[5] = numverts + 2;
246 
247  numverts += 4;
248  numindices += 6;
249  }
250 
251  qglDrawElements(GL_TRIANGLES, numindices,
253 }

Referenced by R_RenderFrame_GL().

◆ GL_DrawBspModel()

void GL_DrawBspModel ( mmodel_t *  model)

Definition at line 358 of file world.c.

359 {
360  mface_t *face, *last;
361  vec3_t bounds[2];
362  vec_t dot;
363  vec3_t transformed, temp;
364  entity_t *ent = glr.ent;
365  glCullResult_t cull;
366 
367  if (!model->numfaces)
368  return;
369 
370  if (glr.entrotated) {
371  cull = GL_CullSphere(ent->origin, model->radius);
372  if (cull == CULL_OUT) {
373  c.spheresCulled++;
374  return;
375  }
376  if (cull == CULL_CLIP) {
377  VectorCopy(model->mins, bounds[0]);
378  VectorCopy(model->maxs, bounds[1]);
379  cull = GL_CullLocalBox(ent->origin, bounds);
380  if (cull == CULL_OUT) {
382  return;
383  }
384  }
385  VectorSubtract(glr.fd.vieworg, ent->origin, temp);
386  transformed[0] = DotProduct(temp, glr.entaxis[0]);
387  transformed[1] = DotProduct(temp, glr.entaxis[1]);
388  transformed[2] = DotProduct(temp, glr.entaxis[2]);
389  } else {
390  VectorAdd(model->mins, ent->origin, bounds[0]);
391  VectorAdd(model->maxs, ent->origin, bounds[1]);
392  cull = GL_CullBox(bounds);
393  if (cull == CULL_OUT) {
394  c.boxesCulled++;
395  return;
396  }
397  VectorSubtract(glr.fd.vieworg, ent->origin, transformed);
398  }
399 
400  GL_TransformLights(model);
401 
402  GL_RotateForEntity(ent->origin, 1.f);
403 
404  GL_BindArrays();
405 
406  // draw visible faces
407  last = model->firstface + model->numfaces;
408  for (face = model->firstface; face < last; face++) {
409  dot = PlaneDiffFast(transformed, face->plane);
410  if (BSP_CullFace(face, dot)) {
411  c.facesCulled++;
412  continue;
413  }
414 
415  // sky faces don't have their polygon built
416  if (face->drawflags & SURF_SKY) {
417  continue;
418  }
419 
420  // alpha faces on transformed inline models are drawn with world GL
421  // matrix. this bug is intentional: some maps exploit this to hide
422  // surfaces that would otherwise be visible.
423  if (face->drawflags & SURF_TRANS_MASK) {
424  if (model->drawframe != glr.drawframe)
425  GL_AddAlphaFace(face);
426  continue;
427  }
428 
429  if (gl_dynamic->integer) {
430  GL_PushLights(face);
431  }
432 
433  GL_DrawFace(face);
434  }
435 
436  GL_Flush3D();
437 
438  // protect against infinite loop if the same inline model
439  // with alpha faces is referenced by multiple entities
440  model->drawframe = glr.drawframe;
441 }

Referenced by GL_DrawEntities().

◆ GL_DrawFace()

void GL_DrawFace ( mface_t *  surf)

Definition at line 367 of file tess.c.

368 {
369  int numtris = surf->numsurfedges - 2;
370  int numindices = numtris * 3;
371  GLuint texnum[2];
372  QGL_INDEX_TYPE *dst_indices;
373  int i, j;
374 
375  if (q_unlikely(gl_lightmap->integer)) {
376  texnum[0] = surf->texnum[1];
377  if (!texnum[0])
378  texnum[0] = GL_TextureAnimation(surf->texinfo);
379  texnum[1] = 0;
380  } else {
381  texnum[0] = GL_TextureAnimation(surf->texinfo);
382  texnum[1] = surf->texnum[1];
383  }
384 
385  if (tess.texnum[0] != texnum[0] ||
386  tess.texnum[1] != texnum[1] ||
387  tess.flags != surf->statebits ||
388  tess.numindices + numindices > TESS_MAX_INDICES) {
389  GL_Flush3D();
390  }
391 
392  tess.texnum[0] = texnum[0];
393  tess.texnum[1] = texnum[1];
394  tess.flags = surf->statebits;
395 
396  if (q_unlikely(gl_static.world.vertices)) {
397  j = GL_CopyVerts(surf);
398  } else {
399  j = surf->firstvert;
400  }
401 
402  dst_indices = tess.indices + tess.numindices;
403  for (i = 0; i < numtris; i++) {
404  dst_indices[0] = j;
405  dst_indices[1] = j + (i + 1);
406  dst_indices[2] = j + (i + 2);
407  dst_indices += 3;
408  }
409  tess.numindices += numindices;
410 
411  c.trisDrawn += numtris;
412  c.facesTris += numtris;
413  c.facesDrawn++;
414 }

Referenced by GL_DrawBspModel(), GL_DrawChain(), and GL_DrawNode().

◆ GL_DrawParticles()

void GL_DrawParticles ( void  )

Definition at line 79 of file tess.c.

80 {
81  particle_t *p;
82  int total, count;
83  vec3_t transformed;
84  vec_t scale, dist;
85  color_t color;
86  int numverts;
87  vec_t *dst_vert;
88  uint32_t *dst_color;
89  int blend;
90 
91  if (!glr.fd.num_particles)
92  return;
93 
94  if (gl_partstyle->integer)
95  blend = GLS_BLEND_ADD;
96  else
97  blend = GLS_BLEND_BLEND;
98 
100 
102  GL_TexCoordPointer(2, 5, tess.vertices + 3);
104 
105  p = glr.fd.particles;
106  total = glr.fd.num_particles;
107  do {
111 
112  count = total;
113  if (count > TESS_MAX_VERTICES / 3)
114  count = TESS_MAX_VERTICES / 3;
115 
116  total -= count;
117 
118  numverts = 0;
119  do {
120  VectorSubtract(p->origin, glr.fd.vieworg, transformed);
121  dist = DotProduct(transformed, glr.viewaxis[0]);
122 
123  scale = gl_partscale->value;
124  if (dist > 20)
125  scale += dist * 0.01f;
126 
127  if (p->color == -1) {
128  color.u32 = p->rgba.u32;
129  } else {
130  color.u32 = d_8to24table[p->color & 0xff];
131  color.u8[3] = 255 * p->alpha;
132  }
133 
134  dst_vert = tess.vertices + numverts * 5;
135  VectorMA(p->origin, scale * PARTICLE_SCALE, glr.viewaxis[1], dst_vert);
136  VectorMA(dst_vert, -scale * PARTICLE_SCALE, glr.viewaxis[2], dst_vert);
137  VectorMA(dst_vert, scale, glr.viewaxis[2], dst_vert + 5);
138  VectorMA(dst_vert, -scale, glr.viewaxis[1], dst_vert + 10);
139 
140  dst_vert[ 3] = 0; dst_vert[ 4] = 0;
141  dst_vert[ 8] = 0; dst_vert[ 9] = PARTICLE_SIZE;
142  dst_vert[13] = PARTICLE_SIZE; dst_vert[14] = 0;
143 
144  dst_color = (uint32_t *)tess.colors + numverts;
145  dst_color[0] = color.u32;
146  dst_color[1] = color.u32;
147  dst_color[2] = color.u32;
148 
149  p++;
150  numverts += 3;
151  } while (--count);
152 
153  qglDrawArrays(GL_TRIANGLES, 0, numverts);
154 
155  if (gl_showtris->integer) {
157  qglDrawArrays(GL_TRIANGLES, 0, numverts);
159  }
160  } while (total);
161 }

Referenced by R_RenderFrame_GL().

◆ GL_DrawSolidFaces()

void GL_DrawSolidFaces ( void  )

Definition at line 436 of file tess.c.

437 {
438  int i;
439 
440  for (i = 0; i < FACE_HASH_SIZE; i++) {
442  }
443 }

Referenced by GL_DrawWorld().

◆ GL_DrawWorld()

void GL_DrawWorld ( void  )

Definition at line 552 of file world.c.

553 {
554  // auto cycle the world frame for texture animation
555  gl_world.frame = (int)(glr.fd.time * 2);
556 
557  glr.ent = &gl_world;
558 
559  GL_MarkLeaves();
560 
561  GL_MarkLights();
562 
563  R_ClearSkyBox();
564 
566 
567  GL_BindArrays();
568 
570 
573 
575 
576  GL_Flush3D();
577 
578  R_DrawSkyBox();
579 }

Referenced by R_RenderFrame_GL().

◆ GL_EnableOutlines()

void GL_EnableOutlines ( void  )

Definition at line 460 of file state.c.

461 {
465  qglColor4f(1, 1, 1, 1);
466 
467  qglPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
468  qglDepthRange(0, 0);
469 }

Referenced by draw_alias_mesh(), GL_DrawParticles(), GL_Flush2D(), and GL_Flush3D().

◆ GL_Flush2D()

void GL_Flush2D ( void  )

Definition at line 31 of file tess.c.

32 {
33  glStateBits_t bits;
34 
35  if (!tess.numverts) {
36  return;
37  }
38 
40  if (tess.flags & 2) {
41  bits |= GLS_BLEND_BLEND;
42  } else if (tess.flags & 1) {
43  bits |= GLS_ALPHATEST_ENABLE;
44  }
45 
46  Scrap_Upload();
47 
48  GL_BindTexture(0, tess.texnum[0]);
49  GL_StateBits(bits);
51 
53  GL_TexCoordPointer(2, 4, tess.vertices + 2);
55 
57 
59 
60  if (gl_showtris->integer > 1) {
64  }
65 
67 
68  c.batchesDrawn2D++;
69 
70  tess.numindices = 0;
71  tess.numverts = 0;
72  tess.texnum[0] = 0;
73  tess.flags = 0;
74 }

Referenced by _GL_StretchPic(), R_EndFrame_GL(), R_RenderFrame_GL(), R_SetClipRect_GL(), and R_SetScale_GL().

◆ GL_Flush3D()

void GL_Flush3D ( void  )

Definition at line 284 of file tess.c.

285 {
286  glStateBits_t state = tess.flags;
287  glArrayBits_t array = GLA_VERTEX | GLA_TC;
288 
289  if (!tess.numindices) {
290  return;
291  }
292 
293  if (q_likely(tess.texnum[1])) {
294  state |= GLS_LIGHTMAP_ENABLE;
295  array |= GLA_LMTC;
296  }
297 
298  if (!(state & GLS_TEXTURE_REPLACE)) {
299  array |= GLA_COLOR;
300  }
301 
302  GL_StateBits(state);
303  GL_ArrayBits(array);
304 
305  GL_BindTexture(0, tess.texnum[0]);
306  if (q_likely(tess.texnum[1])) {
307  GL_BindTexture(1, tess.texnum[1]);
308  }
309 
310  if (gl_static.world.vertices) {
312  }
313 
315 
316  if (gl_showtris->integer) {
320  }
321 
322  if (gl_static.world.vertices) {
323  GL_UnlockArrays();
324  }
325 
326  c.batchesDrawn++;
327 
328  tess.texnum[0] = tess.texnum[1] = 0;
329  tess.numindices = 0;
330  tess.numverts = 0;
331  tess.flags = 0;
332 }

Referenced by GL_CopyVerts(), GL_DrawAlphaFaces(), GL_DrawBspModel(), GL_DrawFace(), and GL_DrawWorld().

◆ GL_ForceTexture()

void GL_ForceTexture ( GLuint  tmu,
GLuint  texnum 
)

◆ GL_FreeWorld()

void GL_FreeWorld ( void  )

Definition at line 859 of file surf.c.

860 {
861  if (!gl_static.world.cache) {
862  return;
863  }
864 
866 
867  if (gl_static.world.vertices) {
869  } else if (qglDeleteBuffersARB) {
871  }
872 
873  memset(&gl_static.world, 0, sizeof(gl_static.world));
874 }

Referenced by GL_LoadWorld(), and R_Shutdown_GL().

◆ GL_InitImages()

void GL_InitImages ( void  )

Definition at line 855 of file images.c.

856 {
857  gl_bilerp_chars = Cvar_Get("gl_bilerp_chars", "0", 0);
859  gl_bilerp_pics = Cvar_Get("gl_bilerp_pics", "1", 0);
861  gl_texturemode = Cvar_Get("gl_texturemode",
862  "GL_LINEAR_MIPMAP_LINEAR", CVAR_ARCHIVE);
864  gl_texturemode->generator = gl_texturemode_g;
865  gl_texturebits = Cvar_Get("gl_texturebits", "0", CVAR_FILES);
866  gl_texture_non_power_of_two = Cvar_Get("gl_texture_non_power_of_two", "1", 0);
867  gl_anisotropy = Cvar_Get("gl_anisotropy", "8", 0);
869  gl_noscrap = Cvar_Get("gl_noscrap", "0", CVAR_FILES);
870  gl_round_down = Cvar_Get("gl_round_down", "0", CVAR_FILES);
871  gl_picmip = Cvar_Get("gl_picmip", "0", CVAR_FILES);
872  gl_downsample_skins = Cvar_Get("gl_downsample_skins", "1", CVAR_FILES);
873  gl_gamma_scale_pics = Cvar_Get("gl_gamma_scale_pics", "0", CVAR_FILES);
874  gl_upscale_pcx = Cvar_Get("gl_upscale_pcx", "0", CVAR_FILES);
875  gl_saturation = Cvar_Get("gl_saturation", "1", CVAR_FILES);
876  gl_intensity = Cvar_Get("intensity", "2", CVAR_FILES);
877  gl_invert = Cvar_Get("gl_invert", "0", CVAR_FILES);
878  gl_gamma = Cvar_Get("vid_gamma", "0.8", CVAR_ARCHIVE);
879 
880  if (r_config.flags & QVF_GAMMARAMP) {
881  gl_gamma->changed = gl_gamma_changed;
882  gl_gamma->flags &= ~CVAR_FILES;
883  } else {
884  gl_gamma->flags |= CVAR_FILES;
885  }
886 
887  if (AT_LEAST_OPENGL(3, 0)) {
888  gl_texture_non_power_of_two->flags |= CVAR_FILES;
889  } else {
890  gl_texture_non_power_of_two->flags &= ~CVAR_FILES;
891  }
892 
893  IMG_Init();
894 
895  IMG_GetPalette();
896 
897  if (gl_upscale_pcx->integer) {
898  HQ2x_Init();
899  }
900 
902 
903  if (r_config.flags & QVF_GAMMARAMP) {
905  } else {
907  }
908 
909  // FIXME: the name 'saturation' is misleading in this context
911 
917 
920 
921  Scrap_Init();
922 
927 
928  GL_ShowErrors(__func__);
929 }

Referenced by GL_PostInit().

◆ GL_InitPrograms()

void GL_InitPrograms ( void  )

Definition at line 477 of file state.c.

478 {
479 #ifdef GL_ARB_fragment_program
480  GLuint prog = 0;
481 
483  if (gl_fragment_program->integer) {
484  Com_Printf("...enabling GL_ARB_fragment_program\n");
487  } else {
488  Com_Printf("...ignoring GL_ARB_fragment_program\n");
489  }
490  } else if (gl_fragment_program->integer) {
491  Com_Printf("GL_ARB_fragment_program not found\n");
492  Cvar_Set("gl_fragment_program", "0");
493  }
494 
497  return;
498  }
499 
500  QGL_ClearErrors();
501 
502  qglGenProgramsARB(1, &prog);
503  qglBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, prog);
504  qglProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
505  sizeof(gl_prog_warp) - 1, gl_prog_warp);
506 
507  if (GL_ShowErrors("Failed to initialize fragment program")) {
508  qglBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0);
509  qglDeleteProgramsARB(1, &prog);
510  return;
511  }
512 
513  qglBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0);
514  gl_static.prognum_warp = prog;
515 #endif
516 }

Referenced by R_EndFrame_GL(), and R_Init_GL().

◆ GL_LightCoordPointer()

static void GL_LightCoordPointer ( GLint  size,
GLsizei  stride,
const GLfloat *  pointer 
)
inlinestatic

Definition at line 345 of file gl.h.

346 {
348  qglTexCoordPointer(size, GL_FLOAT, sizeof(GLfloat) * stride, pointer);
349 }

Referenced by GL_BindArrays().

◆ GL_LightPoint()

void GL_LightPoint ( vec3_t  origin,
vec3_t  color 
)

Definition at line 233 of file world.c.

234 {
235  if (gl_fullbright->integer) {
236  VectorSet(color, 1, 1, 1);
237  return;
238  }
239 
240  // get lighting from world
241  if (!_GL_LightPoint(origin, color)) {
242  VectorSet(color, 1, 1, 1);
243  }
244 
245  // add dynamic lights
247 
248  if (gl_doublelight_entities->integer) {
249  // apply modulate twice to mimic original ref_gl behavior
250  VectorScale(color, gl_static.entity_modulate, color);
251  }
252 }

Referenced by R_LightPoint_GL(), and setup_color().

◆ GL_LoadMatrix()

void GL_LoadMatrix ( const GLfloat *  matrix)
inlinestatic

Definition at line 375 of file gl.h.

376 {
377  if (gls.currentmatrix != matrix) {
378  qglLoadMatrixf(matrix);
379  gls.currentmatrix = matrix;
380  }
381 }

Referenced by draw_alias_mesh(), draw_shadow(), GL_DrawAlphaFaces(), GL_DrawBeams(), GL_DrawNullModel(), GL_DrawParticles(), and GL_DrawWorld().

◆ GL_LoadWorld()

void GL_LoadWorld ( const char *  name)

Definition at line 876 of file surf.c.

877 {
878  char buffer[MAX_QPATH];
879  size_t size;
880  bsp_t *bsp;
881  mtexinfo_t *info;
882  mface_t *surf;
883  qerror_t ret;
884  imageflags_t flags;
885  int i;
886 
887  ret = BSP_Load(name, &bsp);
888  if (!bsp) {
889  Com_Error(ERR_DROP, "%s: couldn't load %s: %s",
890  __func__, name, Q_ErrorString(ret));
891  }
892 
893  // check if the required world model was already loaded
894  if (gl_static.world.cache == bsp) {
895  for (i = 0; i < bsp->numtexinfo; i++) {
896  bsp->texinfo[i].image->registration_sequence = registration_sequence;
897  }
898  for (i = 0; i < bsp->numnodes; i++) {
899  bsp->nodes[i].visframe = 0;
900  }
901  for (i = 0; i < bsp->numleafs; i++) {
902  bsp->leafs[i].visframe = 0;
903  }
904  Com_DPrintf("%s: reused old world model\n", __func__);
905  bsp->refcount--;
906  return;
907  }
908 
909  // free previous model, if any
910  GL_FreeWorld();
911 
912  gl_static.world.cache = bsp;
913 
914  // calculate world size for far clip plane and sky box
915  set_world_size();
916 
917  // register all texinfo
918  for (i = 0, info = bsp->texinfo; i < bsp->numtexinfo; i++, info++) {
919  if (info->c.flags & SURF_WARP)
920  flags = IF_TURBULENT;
921  else
922  flags = IF_NONE;
923 
924  Q_concat(buffer, sizeof(buffer), "textures/", info->name, ".wal", NULL);
925  FS_NormalizePath(buffer, buffer);
926  info->image = IMG_Find(buffer, IT_WALL, flags);
927  }
928 
929  // calculate vertex buffer size in bytes
930  size = 0;
931  for (i = 0, surf = bsp->faces; i < bsp->numfaces; i++, surf++) {
932  // hack surface flags into drawflags for faster access
933  surf->drawflags |= surf->texinfo->c.flags & ~DSURF_PLANEBACK;
934 
935  // don't count sky surfaces
936  if (surf->drawflags & SURF_SKY)
937  continue;
938 
939  size += surf->numsurfedges * VERTEX_SIZE * sizeof(vec_t);
940  }
941 
942  // try VBO first, then allocate on hunk
943  if (create_surface_vbo(size)) {
944  Com_DPrintf("%s: %"PRIz" bytes of vertex data as VBO\n", __func__, size);
945  } else {
946  Hunk_Begin(&gl_static.world.hunk, size);
949 
950  Com_DPrintf("%s: %"PRIz" bytes of vertex data on hunk\n", __func__, size);
951  }
952 
953  // begin building lightmaps
955 
956  // post process all surfaces
958 
959  // end building lightmaps
960  LM_EndBuilding();
961 
962  GL_ShowErrors(__func__);
963 }

Referenced by R_BeginRegistration_GL().

◆ GL_LockArrays()

static void GL_LockArrays ( GLsizei  count)
inlinestatic

Definition at line 361 of file gl.h.

362 {
363  if (qglLockArraysEXT) {
364  qglLockArraysEXT(0, count);
365  }
366 }

Referenced by draw_alias_mesh(), GL_Flush2D(), and GL_Flush3D().

◆ GL_MultMatrix()

void GL_MultMatrix ( GLfloat *  out,
const GLfloat *  a,
const GLfloat *  b 
)

Definition at line 290 of file main.c.

291 {
292  int i, j;
293 
294  for (i = 0; i < 4; i++) {
295  for (j = 0; j < 4; j++) {
296  p[i * 4 + j] =
297  a[0 * 4 + j] * b[i * 4 + 0] +
298  a[1 * 4 + j] * b[i * 4 + 1] +
299  a[2 * 4 + j] * b[i * 4 + 2] +
300  a[3 * 4 + j] * b[i * 4 + 3];
301  }
302  }
303 }

Referenced by GL_RotateForEntity(), and setup_shadow().

◆ GL_Ortho()

void GL_Ortho ( GLfloat  xmin,
GLfloat  xmax,
GLfloat  ymin,
GLfloat  ymax,
GLfloat  znear,
GLfloat  zfar 
)

Definition at line 230 of file state.c.

231 {
232  GLfloat width, height, depth;
233  GLfloat matrix[16];
234 
235  width = xmax - xmin;
236  height = ymax - ymin;
237  depth = zfar - znear;
238 
239  matrix[0] = 2 / width;
240  matrix[4] = 0;
241  matrix[8] = 0;
242  matrix[12] = -(xmax + xmin) / width;
243 
244  matrix[1] = 0;
245  matrix[5] = 2 / height;
246  matrix[9] = 0;
247  matrix[13] = -(ymax + ymin) / height;
248 
249  matrix[2] = 0;
250  matrix[6] = 0;
251  matrix[10] = -2 / depth;
252  matrix[14] = -(zfar + znear) / depth;
253 
254  matrix[3] = 0;
255  matrix[7] = 0;
256  matrix[11] = 0;
257  matrix[15] = 1;
258 
259  qglMatrixMode(GL_PROJECTION);
260  qglLoadMatrixf(matrix);
261 }

Referenced by GL_Setup2D(), and R_SetScale_GL().

◆ GL_PushLights()

void GL_PushLights ( mface_t *  surf)

Definition at line 271 of file surf.c.

272 {
273  lightstyle_t *style;
274  int i;
275 
276  if (!surf->lightmap) {
277  return;
278  }
279  if (surf->drawflags & SURF_NOLM_MASK) {
280  return;
281  }
282  if (!surf->texnum[1]) {
283  return;
284  }
285 
286 #if USE_DLIGHTS
287  // dynamic this frame or dynamic previously
288  if (surf->dlightframe) {
290  return;
291  }
292 #endif
293 
294  // check for light style updates
295  for (i = 0; i < surf->numstyles; i++) {
296  style = LIGHT_STYLE(surf, i);
297  if (style->white != surf->stylecache[i]) {
299  return;
300  }
301  }
302 }

Referenced by GL_DrawBspModel(), and GL_DrawNode().

◆ GL_RebuildLighting()

void GL_RebuildLighting ( void  )

Definition at line 836 of file surf.c.

837 {
838  if (!gl_static.world.cache)
839  return;
840 
841  // if doing vertex lighting, rebuild all surfaces
842  if (gl_fullbright->integer || gl_vertexlight->integer) {
844  return;
845  }
846 
847  // if did vertex lighting previously, rebuild all surfaces and lightmaps
848  if (gl_fullbright->modified || gl_vertexlight->modified) {
851  LM_EndBuilding();
852  return;
853  }
854 
855  // rebuild all lightmaps
857 }

Referenced by R_RenderFrame_GL().

◆ GL_RotateForEntity()

void GL_RotateForEntity ( vec3_t  origin,
float  scale 
)

Definition at line 305 of file main.c.

306 {
307  GLfloat matrix[16];
308 
309  matrix[0] = glr.entaxis[0][0] * scale;
310  matrix[4] = glr.entaxis[1][0] * scale;
311  matrix[8] = glr.entaxis[2][0] * scale;
312  matrix[12] = origin[0];
313 
314  matrix[1] = glr.entaxis[0][1] * scale;
315  matrix[5] = glr.entaxis[1][1] * scale;
316  matrix[9] = glr.entaxis[2][1] * scale;
317  matrix[13] = origin[1];
318 
319  matrix[2] = glr.entaxis[0][2] * scale;
320  matrix[6] = glr.entaxis[1][2] * scale;
321  matrix[10] = glr.entaxis[2][2] * scale;
322  matrix[14] = origin[2];
323 
324  matrix[3] = 0;
325  matrix[7] = 0;
326  matrix[11] = 0;
327  matrix[15] = 1;
328 
331 
332  // forced matrix upload
334 }

Referenced by GL_DrawAliasModel(), and GL_DrawBspModel().

◆ GL_SampleLightPoint()

void GL_SampleLightPoint ( vec3_t  color)

Definition at line 21 of file world.c.

22 {
23  mface_t *surf;
24  int s, t, i;
25  byte *lightmap;
26  byte *b1, *b2, *b3, *b4;
27  int fracu, fracv;
28  int w1, w2, w3, w4;
29  byte temp[3];
30  int smax, tmax, size;
31  lightstyle_t *style;
32 
33  fracu = glr.lightpoint.s & 15;
34  fracv = glr.lightpoint.t & 15;
35 
36  // compute weights of lightmap blocks
37  w1 = (16 - fracu) * (16 - fracv);
38  w2 = fracu * (16 - fracv);
39  w3 = fracu * fracv;
40  w4 = (16 - fracu) * fracv;
41 
42  s = glr.lightpoint.s >> 4;
43  t = glr.lightpoint.t >> 4;
44 
45  surf = glr.lightpoint.surf;
46 
47  smax = S_MAX(surf);
48  tmax = T_MAX(surf);
49  size = smax * tmax * 3;
50 
51  VectorClear(color);
52 
53  // add all the lightmaps with bilinear filtering
54  lightmap = surf->lightmap;
55  for (i = 0; i < surf->numstyles; i++) {
56  b1 = &lightmap[3 * ((t + 0) * smax + (s + 0))];
57  b2 = &lightmap[3 * ((t + 0) * smax + (s + 1))];
58  b3 = &lightmap[3 * ((t + 1) * smax + (s + 1))];
59  b4 = &lightmap[3 * ((t + 1) * smax + (s + 0))];
60 
61  temp[0] = (w1 * b1[0] + w2 * b2[0] + w3 * b3[0] + w4 * b4[0]) >> 8;
62  temp[1] = (w1 * b1[1] + w2 * b2[1] + w3 * b3[1] + w4 * b4[1]) >> 8;
63  temp[2] = (w1 * b1[2] + w2 * b2[2] + w3 * b3[2] + w4 * b4[2]) >> 8;
64 
65  style = LIGHT_STYLE(surf, i);
66 
67  color[0] += temp[0] * style->rgb[0];
68  color[1] += temp[1] * style->rgb[1];
69  color[2] += temp[2] * style->rgb[2];
70 
71  lightmap += size;
72  }
73 }

Referenced by _GL_LightPoint(), and sample_surface_verts().

◆ GL_SetDefaultState()

void GL_SetDefaultState ( void  )

Definition at line 377 of file state.c.

378 {
379  qglClearColor(0, 0, 0, 1);
380  qglClearDepth(1);
381  qglClearStencil(0);
382 
383  qglEnable(GL_DEPTH_TEST);
384  qglDepthFunc(GL_LEQUAL);
385  qglDepthRange(0, 1);
386  qglDepthMask(GL_TRUE);
387  qglDisable(GL_BLEND);
388  qglDisable(GL_ALPHA_TEST);
389  qglAlphaFunc(GL_GREATER, 0.666f);
390  qglPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
391  qglFrontFace(GL_CW);
392  qglCullFace(GL_BACK);
393  qglEnable(GL_CULL_FACE);
394  qglShadeModel(GL_FLAT);
395 
397  qglActiveTextureARB(GL_TEXTURE1_ARB);
398  qglBindTexture(GL_TEXTURE_2D, 0);
399  qglDisable(GL_TEXTURE_2D);
400  qglClientActiveTextureARB(GL_TEXTURE1_ARB);
401  qglDisableClientState(GL_TEXTURE_COORD_ARRAY);
402 
403  qglActiveTextureARB(GL_TEXTURE0_ARB);
404  qglBindTexture(GL_TEXTURE_2D, 0);
405  qglEnable(GL_TEXTURE_2D);
406  qglClientActiveTextureARB(GL_TEXTURE0_ARB);
407  qglDisableClientState(GL_TEXTURE_COORD_ARRAY);
408  } else {
409  qglBindTexture(GL_TEXTURE_2D, 0);
410  qglEnable(GL_TEXTURE_2D);
411  qglDisableClientState(GL_TEXTURE_COORD_ARRAY);
412  }
413 
414  qglMatrixMode(GL_TEXTURE);
415  qglLoadIdentity();
416  qglMatrixMode(GL_MODELVIEW);
417 
418  qglDisableClientState(GL_VERTEX_ARRAY);
419  qglDisableClientState(GL_COLOR_ARRAY);
420 
421  qglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | gl_static.stencil_buffer_bit);
422 
423  memset(&gls, 0, sizeof(gls));
424 }

Referenced by GL_PostInit().

◆ GL_Setup2D()

void GL_Setup2D ( void  )

Definition at line 263 of file state.c.

264 {
265  qglViewport(0, 0, r_config.width, r_config.height);
266 
267  GL_Ortho(0, r_config.width, r_config.height, 0, -1, 1);
268  draw.scale = 1;
269 
270  draw.colors[0].u32 = U32_WHITE;
271  draw.colors[1].u32 = U32_WHITE;
272 
273  if (draw.scissor) {
274  qglDisable(GL_SCISSOR_TEST);
275  draw.scissor = qfalse;
276  }
277 
278  qglMatrixMode(GL_MODELVIEW);
279  qglLoadIdentity();
280 }

Referenced by R_BeginFrame_GL(), and R_RenderFrame_GL().

◆ GL_Setup3D()

void GL_Setup3D ( void  )

Definition at line 362 of file state.c.

363 {
364  qglViewport(glr.fd.x, r_config.height - (glr.fd.y + glr.fd.height),
365  glr.fd.width, glr.fd.height);
366 
367  GL_Frustum();
368 
370 
371  // enable depth writes before clearing
373 
374  qglClear(GL_DEPTH_BUFFER_BIT | gl_static.stencil_buffer_bit);
375 }

Referenced by R_RenderFrame_GL().

◆ GL_ShowErrors()

qboolean GL_ShowErrors ( const char *  func)

Definition at line 539 of file main.c.

540 {
541  GLenum err = qglGetError();
542 
543  if (err == GL_NO_ERROR) {
544  return qfalse;
545  }
546 
547  do {
548  if (gl_showerrors->integer) {
549  Com_EPrintf("%s: %s\n", func, GL_ErrorString(err));
550  }
551  } while ((err = qglGetError()) != GL_NO_ERROR);
552 
553  return qtrue;
554 }

Referenced by create_surface_vbo(), GL_InitImages(), GL_InitPrograms(), GL_LoadWorld(), GL_SetupConfig(), R_BeginFrame_GL(), R_EndFrame_GL(), and R_RenderFrame_GL().

◆ GL_ShutdownImages()

void GL_ShutdownImages ( void  )

Definition at line 940 of file images.c.

941 {
942  gl_bilerp_chars->changed = NULL;
943  gl_bilerp_pics->changed = NULL;
944  gl_texturemode->changed = NULL;
945  gl_texturemode->generator = NULL;
946  gl_anisotropy->changed = NULL;
947  gl_gamma->changed = NULL;
948 
949  // delete auto textures
952 
953 #ifdef _DEBUG
954  r_charset = NULL;
955 #endif
956 
957  IMG_FreeAll();
958  IMG_Shutdown();
959 
960  Scrap_Shutdown();
961 }

Referenced by R_Shutdown_GL().

◆ GL_ShutdownPrograms()

void GL_ShutdownPrograms ( void  )

Definition at line 518 of file state.c.

519 {
520 #ifdef GL_ARB_fragment_program
521  if (!qglDeleteProgramsARB) {
522  return;
523  }
524 
525  if (gl_static.prognum_warp) {
528  }
529 
532 #endif
533 }

Referenced by R_EndFrame_GL(), and R_Shutdown_GL().

◆ GL_StateBits()

void GL_StateBits ( glStateBits_t  bits)

Definition at line 60 of file state.c.

61 {
63 
64  if (!diff) {
65  return;
66  }
67 
68  if (diff & GLS_BLEND_MASK) {
69  if (bits & GLS_BLEND_MASK) {
70  qglEnable(GL_BLEND);
71  if (bits & GLS_BLEND_BLEND) {
72  qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
73  } else if (bits & GLS_BLEND_ADD) {
74  qglBlendFunc(GL_SRC_ALPHA, GL_ONE);
75  } else if (bits & GLS_BLEND_MODULATE) {
76  qglBlendFunc(GL_DST_COLOR, GL_ONE);
77  }
78  } else {
79  qglDisable(GL_BLEND);
80  }
81  }
82 
83  if (diff & GLS_DEPTHMASK_FALSE) {
84  if (bits & GLS_DEPTHMASK_FALSE) {
85  qglDepthMask(GL_FALSE);
86  } else {
87  qglDepthMask(GL_TRUE);
88  }
89  }
90 
92  if (bits & GLS_DEPTHTEST_DISABLE) {
93  qglDisable(GL_DEPTH_TEST);
94  } else {
95  qglEnable(GL_DEPTH_TEST);
96  }
97  }
98 
99  if (diff & GLS_ALPHATEST_ENABLE) {
100  if (bits & GLS_ALPHATEST_ENABLE) {
101  qglEnable(GL_ALPHA_TEST);
102  } else {
103  qglDisable(GL_ALPHA_TEST);
104  }
105  }
106 
107  if (diff & GLS_TEXTURE_REPLACE) {
108  GL_ActiveTexture(0);
109  if (bits & GLS_TEXTURE_REPLACE) {
110  qglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
111  } else {
112  qglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
113  }
114  }
115 
116  if (diff & GLS_FLOW_ENABLE) {
117  GL_ActiveTexture(0);
118  qglMatrixMode(GL_TEXTURE);
119 
120  if (bits & GLS_FLOW_ENABLE) {
121  float scaled, scroll;
122 
123  if (bits & GLS_WARP_ENABLE) {
124  scaled = glr.fd.time * 0.5f;
125  scroll = -scaled;
126  } else {
127  scaled = glr.fd.time / 40;
128  scroll = -64 * (scaled - (int)scaled);
129  }
130 
131  qglTranslatef(scroll, 0, 0);
132  } else {
133  qglLoadIdentity();
134  }
135 
136  qglMatrixMode(GL_MODELVIEW);
137  }
138 
139  if (diff & GLS_LIGHTMAP_ENABLE) {
140  GL_ActiveTexture(1);
141  if (bits & GLS_LIGHTMAP_ENABLE) {
142  qglEnable(GL_TEXTURE_2D);
143  } else {
144  qglDisable(GL_TEXTURE_2D);
145  }
146  }
147 
148 #ifdef GL_ARB_fragment_program
150  if (bits & GLS_WARP_ENABLE) {
151  vec4_t param;
152 
153  qglEnable(GL_FRAGMENT_PROGRAM_ARB);
154  qglBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, gl_static.prognum_warp);
155  param[0] = glr.fd.time;
156  param[1] = glr.fd.time;
157  param[2] = param[3] = 0;
158  qglProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 0, param);
159  } else {
160  qglBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0);
161  qglDisable(GL_FRAGMENT_PROGRAM_ARB);
162  }
163  }
164 #endif
165 
166  if (diff & GLS_CULL_DISABLE) {
167  if (bits & GLS_CULL_DISABLE) {
168  qglDisable(GL_CULL_FACE);
169  } else {
170  qglEnable(GL_CULL_FACE);
171  }
172  }
173 
174  if (diff & GLS_SHADE_SMOOTH) {
175  if (bits & GLS_SHADE_SMOOTH) {
176  qglShadeModel(GL_SMOOTH);
177  } else {
178  qglShadeModel(GL_FLAT);
179  }
180  }
181 
182  gls.state_bits = bits;
183 }

Referenced by draw_alias_mesh(), draw_celshading(), draw_shadow(), GL_DrawBeams(), GL_DrawNullModel(), GL_DrawParticles(), GL_EnableOutlines(), GL_Flush2D(), GL_Flush3D(), GL_Setup3D(), and R_DrawSkyBox().

◆ GL_TexCoordPointer()

static void GL_TexCoordPointer ( GLint  size,
GLsizei  stride,
const GLfloat *  pointer 
)
inlinestatic

Definition at line 339 of file gl.h.

340 {
342  qglTexCoordPointer(size, GL_FLOAT, sizeof(GLfloat) * stride, pointer);
343 }

Referenced by draw_alias_mesh(), GL_BindArrays(), GL_DrawBeams(), GL_DrawParticles(), GL_Flush2D(), and R_DrawSkyBox().

◆ GL_UnlockArrays()

static void GL_UnlockArrays ( void  )
inlinestatic

Definition at line 368 of file gl.h.

369 {
370  if (qglUnlockArraysEXT) {
372  }
373 }

Referenced by draw_alias_mesh(), GL_Flush2D(), and GL_Flush3D().

◆ GL_VertexPointer()

static void GL_VertexPointer ( GLint  size,
GLsizei  stride,
const GLfloat *  pointer 
)
inlinestatic

Definition at line 334 of file gl.h.

335 {
336  qglVertexPointer(size, GL_FLOAT, sizeof(GLfloat) * stride, pointer);
337 }

Referenced by draw_alias_mesh(), GL_BindArrays(), GL_DrawBeams(), GL_DrawNullModel(), GL_DrawParticles(), GL_Flush2D(), and R_DrawSkyBox().

◆ HQ2x_Init()

void HQ2x_Init ( void  )

Definition at line 459 of file hq2x.c.

460 {
461  int n;
462 
463  cvar_t *hqx_y = Cvar_Get("hqx_y", "48", CVAR_FILES);
464  cvar_t *hqx_cb = Cvar_Get("hqx_cb", "7", CVAR_FILES);
465  cvar_t *hqx_cr = Cvar_Get("hqx_cr", "6", CVAR_FILES);
466 
467  maxY = FIX(Cvar_ClampValue(hqx_y, 0, 256));
468  maxCb = FIX(Cvar_ClampValue(hqx_cb, 0, 256));
469  maxCr = FIX(Cvar_ClampValue(hqx_cr, 0, 256));
470 
471  for (n = 0; n < 256; n++) {
472  rotTable[n] = ((n >> 2) & 0x11) | ((n << 2) & 0x88)
473  | ((n & 0x01) << 5) | ((n & 0x08) << 3)
474  | ((n & 0x10) >> 3) | ((n & 0x80) >> 5);
475  }
476 
477  // libjpeg YCbCr coefficients
478  for (n = 0; n < 256; n++) {
479  yccTable[0][n] = FIX(0.29900f) * n;
480  yccTable[1][n] = FIX(0.58700f) * n;
481  yccTable[2][n] = FIX(0.11400f) * n;
482  yccTable[3][n] = -FIX(0.16874f) * n;
483  yccTable[4][n] = -FIX(0.33126f) * n;
484  yccTable[5][n] = FIX(0.50000f) * n;
485  yccTable[6][n] = -FIX(0.41869f) * n;
486  yccTable[7][n] = -FIX(0.08131f) * n;
487  }
488 }

Referenced by GL_InitImages().

◆ HQ2x_Render()

void HQ2x_Render ( uint32_t *  output,
const uint32_t *  input,
int  width,
int  height 
)

Definition at line 357 of file hq2x.c.

358 {
359  int x, y;
360 
361  for (y = 0; y < height; y++) {
362  const uint32_t *in = input + y * width;
363  uint32_t *out0 = output + (y * 2 + 0) * width * 2;
364  uint32_t *out1 = output + (y * 2 + 1) * width * 2;
365 
366  int prevline = (y == 0 ? 0 : width);
367  int nextline = (y == height - 1 ? 0 : width);
368 
369  for (x = 0; x < width; x++) {
370  int prev = (x == 0 ? 0 : 1);
371  int next = (x == width - 1 ? 0 : 1);
372 
373  uint32_t A = *(in - prevline - prev);
374  uint32_t B = *(in - prevline);
375  uint32_t C = *(in - prevline + next);
376  uint32_t D = *(in - prev);
377  uint32_t E = *(in);
378  uint32_t F = *(in + next);
379  uint32_t G = *(in + nextline - prev);
380  uint32_t H = *(in + nextline);
381  uint32_t I = *(in + nextline + next);
382 
383  int pattern;
384  pattern = diff(E, A) << 0;
385  pattern |= diff(E, B) << 1;
386  pattern |= diff(E, C) << 2;
387  pattern |= diff(E, D) << 3;
388  pattern |= diff(E, F) << 4;
389  pattern |= diff(E, G) << 5;
390  pattern |= diff(E, H) << 6;
391  pattern |= diff(E, I) << 7;
392 
393  *(out0 + 0) = hq2x_blend(hqTable[pattern], E, A, B, D, F, H); pattern = rotTable[pattern];
394  *(out0 + 1) = hq2x_blend(hqTable[pattern], E, C, F, B, H, D); pattern = rotTable[pattern];
395  *(out1 + 1) = hq2x_blend(hqTable[pattern], E, I, H, F, D, B); pattern = rotTable[pattern];
396  *(out1 + 0) = hq2x_blend(hqTable[pattern], E, G, D, H, B, F);
397 
398  in++;
399  out0 += 2;
400  out1 += 2;
401  }
402  }
403 }

Referenced by GL_Upscale32().

◆ HQ4x_Render()

void HQ4x_Render ( uint32_t *  output,
const uint32_t *  input,
int  width,
int  height 
)

Definition at line 405 of file hq2x.c.

406 {
407  int x, y;
408 
409  for (y = 0; y < height; y++) {
410  const uint32_t *in = input + y * width;
411  uint32_t *out0 = output + (y * 4 + 0) * width * 4;
412  uint32_t *out1 = output + (y * 4 + 1) * width * 4;
413  uint32_t *out2 = output + (y * 4 + 2) * width * 4;
414  uint32_t *out3 = output + (y * 4 + 3) * width * 4;
415 
416  int prevline = (y == 0 ? 0 : width);
417  int nextline = (y == height - 1 ? 0 : width);
418 
419  for (x = 0; x < width; x++) {
420  int prev = (x == 0 ? 0 : 1);
421  int next = (x == width - 1 ? 0 : 1);
422 
423  uint32_t A = *(in - prevline - prev);
424  uint32_t B = *(in - prevline);
425  uint32_t C = *(in - prevline + next);
426  uint32_t D = *(in - prev);
427  uint32_t E = *(in);
428  uint32_t F = *(in + next);
429  uint32_t G = *(in + nextline - prev);
430  uint32_t H = *(in + nextline);
431  uint32_t I = *(in + nextline + next);
432 
433  int pattern;
434  pattern = diff(E, A) << 0;
435  pattern |= diff(E, B) << 1;
436  pattern |= diff(E, C) << 2;
437  pattern |= diff(E, D) << 3;
438  pattern |= diff(E, F) << 4;
439  pattern |= diff(E, G) << 5;
440  pattern |= diff(E, H) << 6;
441  pattern |= diff(E, I) << 7;
442 
443  hq4x_blend(hqTable[pattern], out0 + 0, out0 + 1, out1 + 0, out1 + 1, E, A, B, D, F, H); pattern = rotTable[pattern];
444  hq4x_blend(hqTable[pattern], out0 + 3, out1 + 3, out0 + 2, out1 + 2, E, C, F, B, H, D); pattern = rotTable[pattern];
445  hq4x_blend(hqTable[pattern], out3 + 3, out3 + 2, out2 + 3, out2 + 2, E, I, H, F, D, B); pattern = rotTable[pattern];
446  hq4x_blend(hqTable[pattern], out3 + 0, out2 + 0, out3 + 1, out2 + 1, E, G, D, H, B, F);
447 
448  in++;
449  out0 += 4;
450  out1 += 4;
451  out2 += 4;
452  out3 += 4;
453  }
454  }
455 }

Referenced by GL_Upscale32().

◆ IMG_Load_GL()

void IMG_Load_GL ( image_t image,
byte *  pic 
)

Definition at line 618 of file images.c.

619 {
620  byte *src, *dst;
621  int i, s, t, maxlevel;
622  int width, height;
623 
624  width = image->upload_width;
625  height = image->upload_height;
626 
627  // load small pics onto the scrap
628  if (image->type == IT_PIC && width < 64 && height < 64 &&
629  gl_noscrap->integer == 0 && Scrap_AllocBlock(width, height, &s, &t)) {
630  src = pic;
631  dst = &scrap_data[(t * SCRAP_BLOCK_WIDTH + s) * 4];
632  for (i = 0; i < height; i++) {
633  memcpy(dst, src, width * 4);
634  src += width * 4;
635  dst += SCRAP_BLOCK_WIDTH * 4;
636  }
637 
638  image->texnum = TEXNUM_SCRAP;
639  image->flags |= IF_SCRAP | IF_TRANSPARENT;
640  image->sl = (s + 0.01f) / (float)SCRAP_BLOCK_WIDTH;
641  image->sh = (s + width - 0.01f) / (float)SCRAP_BLOCK_WIDTH;
642  image->tl = (t + 0.01f) / (float)SCRAP_BLOCK_HEIGHT;
643  image->th = (t + height - 0.01f) / (float)SCRAP_BLOCK_HEIGHT;
644 
645  maxlevel = GL_UpscaleLevel(SCRAP_BLOCK_WIDTH, SCRAP_BLOCK_HEIGHT, IT_PIC, IF_SCRAP);
646  if (maxlevel)
647  image->flags |= IF_UPSCALED;
648 
649  scrap_dirty = qtrue;
650  } else {
651  qglGenTextures(1, &image->texnum);
652  GL_ForceTexture(0, image->texnum);
653 
654  maxlevel = GL_UpscaleLevel(width, height, image->type, image->flags);
655  if (maxlevel) {
656  GL_Upscale32(pic, width, height, maxlevel, image->type, image->flags);
657  image->flags |= IF_UPSCALED;
658  } else {
659  GL_Upload32(pic, width, height, maxlevel, image->type, image->flags);
660  }
661 
662  GL_SetFilterAndRepeat(image->type, image->flags);
663 
664  if (upload_alpha) {
665  image->flags |= IF_TRANSPARENT;
666  }
667  image->upload_width = upload_width << maxlevel; // after power of 2 and scales
668  image->upload_height = upload_height << maxlevel;
669  image->sl = 0;
670  image->sh = 1;
671  image->tl = 0;
672  image->th = 1;
673  }
674 
675  // don't need pics in memory after GL upload
676  Z_Free(pic);
677 }

Referenced by R_RegisterFunctionsGL().

◆ IMG_ReadPixels_GL()

byte* IMG_ReadPixels_GL ( int width,
int height,
int rowbytes 
)

Definition at line 427 of file state.c.

428 {
429  int align = 4;
430  int pitch;
431  byte *pixels;
432 
433  qglGetIntegerv(GL_PACK_ALIGNMENT, &align);
434  pitch = (r_config.width * 3 + align - 1) & ~(align - 1);
435  pixels = FS_AllocTempMem(pitch * r_config.height);
436 
437  qglReadPixels(0, 0, r_config.width, r_config.height,
438  GL_RGB, GL_UNSIGNED_BYTE, pixels);
439 
440  int ideal_pitch = r_config.width * 3;
441  if (pitch > ideal_pitch)
442  {
443  for (int row = 1; row < r_config.height; row++)
444  {
445  byte* src = pixels + row * pitch;
446  byte* dst = pixels + row * ideal_pitch;
447  memcpy(dst, src, ideal_pitch);
448  }
449 
450  pitch = ideal_pitch;
451  }
452 
453  *width = r_config.width;
454  *height = r_config.height;
455  *rowbytes = pitch;
456 
457  return pixels;
458 }

Referenced by R_RegisterFunctionsGL().

◆ IMG_Unload_GL()

void IMG_Unload_GL ( image_t image)

Definition at line 679 of file images.c.

680 {
681  if (image->texnum && !(image->flags & IF_SCRAP)) {
682  if (gls.texnums[0] == image->texnum)
683  gls.texnums[0] = 0;
684  qglDeleteTextures(1, &image->texnum);
685  image->texnum = 0;
686  }
687 }

Referenced by R_RegisterFunctionsGL().

◆ MOD_LoadMD2_GL()

qerror_t MOD_LoadMD2_GL ( model_t *  model,
const void rawdata,
size_t  length 
)

Definition at line 32 of file models.c.

33 {
34  dmd2header_t header;
35  dmd2frame_t *src_frame;
36  dmd2trivertx_t *src_vert;
37  dmd2triangle_t *src_tri;
38  dmd2stvert_t *src_tc;
39  char *src_skin;
40  maliasframe_t *dst_frame;
41  maliasvert_t *dst_vert;
42  maliasmesh_t *dst_mesh;
43  maliastc_t *dst_tc;
44  int i, j, k, val;
45  uint16_t remap[TESS_MAX_INDICES];
46  uint16_t vertIndices[TESS_MAX_INDICES];
47  uint16_t tcIndices[TESS_MAX_INDICES];
48  uint16_t finalIndices[TESS_MAX_INDICES];
49  int numverts, numindices;
50  char skinname[MAX_QPATH];
51  vec_t scale_s, scale_t;
52  vec3_t mins, maxs;
53  qerror_t ret;
54 
55  if (length < sizeof(header)) {
56  return Q_ERR_FILE_TOO_SMALL;
57  }
58 
59  // byte swap the header
60  header = *(dmd2header_t *)rawdata;
61  for (i = 0; i < sizeof(header) / 4; i++) {
62  ((uint32_t *)&header)[i] = LittleLong(((uint32_t *)&header)[i]);
63  }
64 
65  // validate the header
66  ret = MOD_ValidateMD2(&header, length);
67  if (ret) {
68  if (ret == Q_ERR_TOO_FEW) {
69  // empty models draw nothing
70  model->type = MOD_EMPTY;
71  return Q_ERR_SUCCESS;
72  }
73  return ret;
74  }
75 
76  // load all triangle indices
77  numindices = 0;
78  src_tri = (dmd2triangle_t *)((byte *)rawdata + header.ofs_tris);
79  for (i = 0; i < header.num_tris; i++) {
80  for (j = 0; j < 3; j++) {
81  uint16_t idx_xyz = LittleShort(src_tri->index_xyz[j]);
82  uint16_t idx_st = LittleShort(src_tri->index_st[j]);
83 
84  // some broken models have 0xFFFF indices
85  if (idx_xyz >= header.num_xyz || idx_st >= header.num_st) {
86  break;
87  }
88 
89  vertIndices[numindices + j] = idx_xyz;
90  tcIndices[numindices + j] = idx_st;
91  }
92  if (j == 3) {
93  // only count good triangles
94  numindices += 3;
95  }
96  src_tri++;
97  }
98 
99  if (numindices < 3) {
100  return Q_ERR_TOO_FEW;
101  }
102 
103  for (i = 0; i < numindices; i++) {
104  remap[i] = 0xFFFF;
105  }
106 
107  // remap all triangle indices
108  numverts = 0;
109  src_tc = (dmd2stvert_t *)((byte *)rawdata + header.ofs_st);
110  for (i = 0; i < numindices; i++) {
111  if (remap[i] != 0xFFFF) {
112  continue; // already remapped
113  }
114 
115  for (j = i + 1; j < numindices; j++) {
116  if (vertIndices[i] == vertIndices[j] &&
117  (src_tc[tcIndices[i]].s == src_tc[tcIndices[j]].s &&
118  src_tc[tcIndices[i]].t == src_tc[tcIndices[j]].t)) {
119  // duplicate vertex
120  remap[j] = i;
121  finalIndices[j] = numverts;
122  }
123  }
124 
125  // new vertex
126  remap[i] = i;
127  finalIndices[i] = numverts++;
128  }
129 
130  if (numverts > TESS_MAX_VERTICES) {
131  return Q_ERR_TOO_MANY;
132  }
133 
134  Hunk_Begin(&model->hunk, 0x400000);
135  model->type = MOD_ALIAS;
136  model->nummeshes = 1;
137  model->numframes = header.num_frames;
138  model->meshes = MOD_Malloc(sizeof(maliasmesh_t));
139  model->frames = MOD_Malloc(header.num_frames * sizeof(maliasframe_t));
140 
141  dst_mesh = model->meshes;
142  dst_mesh->numtris = numindices / 3;
143  dst_mesh->numindices = numindices;
144  dst_mesh->numverts = numverts;
145  dst_mesh->numskins = header.num_skins;
146  dst_mesh->verts = MOD_Malloc(numverts * header.num_frames * sizeof(maliasvert_t));
147  dst_mesh->tcoords = MOD_Malloc(numverts * sizeof(maliastc_t));
148  dst_mesh->indices = MOD_Malloc(numindices * sizeof(QGL_INDEX_TYPE));
149 
150  if (dst_mesh->numtris != header.num_tris) {
151  Com_DPrintf("%s has %d bad triangles\n", model->name, header.num_tris - dst_mesh->numtris);
152  }
153 
154  // store final triangle indices
155  for (i = 0; i < numindices; i++) {
156  dst_mesh->indices[i] = finalIndices[i];
157  }
158 
159  // load all skins
160  src_skin = (char *)rawdata + header.ofs_skins;
161  for (i = 0; i < header.num_skins; i++) {
162  if (!Q_memccpy(skinname, src_skin, 0, sizeof(skinname))) {
163  ret = Q_ERR_STRING_TRUNCATED;
164  goto fail;
165  }
166  FS_NormalizePath(skinname, skinname);
167  dst_mesh->skins[i] = IMG_Find(skinname, IT_SKIN, IF_NONE);
168  src_skin += MD2_MAX_SKINNAME;
169  }
170 
171  // load all tcoords
172  src_tc = (dmd2stvert_t *)((byte *)rawdata + header.ofs_st);
173  dst_tc = dst_mesh->tcoords;
174  scale_s = 1.0f / header.skinwidth;
175  scale_t = 1.0f / header.skinheight;
176  for (i = 0; i < numindices; i++) {
177  if (remap[i] != i) {
178  continue;
179  }
180  dst_tc[finalIndices[i]].st[0] =
181  (int16_t)LittleShort(src_tc[tcIndices[i]].s) * scale_s;
182  dst_tc[finalIndices[i]].st[1] =
183  (int16_t)LittleShort(src_tc[tcIndices[i]].t) * scale_t;
184  }
185 
186  // load all frames
187  src_frame = (dmd2frame_t *)((byte *)rawdata + header.ofs_frames);
188  dst_frame = model->frames;
189  for (j = 0; j < header.num_frames; j++) {
190  LittleVector(src_frame->scale, dst_frame->scale);
191  LittleVector(src_frame->translate, dst_frame->translate);
192 
193  // load frame vertices
194  ClearBounds(mins, maxs);
195  for (i = 0; i < numindices; i++) {
196  if (remap[i] != i) {
197  continue;
198  }
199  src_vert = &src_frame->verts[vertIndices[i]];
200  dst_vert = &dst_mesh->verts[j * numverts + finalIndices[i]];
201 
202  dst_vert->pos[0] = src_vert->v[0];
203  dst_vert->pos[1] = src_vert->v[1];
204  dst_vert->pos[2] = src_vert->v[2];
205 
206  val = src_vert->lightnormalindex;
207  if (val >= NUMVERTEXNORMALS) {
208  dst_vert->norm[0] = 0;
209  dst_vert->norm[1] = 0;
210  } else {
211  dst_vert->norm[0] = gl_static.latlngtab[val][0];
212  dst_vert->norm[1] = gl_static.latlngtab[val][1];
213  }
214 
215  for (k = 0; k < 3; k++) {
216  val = dst_vert->pos[k];
217  if (val < mins[k])
218  mins[k] = val;
219  if (val > maxs[k])
220  maxs[k] = val;
221  }
222  }
223 
224  VectorVectorScale(mins, dst_frame->scale, mins);
225  VectorVectorScale(maxs, dst_frame->scale, maxs);
226 
227  dst_frame->radius = RadiusFromBounds(mins, maxs);
228 
229  VectorAdd(mins, dst_frame->translate, dst_frame->bounds[0]);
230  VectorAdd(maxs, dst_frame->translate, dst_frame->bounds[1]);
231 
232  src_frame = (dmd2frame_t *)((byte *)src_frame + header.framesize);
233  dst_frame++;
234  }
235 
236  Hunk_End(&model->hunk);
237  return Q_ERR_SUCCESS;
238 
239 fail:
240  Hunk_Free(&model->hunk);
241  return ret;
242 }

Referenced by R_RegisterFunctionsGL().

◆ MOD_LoadMD3_GL()

qerror_t MOD_LoadMD3_GL ( model_t *  model,
const void rawdata,
size_t  length 
)

Referenced by R_RegisterFunctionsGL().

◆ MOD_Reference_GL()

void MOD_Reference_GL ( model_t *  model)

Definition at line 425 of file models.c.

426 {
427  int i, j;
428 
429  // register any images used by the models
430  switch (model->type) {
431  case MOD_ALIAS:
432  for (i = 0; i < model->nummeshes; i++) {
433  maliasmesh_t *mesh = &model->meshes[i];
434  for (j = 0; j < mesh->numskins; j++) {
435  mesh->skins[j]->registration_sequence = registration_sequence;
436  }
437  }
438  break;
439  case MOD_SPRITE:
440  for (i = 0; i < model->numframes; i++) {
441  model->spriteframes[i].image->registration_sequence = registration_sequence;
442  }
443  break;
444  case MOD_EMPTY:
445  break;
446  default:
447  Com_Error(ERR_FATAL, "%s: bad model type", __func__);
448  }
449 
450  model->registration_sequence = registration_sequence;
451 }

Referenced by R_RegisterFunctionsGL().

◆ QGL_ClearErrors()

void QGL_ClearErrors ( void  )

Definition at line 531 of file main.c.

532 {
533  GLenum err;
534 
535  while ((err = qglGetError()) != GL_NO_ERROR)
536  ;
537 }

Referenced by create_surface_vbo(), and GL_InitPrograms().

◆ R_AddSkySurface()

void R_AddSkySurface ( mface_t *  surf)

Definition at line 234 of file sky.c.

235 {
236  int i;
237  vec3_t verts[MAX_CLIP_VERTS];
238  vec3_t temp;
239  msurfedge_t *surfedge;
240  mvertex_t *vert;
241 
242  if (fa->numsurfedges > MAX_CLIP_VERTS) {
243  Com_DPrintf("%s: too many verts\n", __func__);
244  return;
245  }
246 
247  // calculate vertex values for sky box
248  surfedge = fa->firstsurfedge;
249  if (skyrotate) {
250  if (!skyfaces)
252 
253  for (i = 0; i < fa->numsurfedges; i++, surfedge++) {
254  vert = surfedge->edge->v[surfedge->vert];
255  VectorSubtract(vert->point, glr.fd.vieworg, temp);
256  SkyInverseRotate(verts[i], temp);
257  }
258  } else {
259  for (i = 0; i < fa->numsurfedges; i++, surfedge++) {
260  vert = surfedge->edge->v[surfedge->vert];
261  VectorSubtract(vert->point, glr.fd.vieworg, verts[i]);
262  }
263  }
264 
265  ClipSkyPolygon(fa->numsurfedges, verts[0], 0);
266  skyfaces++;
267 }

Referenced by GL_DrawNode().

◆ R_ClampScaleGL()

float R_ClampScaleGL ( cvar_t *  var)

◆ R_ClearColor_GL()

void R_ClearColor_GL ( void  )

Definition at line 92 of file draw.c.

93 {
94  draw.colors[0].u32 = U32_WHITE;
95  draw.colors[1].u32 = U32_WHITE;
96 }

Referenced by R_RegisterFunctionsGL().

◆ R_ClearSkyBox()

void R_ClearSkyBox ( void  )

Definition at line 274 of file sky.c.

275 {
276  int i;
277 
278  for (i = 0; i < 6; i++) {
279  skymins[0][i] = skymins[1][i] = 9999;
280  skymaxs[0][i] = skymaxs[1][i] = -9999;
281  }
282 
283  skyfaces = 0;
284 }

Referenced by GL_DrawWorld().

◆ R_DrawChar_GL()

void R_DrawChar_GL ( int  x,
int  y,
int  flags,
int  c,
qhandle_t  font 
)

Definition at line 242 of file draw.c.

243 {
244  draw_char(x, y, flags, c & 255, IMG_ForHandle(font));
245 }

Referenced by R_RegisterFunctionsGL().

◆ R_DrawFill32_GL()

void R_DrawFill32_GL ( int  x,
int  y,
int  w,
int  h,
uint32_t  color 
)

Definition at line 202 of file draw.c.

203 {
204  if (!w || !h)
205  return;
206  _GL_StretchPic(x, y, w, h, 0, 0, 1, 1, color, TEXNUM_WHITE, 0);
207 }

Referenced by R_RegisterFunctionsGL().

◆ R_DrawFill8_GL()

void R_DrawFill8_GL ( int  x,
int  y,
int  w,
int  h,
int  c 
)

Definition at line 195 of file draw.c.

196 {
197  if (!w || !h)
198  return;
199  _GL_StretchPic(x, y, w, h, 0, 0, 1, 1, d_8to24table[c & 0xff], TEXNUM_WHITE, 0);
200 }

Referenced by R_RegisterFunctionsGL().

◆ R_DrawPic_GL()

void R_DrawPic_GL ( int  x,
int  y,
qhandle_t  pic 
)

Definition at line 179 of file draw.c.

180 {
181  image_t *image = IMG_ForHandle(pic);
182 
183  GL_StretchPic(x, y, image->width, image->height,
184  image->sl, image->tl, image->sh, image->th, draw.colors[0].u32, image);
185 }

Referenced by R_RegisterFunctionsGL().

◆ R_DrawSkyBox()

void R_DrawSkyBox ( void  )

Definition at line 337 of file sky.c.

338 {
339  static const int skytexorder[6] = {0, 2, 1, 3, 4, 5};
340  vec5_t verts[4];
341  int i;
342 
343  // check for no sky at all
344  if (!skyfaces)
345  return; // nothing visible
346 
349  GL_VertexPointer(3, 5, &verts[0][0]);
350  GL_TexCoordPointer(2, 5, &verts[0][3]);
351 
352  for (i = 0; i < 6; i++) {
353  if (!SKY_VISIBLE(i)) {
354  continue;
355  }
356 
357  GL_BindTexture(0, sky_images[skytexorder[i]]);
358 
359  MakeSkyVec(skymaxs[0][i], skymins[1][i], i, verts[0]);
360  MakeSkyVec(skymins[0][i], skymins[1][i], i, verts[1]);
361  MakeSkyVec(skymaxs[0][i], skymaxs[1][i], i, verts[2]);
362  MakeSkyVec(skymins[0][i], skymaxs[1][i], i, verts[3]);
363  qglDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
364  }
365 }

Referenced by GL_DrawWorld().

◆ R_DrawStretchPic_GL()

void R_DrawStretchPic_GL ( int  x,
int  y,
int  w,
int  h,
qhandle_t  pic 
)

Definition at line 171 of file draw.c.

172 {
173  image_t *image = IMG_ForHandle(pic);
174 
175  GL_StretchPic(x, y, w, h, image->sl, image->tl, image->sh, image->th,
176  draw.colors[0].u32, image);
177 }

Referenced by R_RegisterFunctionsGL().

◆ R_DrawString_GL()

int R_DrawString_GL ( int  x,
int  y,
int  flags,
size_t  maxlen,
const char *  s,
qhandle_t  font 
)

Definition at line 247 of file draw.c.

248 {
249  image_t *image = IMG_ForHandle(font);
250 
251  while (maxlen-- && *s) {
252  byte c = *s++;
253  draw_char(x, y, flags, c, image);
254  x += CHAR_WIDTH;
255  }
256 
257  return x;
258 }

Referenced by R_RegisterFunctionsGL().

◆ R_LightPoint_GL()

void R_LightPoint_GL ( vec3_t  origin,
vec3_t  color 
)

Definition at line 254 of file world.c.

255 {
256  int i;
257 
259 
260  for (i = 0; i < 3; i++) {
261  clamp(color[i], 0, 1);
262  }
263 }

Referenced by R_RegisterFunctionsGL().

◆ R_SetAlpha_GL()

void R_SetAlpha_GL ( float  alpha)

Definition at line 98 of file draw.c.

99 {
100  draw.colors[0].u8[3] =
101  draw.colors[1].u8[3] = alpha * 255;
102 }

Referenced by R_RegisterFunctionsGL().

◆ R_SetAlphaScale_GL()

void R_SetAlphaScale_GL ( float  alpha)

Definition at line 104 of file draw.c.

105 {
106  // nop - only used by the RTX renderer
107 }

Referenced by R_RegisterFunctionsGL().

◆ R_SetClipRect_GL()

void R_SetClipRect_GL ( const clipRect_t *  clip)

Definition at line 115 of file draw.c.

116 {
117  clipRect_t rc;
118  float scale;
119 
120  GL_Flush2D();
121 
122  if (!clip) {
123 clear:
124  if (draw.scissor) {
125  qglDisable(GL_SCISSOR_TEST);
126  draw.scissor = qfalse;
127  }
128  return;
129  }
130 
131  scale = 1 / draw.scale;
132 
133  rc.left = clip->left * scale;
134  rc.top = clip->top * scale;
135  rc.right = clip->right * scale;
136  rc.bottom = clip->bottom * scale;
137 
138  if (rc.left < 0)
139  rc.left = 0;
140  if (rc.top < 0)
141  rc.top = 0;
142  if (rc.right > r_config.width)
143  rc.right = r_config.width;
144  if (rc.bottom > r_config.height)
145  rc.bottom = r_config.height;
146  if (rc.right < rc.left)
147  goto clear;
148  if (rc.bottom < rc.top)
149  goto clear;
150 
151  qglEnable(GL_SCISSOR_TEST);
152  qglScissor(rc.left, r_config.height - rc.bottom,
153  rc.right - rc.left, rc.bottom - rc.top);
154  draw.scissor = qtrue;
155 }

Referenced by R_RegisterFunctionsGL().

◆ R_SetColor_GL()

void R_SetColor_GL ( uint32_t  color)

Definition at line 109 of file draw.c.

110 {
111  draw.colors[0].u32 = color;
112  draw.colors[1].u8[3] = draw.colors[0].u8[3];
113 }

Referenced by R_RegisterFunctionsGL().

◆ R_SetScale_GL()

void R_SetScale_GL ( float  scale)

Definition at line 157 of file draw.c.

158 {
159  if (draw.scale == scale) {
160  return;
161  }
162 
163  GL_Flush2D();
164 
165  GL_Ortho(0, Q_rint(r_config.width * scale),
166  Q_rint(r_config.height * scale), 0, -1, 1);
167 
168  draw.scale = scale;
169 }

Referenced by R_RegisterFunctionsGL().

◆ R_SetSky_GL()

void R_SetSky_GL ( const char *  name,
float  rotate,
vec3_t  axis 
)

Definition at line 382 of file sky.c.

383 {
384  int i;
385  char pathname[MAX_QPATH];
386  image_t *image;
387  size_t len;
388  // 3dstudio environment map names
389  static const char suf[6][3] = { "rt", "bk", "lf", "ft", "up", "dn" };
390 
391  if (!gl_drawsky->integer) {
392  R_UnsetSky();
393  return;
394  }
395 
396  skyrotate = rotate;
397  VectorNormalize2(axis, skyaxis);
398 
399  for (i = 0; i < 6; i++) {
400  len = Q_concat(pathname, sizeof(pathname),
401  "env/", name, suf[i], ".tga", NULL);
402  if (len >= sizeof(pathname)) {
403  R_UnsetSky();
404  return;
405  }
406  FS_NormalizePath(pathname, pathname);
407  image = IMG_Find(pathname, IT_SKY, IF_NONE);
408  if (image->texnum == TEXNUM_DEFAULT) {
409  R_UnsetSky();
410  return;
411  }
412  sky_images[i] = image->texnum;
413  }
414 }

Referenced by R_RegisterFunctionsGL().

◆ R_TileClear_GL()

void R_TileClear_GL ( int  x,
int  y,
int  w,
int  h,
qhandle_t  pic 
)

Definition at line 189 of file draw.c.

190 {
191  GL_StretchPic(x, y, w, h, x * DIV64, y * DIV64,
192  (x + w) * DIV64, (y + h) * DIV64, U32_WHITE, IMG_ForHandle(pic));
193 }

Referenced by R_RegisterFunctionsGL().

◆ Scrap_Upload()

void Scrap_Upload ( void  )

Definition at line 220 of file images.c.

221 {
222  int maxlevel;
223 
224  if (!scrap_dirty) {
225  return;
226  }
227 
229 
230  maxlevel = GL_UpscaleLevel(SCRAP_BLOCK_WIDTH, SCRAP_BLOCK_HEIGHT, IT_PIC, IF_SCRAP);
231  if (maxlevel) {
232  GL_Upscale32(scrap_data, SCRAP_BLOCK_WIDTH, SCRAP_BLOCK_HEIGHT, maxlevel, IT_PIC, IF_SCRAP);
233  GL_SetFilterAndRepeat(IT_PIC, IF_SCRAP | IF_UPSCALED);
234  } else {
235  GL_Upload32(scrap_data, SCRAP_BLOCK_WIDTH, SCRAP_BLOCK_HEIGHT, maxlevel, IT_PIC, IF_SCRAP);
236  GL_SetFilterAndRepeat(IT_PIC, IF_SCRAP);
237  }
238 
239  scrap_dirty = qfalse;
240 }

Referenced by GL_Flush2D(), and R_EndRegistration_GL().

Variable Documentation

◆ c

Definition at line 30 of file main.c.

Referenced by AC_FreeChecks(), AC_SendChecks(), BSP_ClusterVis(), CheckBlock(), CL_ConnectionlessPacket(), CL_GetDemoInfo(), CL_Heatbeam(), CL_OldRailTrail(), CL_RailSpiral(), CL_Record_f(), CL_WriteConfig_f(), clamp_output(), CM_InitBoxHull(), Cmd_EchoEx_f(), Cmd_UnAlias_f(), COM_Compress(), Com_Generic_c(), Com_HashString(), Com_HashStringLen(), COM_IsFloat(), COM_IsPath(), COM_IsUint(), COM_IsWhite(), COM_Parse(), COM_strclr(), compute_cluster_aabbs(), Con_DrawLine(), Con_Paste(), cull_lerped_model(), cull_static_model(), Cvar_BitInfo(), Cvar_Default_g(), Cvar_Get(), Cvar_List_f(), Cvar_Set_f(), Cvar_Variable_g(), D_FlushCaches(), draw_alias_mesh(), draw_char(), dummy_find_slot(), escape_path(), format_mask(), FS_NormalizePath(), FS_UnLink_f(), G_FindTeams(), get_emissive_shell(), GL_BindTexture(), GL_ColorInvertTexture(), GL_DrawBspModel(), GL_DrawFace(), GL_DrawLeaf(), GL_DrawNode(), GL_Flush2D(), GL_Flush3D(), GL_ForceTexture(), GL_GrayScaleTexture(), GL_LightScaleTexture(), GL_MarkLeaves(), GL_TextureAnimation(), GL_TextureHasAlpha(), GL_Upload32(), GL_WorldNode_r(), IMG_Load(), Info_SetValueForKey(), Info_SubValidate(), Info_Validate(), inject_model_lights(), Key_Bind_f(), KeyDown(), KeyUp(), left_of(), LM_RebuildSurfaces(), logfile_write(), MSG_ReadByte(), MSG_ReadChar(), MSG_ReadLong(), MSG_ReadShort(), MSG_ReadString(), MSG_ReadStringLine(), MSG_ReadWord(), MSG_WriteByte(), MSG_WriteChar(), MSG_WriteLong(), MSG_WriteShort(), MVD_Connect_f(), MVD_Control_f(), MVD_CountClients(), MVD_Play_f(), MVD_StreamedRecord_f(), needs_quotes(), Parse_Action(), Parse_Bind(), Parse_Bitmap(), Parse_Color(), parse_CSV_line(), Parse_Field(), parse_ignore_nick(), Parse_Pairs(), Parse_Range(), Parse_Savegame(), Parse_Spin(), Parse_Style(), Parse_Toggle(), Q_memccpy(), Q_strchrnul(), R_BeginFrame_GL(), R_DrawChar_GL(), R_DrawChar_RTX(), R_DrawFill32(), R_DrawFill8(), R_DrawFill8_GL(), R_DrawFill8_RTX(), R_DrawString(), R_DrawString_GL(), R_DrawString_RTX(), R_IMFlatShadedQuad(), R_LightScaleTexture(), R_RecursiveWorldNode(), R_TextureAnimation(), sample_spherical_lights(), SCR_Draw_f(), SCR_LagDraw(), SCR_ParseColor(), SetupRotationMatrix(), SV_ConnectionlessPacket(), SV_CvarResult_f(), SV_DumpEnts_f(), SV_ExecuteClientMessage(), SV_ExecuteUserCommand(), SV_MvdRecord_f(), SV_NewClientExecuteMove(), SV_StuffCvar_f(), SZ_WriteByte(), SZ_WriteLong(), SZ_WriteShort(), target_string_use(), TH_DrawString(), UI_DrawRect8(), UnionBounds(), update_dynamic_lightmap(), and validate_char().

◆ draw

Definition at line 21 of file draw.c.

◆ gl_brightness

cvar_t* gl_brightness

Definition at line 45 of file main.c.

◆ gl_celshading

cvar_t* gl_celshading

Definition at line 39 of file main.c.

Referenced by draw_celshading(), GL_Register(), and setup_celshading().

◆ gl_clear

cvar_t* gl_clear

Definition at line 73 of file main.c.

Referenced by GL_Register(), and R_BeginFrame_GL().

◆ gl_coloredlightmaps

cvar_t* gl_coloredlightmaps

Definition at line 44 of file main.c.

Referenced by gl_lightmap_changed(), and GL_Register().

◆ gl_config

◆ gl_cull_nodes

cvar_t* gl_cull_nodes

Definition at line 71 of file main.c.

Referenced by GL_DrawWorld(), GL_Register(), and R_RenderFrame_GL().

◆ gl_dotshading

cvar_t* gl_dotshading

Definition at line 40 of file main.c.

Referenced by GL_Register(), and setup_dotshading().

◆ gl_doublelight_entities

cvar_t* gl_doublelight_entities

Definition at line 51 of file main.c.

Referenced by GL_LightPoint(), and GL_Register().

◆ gl_drawsky

cvar_t* gl_drawsky

Definition at line 60 of file main.c.

Referenced by GL_Register(), and R_SetSky_GL().

◆ gl_dynamic

cvar_t* gl_dynamic

◆ gl_fontshadow

cvar_t* gl_fontshadow

Definition at line 54 of file main.c.

Referenced by draw_char(), and GL_Register().

◆ gl_fragment_program

cvar_t* gl_fragment_program

Definition at line 52 of file main.c.

Referenced by GL_InitPrograms(), GL_Register(), R_EndFrame_GL(), and R_Init_GL().

◆ gl_fullbright

cvar_t* gl_fullbright

◆ gl_hash_faces

cvar_t* gl_hash_faces

Definition at line 75 of file main.c.

Referenced by GL_DrawNode(), and GL_Register().

◆ gl_lightmap

cvar_t* gl_lightmap

Definition at line 78 of file main.c.

Referenced by GL_BindArrays(), GL_DrawFace(), GL_Register(), and R_RenderFrame_GL().

◆ gl_lockpvs

cvar_t* gl_lockpvs

Definition at line 77 of file main.c.

Referenced by GL_MarkLeaves(), and GL_Register().

◆ gl_modulate

cvar_t* gl_modulate

Definition at line 42 of file main.c.

Referenced by gl_lightmap_changed(), gl_modulate_entities_changed(), and GL_Register().

◆ gl_modulate_entities

cvar_t* gl_modulate_entities

Definition at line 50 of file main.c.

◆ gl_modulate_world

cvar_t* gl_modulate_world

Definition at line 43 of file main.c.

◆ gl_novis

cvar_t* gl_novis

Definition at line 76 of file main.c.

Referenced by GL_MarkLeaves(), and GL_Register().

◆ gl_partscale

cvar_t* gl_partscale

Definition at line 37 of file main.c.

Referenced by GL_DrawParticles(), and GL_Register().

◆ gl_partstyle

cvar_t* gl_partstyle

Definition at line 38 of file main.c.

Referenced by GL_DrawParticles(), and GL_Register().

◆ gl_shadows

cvar_t* gl_shadows

Definition at line 41 of file main.c.

Referenced by GL_Register(), and setup_shadow().

◆ gl_showtris

cvar_t* gl_showtris

Definition at line 61 of file main.c.

Referenced by draw_alias_mesh(), GL_DrawParticles(), GL_Flush2D(), GL_Flush3D(), and GL_Register().

◆ gl_static

◆ gl_vertexlight

cvar_t* gl_vertexlight

◆ gl_world

entity_t gl_world

Definition at line 32 of file main.c.

Referenced by GL_DrawAlphaFaces(), and GL_DrawWorld().

◆ gl_znear

cvar_t* gl_znear

Definition at line 57 of file main.c.

Referenced by GL_Frustum(), and GL_Register().

◆ glr

◆ gls

◆ lm

◆ tess

RadiusFromBounds
vec_t RadiusFromBounds(const vec3_t mins, const vec3_t maxs)
Definition: shared.c:127
qglBindTexture
#define qglBindTexture
Definition: fixed.h:37
GLS_BLEND_MODULATE
@ GLS_BLEND_MODULATE
Definition: gl.h:287
TEXNUM_SCRAP
#define TEXNUM_SCRAP
Definition: gl.h:440
gl_partscale
cvar_t * gl_partscale
Definition: main.c:37
qglDepthFunc
#define qglDepthFunc
Definition: fixed.h:51
qglPolygonMode
#define qglPolygonMode
Definition: fixed.h:92
GLS_SHADE_SMOOTH
@ GLS_SHADE_SMOOTH
Definition: gl.h:294
maliasmesh_s
Definition: gl.h:232
SCRAP_BLOCK_HEIGHT
#define SCRAP_BLOCK_HEIGHT
Definition: images.c:194
qglColorPointer
#define qglColorPointer
Definition: fixed.h:46
gl_fullbright
cvar_t * gl_fullbright
Definition: main.c:79
Cvar_Set
cvar_t * Cvar_Set(const char *var_name, const char *value)
Definition: cvar.c:466
SKY_VISIBLE
#define SKY_VISIBLE(side)
Definition: sky.c:328
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
gl_gamma_scale_pics
static cvar_t * gl_gamma_scale_pics
Definition: images.c:37
IMG_GetPalette
void IMG_GetPalette(void)
Definition: images.c:1376
hqTable
static const uint8_t hqTable[256]
Definition: hq2x.c:32
maliasmesh_s::numindices
int numindices
Definition: gl.h:235
qglClearDepth
#define qglClearDepth
Definition: fixed.h:41
masliasvert_s::norm
byte norm[2]
Definition: gl.h:222
GLS_DEPTHTEST_DISABLE
@ GLS_DEPTHTEST_DISABLE
Definition: gl.h:284
IMG_FreeAll
void IMG_FreeAll(void)
Definition: images.c:1343
gl_showtris
cvar_t * gl_showtris
Definition: main.c:61
FACE_HASH_SIZE
#define FACE_HASH_SIZE
Definition: tess.c:24
lm
lightmap_builder_t lm
Definition: surf.c:25
newframenum
static int newframenum
Definition: mesh.c:24
GL_DrawChain
static void GL_DrawChain(mface_t **head)
Definition: tess.c:416
tessfunc
static tessfunc_t tessfunc
Definition: mesh.c:32
draw_alias_mesh
static void draw_alias_mesh(maliasmesh_t *mesh)
Definition: mesh.c:571
glArrayBits_t
glArrayBits_t
Definition: gl.h:299
maliasmesh_s::tcoords
maliastc_t * tcoords
Definition: gl.h:238
Scrap_Init
static void Scrap_Init(void)
Definition: images.c:203
upload_height
static int upload_height
Definition: images.c:30
height
static int height
Definition: physical_sky.c:39
gl_texturemode
static cvar_t * gl_texturemode
Definition: images.c:41
GL_MarkLights
#define GL_MarkLights()
Definition: world.c:228
maliasframe_s::scale
vec3_t scale
Definition: gl.h:226
NUM_TEXNUMS
#define NUM_TEXNUMS
Definition: gl.h:57
Scrap_AllocBlock
#define Scrap_AllocBlock(w, h, s, t)
Definition: images.c:200
yccTable
static int32_t yccTable[8][256]
Definition: hq2x.c:52
faces_next
static mface_t ** faces_next[FACE_HASH_SIZE]
Definition: tess.c:28
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
qglDepthMask
#define qglDepthMask
Definition: fixed.h:52
scrap_data
static byte scrap_data[SCRAP_BLOCK_WIDTH *SCRAP_BLOCK_HEIGHT *4]
Definition: images.c:197
LM_RebuildSurfaces
static void LM_RebuildSurfaces(void)
Definition: surf.c:459
sky_images
static int sky_images[6]
Definition: sky.c:23
GLS_CULL_DISABLE
@ GLS_CULL_DISABLE
Definition: gl.h:293
Hunk_Begin
void Hunk_Begin(memhunk_t *hunk, size_t maxsize)
Definition: hunk.c:23
tesselator_t::numindices
int numindices
Definition: gl.h:468
GL_Frustum
static void GL_Frustum(void)
Definition: state.c:282
GL_InitParticleTexture
static void GL_InitParticleTexture(void)
Definition: images.c:783
gl_cull_models
cvar_t * gl_cull_models
Definition: main.c:72
NODE_CLIPPED
#define NODE_CLIPPED
Definition: world.c:443
GL_PushLights
void GL_PushLights(mface_t *surf)
Definition: surf.c:271
qglMatrixMode
#define qglMatrixMode
Definition: fixed.h:84
input
static in_state_t input
Definition: input.c:71
GL_ErrorString
static const char * GL_ErrorString(GLenum err)
Definition: main.c:511
qglProgramLocalParameter4fvARB
PFNGLPROGRAMLOCALPARAMETER4FVARBPROC qglProgramLocalParameter4fvARB
Definition: fixed.c:35
align
static size_t align(size_t x, size_t alignment)
Definition: vk_util.h:143
skymins
static float skymins[2][6]
Definition: sky.c:59
tess_static_shade
static void tess_static_shade(const maliasmesh_t *mesh)
Definition: mesh.c:114
maliastc_s
Definition: gl.h:216
gl_cull_nodes
cvar_t * gl_cull_nodes
Definition: main.c:71
qglGetError
#define qglGetError
Definition: fixed.h:67
hq2x_blend
static q_noinline uint32_t hq2x_blend(int rule, uint32_t E, uint32_t A, uint32_t B, uint32_t D, uint32_t F, uint32_t H)
Definition: hq2x.c:151
glStatic_t::cache
bsp_t * cache
Definition: gl.h:62
Cvar_Get
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags)
Definition: cvar.c:257
Q_ErrorString
const char * Q_ErrorString(qerror_t error)
Definition: error.c:51
qglCullFace
#define qglCullFace
Definition: fixed.h:49
GL_Ortho
void GL_Ortho(GLfloat xmin, GLfloat xmax, GLfloat ymin, GLfloat ymax, GLfloat znear, GLfloat zfar)
Definition: state.c:230
glr
glRefdef_t glr
Definition: main.c:27
E
#define E(name)
Definition: g_save.c:50
qglLockArraysEXT
PFNGLLOCKARRAYSEXTPROC qglLockArraysEXT
Definition: fixed.c:49
qglDepthRange
#define qglDepthRange
Definition: fixed.h:53
adjust_color_f
static void adjust_color_f(vec_t *out, const vec_t *in, float modulate)
Definition: surf.c:36
Hunk_Alloc
void * Hunk_Alloc(memhunk_t *hunk, size_t size)
Definition: hunk.c:38
qglProgramStringARB
PFNGLPROGRAMSTRINGARBPROC qglProgramStringARB
Definition: fixed.c:30
GL_UpscaleLevel
static int GL_UpscaleLevel(int width, int height, imagetype_t type, imageflags_t flags)
Definition: images.c:484
glRefdef_t::entrotated
qboolean entrotated
Definition: gl.h:93
setup_color
static void setup_color(void)
Definition: mesh.c:335
BSP_CullFace
#define BSP_CullFace(face, dot)
Definition: world.c:354
gl_lightmap
cvar_t * gl_lightmap
Definition: main.c:78
FACE_HASH_BITS
#define FACE_HASH_BITS
Definition: tess.c:23
glStatic_t::hunk
memhunk_t hunk
Definition: gl.h:63
GL_AddAlphaFace
void GL_AddAlphaFace(mface_t *face)
Definition: tess.c:476
gl_noscrap
static cvar_t * gl_noscrap
Definition: images.c:33
qglClearColor
#define qglClearColor
Definition: fixed.h:40
gls
glState_t gls
Definition: state.c:22
statCounters_t::trisDrawn
int trisDrawn
Definition: gl.h:142
qglDisableClientState
#define qglDisableClientState
Definition: fixed.h:55
qglColor4f
#define qglColor4f
Definition: fixed.h:43
MakeSkyVec
static void MakeSkyVec(float s, float t, int axis, vec_t *out)
Definition: sky.c:286
faces_alpha
static mface_t * faces_alpha
Definition: tess.c:29
FIX
#define FIX(x)
Definition: hq2x.c:457
GL_CopyVerts
static int GL_CopyVerts(mface_t *surf)
Definition: tess.c:334
cull_static_model
static glCullResult_t cull_static_model(model_t *model)
Definition: mesh.c:256
GL_Upscale32
static void GL_Upscale32(byte *data, int width, int height, int maxlevel, imagetype_t type, imageflags_t flags)
Definition: images.c:512
FACE_HASH_MASK
#define FACE_HASH_MASK
Definition: tess.c:25
make_box_points
static void make_box_points(const vec3_t origin, vec3_t bounds[2], vec3_t points[8])
Definition: main.c:170
GL_BindTexture
void GL_BindTexture(GLuint tmu, GLuint texnum)
Definition: state.c:40
drawStatic_t::colors
color_t colors[2]
Definition: gl.h:402
gl_drawsky
cvar_t * gl_drawsky
Definition: main.c:60
GLS_TEXTURE_REPLACE
@ GLS_TEXTURE_REPLACE
Definition: gl.h:289
qglDeleteProgramsARB
PFNGLDELETEPROGRAMSARBPROC qglDeleteProgramsARB
Definition: fixed.c:32
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
F
#define F(name)
Definition: g_save.c:46
create_surface_vbo
static qboolean create_surface_vbo(size_t size)
Definition: surf.c:722
d_8to24table
uint32_t d_8to24table[256]
Definition: images.c:654
qglBlendFunc
#define qglBlendFunc
Definition: fixed.h:38
GL_Upload32
static void GL_Upload32(byte *data, int width, int height, int baselevel, imagetype_t type, imageflags_t flags)
Definition: images.c:380
GL_ClientActiveTexture
static void GL_ClientActiveTexture(GLuint tmu)
Definition: gl.h:326
glState_t::texnums
GLuint texnums[MAX_TMUS]
Definition: gl.h:310
GL_FreeWorld
void GL_FreeWorld(void)
Definition: surf.c:859
glRefdef_t::num_beams
int num_beams
Definition: gl.h:97
GLS_WARP_ENABLE
@ GLS_WARP_ENABLE
Definition: gl.h:292
B
#define B(name)
Definition: g_save.c:40
R_UnsetSky
static void R_UnsetSky(void)
Definition: sky.c:367
MOD_ValidateMD2
qerror_t MOD_ValidateMD2(dmd2header_t *header, size_t length)
Definition: models.c:142
GLS_BLEND_BLEND
@ GLS_BLEND_BLEND
Definition: gl.h:285
GLS_LIGHTMAP_ENABLE
@ GLS_LIGHTMAP_ENABLE
Definition: gl.h:291
qglDeleteBuffersARB
PFNGLDELETEBUFFERSARBPROC qglDeleteBuffersARB
Definition: fixed.c:43
faces_head
static mface_t * faces_head[FACE_HASH_SIZE]
Definition: tess.c:27
maliasmesh_s::indices
QGL_INDEX_TYPE * indices
Definition: gl.h:236
glConfig_t::ext_supported
unsigned ext_supported
Definition: gl.h:106
backlerp
static float backlerp
Definition: mesh.c:26
TEXNUM_BEAM
#define TEXNUM_BEAM
Definition: gl.h:442
qglReadPixels
#define qglReadPixels
Definition: fixed.h:96
gl_texturemode_g
static void gl_texturemode_g(genctx_t *ctx)
Definition: images.c:100
GL_LockArrays
static void GL_LockArrays(GLsizei count)
Definition: gl.h:361
gl_vertexlight
cvar_t * gl_vertexlight
Definition: main.c:80
gl_saturation
static cvar_t * gl_saturation
Definition: images.c:45
infront
qboolean infront(edict_t *self, edict_t *other)
Definition: g_ai.c:293
gl_bilerp_chars_changed
static void gl_bilerp_chars_changed(cvar_t *self)
Definition: images.c:131
qglVertexPointer
#define qglVertexPointer
Definition: fixed.h:112
gl_round_down
static cvar_t * gl_round_down
Definition: images.c:34
gl_invert
static cvar_t * gl_invert
Definition: images.c:48
statCounters_t::boxesCulled
int boxesCulled
Definition: gl.h:146
gl_texturebits_changed
static void gl_texturebits_changed(cvar_t *self)
Definition: images.c:159
GL_InitBeamTexture
static void GL_InitBeamTexture(void)
Definition: images.c:825
maxCb
static int32_t maxCb
Definition: hq2x.c:53
gl_world
entity_t gl_world
Definition: main.c:32
GLA_VERTEX
@ GLA_VERTEX
Definition: gl.h:301
upload_width
static int upload_width
Definition: images.c:29
GL_UnlockArrays
static void GL_UnlockArrays(void)
Definition: gl.h:368
maliasmesh_s::verts
maliasvert_t * verts
Definition: gl.h:237
skymaxs
static float skymaxs[2][6]
Definition: sky.c:59
masliasvert_s::pos
short pos[3]
Definition: gl.h:221
glStatic_t::stencil_buffer_bit
GLbitfield stencil_buffer_bit
Definition: gl.h:70
GL_Flush2D
void GL_Flush2D(void)
Definition: tess.c:31
DIV64
#define DIV64
Definition: draw.c:187
qglGenTextures
#define qglGenTextures
Definition: fixed.h:66
gl_config
glConfig_t gl_config
Definition: main.c:29
setup_shadow
static void setup_shadow(void)
Definition: mesh.c:440
maliasframe_s::translate
vec3_t translate
Definition: gl.h:227
GL_TextureAnimation
static int GL_TextureAnimation(mtexinfo_t *tex)
Definition: tess.c:352
gl_bilerp_pics_changed
static void gl_bilerp_pics_changed(cvar_t *self)
Definition: images.c:145
qglClear
#define qglClear
Definition: fixed.h:39
draw
drawStatic_t draw
Definition: draw.c:21
skyfaces
static int skyfaces
Definition: sky.c:60
gl_anisotropy
static cvar_t * gl_anisotropy
Definition: images.c:44
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
Hunk_Free
void Hunk_Free(memhunk_t *hunk)
Definition: hunk.c:75
width
static int width
Definition: physical_sky.c:38
GL_BuildGammaTables
static void GL_BuildGammaTables(void)
Definition: images.c:709
TESS_MAX_VERTICES
#define TESS_MAX_VERTICES
Definition: gl.h:459
GLS_BLEND_MASK
#define GLS_BLEND_MASK
Definition: gl.h:297
GLS_FLOW_ENABLE
@ GLS_FLOW_ENABLE
Definition: gl.h:290
Scrap_Shutdown
static void Scrap_Shutdown(void)
Definition: images.c:209
LM_EndBuilding
static void LM_EndBuilding(void)
Definition: surf.c:380
VERTEX_SIZE
#define VERTEX_SIZE
Definition: gl.h:245
GL_AddLights
#define GL_AddLights(origin, color)
Definition: world.c:230
maliastc_s::st
float st[2]
Definition: gl.h:217
GL_ArrayBits
void GL_ArrayBits(glArrayBits_t bits)
Definition: state.c:185
qglTexCoordPointer
#define qglTexCoordPointer
Definition: fixed.h:104
NODE_UNCLIPPED
#define NODE_UNCLIPPED
Definition: world.c:444
GL_StretchPic
#define GL_StretchPic(x, y, w, h, s1, t1, s2, t2, color, image)
Definition: draw.c:76
shellscale
static vec_t shellscale
Definition: mesh.c:31
Com_Error
void Com_Error(error_type_t type, const char *fmt,...)
Definition: g_main.c:258
BSP_Free
void BSP_Free(bsp_t *bsp)
Definition: bsp.c:932
maliasframe_s::bounds
vec3_t bounds[2]
Definition: gl.h:228
gl_showerrors
cvar_t * gl_showerrors
Definition: main.c:82
GLS_BLEND_ADD
@ GLS_BLEND_ADD
Definition: gl.h:286
Scrap_Upload
void Scrap_Upload(void)
Definition: images.c:220
PARTICLE_SCALE
#define PARTICLE_SCALE
Definition: tess.c:77
GL_RotateForEntity
void GL_RotateForEntity(vec3_t origin, float scale)
Definition: main.c:305
tess_lerped_plain
static void tess_lerped_plain(const maliasmesh_t *mesh)
Definition: mesh.c:232
GL_DrawFace
void GL_DrawFace(mface_t *surf)
Definition: tess.c:367
TEXNUM_DEFAULT
#define TEXNUM_DEFAULT
Definition: gl.h:439
gl_downsample_skins
static cvar_t * gl_downsample_skins
Definition: images.c:36
qglScissor
#define qglScissor
Definition: fixed.h:99
QGL_ARB_fragment_program
#define QGL_ARB_fragment_program
Definition: dynamic.h:155
QGL_ClearErrors
void QGL_ClearErrors(void)
Definition: main.c:531
glRefdef_t::viewaxis
vec3_t viewaxis[3]
Definition: gl.h:82
maliasframe_s::radius
vec_t radius
Definition: gl.h:229
tess_lerped_shell
static void tess_lerped_shell(const maliasmesh_t *mesh)
Definition: mesh.c:173
statCounters_t::texSwitches
int texSwitches
Definition: gl.h:140
AT_LEAST_OPENGL
#define AT_LEAST_OPENGL(major, minor)
Definition: gl.h:121
glStatic_t::world
struct glStatic_t::@11 world
Cvar_ClampValue
float Cvar_ClampValue(cvar_t *var, float min, float max)
Definition: cvar.c:571
gl_anisotropy_changed
static void gl_anisotropy_changed(cvar_t *self)
Definition: images.c:111
glRefdef_t::frustumPlanes
cplane_t frustumPlanes[4]
Definition: gl.h:91
Z_Free
void Z_Free(void *ptr)
Definition: zone.c:147
GL_MultMatrix
void GL_MultMatrix(GLfloat *p, const GLfloat *a, const GLfloat *b)
Definition: main.c:290
glStatic_t::latlngtab
byte latlngtab[NUMVERTEXNORMALS][2]
Definition: gl.h:76
TEXNUM_PARTICLE
#define TEXNUM_PARTICLE
Definition: gl.h:441
GL_ColorBytePointer
static void GL_ColorBytePointer(GLint size, GLsizei stride, const GLubyte *pointer)
Definition: gl.h:351
glRefdef_t::entmatrix
GLfloat entmatrix[16]
Definition: gl.h:95
IMG_Shutdown
void IMG_Shutdown(void)
Definition: images.c:1448
glStateBits_t
glStateBits_t
Definition: gl.h:281
tess
tesselator_t tess
Definition: tess.c:21
tesselator_t::indices
QGL_INDEX_TYPE indices[TESS_MAX_INDICES]
Definition: gl.h:464
setup_dotshading
static void setup_dotshading(void)
Definition: mesh.c:42
tess_static_plain
static void tess_static_plain(const maliasmesh_t *mesh)
Definition: mesh.c:138
SkyInverseRotate
static void SkyInverseRotate(vec3_t out, const vec3_t in)
Definition: sky.c:222
ClearBounds
void ClearBounds(vec3_t mins, vec3_t maxs)
Definition: shared.c:91
skyaxis
static vec3_t skyaxis
Definition: sky.c:22
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
qglDisable
#define qglDisable
Definition: fixed.h:54
GL_ArrayBits
void GL_ArrayBits(glArrayBits_t bits)
Definition: state.c:185
qglFrontFace
#define qglFrontFace
Definition: fixed.h:64
Hunk_End
void Hunk_End(memhunk_t *hunk)
Definition: hunk.c:66
hq4x_blend
static q_noinline void hq4x_blend(int rule, uint32_t *p00, uint32_t *p01, uint32_t *p10, uint32_t *p11, uint32_t E, uint32_t A, uint32_t B, uint32_t D, uint32_t F, uint32_t H)
Definition: hq2x.c:190
I
#define I(name)
Definition: g_save.c:44
qglEnableClientState
#define qglEnableClientState
Definition: fixed.h:59
GL_DisableOutlines
void GL_DisableOutlines(void)
Definition: state.c:471
glRefdef_t::viewmatrix
GLfloat viewmatrix[16]
Definition: gl.h:83
glRefdef_t::lightpoint
lightpoint_t lightpoint
Definition: gl.h:96
gl_bilerp_pics
static cvar_t * gl_bilerp_pics
Definition: images.c:39
glStatic_t::texnums
GLuint texnums[NUM_TEXNUMS]
Definition: gl.h:69
QGL_ShutdownExtensions
void QGL_ShutdownExtensions(unsigned mask)
Definition: dynamic.c:643
qglScalef
#define qglScalef
Definition: fixed.h:98
SetupRotationMatrix
void SetupRotationMatrix(vec3_t matrix[3], const vec3_t dir, float degrees)
Definition: math.c:367
qglGetIntegerv
#define qglGetIntegerv
Definition: fixed.h:69
_GL_StretchPic
static void _GL_StretchPic(float x, float y, float w, float h, float s1, float t1, float s2, float t2, uint32_t color, int texnum, int flags)
Definition: draw.c:23
CULL_IN
@ CULL_IN
Definition: gl.h:192
GL_TransformLights
#define GL_TransformLights()
Definition: world.c:229
qglLoadIdentity
#define qglLoadIdentity
Definition: fixed.h:79
GL_ActiveTexture
static void GL_ActiveTexture(GLuint tmu)
Definition: gl.h:318
upload_alpha
static qboolean upload_alpha
Definition: images.c:31
draw_char
static void draw_char(int x, int y, int flags, int c, image_t *image)
Definition: draw.c:209
GL_DrawSolidFaces
void GL_DrawSolidFaces(void)
Definition: tess.c:436
R_DrawSkyBox
void R_DrawSkyBox(void)
Definition: sky.c:337
GLS_DEFAULT
@ GLS_DEFAULT
Definition: gl.h:282
VectorNormalize2
vec_t VectorNormalize2(vec3_t v, vec3_t out)
Definition: shared.c:73
QGL_INDEX_ENUM
#define QGL_INDEX_ENUM
Definition: gl.h:49
G
#define G(X, Y, Z)
Definition: mdfour.c:35
qglDrawArrays
#define qglDrawArrays
Definition: fixed.h:56
GL_BindArrays
void GL_BindArrays(void)
Definition: tess.c:255
qglLoadMatrixf
#define qglLoadMatrixf
Definition: fixed.h:80
upload_world_surfaces
static void upload_world_surfaces(void)
Definition: surf.c:760
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
rotTable
static uint8_t rotTable[256]
Definition: hq2x.c:51
qglDrawElements
#define qglDrawElements
Definition: fixed.h:57
IMG_Find
image_t * IMG_Find(const char *name, imagetype_t type, imageflags_t flags)
Definition: images.c:1122
tesselator_t::texnum
GLuint texnum[MAX_TMUS]
Definition: gl.h:466
_GL_LightPoint
static qboolean _GL_LightPoint(vec3_t start, vec3_t color)
Definition: world.c:75
GL_Ortho
void GL_Ortho(GLfloat xmin, GLfloat xmax, GLfloat ymin, GLfloat ymax, GLfloat znear, GLfloat zfar)
Definition: state.c:230
gl_static
glStatic_t gl_static
Definition: main.c:28
maxCr
static int32_t maxCr
Definition: hq2x.c:53
GL_LightPoint
void GL_LightPoint(vec3_t origin, vec3_t color)
Definition: world.c:233
gl_upscale_pcx
static cvar_t * gl_upscale_pcx
Definition: images.c:40
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
gl_texturemode_changed
static void gl_texturemode_changed(cvar_t *self)
Definition: images.c:71
qglGenProgramsARB
PFNGLGENPROGRAMSARBPROC qglGenProgramsARB
Definition: fixed.c:33
LM_MAX_LIGHTMAPS
#define LM_MAX_LIGHTMAPS
Definition: gl.h:254
gl_dynamic
cvar_t * gl_dynamic
Definition: main.c:46
glr
glRefdef_t glr
Definition: main.c:27
GL_BindTexture
void GL_BindTexture(GLuint tmu, GLuint texnum)
Definition: state.c:40
tesselator_t::colors
GLubyte colors[4 *TESS_MAX_VERTICES]
Definition: gl.h:465
gl_bilerp_chars
static cvar_t * gl_bilerp_chars
Definition: images.c:38
setup_celshading
static void setup_celshading(void)
Definition: mesh.c:403
TEXNUM_WHITE
#define TEXNUM_WHITE
Definition: gl.h:443
glStatic_t::prognum_warp
GLuint prognum_warp
Definition: gl.h:68
GL_Flush3D
void GL_Flush3D(void)
Definition: tess.c:284
GL_InitDefaultTexture
static void GL_InitDefaultTexture(void)
Definition: images.c:748
registration_sequence
int registration_sequence
Definition: main.c:34
GL_VertexPointer
static void GL_VertexPointer(GLint size, GLsizei stride, const GLfloat *pointer)
Definition: gl.h:334
qglClearStencil
#define qglClearStencil
Definition: fixed.h:42
masliasvert_s
Definition: gl.h:220
glConfig_t::ext_enabled
unsigned ext_enabled
Definition: gl.h:107
GL_BuildIntensityTable
static void GL_BuildIntensityTable(void)
Definition: images.c:689
LM_BeginBuilding
static void LM_BeginBuilding(void)
Definition: surf.c:368
qglShadeModel
#define qglShadeModel
Definition: fixed.h:100
QGL_InitExtensions
void QGL_InitExtensions(unsigned mask)
Definition: dynamic.c:683
GL_InitWhiteImage
static void GL_InitWhiteImage(void)
Definition: images.c:810
glState_t::client_tmu
GLuint client_tmu
Definition: gl.h:308
frontlerp
static float frontlerp
Definition: mesh.c:25
gl_doublelight_entities
cvar_t * gl_doublelight_entities
Definition: main.c:51
GL_Flush3D
void GL_Flush3D(void)
Definition: tess.c:284
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
qglViewport
#define qglViewport
Definition: fixed.h:113
qglBindBufferARB
PFNGLBINDBUFFERARBPROC qglBindBufferARB
Definition: fixed.c:42
diff
static q_noinline int diff(uint32_t A_u32, uint32_t B_u32)
Definition: hq2x.c:55
skymatrix
static vec3_t skymatrix[3]
Definition: sky.c:58
qglAlphaFunc
#define qglAlphaFunc
Definition: fixed.h:36
gl_gamma
static cvar_t * gl_gamma
Definition: images.c:47
maliasmesh_s::numtris
int numtris
Definition: gl.h:234
cull_lerped_model
static glCullResult_t cull_lerped_model(model_t *model)
Definition: mesh.c:291
R_ClearSkyBox
void R_ClearSkyBox(void)
Definition: sky.c:274
statCounters_t::facesTris
int facesTris
Definition: gl.h:139
err
int err
Definition: win.h:24
colorscale
static float colorscale
Definition: images.c:247
qglTranslatef
#define qglTranslatef
Definition: fixed.h:111
LIGHT_STYLE
#define LIGHT_STYLE(surf, i)
Definition: gl.h:251
gl_fragment_program
cvar_t * gl_fragment_program
Definition: main.c:52
gl_prog_warp
static const char gl_prog_warp[]
Definition: arbfp.h:1
gl_texture_non_power_of_two
static cvar_t * gl_texture_non_power_of_two
Definition: images.c:43
shadelight
static const vec_t * shadelight
Definition: mesh.c:35
TEXNUM_WHITE
#define TEXNUM_WHITE
Definition: draw.c:30
lightmap_builder_t::texnums
GLuint texnums[LM_MAX_LIGHTMAPS]
Definition: gl.h:265
skyrotate
static float skyrotate
Definition: sky.c:21
statCounters_t::batchesDrawn
int batchesDrawn
Definition: gl.h:143
MAX_CLIP_VERTS
#define MAX_CLIP_VERTS
Definition: sky.c:129
Q_memccpy
void * Q_memccpy(void *dst, const void *src, int c, size_t size)
Definition: shared.c:895
statCounters_t::rotatedBoxesCulled
int rotatedBoxesCulled
Definition: gl.h:148
SCRAP_BLOCK_WIDTH
#define SCRAP_BLOCK_WIDTH
Definition: images.c:193
GL_WorldNode_r
static void GL_WorldNode_r(mnode_t *node, int clipflags)
Definition: world.c:525
BSP_Load
qerror_t BSP_Load(const char *name, bsp_t **bsp_p)
Definition: bsp.c:1087
update_dynamic_lightmap
static void update_dynamic_lightmap(mface_t *surf)
Definition: surf.c:232
GLS_ALPHATEST_ENABLE
@ GLS_ALPHATEST_ENABLE
Definition: gl.h:288
color
static vec4_t color
Definition: mesh.c:33
IMG_ForHandle
image_t * IMG_ForHandle(qhandle_t h)
Definition: images.c:1156
statCounters_t::spheresCulled
int spheresCulled
Definition: gl.h:147
qglTexEnvf
#define qglTexEnvf
Definition: fixed.h:105
drawStatic_t::scale
float scale
Definition: gl.h:404
glStatic_t::bufnum
GLuint bufnum
Definition: gl.h:65
Q_concat
size_t Q_concat(char *dest, size_t size,...)
Definition: shared.c:758
QGL_INDEX_TYPE
#define QGL_INDEX_TYPE
Definition: gl.h:48
glRefdef_t::entaxis
vec3_t entaxis[3]
Definition: gl.h:94
glState_t::currentmatrix
const GLfloat * currentmatrix
Definition: gl.h:313
oldframenum
static int oldframenum
Definition: mesh.c:23
gl_gamma_changed
static void gl_gamma_changed(cvar_t *self)
Definition: images.c:731
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::vertices
GLfloat vertices[VERTEX_SIZE *TESS_MAX_VERTICES]
Definition: gl.h:463
int
CONST PIXELFORMATDESCRIPTOR int
Definition: wgl.c:26
gl_intensity
static cvar_t * gl_intensity
Definition: images.c:46
gl_texturebits
static cvar_t * gl_texturebits
Definition: images.c:42
GL_RotateForViewer
static void GL_RotateForViewer(void)
Definition: state.c:329
GLS_DEPTHMASK_FALSE
@ GLS_DEPTHMASK_FALSE
Definition: gl.h:283
GL_EnableOutlines
void GL_EnableOutlines(void)
Definition: state.c:460
GL_StateBits
void GL_StateBits(glStateBits_t bits)
Definition: state.c:60
GL_BindArrays
void GL_BindArrays(void)
Definition: tess.c:255
CULL_CLIP
@ CULL_CLIP
Definition: gl.h:193
tess_lerped_shade
static void tess_lerped_shade(const maliasmesh_t *mesh)
Definition: mesh.c:200
maliasframe_s
Definition: gl.h:225
H
#define H(X, Y, Z)
Definition: mdfour.c:36
drawStatic_t::scissor
qboolean scissor
Definition: gl.h:403
glStatic_t::vertices
vec_t * vertices
Definition: gl.h:64
gl_picmip
static cvar_t * gl_picmip
Definition: images.c:35
GL_MarkLeaves
static void GL_MarkLeaves(void)
Definition: world.c:265
qglBindProgramARB
PFNGLBINDPROGRAMARBPROC qglBindProgramARB
Definition: fixed.c:31
IMG_Init
void IMG_Init(void)
Definition: images.c:1419
HQ2x_Init
void HQ2x_Init(void)
Definition: hq2x.c:459
GL_ShowErrors
qboolean GL_ShowErrors(const char *func)
Definition: main.c:539
tess_static_shell
static void tess_static_shell(const maliasmesh_t *mesh)
Definition: mesh.c:92
GL_SetFilterAndRepeat
static void GL_SetFilterAndRepeat(imagetype_t type, imageflags_t flags)
Definition: images.c:550
glState_t::state_bits
glStateBits_t state_bits
Definition: gl.h:311
FS_NormalizePath
size_t FS_NormalizePath(char *out, const char *in)
Definition: files.c:331
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
GL_StateBits
void GL_StateBits(glStateBits_t bits)
Definition: state.c:60
maxY
static int32_t maxY
Definition: hq2x.c:53
r_config
refcfg_t r_config
Definition: refresh.c:401
BoxOnPlaneSide
int BoxOnPlaneSide(vec3_t emins, vec3_t emaxs, cplane_t *p)
Definition: math.c:322
qglDeleteTextures
#define qglDeleteTextures
Definition: fixed.h:50
glState_t::server_tmu
GLuint server_tmu
Definition: gl.h:309
PARTICLE_SIZE
#define PARTICLE_SIZE
Definition: tess.c:76
CULL_OUT
@ CULL_OUT
Definition: gl.h:191
glRefdef_t::fd
refdef_t fd
Definition: gl.h:81
tesselator_t::numverts
int numverts
Definition: gl.h:467
ClipSkyPolygon
static void ClipSkyPolygon(int nump, vec3_t vecs, int stage)
Definition: sky.c:135
qglEnable
#define qglEnable
Definition: fixed.h:58
scrap_dirty
static qboolean scrap_dirty
Definition: images.c:198
statCounters_t::facesCulled
int facesCulled
Definition: gl.h:145
set_world_size
static void set_world_size(void)
Definition: surf.c:815