LibGame
v0.4.0
The LG Game Engine - Copyright (C) 2024 ETMSoftware
|
Functions | |
int | lg_mesh_to_drawelements_cmd (LG_Mesh *mesh, int u_tex, LG_DrawElements_Cmd *draw_params) |
void | lg_draw_elements (LG_DrawElements_Cmd *draw_params) |
void | lg_drawelements_info (LG_DrawElements_Cmd *draw_params) |
=== Structs and wrapper funcs to efficiently draw mesh data === - Set textures and params to be used by glDrawElements() - Make batch calls to glDrawElements() LG_DrawElements_Cmd = glDrawElements() command
int lg_mesh_to_drawelements_cmd | ( | LG_Mesh * | mesh, |
int | u_tex, | ||
LG_DrawElements_Cmd * | draw_params | ||
) |
Here we use:
to compute size and shift
LG_N_MAX_DRAWS = N_MAX_MAT_PER_OBJ
mesh | Pointer to a LG_Mesh struct |
u_tex | Texture coords uniform to be used by glUniform1i() |
draw_params | Pointer to a LG_DrawElements_Cmd struct |
void lg_draw_elements | ( | LG_DrawElements_Cmd * | draw_params | ) |
Call glDrawElements(GL_TRIANGLES, size[i], GL_UNSIGNED_INT, shift[i]) n_draws times
draw_params | Pointer to a LG_DrawElements_Cmd struct |
void lg_drawelements_info | ( | LG_DrawElements_Cmd * | draw_params | ) |
Print out LG_DrawElements_Cmd info
draw_params | Pointer to a LG_DrawElements_Cmd struct |