LibGame  v0.4.0
The LG Game Engine - Copyright (C) 2024-2025 ETMSoftware
lg_obj_parser.h
1 /*
2  * LibGame - Copyright (C) Emmanuel Thomas-Maurin 2011-2025
3  * All rights reserved
4  */
5 
6 #ifndef LG_OBJ_PARSER_H
7 #define LG_OBJ_PARSER_H
8 
9 #define SPATIAL_COORD_HUGE_VALUE (10e9) /* = 1 000 000 000.0 - OK ? */
10 
11 #define OBJPARSER_BBOX_COLOR "purple"
12 
13 typedef enum {
14  WITH_COORDS_ONLY,
15  WITH_TEXCOORDS,
16  WITH_NORMALS,
17  WITH_TEXCOORDS_AND_NORMALS
18 } lg_vertex_type;
19 
20 LG_Mesh *lg_obj2vbo(const char *, FILE *, zboolean, zboolean, zboolean, zboolean, int);
21 
22 int lg_mtl_parser(const char *, LG_Material *[]);
23 
24 int lg_vertex_cmp(Vertex_uv_n *, Vertex_uv_n *, zboolean, zboolean);
25 
26 void lg_vbo_and_ibo_info(Vertex_uv_n *, uint32_t *, uint32_t, uint32_t, lg_vertex_type, int);
27 
28 void lg_vb_info(Vertex *, uint32_t, int, const char *, zboolean);
29 
30 void lg_vb_rgba_info(Vertex_rgba *, uint32_t, int, const char *, zboolean);
31 
33 
34 #endif /* LG_OBJ_PARSER_H */
LG_Mesh
Definition: lg_mesh.h:73
lg_vertex_cmp
int lg_vertex_cmp(Vertex_uv_n *v1, Vertex_uv_n *v2, zboolean tex_coords, zboolean normals)
Definition: lg_obj_parser.c:747
lg_objparser_check_consistency
zboolean lg_objparser_check_consistency()
Definition: lg_obj_parser.c:982
lg_obj2vbo
LG_Mesh * lg_obj2vbo(const char *mesh_name, FILE *stream, zboolean invert_z, zboolean normalize_xyz, zboolean horiz_center, zboolean vert_center, zboolean vert_bottom)
Definition: lg_obj_parser.c:151
Vertex_uv_n
Definition: lg_vertex.h:46
lg_vb_rgba_info
void lg_vb_rgba_info(Vertex_rgba *vb_data, uint32_t vb_size, int n_lines_max, const char *line_start, zboolean is_triangle_mesh)
Definition: lg_obj_parser.c:928
Vertex
Definition: lg_vertex.h:16
lg_vb_info
void lg_vb_info(Vertex *vb_data, uint32_t vb_size, int n_lines_max, const char *line_start, zboolean is_triangle_mesh)
Definition: lg_obj_parser.c:883
LG_Material
Definition: lg_mesh.h:40
lg_mtl_parser
int lg_mtl_parser(const char *mtl_file, LG_Material *mat[])
Definition: lg_obj_parser.c:664
Vertex_rgba
Definition: lg_vertex.h:80
lg_vbo_and_ibo_info
void lg_vbo_and_ibo_info(Vertex_uv_n *vbo_data, uint32_t *ibo_data, uint32_t vbo_size, uint32_t ibo_size, lg_vertex_type vertex_type, int n_lines_max)
Definition: lg_obj_parser.c:795