41#define SKYBOX_DEPTH -9999.0f
44#define GL_ARRAY_LENGTH_CHUNK 4096
48typedef struct gltexunit_s {
58#define MAX_GL_TEXUNITS 6
61#define texunit_0 r_state.texunits[0]
62#define texunit_1 r_state.texunits[1]
63#define texunit_2 r_state.texunits[2]
64#define texunit_3 r_state.texunits[3]
65#define texunit_4 r_state.texunits[4]
66#define texunit_5 r_state.texunits[5]
68#define texunit_diffuse texunit_0
69#define texunit_lightmap texunit_1
70#define texunit_deluxemap texunit_2
71#define texunit_normalmap texunit_3
72#define texunit_glowmap texunit_4
73#define texunit_specularmap texunit_5
74#define texunit_roughnessmap texunit_2
76#define COMPONENTS_VERTEX_ARRAY3D 3
77#define COMPONENTS_VERTEX_ARRAY2D 2
78#define COMPONENTS_COLOR_ARRAY 4
79#define COMPONENTS_INDEX_ARRAY 1
80#define COMPONENTS_NORMAL_ARRAY 3
81#define COMPONENTS_TANGENT_ARRAY 4
82#define COMPONENTS_TEXCOORD_ARRAY 2
84#define DOWNSAMPLE_PASSES 5
85#define DOWNSAMPLE_SCALE 2
87#define fbo_screen nullptr
88#define fbo_render r_state.renderBuffer
89#define fbo_bloom0 r_state.bloomBuffer0
90#define fbo_bloom1 r_state.bloomBuffer1
92#define default_program nullptr
96typedef struct rstate_s {
184#define R_BindTexture(tn) R_BindTextureDebug(tn, __FILE__, __LINE__, __PRETTY_FUNCTION__)
QGL_EXTERN GLenum GLuint * dest
QGL_EXTERN GLint GLenum type
QGL_EXTERN const GLuint *QGL_EXTERN GLuint *QGL_EXTERN GLenum
Header file for the render material subsystem.
const vec2_t default_texcoords[4]
void R_EnableAlphaTest(bool enable)
void R_BindBuffer(GLenum target, GLenum type, GLuint id)
void R_EnableTexture(gltexunit_t *texunit, bool enable)
void R_BindDefaultArray(GLenum target)
Binds the appropriate shared vertex array to the specified target.
void R_TexOverride(vec4_t rgba)
Sets special texture environment mode to override texture color; don't forget to call R_TexOverride(n...
#define DOWNSAMPLE_PASSES
void R_BlendFunc(GLenum src, GLenum dest)
void R_EnableAnimation(const struct mAliasMesh_s *mesh, float backlerp, bool enable)
void R_EnableDrawAsGlow(bool enable)
void R_SetDefaultState(void)
void R_EnableBlur(r_program_t *program, bool enable, r_framebuffer_t *source, r_framebuffer_t *dest, int dir)
void R_SetupSpotLight(int index, const light_t *light)
void R_EnableMultisample(bool enable)
bool R_EnableLighting(r_program_t *program, bool enable)
Enables hardware-accelerated lighting with the specified program. This should be called after any tex...
bool R_SelectTexture(gltexunit_t *texunit)
Returns false if the texunit is not supported.
void R_BindLightmapTexture(GLuint texnum)
void R_DisableSpotLight(int index)
void R_BindDeluxemapTexture(GLuint texnum)
void R_UseMaterial(const material_t *material)
void R_EnableGlowMap(const struct image_s *image)
void R_EnableWarp(r_program_t *program, bool enable)
void R_EnableBumpmap(const struct image_s *normalmap)
void R_EnableBlend(bool enable)
void R_BindTextureForTexUnit(GLuint texnum, gltexunit_t *texunit)
void R_TexEnv(GLenum value)
void R_ReallocateTexunitArray(gltexunit_t *texunit, int size)
Reallocate texcoord array of the specified texunit, if needed.
void R_EnableShell(bool enable)
void R_EnableColorArray(bool enable)
void R_BindNormalmapTexture(GLuint texnum)
void R_EnableFog(bool enable)
void R_ReallocateStateArrays(int size)
Reallocate arrays of GL primitives if needed.
void R_EnableSpecularMap(const struct image_s *image, bool enable)
void R_BindArray(GLenum target, GLenum type, const void *array)
void R_EnableStencilTest(bool enable)
void R_EnableRoughnessMap(const struct image_s *image, bool enable)
void R_BindTextureDebug(int texnum, const char *file, int line, const char *function)
texunits maintain multitexture state
const struct image_s * active_normalmap
GLfloat * vertex_array_3d
r_program_t programs[MAX_PROGRAMS]
GLfloat * next_normal_array
bool frameBufferObjectsInitialized
bool dynamic_lighting_enabled
GLfloat * next_tangent_array
r_program_t * world_program
r_framebuffer_t * buffers1[DOWNSAMPLE_PASSES]
r_program_t * geoscape_program
r_program_t * convolve_program
gltexunit_t * active_texunit
const r_framebuffer_t * activeFramebuffer
r_framebuffer_t * renderBuffer
r_program_t * atmosphere_program
r_framebuffer_t * bloomBuffer0
bool stencil_test_enabled
bool renderbuffer_enabled
r_program_t * warp_program
r_framebuffer_t * buffers2[DOWNSAMPLE_PASSES]
r_program_t * simple_glow_program
bool roughnessmap_enabled
r_program_t * active_program
GLshort * vertex_array_2d
r_framebuffer_t * bloomBuffer1
GLfloat * next_vertex_array_3d
gltexunit_t texunits[MAX_GL_TEXUNITS]
const material_t * active_material
r_framebuffer_t * buffers0[DOWNSAMPLE_PASSES]
r_shader_t shaders[MAX_SHADERS]
r_program_t * model_program
r_program_t * combine2_program