LibGame  v0.4.0
The LG Game Engine - Copyright (C) 2024 ETMSoftware
lg_vbo.h
1 /*
2  * LibGame - Copyright (C) Emmanuel Thomas-Maurin 2011-2024
3  * All rights reserved
4  */
5 
6 #ifndef LG_VBO_H
7 #define LG_VBO_H
8 
9 #define LG_INVALID_BUF_OBJ_ID 500000
10 
11 // VBO = Vertex Buffer Object / IBO = Index Buffer Object / VAO = Vertex Array Object
12 
13 /*
14  * === VBO ===
15  */
16 typedef struct {
17  unsigned int id;
18  unsigned int size;
19 } LG_VBO;
20 
21 LG_VBO LG_VBO_new(const void *, unsigned int);
22 
23 int LG_VBO_set_data(LG_VBO *, const void *);
24 
25 void LG_VBO_free(LG_VBO *);
26 
27 void LG_VBO_bind(LG_VBO *);
28 
29 void LG_VBO_unbind();
30 
31 /*
32  * === IBO ===
33  */
34 typedef struct {
35  unsigned int id;
36  unsigned int size;
37 } LG_IBO;
38 
39 LG_IBO LG_IBO_new(const void *, unsigned int);
40 
41 int LG_IBO_set_data(LG_IBO *, const void *);
42 
43 void LG_IBO_free(LG_IBO *);
44 
45 void LG_IBO_bind(LG_IBO *);
46 
47 void LG_IBO_unbind();
48 
49 /*
50  * === VAO ===
51  */
52 typedef struct {
53  unsigned int id;
54 } LG_VAO;
55 
57 
58 void LG_VAO_free(LG_VAO *);
59 
60 void LG_VAO_bind(LG_VAO *, zboolean);
61 
62 void LG_VAO_unbind();
63 
64 #endif /* LG_VBO_H */
LG_IBO_free
void LG_IBO_free(LG_IBO *ibo)
Definition: lg_vbo.c:203
LG_VAO_bind
void LG_VAO_bind(LG_VAO *vao, zboolean gl_checking)
Definition: lg_vbo.c:303
LG_IBO_bind
void LG_IBO_bind(LG_IBO *ibo)
Definition: lg_vbo.c:218
LG_VAO_unbind
void LG_VAO_unbind()
Definition: lg_vbo.c:320
LG_VBO_free
void LG_VBO_free(LG_VBO *vbo)
Definition: lg_vbo.c:91
LG_VAO
Definition: lg_vbo.h:52
LG_VBO_unbind
void LG_VBO_unbind()
Definition: lg_vbo.c:120
LG_VBO_set_data
int LG_VBO_set_data(LG_VBO *vbo, const void *vertex_data)
Definition: lg_vbo.c:66
LG_IBO_new
LG_IBO LG_IBO_new(const void *vertex_indices, unsigned int size)
Definition: lg_vbo.c:137
LG_IBO_set_data
int LG_IBO_set_data(LG_IBO *ibo, const void *vertex_indices)
Definition: lg_vbo.c:177
LG_VBO_bind
void LG_VBO_bind(LG_VBO *vbo)
Definition: lg_vbo.c:105
LG_IBO_unbind
void LG_IBO_unbind()
Definition: lg_vbo.c:233
LG_IBO
Definition: lg_vbo.h:34
LG_VAO_new
LG_VAO LG_VAO_new()
Definition: lg_vbo.c:253
LG_VBO_new
LG_VBO LG_VBO_new(const void *vertex_data, unsigned int size)
Definition: lg_vbo.c:26
LG_VBO
Definition: lg_vbo.h:16
LG_VAO_free
void LG_VAO_free(LG_VAO *vao)
Definition: lg_vbo.c:280