LibGame
v0.4.0
The LG Game Engine - Copyright (C) 2024 ETMSoftware
|
Functions | |
Vertex | lg_vertex (float x, float y, float z) |
Vertex | lg_vertex_from_vec3 (vec3_t v) |
Vertex_uv | lg_vertex_uv (float x, float y, float z, uint16_t u, uint16_t v) |
Vertex_n | lg_vertex_n (float x, float y, float z, int16_t n_x, int16_t n_y, int16_t n_z) |
Vertex_uv_n | lg_vertex_uv_n (float x, float y, float z, uint16_t u, uint16_t v, int16_t n_x, int16_t n_y, int16_t n_z) |
Vertex_rgba | lg_vertex_rgba (float x, float y, float z, LG_Color_u c) |
Vertex_rgba | lg_vertex_rgba_from_vec3 (vec3_t v, LG_Color_u c) |
Vertex_rgba_n | lg_vertex_rgba_n (float x, float y, float z, LG_Color_u c, int16_t n_x, int16_t n_y, int16_t n_z) |
LG_Color_u | lg_color_u (uint8_t r, uint8_t g, uint8_t b, uint8_t a) |
LG_Color_f | lg_color_f (float r, float g, float b, float a) |
LG_Color_u | lg_color_u_from_f (LG_Color_f c) |
LG_Color_f | lg_color_f_from_u (LG_Color_u c) |
void | lg_vertex_sizes_info () |
=== VBO vertex struct for interleaved data === Storage format: - 3 float's for 3D spatial coords (optionally) - 2 uint16_t for tex coords - 3 int16_t for normals - 4 uint8_t for each color component All struct's are packed and aligned Aside from padding, flag1 can be used for extra purposes if necessary (max value of uint16_t = 65535)
Vertex lg_vertex | ( | float | x, |
float | y, | ||
float | z | ||
) |
Vertex_uv lg_vertex_uv | ( | float | x, |
float | y, | ||
float | z, | ||
uint16_t | u, | ||
uint16_t | v | ||
) |
Vertex_n lg_vertex_n | ( | float | x, |
float | y, | ||
float | z, | ||
int16_t | n_x, | ||
int16_t | n_y, | ||
int16_t | n_z | ||
) |
Vertex_uv_n lg_vertex_uv_n | ( | float | x, |
float | y, | ||
float | z, | ||
uint16_t | u, | ||
uint16_t | v, | ||
int16_t | n_x, | ||
int16_t | n_y, | ||
int16_t | n_z | ||
) |
Create a new Vertex_uv_n (spatial coords + tex uv + normals)
The most used/useful vertex struct, appropriate for LG_Mesh's VBOs
x | Spatial coord x |
y | Spatial coord y |
z | Spatial coord z |
u | Texture mapping u |
v | Texture mapping v |
n_x | Normal vector x |
n_y | Normal vector y |
n_z | Normal vector z |
Vertex_rgba lg_vertex_rgba | ( | float | x, |
float | y, | ||
float | z, | ||
LG_Color_u | c | ||
) |
Create a new Vertex_rgba (spatial coords + RGBA color)
Very useful vertex struct, appropriate for Lines3D_VB's vb_array/vb_ptr
x | Spatial coord x |
y | Spatial coord y |
z | Spatial coord z |
c | Color as a LG_Color_u |
Vertex_rgba lg_vertex_rgba_from_vec3 | ( | vec3_t | v, |
LG_Color_u | c | ||
) |
Create a new Vertex_rgba (spatial coords vec3_t + RGBA color)
v | Spatial coords as a vec3_t |
c | Color as a LG_Color_u |
Vertex_rgba_n lg_vertex_rgba_n | ( | float | x, |
float | y, | ||
float | z, | ||
LG_Color_u | c, | ||
int16_t | n_x, | ||
int16_t | n_y, | ||
int16_t | n_z | ||
) |
Create a new Vertex_rgba_n (spatial coords + RGBA color as 4 unsigned bytes + normals)
x | Spatial coord x |
y | Spatial coord y |
z | Spatial coord z |
c | Color as a LG_Color_u |
n_x | Normal vector x |
n_y | Normal vector y |
n_z | Normal vector z |
LG_Color_u lg_color_u | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b, | ||
uint8_t | a | ||
) |
Create a new LG_Color_u, ie a RGBA color as 4 unsigned bytes (in range [0, 255])
r | Red |
g | Green |
b | Blue |
a | Alpha |
LG_Color_f lg_color_f | ( | float | r, |
float | g, | ||
float | b, | ||
float | a | ||
) |
Create a new LG_Color_f, ie a RGBA color as 4 normalized float's (in range [0.0, 1.0])
r | Red |
g | Green |
b | Blue |
a | Alpha |
LG_Color_u lg_color_u_from_f | ( | LG_Color_f | c | ) |
Convert a LG_Color_f color to a a LG_Color_u color, ie a RGBA color as 4 unsigned bytes (in range [0, 255])
r | Red |
g | Green |
b | Blue |
a | Alpha |
LG_Color_f lg_color_f_from_u | ( | LG_Color_u | c | ) |
Convert a LG_Color_u color to a LG_Color_f color, ie a RGBA color as 4 normalized float's (in range [0.0, 1.0])
r | Red |
g | Green |
b | Blue |
a | Alpha |
void lg_vertex_sizes_info | ( | ) |
Print out Vertex sizes and alignement requirements