Arrays are "lazily" managed to reduce glArrayPointer calls. Drawing routines should call R_SetArrayState or R_ResetArrayState somewhat early-on. More...
#include "r_local.h"
Go to the source code of this file.
Data Structures | |
struct | r_array_state_s |
Defines | |
#define | R_ARRAY_VERTEX 0x1 |
#define | R_ARRAY_COLOR 0x2 |
#define | R_ARRAY_NORMAL 0x4 |
#define | R_ARRAY_TANGENT 0x8 |
#define | R_ARRAY_TEX_DIFFUSE 0x10 |
#define | R_ARRAY_TEX_LIGHTMAP 0x20 |
Typedefs | |
typedef struct r_array_state_s | r_array_state_t |
Functions | |
static int | R_ArraysMask (void) |
This function is consulted to determine whether or not array bindings are up to date. | |
static void | R_SetVertexArrayState (const model_t *mod, int mask) |
static void | R_SetVertexBufferState (const model_t *mod, int mask) |
void | R_SetArrayState (const model_t *mod) |
void | R_ResetArrayState (void) |
Variables | |
static r_array_state_t | r_array_state |
Arrays are "lazily" managed to reduce glArrayPointer calls. Drawing routines should call R_SetArrayState or R_ResetArrayState somewhat early-on.
Definition in file r_array.c.
#define R_ARRAY_COLOR 0x2 |
Definition at line 31 of file r_array.c.
Referenced by R_ArraysMask().
#define R_ARRAY_NORMAL 0x4 |
Definition at line 32 of file r_array.c.
Referenced by R_ArraysMask(), R_SetVertexArrayState(), and R_SetVertexBufferState().
#define R_ARRAY_TANGENT 0x8 |
Definition at line 33 of file r_array.c.
Referenced by R_ArraysMask(), R_SetVertexArrayState(), and R_SetVertexBufferState().
#define R_ARRAY_TEX_DIFFUSE 0x10 |
Definition at line 34 of file r_array.c.
Referenced by R_ArraysMask(), R_SetVertexArrayState(), and R_SetVertexBufferState().
#define R_ARRAY_TEX_LIGHTMAP 0x20 |
Definition at line 35 of file r_array.c.
Referenced by R_ArraysMask(), R_SetVertexArrayState(), and R_SetVertexBufferState().
#define R_ARRAY_VERTEX 0x1 |
Definition at line 30 of file r_array.c.
Referenced by R_ArraysMask(), R_SetVertexArrayState(), and R_SetVertexBufferState().
typedef struct r_array_state_s r_array_state_t |
static int R_ArraysMask | ( | void | ) | [static] |
This function is consulted to determine whether or not array bindings are up to date.
Definition at line 51 of file r_array.c.
References rstate_t::color_array_enabled, rstate_t::lighting_enabled, R_ARRAY_COLOR, R_ARRAY_NORMAL, R_ARRAY_TANGENT, R_ARRAY_TEX_DIFFUSE, R_ARRAY_TEX_LIGHTMAP, R_ARRAY_VERTEX, r_bumpmap, r_state, texunit_diffuse, texunit_lightmap, and cvar_s::value.
Referenced by R_SetArrayState().
void R_ResetArrayState | ( | void | ) |
Definition at line 180 of file r_array.c.
References rstate_t::active_program, r_array_state_s::arrays, rstate_t::color_array_enabled, GL_TANGENT_ARRAY, rstate_t::lighting_enabled, r_array_state_s::model, R_BindBuffer(), R_BindDefaultArray(), r_bumpmap, R_SelectTexture(), r_state, texunit_diffuse, texunit_lightmap, cvar_s::value, and rstate_t::world_program.
Referenced by R_DrawBspNormals(), R_DrawCoronas(), R_DrawFlareSurfaces(), R_DrawMaterialSurfaces(), R_DrawSurfaces(), and R_RenderFrame().
void R_SetArrayState | ( | const model_t * | mod | ) |
Definition at line 148 of file r_array.c.
References r_array_state_s::arrays, cvar_s::integer, r_array_state_s::model, cvar_s::modified, qfalse, R_ArraysMask(), R_SetVertexArrayState(), R_SetVertexBufferState(), and r_vertexbuffers.
Referenced by R_SetSurfaceState().
static void R_SetVertexArrayState | ( | const model_t * | mod, | |
int | mask | |||
) | [inline, static] |
[in] | mod | The loaded maptile (more than one bsp loaded at the same time) |
Definition at line 80 of file r_array.c.
References rstate_t::active_program, model_s::bsp, GL_TANGENT_ARRAY, rstate_t::lighting_enabled, mBspModel_s::lmtexcoords, mBspModel_s::normals, R_ARRAY_NORMAL, R_ARRAY_TANGENT, R_ARRAY_TEX_DIFFUSE, R_ARRAY_TEX_LIGHTMAP, R_ARRAY_VERTEX, R_BindArray(), r_bumpmap, R_SelectTexture(), r_state, mBspModel_s::tangents, mBspModel_s::texcoords, texunit_diffuse, texunit_lightmap, cvar_s::value, mBspModel_s::verts, and rstate_t::world_program.
Referenced by R_SetArrayState().
static void R_SetVertexBufferState | ( | const model_t * | mod, | |
int | mask | |||
) | [inline, static] |
[in] | mod | The loaded maptile (more than one bsp loaded at the same time) |
Definition at line 117 of file r_array.c.
References model_s::bsp, GL_TANGENT_ARRAY, rstate_t::lighting_enabled, mBspModel_s::lmtexcoord_buffer, mBspModel_s::normal_buffer, R_ARRAY_NORMAL, R_ARRAY_TANGENT, R_ARRAY_TEX_DIFFUSE, R_ARRAY_TEX_LIGHTMAP, R_ARRAY_VERTEX, R_BindBuffer(), r_bumpmap, R_SelectTexture(), r_state, mBspModel_s::tangent_buffer, mBspModel_s::texcoord_buffer, texunit_diffuse, texunit_lightmap, cvar_s::value, and mBspModel_s::vertex_buffer.
Referenced by R_SetArrayState().
r_array_state_t r_array_state [static] |