Open source remastering of the Freespace 2 engine
gropengltnl.cpp File Reference

Go to the source code of this file.


struct  opengl_buffer_object
struct  opengl_vertex_buffer


#define DO_RENDER()
#define BUFFER_OFFSET(off)   (vbuffer+bufferp->vertex_offset+(off))


int opengl_create_buffer_object (GLenum type, GLenum usage)
void opengl_bind_buffer_object (int handle)
void gr_opengl_update_buffer_object (int handle, uint size, void *data)
void opengl_delete_buffer_object (int handle)
int gr_opengl_create_stream_buffer_object ()
int opengl_create_texture_buffer_object ()
void gr_opengl_update_transform_buffer (void *data, uint size)
GLuint opengl_get_transform_buffer_texture ()
void gr_opengl_set_transform_buffer_offset (int offset)
int gr_opengl_create_buffer ()
bool gr_opengl_config_buffer (const int buffer_id, vertex_buffer *vb, bool update_ibuffer_only)
bool gr_opengl_pack_buffer (const int buffer_id, vertex_buffer *vb)
void gr_opengl_set_buffer (int idx)
void gr_opengl_destroy_buffer (int idx)
void opengl_destroy_all_buffers ()
void opengl_tnl_init ()
void opengl_tnl_shutdown ()
void mix_two_team_colors (team_color *dest, team_color *a, team_color *b, float mix_factor)
void gr_opengl_set_team_color (const team_color *colors)
void gr_opengl_set_thrust_scale (float scale)
void gr_opengl_render_buffer (int start, const vertex_buffer *bufferp, int texi, int flags)
void gr_opengl_render_stream_buffer (int buffer_handle, int offset, int n_verts, int flags)
void gr_opengl_start_instance_matrix (const vec3d *offset, const matrix *rotation)
void gr_opengl_start_instance_angles (const vec3d *pos, const angles *rotation)
void gr_opengl_end_instance_matrix ()
void gr_opengl_set_projection_matrix (float fov, float aspect, float z_near, float z_far)
void gr_opengl_end_projection_matrix ()
void gr_opengl_set_view_matrix (const vec3d *pos, const matrix *orient)
void gr_opengl_end_view_matrix ()
void gr_opengl_set_2d_matrix ()
void gr_opengl_end_2d_matrix ()
void gr_opengl_push_scale_matrix (const vec3d *scale_factor)
void gr_opengl_pop_scale_matrix ()
void gr_opengl_end_clip_plane ()
void gr_opengl_start_clip_plane ()
void gr_opengl_shadow_map_start (const matrix4 *shadow_view_matrix, const matrix *light_orient)
void gr_opengl_shadow_map_end ()
void opengl_tnl_set_material (int flags, uint shader_flags, int tmap_type)
void opengl_tnl_set_material_soft_particle (uint flags)
void opengl_tnl_set_material_distortion (uint flags)


 References a map that is a fully lit version of its index -Bobboau. More...
 References a map that is for specular mapping -Bobboau. More...
 Normal mapping. More...
 Utility map, to be utilized for various things shader authors can come up with. More...
 Height map for normal mapping. More...
int G3_user_clip
vec3d G3_user_clip_normal
vec3d G3_user_clip_point
int Interp_multitex_cloakmap
int Interp_cloakmap_alpha
bool Basemap_override
bool Envmap_override
bool Specmap_override
bool Normalmap_override
bool Heightmap_override
bool GLSL_override
bool Shadow_override
vec3d shadow_ref_point
int GL_vertex_data_in = 0
GLint GL_max_elements_vertices = 4096
GLint GL_max_elements_indices = 4096
float GL_thrust_scale = -1.0f
team_color Current_temp_color
bool Using_Team_Color = false
int GL_transform_buffer_offset = -1
GLuint Shadow_map_texture = 0
GLuint Shadow_map_depth_texture = 0
GLuint shadow_fbo = 0
GLint saved_fb = 0
bool Rendering_to_shadow_map = false
int Transform_buffer_handle = -1
unsigned int GL_last_shader_flags = 0
int GL_last_shader_index = -1
bool Scene_framebuffer_in_frame
GLuint Framebuffer_fallback_texture_id
matrix Object_matrix
vec3d Object_position
int Interp_thrust_scale_subobj
float Interp_thrust_scale
GLuint Scene_depth_texture
GLuint Scene_position_texture
GLuint Distortion_texture [2]
int Distortion_switch
bool Glowpoint_override
bool Glowpoint_override_save

Macro Definition Documentation

#define BUFFER_OFFSET (   off)    (vbuffer+bufferp->vertex_offset+(off))
#define DO_RENDER ( )
glDrawElements(GL_TRIANGLES, count, element_type, ibuffer + (datap->index_offset + start)); \
vglDrawRangeElements(GL_TRIANGLES, datap->i_first, datap->i_last, count, element_type, ibuffer + (datap->index_offset + start));
Definition: Gl.h:109
#define vglDrawRangeElements
GLuint start
Definition: Gl.h:1502
int Cmdline_drawelements
Definition: cmdline.cpp:448
WINGDIAPI void APIENTRY glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
GLint GLsizei count
Definition: Gl.h:1491

Definition at line 783 of file gropengltnl.cpp.

Function Documentation

bool gr_opengl_config_buffer ( const int  buffer_id,
vertex_buffer vb,
bool  update_ibuffer_only 

Definition at line 357 of file gropengltnl.cpp.

int gr_opengl_create_buffer ( )

Definition at line 343 of file gropengltnl.cpp.

int gr_opengl_create_stream_buffer_object ( )

Definition at line 218 of file gropengltnl.cpp.

void gr_opengl_destroy_buffer ( int  idx)

Definition at line 578 of file gropengltnl.cpp.

void gr_opengl_end_2d_matrix ( )

Definition at line 1784 of file gropengltnl.cpp.

void gr_opengl_end_clip_plane ( )

Definition at line 1834 of file gropengltnl.cpp.

void gr_opengl_end_instance_matrix ( )

Definition at line 1531 of file gropengltnl.cpp.

void gr_opengl_end_projection_matrix ( )

Definition at line 1581 of file gropengltnl.cpp.

void gr_opengl_end_view_matrix ( )

Definition at line 1721 of file gropengltnl.cpp.

bool gr_opengl_pack_buffer ( const int  buffer_id,
vertex_buffer vb 

Definition at line 434 of file gropengltnl.cpp.

void gr_opengl_pop_scale_matrix ( )

Definition at line 1823 of file gropengltnl.cpp.

void gr_opengl_push_scale_matrix ( const vec3d scale_factor)

Definition at line 1810 of file gropengltnl.cpp.

void gr_opengl_render_buffer ( int  start,
const vertex_buffer bufferp,
int  texi,
int  flags 

Definition at line 1328 of file gropengltnl.cpp.

void gr_opengl_render_stream_buffer ( int  buffer_handle,
int  offset,
int  n_verts,
int  flags 

Definition at line 1358 of file gropengltnl.cpp.

void gr_opengl_set_2d_matrix ( )

Definition at line 1738 of file gropengltnl.cpp.

void gr_opengl_set_buffer ( int  idx)

Definition at line 552 of file gropengltnl.cpp.

void gr_opengl_set_projection_matrix ( float  fov,
float  aspect,
float  z_near,
float  z_far 

Definition at line 1545 of file gropengltnl.cpp.

void gr_opengl_set_team_color ( const team_color colors)

Definition at line 719 of file gropengltnl.cpp.

void gr_opengl_set_thrust_scale ( float  scale)

Definition at line 730 of file gropengltnl.cpp.

void gr_opengl_set_transform_buffer_offset ( int  offset)

Definition at line 273 of file gropengltnl.cpp.

void gr_opengl_set_view_matrix ( const vec3d pos,
const matrix orient 

Definition at line 1608 of file gropengltnl.cpp.

void gr_opengl_shadow_map_end ( )

Definition at line 1907 of file gropengltnl.cpp.

void gr_opengl_shadow_map_start ( const matrix4 shadow_view_matrix,
const matrix light_orient 

Definition at line 1877 of file gropengltnl.cpp.

void gr_opengl_start_clip_plane ( )

Definition at line 1847 of file gropengltnl.cpp.

void gr_opengl_start_instance_angles ( const vec3d pos,
const angles rotation 

Definition at line 1517 of file gropengltnl.cpp.

void gr_opengl_start_instance_matrix ( const vec3d offset,
const matrix rotation 

Definition at line 1482 of file gropengltnl.cpp.

void gr_opengl_update_buffer_object ( int  handle,
uint  size,
void data 

Definition at line 186 of file gropengltnl.cpp.

void gr_opengl_update_transform_buffer ( void data,
uint  size 

Definition at line 255 of file gropengltnl.cpp.

void mix_two_team_colors ( team_color dest,
team_color a,
team_color b,
float  mix_factor 

Definition at line 709 of file gropengltnl.cpp.

void opengl_bind_buffer_object ( int  handle)

Definition at line 159 of file gropengltnl.cpp.

int opengl_create_buffer_object ( GLenum  type,
GLenum  usage 

Definition at line 144 of file gropengltnl.cpp.

int opengl_create_texture_buffer_object ( )

Definition at line 227 of file gropengltnl.cpp.

void opengl_delete_buffer_object ( int  handle)

Definition at line 202 of file gropengltnl.cpp.

void opengl_destroy_all_buffers ( )

Definition at line 605 of file gropengltnl.cpp.

GLuint opengl_get_transform_buffer_texture ( )

Definition at line 264 of file gropengltnl.cpp.

void opengl_tnl_init ( )

Definition at line 619 of file gropengltnl.cpp.

void opengl_tnl_set_material ( int  flags,
uint  shader_flags,
int  tmap_type 

Definition at line 1930 of file gropengltnl.cpp.

void opengl_tnl_set_material_distortion ( uint  flags)

Definition at line 2189 of file gropengltnl.cpp.

void opengl_tnl_set_material_soft_particle ( uint  flags)

Definition at line 2149 of file gropengltnl.cpp.

void opengl_tnl_shutdown ( )

Definition at line 694 of file gropengltnl.cpp.

Variable Documentation

bool Basemap_override

Definition at line 70 of file systemvars.cpp.


Called in game_shutdown() to free malloced memory

NOTE: do not call this function. It is only called from game_shutdown()

Definition at line 14145 of file ship.cpp.

team_color* Current_team_color

Definition at line 78 of file gropengltnl.cpp.

team_color Current_temp_color

Definition at line 79 of file gropengltnl.cpp.

int Distortion_switch

Definition at line 47 of file gropengldraw.cpp.

GLuint Distortion_texture[2]

Definition at line 46 of file gropengldraw.cpp.

bool Envmap_override

Definition at line 71 of file systemvars.cpp.

GLuint Framebuffer_fallback_texture_id

Definition at line 32 of file gropenglshader.cpp.

int G3_user_clip

Definition at line 360 of file 3dsetup.cpp.

vec3d G3_user_clip_normal

Definition at line 361 of file 3dsetup.cpp.

vec3d G3_user_clip_point

Definition at line 362 of file 3dsetup.cpp.

unsigned int GL_last_shader_flags = 0

Definition at line 789 of file gropengltnl.cpp.

int GL_last_shader_index = -1

Definition at line 790 of file gropengltnl.cpp.

GLint GL_max_elements_indices = 4096

Definition at line 75 of file gropengltnl.cpp.

GLint GL_max_elements_vertices = 4096

Definition at line 74 of file gropengltnl.cpp.

float GL_thrust_scale = -1.0f

Definition at line 77 of file gropengltnl.cpp.

int GL_transform_buffer_offset = -1

Definition at line 82 of file gropengltnl.cpp.

int GL_vertex_data_in = 0

Definition at line 72 of file gropengltnl.cpp.


References a map that is a fully lit version of its index -Bobboau.

Definition at line 57 of file bmpman.cpp.

bool Glowpoint_override

Definition at line 75 of file systemvars.cpp.

bool Glowpoint_override_save

Definition at line 1875 of file gropengltnl.cpp.

bool GLSL_override

Definition at line 77 of file systemvars.cpp.


Height map for normal mapping.

Definition at line 61 of file bmpman.cpp.

bool Heightmap_override

Definition at line 74 of file systemvars.cpp.

int Interp_cloakmap_alpha

Definition at line 210 of file modelinterp.cpp.

int Interp_multitex_cloakmap

Definition at line 209 of file modelinterp.cpp.

float Interp_thrust_scale

Definition at line 161 of file modelinterp.cpp.

int Interp_thrust_scale_subobj

Definition at line 160 of file modelinterp.cpp.


Utility map, to be utilized for various things shader authors can come up with.

Definition at line 62 of file bmpman.cpp.

bool Normalmap_override

Definition at line 73 of file systemvars.cpp.


Normal mapping.

Definition at line 60 of file bmpman.cpp.

matrix Object_matrix

Definition at line 43 of file 3dsetup.cpp.

vec3d Object_position

Definition at line 42 of file 3dsetup.cpp.

bool Rendering_to_shadow_map = false

Definition at line 88 of file gropengltnl.cpp.

GLint saved_fb = 0

Definition at line 87 of file gropengltnl.cpp.

GLuint Scene_depth_texture

Definition at line 41 of file gropengldraw.cpp.

bool Scene_framebuffer_in_frame

Definition at line 50 of file gropengldraw.cpp.

GLuint Scene_position_texture

Definition at line 36 of file gropengldraw.cpp.

GLuint shadow_fbo = 0

Definition at line 86 of file gropengltnl.cpp.

GLuint Shadow_map_depth_texture = 0

Definition at line 85 of file gropengltnl.cpp.

GLuint Shadow_map_texture = 0

Definition at line 84 of file gropengltnl.cpp.

bool Shadow_override

Definition at line 80 of file systemvars.cpp.

vec3d shadow_ref_point

Definition at line 68 of file gropengltnl.cpp.


References a map that is for specular mapping -Bobboau.

Definition at line 58 of file bmpman.cpp.

bool Specmap_override

Definition at line 72 of file systemvars.cpp.

int Transform_buffer_handle = -1

Definition at line 90 of file gropengltnl.cpp.

bool Using_Team_Color = false

Definition at line 80 of file gropengltnl.cpp.