![]() |
LibGame v0.4.0
The LG Game Engine - Copyright (C) 2024-2026 ETMSoftware
|
Functions | |
| static void | build_base_hexagon (vec3_t *hexagon2, vec3_t v1, vec3_t v2, float line_width) |
| LG_MeshLine | lg_meshline_new (vec3_t v1, vec3_t v2, int n_seg, float line_width, LG_Color_u c1, LG_Color_u c2, zboolean *is_ok) |
| int | lg_meshline_set_data (LG_MeshLine *mesh_line, vec3_t v1, vec3_t v2, LG_Color_u c1, LG_Color_u c2) |
| int | lg_meshline_render (LG_MeshLine *mesh_line, mat4_t *model_view_proj_m) |
| void | lg_meshline_free (LG_MeshLine *mesh_line) |
=== Trying to find a better alternative to glDrawArrays(GL_LINES) ===
| LG_MeshLine lg_meshline_new | ( | vec3_t | v1, |
| vec3_t | v2, | ||
| int | n_seg, | ||
| float | line_width, | ||
| LG_Color_u | c1, | ||
| LG_Color_u | c2, | ||
| zboolean * | is_ok | ||
| ) |
Create and return a new LG_MeshLine, ie a hexagon-based mesh line, and initialize its renderer (VAO and shader prog)
base
x x (i = 1)
x x (i = 0)
x x
n_seg = 2
x x
/ / x
x x /
/ / x
x x /
x x
x x
You can/should check the value of is_ok
No GL error checking is performed
| v1 | |
| v2 | |
| n_seg | |
| line_width | |
| c1 | Color of odd segments |
| c2 | Color of even segments |
| is_ok |
| int lg_meshline_set_data | ( | LG_MeshLine * | mesh_line, |
| vec3_t | v1, | ||
| vec3_t | v2, | ||
| LG_Color_u | c1, | ||
| LG_Color_u | c2 | ||
| ) |
Set vbo_data of an already created LG_MeshLine from v1, v2, c1, and c2
| v1 | |
| v2 | |
| c1 | Color of odd segments |
| c2 | Color of even segments |
| int lg_meshline_render | ( | LG_MeshLine * | mesh_line, |
| mat4_t * | model_view_proj_m | ||
| ) |
Render a LG_MeshLine
| mesh_line | Pointer to a LG_MeshLine |
| model_view_proj_m | Pointer to a mat4_t transform matrix |
| void lg_meshline_free | ( | LG_MeshLine * | mesh_line | ) |
Free a LG_MeshLine renderer resources (VAO, VBO, shader prog, and vbo_data)
| mesh_line | Pointer to a LG_MeshLine |