LibGame v0.4.0
The LG Game Engine - Copyright (C) 2024-2026 ETMSoftware
Loading...
Searching...
No Matches
lg_mesh_lines.h
1/*
2 * LibGame - Copyright (C) Emmanuel Thomas-Maurin 2011-2026
3 * All rights reserved
4 */
5
6#ifndef LG_MESH_LINES_H
7#define LG_MESH_LINES_H
8
9#define MESHLINE_N_SEG_MAX 1024
10
11/*
12 * Hexagon-based mesh line
13 *
14 * base
15 *
16 * x x (i = 1)
17 * x x (i = 0)
18 * x x
19 *
20 * n_seg = 2
21 *
22 * x x
23 * x/ / x
24 * /x x /
25 * x/ / x
26 * /x x /
27 * x x
28 * x x
29 *
30 * n_seg = 3
31 *
32 * x x----x----x----x
33 * x x----x----x----x
34 * x x----x----x----x
35 *
36 */
37typedef struct {
38 /* Unused - useful ?
39 vec3_t v1;
40 vec3_t v2;
41 */
42 uint32_t n_seg;
43 float line_width;
44 LG_Color_u c1; /* Color of odd segments */
45 LG_Color_u c2; /* Color of even segments */
46 Vertex_rgba *vbo_data;
47 uint32_t vbo_size;
48 LG_VAO vao;
49 LG_VBO vbo;
50 LG_ShaderProg shader;
52
53typedef struct {
54 LG_MeshLine meshline;
55 /* Unused - useful ?
56 uint16_t half_grid_width;
57 float scaling;
58 */
59 LG_Color_u color;
60 vec3_t *v3_grid;
61 int n_vertices;
63
65
67
69
71
72LG_MeshLine_Grid lg_meshline_grid_new(uint16_t, float, LG_Color_u, uint32_t, float, zboolean *);
73
75
77
78#endif /* LG_MESH_LINES_H */
LG_MeshLine_Grid lg_meshline_grid_new(uint16_t half_grid_width, float scaling, LG_Color_u c, uint32_t n_seg, float line_width, zboolean *is_ok)
Definition lg_mesh_lines.c:347
int lg_meshline_set_data(LG_MeshLine *mesh_line, vec3_t v1, vec3_t v2, LG_Color_u c1, LG_Color_u c2)
Definition lg_mesh_lines.c:207
void lg_meshline_free(LG_MeshLine *mesh_line)
Definition lg_mesh_lines.c:271
void lg_meshline_grid_free(LG_MeshLine_Grid *m_grid)
Definition lg_mesh_lines.c:387
int lg_meshline_render(LG_MeshLine *mesh_line, mat4_t *model_view_proj_m)
Definition lg_mesh_lines.c:248
int lg_meshline_grid_render(LG_MeshLine_Grid *m_grid, mat4_t *model_view_proj_m)
Definition lg_mesh_lines.c:370
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)
Definition lg_mesh_lines.c:102
Definition lg_vertex.h:111
Definition lg_mesh_lines.h:53
Definition lg_mesh_lines.h:37
Definition lg_shader_progs.h:11
Definition lg_vbo.h:52
Definition lg_vbo.h:16
Definition lg_vertex.h:80
Definition math_3d.c:135
Definition math_3d.c:239