21#define gmdi(fn, obj) gmd(fn, obj, "")
28#define gmdn(fn, obj) gmd(fn, obj, "\n")
40#define gmd(fn, obj, e) \
42 char __gmd_str[200]; \
44 gmd_##fn(__gmd_str, sizeof(__gmd_str), obj); \
45 printf("<%s>%s", __gmd_str, e); \
56 return snprintf(s, n,
"gmPos(0x%#08X|r: %d, g: %d, b: %d, a: %d)", c,
68 return snprintf(s, n,
"gm3Pos(x: %.lf, y: %.lf, z: %.lf)", p.
x, p.
y, p.
z);
78 return snprintf(s, n,
"gmPos(x: %.lf, y: %.lf)", p.
x, p.
y);
93 "gm3Mesh(n_vertices: %zu, n_faces: %zu, n_normals: %zu, n_mtllibs: "
#define gm_blue(col)
Extracts the blue component from a color.
Definition color.h:41
#define gm_green(col)
Extracts the green component from a color.
Definition color.h:34
#define gm_red(col)
Extracts the red component from a color.
Definition color.h:27
#define gm_alpha(col)
Extracts the alpha component from a color.
Definition color.h:48
uint32_t gmColor
Type definition for color values, stored as a 32-bit unsigned integer. The color components are packe...
Definition color.h:13
int gmd_mesh(char *s, size_t n, gm3Mesh m)
Formats a gm3Mesh into a human-readable string for debugging.
Definition debug.h:90
int gmd_color(char *s, size_t n, gmColor c)
Formats a gmColor into a human-readable string for debugging.
Definition debug.h:55
int gmd_pos3(char *s, size_t n, gm3Pos p)
Formats a gm3Pos (3D position) into a human-readable string for debugging.
Definition debug.h:67
int gmd_pos2(char *s, size_t n, gmPos p)
Formats a gmPos (2D position) into a human-readable string for debugging.
Definition debug.h:77
Represents a 3D mesh composed of vertices, faces, normals, and texture coordinates.
Definition mesh.h:30
size_t n_mtllibs
Definition mesh.h:44
size_t n_normals
Definition mesh.h:38
size_t n_vertices
Definition mesh.h:32
size_t n_faces
Definition mesh.h:35
Represents a 3D position or vector.
Definition position.h:11
double y
Definition position.h:12
double z
Definition position.h:12
double x
Definition position.h:12
Represents a 2D position or vector.
Definition position.h:8
double x
Definition position.h:9
double y
Definition position.h:9