|
| GLuint | render_utils_create_color_texture (float red, float green, float blue, float alpha) |
| | Creates a 1x1 floating-point texture of a specific color. More...
|
| |
| void | render_utils_bind_texture_safe (GLenum unit, GLuint texture, GLuint fallback_tex) |
| | Safely binds a texture to a specific unit, using a fallback if needed. More...
|
| |
| void | render_utils_reset_texture_units (int start_unit, int end_unit, GLuint fallback_tex) |
| | Resets a range of texture units to a safe state. More...
|
| |
| void | render_utils_create_empty_vao (GLuint *vao) |
| | Creates an empty Vertex Array Object (VAO). More...
|
| |
| void | render_utils_create_quad_vbo (GLuint *vbo) |
| | Creates a standard centered Quad VBO. More...
|
| |
| void | render_utils_create_wire_cube_vbo (GLuint *vbo) |
| | Creates a wireframe Unit Cube VBO (GL_LINES). More...
|
| |
| void | render_utils_create_wire_quad_vbo (GLuint *vbo) |
| | Creates a wireframe Quad VBO (GL_LINE_LOOP). More...
|
| |
| void | render_utils_create_fullscreen_quad (GLuint *vao, GLuint *vbo) |
| | Creates a Full-Screen Quad VAO and VBO. More...
|
| |
| int | render_utils_check_framebuffer (const char *label) |
| | Checks the completeness of the currently bound framebuffer. More...
|
| |
| GPUInfo | render_utils_get_gpu_info (void) |
| | Retrieves currently active GPU hardware and driver information. More...
|
| |
| static void | append_sanitized_char (char raw_char, char *buffer, size_t *dst_idx, size_t size) |
| |
| void | render_utils_generate_gpu_identifier (const char *vendor, const char *renderer, char *buffer, size_t size) |
| | Sanitizes GPU vendor and renderer strings into a filesystem-safe identifier. More...
|
| |
| void | render_utils_get_gpu_identifier (char *buffer, size_t size) |
| | Generates a filesystem-safe identifier for the current GPU. More...
|
| |
| GLuint | render_utils_create_texture_2d (int width, int height, GLenum internal_format, GLint levels, const char *label) |
| | Creates a 2D texture with specified parameters. More...
|
| |
| void | render_utils_setup_sphere_instance_attributes (GLsizei stride, size_t offset_albedo, size_t offset_metallic) |
| | Sets up instance attributes for sphere rendering (Model, Albedo, PBR). More...
|
| |
| GLStateBackup | render_utils_save_state (void) |
| | Saves current OpenGL state to a backup struct. More...
|
| |
| void | render_utils_restore_state (const GLStateBackup *state) |
| | Restores OpenGL state from a backup struct. More...
|
| |
| void | render_utils_setup_ui_state (void) |
| | Configures standard 2D/UI rendering state (Alpha blend, No depth). More...
|
| |
| void render_utils_bind_texture_safe |
( |
GLenum |
unit, |
|
|
GLuint |
texture, |
|
|
GLuint |
fallback_tex |
|
) |
| |
Safely binds a texture to a specific unit, using a fallback if needed.
This function ensures that a valid texture is always bound to the specified unit. If texture is 0 (invalid), it binds fallback_tex instead. This is critical for robustness, preventing GL errors or black screens when resources fail to load or are temporarily unavailable.
- Parameters
-
| unit | The texture unit to bind to (e.g., GL_TEXTURE0). |
| texture | The primary texture to bind. |
| fallback_tex | The fallback texture to use if texture is 0. |
| GLuint render_utils_create_color_texture |
( |
float |
red, |
|
|
float |
green, |
|
|
float |
blue, |
|
|
float |
alpha |
|
) |
| |
Creates a 1x1 floating-point texture of a specific color.
Useful for creating "dummy" textures (e.g., black, white, normal) to bind to shader slots when a real texture is not available. This prevents undefined behavior or warnings from validation layers on some drivers (like NVIDIA) which check that all active samplers have valid textures.
- Parameters
-
| red | Red component (0.0 - 1.0). |
| green | Green component (0.0 - 1.0). |
| blue | Blue component (0.0 - 1.0). |
| alpha | Alpha component (0.0 - 1.0). |
- Returns
- The GLuint handle of the created texture.
| void render_utils_create_quad_vbo |
( |
GLuint * |
vbo | ) |
|
Creates a standard centered Quad VBO.
Generates a VBO containing vertices for a quad centered at (0,0) with size 1x1 (-0.5 to 0.5). Useful for billboard rendering or simple sprites.
Format: 3 floats (x, y, z) per vertex. Vertex count: 6 (2 triangles).
- Parameters
-
| [out] | vbo | Pointer to store the generated VBO handle. |
| void render_utils_create_wire_quad_vbo |
( |
GLuint * |
vbo | ) |
|
Creates a wireframe Quad VBO (GL_LINE_LOOP).
Vertices are: (-0.5, 0.5), (0.5, 0.5), (0.5, -0.5), (-0.5, -0.5). 4 vertices.
- Parameters
-
| [out] | vbo | Pointer to store the generated VBO handle. |