r_array.c File Reference

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"
Include dependency graph for r_array.c:

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

Detailed Description

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 Documentation

#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 Documentation


Function Documentation

static int R_ArraysMask ( void   )  [static]

This function is consulted to determine whether or not array bindings are up to date.

Returns:
Returns a bitmask representing the arrays which should be enabled according to r_state.

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   ) 
void R_SetArrayState ( const model_t mod  ) 
static void R_SetVertexArrayState ( const model_t mod,
int  mask 
) [inline, static]
static void R_SetVertexBufferState ( const model_t mod,
int  mask 
) [inline, static]

Variable Documentation

Definition at line 42 of file r_array.c.


Generated by  doxygen 1.6.2