53 static int GL_modelview_matrix_depth = 1;
54 static int GL_htl_projection_matrix_set = 0;
55 static int GL_htl_view_matrix_set = 0;
56 static int GL_htl_2d_matrix_depth = 0;
57 static int GL_htl_2d_matrix_set = 0;
59 static GLfloat GL_env_texture_matrix[16] = { 0.0f };
60 static bool GL_env_texture_matrix_set =
false;
65 static vec3d last_view_pos;
66 static matrix last_view_orient;
70 static bool use_last_view =
false;
112 array_list(NULL), index_list(NULL),
113 vb_handle(-1), ib_handle(-1), vbo_size(0), ibo_size(0)
142 static int GL_vertex_buffers_in_use = 0;
154 GL_buffer_objects.push_back(buffer_obj);
156 return GL_buffer_objects.size() - 1;
162 Assert((
size_t)handle < GL_buffer_objects.size());
166 switch ( buffer_obj.type ) {
189 Assert((
size_t)handle < GL_buffer_objects.size());
196 buffer_obj.size =
size;
205 Assert((
size_t)handle < GL_buffer_objects.size());
252 return buffer_object_handle;
351 GL_vertex_buffers.push_back( vbuffer );
352 GL_vertex_buffers_in_use++;
354 return (
int)(GL_vertex_buffers.size() - 1);
367 Assert( buffer_id < (
int)GL_vertex_buffers.size() );
416 if ( !update_ibuffer_only ) {
444 Assert( buffer_id < (
int)GL_vertex_buffers.size() );
451 opengl_gen_buffer(m_vbp);
460 if (m_vbp->array_list == NULL) {
464 if (m_vbp->array_list == NULL) {
468 memset(m_vbp->array_list, 0, m_vbp->vbo_size);
471 if (m_vbp->index_list == NULL) {
475 if (m_vbp->index_list == NULL) {
479 memset(m_vbp->index_list, 0, m_vbp->ibo_size);
487 for (i = 0; i < n_verts; i++) {
504 array[arsize++] = nl->
xyz.x;
505 array[arsize++] = nl->
xyz.y;
506 array[arsize++] = nl->
xyz.z;
515 array[arsize++] = tsb->
scaler;
529 for (j = 0; j < vb->
tex_buf.size(); j++) {
539 memcpy(ibuf, index, n_verts *
sizeof(
uint));
543 for (i = 0; i < n_verts; i++) {
573 Assert( idx < (
int)GL_vertex_buffers.size() );
575 g_vbp = &GL_vertex_buffers[
idx];
588 Assert( idx < (
int)GL_vertex_buffers.size() );
598 if (--GL_vertex_buffers_in_use <= 0) {
599 GL_vertex_buffers.clear();
607 for (
uint i = 0;
i < GL_vertex_buffers.size();
i++) {
611 for (
uint i = 0;
i < GL_buffer_objects.size();
i++ ) {
615 GL_vertex_buffers.clear();
616 GL_vertex_buffers_in_use = 0;
710 dest->
base.
r = a->
base.
r * (1.0f - mix_factor) + b->
base.
r * mix_factor;
711 dest->
base.
g = a->
base.
g * (1.0f - mix_factor) + b->
base.
g * mix_factor;
712 dest->
base.
b = a->
base.
b * (1.0f - mix_factor) + b->
base.
b * mix_factor;
721 if ( colors == NULL ) {
725 Current_temp_color = *colors;
756 offset += (2 *
sizeof(
GLfloat));
761 offset += (3 *
sizeof(
GLfloat));
768 offset += (4 *
sizeof(
GLfloat));
773 offset += (1 *
sizeof(
GLfloat));
778 offset += (3 *
sizeof(
GLfloat));
783 #define DO_RENDER() \
784 if (Cmdline_drawelements) \
785 glDrawElements(GL_TRIANGLES, count, element_type, ibuffer + (datap->index_offset + start)); \
787 vglDrawRangeElements(GL_TRIANGLES, datap->i_first, datap->i_last, count, element_type, ibuffer + (datap->index_offset + start));
802 unsigned int shader_flags = 0;
804 int r,
g,
b,
a, tmap_type;
808 int count = (end - (start*3) + 1);
821 textured ?
true :
false,
836 if (shader_flags == GL_last_shader_flags) {
842 opengl_render_pipeline_fixed(start, bufferp, datap, flags);
846 GL_last_shader_index = sdr_index;
847 GL_last_shader_flags = shader_flags;
863 opengl_init_arrays(vbp, bufferp);
957 static void opengl_render_pipeline_fixed(
int start,
const vertex_buffer *bufferp,
const buffer_data *datap,
int flags)
959 float u_scale, v_scale;
961 int r,
g,
b,
a, tmap_type;
965 bool rendered_env =
false;
966 bool using_glow =
false;
967 bool using_spec =
false;
968 bool using_env =
false;
970 int end = (datap->
n_verts - 1);
971 int count = (end - start + 1);
1007 opengl_init_arrays(vbp, bufferp);
1024 #define BUFFER_OFFSET(off) (vbuffer+bufferp->vertex_offset+(off))
1194 if (GL_env_texture_matrix_set) {
1207 GLfloat ambient[4] = { 0.47f, 0.47f, 0.47f, 1.0f };
1232 if (GL_env_texture_matrix_set) {
1247 rendered_env =
true;
1330 Assert( GL_htl_projection_matrix_set );
1331 Assert( GL_htl_view_matrix_set );
1333 Verify( bufferp != NULL );
1346 opengl_render_pipeline_program(start, bufferp, datap, flags);
1348 opengl_render_pipeline_fixed(start, bufferp, datap, flags);
1361 float u_scale = 1.0f, v_scale = 1.0f;
1368 int vert_offset = 0;
1370 int pos_offset = -1;
1371 int tex_offset = -1;
1372 int radius_offset = -1;
1373 int color_offset = -1;
1379 pos_offset = vert_offset;
1380 vert_offset +=
sizeof(
vec3d);
1382 radius_offset = vert_offset;
1383 vert_offset +=
sizeof(
float);
1385 up_offset = vert_offset;
1387 vert_offset +=
sizeof(
vec3d);
1391 pos_offset = vert_offset;
1392 vert_offset +=
sizeof(
vec3d);
1394 tex_offset = vert_offset;
1395 vert_offset +=
sizeof(
uv_pair);
1397 radius_offset = vert_offset;
1398 vert_offset +=
sizeof(
float);
1400 color_offset = vert_offset;
1401 vert_offset +=
sizeof(
ubyte)*4;
1417 if ( radius_offset >= 0 ) {
1426 if ( radius_offset >= 0 ) {
1430 if ( up_offset >= 0 ) {
1440 if ( tex_offset >= 0 ) {
1466 if ( pos_offset >= 0 ) {
1488 Assert( GL_htl_projection_matrix_set );
1489 Assert( GL_htl_view_matrix_set );
1491 if (offset == NULL) {
1495 if (rotation == NULL) {
1508 if (
fl_abs(ang) > 0.0f) {
1514 GL_modelview_matrix_depth++;
1522 Assert(GL_htl_projection_matrix_set);
1523 Assert(GL_htl_view_matrix_set);
1536 Assert(GL_htl_projection_matrix_set);
1537 Assert(GL_htl_view_matrix_set);
1541 GL_modelview_matrix_depth--;
1565 clip_height = tan( (
double)fov * 0.5 ) * z_near;
1566 clip_width = clip_height * (
GLdouble)aspect;
1569 glFrustum( -clip_width, clip_width, clip_height, -clip_height, z_near, z_far );
1571 glFrustum( -clip_width, clip_width, -clip_height, clip_height, z_near, z_far );
1578 GL_htl_projection_matrix_set = 1;
1605 GL_htl_projection_matrix_set = 0;
1613 Assert(GL_htl_projection_matrix_set);
1614 Assert(GL_modelview_matrix_depth == 1);
1622 if ( !memcmp(pos, &last_view_pos,
sizeof(
vec3d)) && !memcmp(orient, &last_view_orient,
sizeof(
matrix)) ) {
1623 use_last_view =
true;
1625 memcpy(&last_view_pos, pos,
sizeof(
vec3d));
1626 memcpy(&last_view_orient, orient,
sizeof(
matrix));
1628 use_last_view =
false;
1631 if ( !use_last_view ) {
1650 GLdouble Sx = (fwdy * upz) - (fwdz * upy);
1651 GLdouble Sy = (fwdz * upx) - (fwdx * upz);
1652 GLdouble Sz = (fwdx * upy) - (fwdy * upx);
1655 mag = 1.0 / sqrt( (Sx*Sx) + (Sy*Sy) + (Sz*Sz) );
1662 GLdouble Ux = (Sy * fwdz) - (Sz * fwdy);
1663 GLdouble Uy = (Sz * fwdx) - (Sx * fwdz);
1664 GLdouble Uz = (Sx * fwdy) - (Sy * fwdx);
1667 mag = 1.0 / sqrt( (Ux*Ux) + (Uy*Uy) + (Uz*Uz) );
1674 memset( vmatrix, 0,
sizeof(vmatrix) );
1675 vmatrix[0] = Sx; vmatrix[1] = Ux; vmatrix[2] = -fwdx;
1676 vmatrix[4] = Sy; vmatrix[5] = Uy; vmatrix[6] = -fwdy;
1677 vmatrix[8] = Sz; vmatrix[9] = Uz; vmatrix[10] = -fwdz;
1688 GL_env_texture_matrix_set =
true;
1691 if ( !use_last_view ) {
1699 GL_env_texture_matrix[0] = mview[0];
1700 GL_env_texture_matrix[1] = mview[4];
1701 GL_env_texture_matrix[2] = mview[8];
1703 GL_env_texture_matrix[4] = mview[1];
1704 GL_env_texture_matrix[5] = mview[5];
1705 GL_env_texture_matrix[6] = mview[9];
1707 GL_env_texture_matrix[8] = mview[2];
1708 GL_env_texture_matrix[9] = mview[6];
1709 GL_env_texture_matrix[10] = mview[10];
1711 GL_env_texture_matrix[15] = 1.0f;
1717 GL_modelview_matrix_depth = 2;
1718 GL_htl_view_matrix_set = 1;
1726 Assert(GL_modelview_matrix_depth == 2);
1731 GL_modelview_matrix_depth = 1;
1732 GL_htl_view_matrix_set = 0;
1733 GL_env_texture_matrix_set =
false;
1745 if ( !GL_htl_projection_matrix_set ) {
1749 Assert( GL_htl_2d_matrix_set == 0 );
1750 Assert( GL_htl_2d_matrix_depth == 0 );
1774 GLint num_proj_stacks = 0;
1776 Assert( num_proj_stacks <= 2 );
1779 GL_htl_2d_matrix_set++;
1780 GL_htl_2d_matrix_depth++;
1789 if (!GL_htl_2d_matrix_set)
1792 Assert( GL_htl_2d_matrix_depth == 1 );
1804 GL_htl_2d_matrix_set = 0;
1805 GL_htl_2d_matrix_depth = 0;
1808 static bool GL_scale_matrix_set =
false;
1812 if ( (scale_factor->
xyz.x == 1) && (scale_factor->
xyz.y == 1) && (scale_factor->
xyz.z == 1) )
1815 GL_scale_matrix_set =
true;
1818 GL_modelview_matrix_depth++;
1825 if (!GL_scale_matrix_set)
1830 GL_modelview_matrix_depth--;
1831 GL_scale_matrix_set =
false;
1860 clip_equation[0] = (
GLdouble)G3_user_clip_normal.
xyz.x;
1861 clip_equation[1] = (
GLdouble)G3_user_clip_normal.
xyz.y;
1862 clip_equation[2] = (
GLdouble)G3_user_clip_normal.
xyz.z;
1864 clip_equation[3] = (
GLdouble)(G3_user_clip_normal.
xyz.x * G3_user_clip_point.
xyz.x)
1865 + (
GLdouble)(G3_user_clip_normal.
xyz.y * G3_user_clip_point.
xyz.y)
1866 + (
GLdouble)(G3_user_clip_normal.
xyz.z * G3_user_clip_point.
xyz.z);
1867 clip_equation[3] *= -1.0;
1896 Glowpoint_override =
true;
1898 GL_htl_projection_matrix_set = 1;
1924 GL_htl_projection_matrix_set = 0;
1932 float u_scale, v_scale;
1933 int render_pass = 0;
1959 memset( &model_matrix, 0,
sizeof(model_matrix) );
1961 model_matrix.
a1d[0] = Object_matrix.
vec.rvec.xyz.x; model_matrix.
a1d[4] = Object_matrix.
vec.uvec.xyz.x; model_matrix.
a1d[8] = Object_matrix.
vec.fvec.xyz.x;
1962 model_matrix.
a1d[1] = Object_matrix.
vec.rvec.xyz.y; model_matrix.
a1d[5] = Object_matrix.
vec.uvec.xyz.y; model_matrix.
a1d[9] = Object_matrix.
vec.fvec.xyz.y;
1963 model_matrix.
a1d[2] = Object_matrix.
vec.rvec.xyz.z; model_matrix.
a1d[6] = Object_matrix.
vec.uvec.xyz.z; model_matrix.
a1d[10] = Object_matrix.
vec.fvec.xyz.z;
1964 model_matrix.
a1d[12] = Object_position.
xyz.x;
1965 model_matrix.
a1d[13] = Object_position.
xyz.y;
1966 model_matrix.
a1d[14] = Object_position.
xyz.z;
1967 model_matrix.
a1d[15] = 1.0f;
1985 if ( flags & TMAP_FLAG_ALPHA ) {
2022 for (
int i = 0;
i < 16; ++
i ) {
2023 texture_mat.
a1d[
i] = GL_env_texture_matrix[
i];
2062 memset( &model_matrix, 0,
sizeof(model_matrix) );
2064 model_matrix.
a1d[0] = Object_matrix.
vec.rvec.xyz.x; model_matrix.
a1d[4] = Object_matrix.
vec.uvec.xyz.x; model_matrix.
a1d[8] = Object_matrix.
vec.fvec.xyz.x;
2065 model_matrix.
a1d[1] = Object_matrix.
vec.rvec.xyz.y; model_matrix.
a1d[5] = Object_matrix.
vec.uvec.xyz.y; model_matrix.
a1d[9] = Object_matrix.
vec.fvec.xyz.y;
2066 model_matrix.
a1d[2] = Object_matrix.
vec.rvec.xyz.z; model_matrix.
a1d[6] = Object_matrix.
vec.uvec.xyz.z; model_matrix.
a1d[10] = Object_matrix.
vec.fvec.xyz.z;
2067 model_matrix.
a1d[12] = Object_position.
xyz.x;
2068 model_matrix.
a1d[13] = Object_position.
xyz.y;
2069 model_matrix.
a1d[14] = Object_position.
xyz.z;
2070 model_matrix.
a1d[15] = 1.0f;
2098 if ( Scene_framebuffer_in_frame ) {
2126 stripe_color.
xyz.x = Current_team_color->
stripe.
r;
2127 stripe_color.
xyz.y = Current_team_color->
stripe.
g;
2128 stripe_color.
xyz.z = Current_team_color->
stripe.
b;
2130 base_color.
xyz.x = Current_team_color->
base.
r;
2131 base_color.
xyz.y = Current_team_color->
base.
g;
2132 base_color.
xyz.z = Current_team_color->
base.
b;
2151 uint sdr_effect_flags = 0;
2175 Assert(Scene_position_texture != 0);
2181 Assert(Scene_depth_texture != 0);
2217 Assert(Scene_depth_texture != 0);
WINGDIAPI void APIENTRY glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
struct team_color::@238 stripe
#define GL_COLOR_ATTACHMENT1_EXT
#define MAX_POLYGON_MODELS
#define vm_malloc_q(size)
#define TMAP_FLAG_POINTLIST
void SetWrapS(GLenum mode)
void vm_matrix_to_rot_axis_and_angle(const matrix *m, float *theta, vec3d *rot_axis)
#define gr_alpha_mask_set
#define MAX_SHADOW_CASCADES
#define TMAP_FLAG_SOFT_QUAD
#define GL_ELEMENT_ARRAY_BUFFER_ARB
WINGDIAPI void APIENTRY glDrawArrays(GLenum mode, GLint first, GLsizei count)
void gr_opengl_end_projection_matrix()
GLuint opengl_get_transform_buffer_texture()
#define vglFramebufferTextureEXT
matrix4 Shadow_view_matrix
#define gr_end_view_matrix
#define vglBindFramebufferEXT
WINGDIAPI void APIENTRY glMaterialfv(GLenum face, GLenum pname, const GLfloat *params)
void opengl_setup_render_states(int &r, int &g, int &b, int &alpha, int &tmap_type, int flags, int is_scaler)
#define SDR_FLAG_MODEL_CLIP
WINGDIAPI void APIENTRY glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
#define GL_TEXTURE_2D_ARRAY_EXT
matrix * vm_angles_2_matrix(matrix *m, const angles *a)
#define OGL_ARB_FLOATING_POINT_TEXTURES
void Color(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha=255)
GLint GL_max_elements_vertices
WINGDIAPI void APIENTRY glMatrixMode(GLenum mode)
void SetTexgenModeS(GLenum mode)
void mix_two_team_colors(team_color *dest, team_color *a, team_color *b, float mix_factor)
void gr_opengl_set_2d_matrix()
WINGDIAPI void APIENTRY glLoadIdentity(void)
WINGDIAPI void APIENTRY glClear(GLbitfield mask)
GLuint Shadow_map_texture
WINGDIAPI void APIENTRY glTexEnvf(GLenum target, GLenum pname, GLfloat param)
#define GL_DEPTH_COMPONENT32
void gr_opengl_end_clip_plane()
WINGDIAPI void APIENTRY glDeleteTextures(GLsizei n, const GLuint *textures)
#define SDR_FLAG_MODEL_DIFFUSE_MAP
void gr_opengl_set_thrust_scale(float scale)
#define GL_REFLECTION_MAP
int Cmdline_softparticles
void gr_opengl_set_lighting(bool set, bool state)
GLboolean TexgenR(GLint state=-1)
GLint GL_max_elements_indices
void gr_opengl_set_transform_buffer_offset(int offset)
struct vec3d::@225::@227 xyz
#define OGL_ARB_TEXTURE_BUFFER
void SetTexgenModeR(GLenum mode)
#define OGL_ARB_DRAW_ELEMENTS_BASE_VERTEX
void BindElementBuffer(GLuint id)
bool gr_opengl_config_buffer(const int buffer_id, vertex_buffer *vb, bool update_ibuffer_only)
#define TMAP_FLAG_VERTEX_GEN
void gr_opengl_deferred_light_cylinder_init(int segments)
bool Rendering_to_shadow_map
#define GL_OPERAND0_RGB_ARB
GLuint Scene_depth_texture
#define TMAP_FLAG_QUADSTRIP
opengl_texture_state Texture
void gr_opengl_shadow_map_end()
void EnableClientTexture()
GLboolean CullFace(GLint state=-1)
int Transform_buffer_handle
bool Scene_framebuffer_in_frame
void DisableClientVertex()
void gr_opengl_deferred_light_sphere_init(int rings, int segments)
void SetAlphaScale(GLfloat scale)
GLenum GLenum GLenum GLenum GLenum scale
#define GL_SOURCE1_RGB_ARB
bool bm_has_alpha_channel(int handle)
Checks to see if the indexed bitmap has an alpha channel.
int Interp_multitex_cloakmap
int gr_opengl_create_buffer()
#define GL_PROJECTION_STACK_DEPTH
#define TMAP_FLAG_DISTORTION
WINGDIAPI void APIENTRY glClipPlane(GLenum plane, const GLdouble *equation)
#define GL_TEXTURE_WRAP_S
void gr_opengl_end_instance_matrix()
#define GL_FRAMEBUFFER_BINDING_EXT
void opengl_delete_buffer_object(int handle)
#define TMAP_ANIMATED_SHADER
WINGDIAPI void APIENTRY glPopMatrix(void)
#define SDR_FLAG_PARTICLE_POINT_GEN
int GLOWMAP
References a map that is a fully lit version of its index -Bobboau.
void DisableClientNormal()
WINGDIAPI void APIENTRY glLoadMatrixf(const GLfloat *m)
#define SDR_FLAG_MODEL_MISC_MAP
int Interp_thrust_scale_subobj
SCP_vector< buffer_data > tex_buf
#define GL_DEPTH_ATTACHMENT_EXT
#define gr_set_view_matrix
#define GL_STREAM_DRAW_ARB
WINGDIAPI void APIENTRY glGetMaterialfv(GLenum face, GLenum pname, GLfloat *params)
#define GL_UNIFORM_BUFFER
void opengl_tnl_set_material_soft_particle(uint flags)
#define SDR_FLAG_MODEL_SPEC_MAP
void gr_opengl_render_stream_buffer(int buffer_handle, int offset, int n_verts, int flags)
void vm_vec_add2(vec3d *dest, const vec3d *src)
GLboolean DepthMask(GLint state=-1)
GLdouble GLdouble GLdouble r
#define vglDrawElementsInstancedBaseVertex
struct matrix::@228::@230 vec
void add_vertex_component(vertex_format_data::vertex_format format_type, uint stride, void *src)
void gr_opengl_render_buffer(int start, const vertex_buffer *bufferp, int texi, int flags)
#define TMAP_FLAG_GOURAUD
#define vglDeleteBuffersARB
void gr_opengl_update_buffer_object(int handle, uint size, void *data)
GLboolean GLboolean GLboolean GLboolean a
#define VB_FLAG_LARGE_INDEX
#define SDR_FLAG_MODEL_SHADOW_MAP
int MISCMAP
Utility map, to be utilized for various things shader authors can come up with.
bool GL_rendering_to_texture
int NORMMAP
Normal mapping.
void gr_opengl_set_center_alpha(int type)
#define GL_FRAMEBUFFER_EXT
void gr_opengl_destroy_buffer(int idx)
WINGDIAPI void APIENTRY glGenTextures(GLsizei n, GLuint *textures)
#define TCACHE_TYPE_CUBEMAP
WINGDIAPI void APIENTRY glPushAttrib(GLbitfield mask)
void SetAlphaBlendMode(gr_alpha_blend ab)
team_color Current_temp_color
#define vglDrawRangeElements
#define GL_SOURCE0_RGB_ARB
void gr_opengl_set_buffer(int idx)
int GL_transform_buffer_offset
#define TMAP_FLAG_DESATURATE
#define TMAP_FLAG_BATCH_TRANSFORMS
#define vglDrawElementsBaseVertex
WINGDIAPI void APIENTRY glTranslated(GLdouble x, GLdouble y, GLdouble z)
#define SDR_FLAG_MODEL_NORMAL_MAP
GLuint Scene_position_texture
unsigned int GL_last_shader_flags
void gr_opengl_push_scale_matrix(const vec3d *scale_factor)
#define GL_DYNAMIC_DRAW_ARB
float Shadow_cascade_distances[MAX_SHADOW_CASCADES]
void gr_opengl_end_view_matrix()
#define GL_TEXTURE_WRAP_R
#define GL_CHECK_FOR_ERRORS(s)
#define GL_OPERAND1_RGB_ARB
void gr_opengl_set_projection_matrix(float fov, float aspect, float z_near, float z_far)
void TexPointer(GLint size, GLenum type, GLsizei stride, GLvoid *pointer)
#define GL_TEXTURE_MAG_FILTER
opengl_uniform_state Uniform
vec3d * vm_vec_unrotate(vec3d *dest, const vec3d *src, const matrix *m)
void gr_opengl_end_2d_matrix()
#define Is_Extension_Enabled(x)
void SetTarget(GLenum tex_target)
WINGDIAPI void APIENTRY glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
int Cmdline_shadow_quality
int Cmdline_no_deferred_lighting
GLboolean Normalize(GLint state=-1)
void gr_opengl_pop_scale_matrix()
#define vglDrawRangeElementsBaseVertex
void Enable(GLuint tex_id=0)
WINGDIAPI void APIENTRY glDrawBuffer(GLenum mode)
WINGDIAPI void APIENTRY glPopAttrib(void)
#define TMAP_FLAG_LINESTRIP
matrix4 Shadow_proj_matrix[MAX_SHADOW_CASCADES]
WINGDIAPI void APIENTRY glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
WINGDIAPI void APIENTRY glGetIntegerv(GLenum pname, GLint *params)
WINGDIAPI void APIENTRY glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
void SetWrapR(GLenum mode)
int Interp_cloakmap_alpha
WINGDIAPI void APIENTRY glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
void opengl_tnl_set_material_distortion(uint flags)
float opengl_shader_get_animated_timer()
#define SDR_FLAG_MODEL_TEAMCOLOR
GLboolean TexgenT(GLint state=-1)
#define GL_UNSIGNED_INT_8_8_8_8_REV
#define GL_STATIC_DRAW_ARB
#define SDR_FLAG_MODEL_GLOW_MAP
void BindArrayBuffer(GLuint id)
WINGDIAPI void APIENTRY glLoadMatrixd(const GLdouble *m)
void gr_opengl_set_team_color(const team_color *colors)
#define GL_MODELVIEW_MATRIX
GLboolean GLboolean GLboolean b
#define SDR_FLAG_MODEL_ENV_MAP
void SetWrapT(GLenum mode)
void opengl_set_additive_tex_env()
#define TMAP_FLAG_TRILIST
typedef float(SCP_EXT_CALLCONV *SCPTRACKIR_PFFLOATVOID)()
GLboolean ClipPlane(GLint num, GLint state=-1)
#define GL_TEXTURE_WRAP_T
WINGDIAPI void APIENTRY glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
WINGDIAPI void APIENTRY glGetFloatv(GLenum pname, GLfloat *params)
#define GL_ARRAY_BUFFER_ARB
struct team_color::@237 base
int gr_opengl_maybe_create_shader(shader_type shader_t, unsigned int flags)
GLboolean Fog(GLint state=-1)
#define SDR_FLAG_MODEL_HEIGHT_MAP
const uint * get_index() const
#define vglGenFramebuffersEXT
WINGDIAPI void APIENTRY glPushMatrix(void)
bool gr_opengl_pack_buffer(const int buffer_id, vertex_buffer *vb)
int opengl_shader_get_animated_effect()
#define GL_TEXTURE_MIN_FILTER
GLsizeiptr const GLvoid GLenum usage
void opengl_set_texture_target(GLenum target)
int opengl_create_texture_buffer_object()
void DisableClientTexture()
GLuint Scene_effect_texture
#define SDR_FLAG_MODEL_SHADOWS
GLenum GLsizei GLenum GLenum const GLvoid * data
#define TMAP_FLAG_TEXTURED
uint gr_determine_model_shader_flags(bool lighting, bool fog, bool textured, bool in_shadow_map, bool thruster_scale, bool transform, bool team_color_set, int tmap_flags, int spec_map, int glow_map, int normal_map, int height_map, int env_map, int misc_map)
void gr_opengl_shadow_map_start(const matrix4 *shadow_view_matrix, const matrix *light_orient)
void opengl_bind_buffer_object(int handle)
void SetRGBScale(GLfloat scale)
WINGDIAPI void APIENTRY glBindTexture(GLenum target, GLuint texture)
void gr_opengl_start_instance_matrix(const vec3d *offset, const matrix *rotation)
struct effect_vertex effect_vertex
GLuint Shadow_map_depth_texture
int gr_opengl_create_stream_buffer_object()
void SetShaderMode(GLboolean mode)
int ENVMAP
References a map that is for environment mapping -Bobboau.
#define TMAP_FLAG_TRISTRIP
void SetActiveClientUnit(GLuint id)
GLenum DepthFunc(GLenum new_val=GL_INVALID_ENUM)
WINGDIAPI void APIENTRY glScalef(GLfloat x, GLfloat y, GLfloat z)
void BindTextureBuffer(GLuint id)
int gr_opengl_tcache_set(int bitmap_handle, int bitmap_type, float *u_scale, float *v_scale, int stage)
WINGDIAPI void APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param)
#define SDR_FLAG_MODEL_ANIMATED
#define GL_DEPTH_COMPONENT
void opengl_destroy_all_buffers()
bool is_minimum_GLSL_version()
#define GL_UNSIGNED_SHORT
void BindUniformBuffer(GLuint id)
GLboolean TexgenS(GLint state=-1)
bool Glowpoint_override_save
void gr_opengl_start_clip_plane()
void gr_opengl_set_view_matrix(const vec3d *pos, const matrix *orient)
void SetTexgenModeT(GLenum mode)
void gr_opengl_update_transform_buffer(void *data, uint size)
#define TMAP_FLAG_DISTORTION_THRUSTER
void opengl_shader_set_current(opengl_shader_t *shader_obj)
void opengl_default_light_settings(int ambient, int emission, int specular)
WINGDIAPI void APIENTRY glTranslatef(GLfloat x, GLfloat y, GLfloat z)
float Interp_thrust_scale
#define BUFFER_OFFSET(off)
#define SDR_FLAG_MODEL_TRANSFORM
GLclampf GLclampf GLclampf alpha
#define TMAP_FLAG_QUADLIST
vec3d G3_user_clip_normal
void opengl_tnl_shutdown()
team_color * Current_team_color
#define GL_COLOR_BUFFER_BIT
GLenum FrontFaceValue(GLenum new_val=GL_INVALID_ENUM)
int opengl_create_buffer_object(GLenum type, GLenum usage)
#define GL_TEXTURE_BUFFER_ARB
#define SDR_FLAG_MODEL_THRUSTER
void opengl_bind_vertex_layout(vertex_layout &layout)
WINGDIAPI GLenum APIENTRY glGetError(void)
void opengl_tnl_set_material(int flags, uint shader_flags, int tmap_type)
matrix vmd_identity_matrix
void gr_opengl_start_instance_angles(const vec3d *pos, const angles *rotation)
void SetActiveUnit(GLuint id=0)
#define GL_COLOR_ATTACHMENT0_EXT
int HEIGHTMAP
Height map for normal mapping.
int opengl_check_for_errors(char *err_at)
int SPECMAP
References a map that is for specular mapping -Bobboau.
#define GL_DEPTH_BUFFER_BIT
GLuint Framebuffer_fallback_texture_id
float vm_vec_normalize(vec3d *v)
GLuint Distortion_texture[2]
#define GL_TRIANGLE_STRIP
void SetEnvCombineMode(GLenum cmode, GLenum cfunc)