$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
skybox.h
Go to the documentation of this file.
1 
10 #ifndef SKYBOX_H
11 #define SKYBOX_H
12 
13 #include "gl_common.h"
14 #include "shader.h"
15 #include <cglm/cam.h>
16 #include <cglm/mat4.h>
17 #include <cglm/types.h>
18 
23 typedef struct {
24  GLuint vao;
25  GLuint vbo;
27  /* Cached uniform locations */
30  GLint u_blur_lod;
31  GLint u_env_map;
32 } Skybox;
33 
39 void skybox_init(Skybox* skybox, Shader* shader);
40 
50 void skybox_render(Skybox* skybox, Shader* shader, GLuint env_map,
51  GLuint fallback_tex, const mat4 inv_view_proj,
52  float blur_lod);
53 
58 void skybox_cleanup(Skybox* skybox);
59 
60 #endif /* SKYBOX_H */
Common OpenGL definitions, RAII helpers, and utilities.
High-level OpenGL shader management with metadata and uniform caching.
void skybox_cleanup(Skybox *skybox)
Cleans up GPU resources.
Definition: skybox.c:69
void skybox_render(Skybox *skybox, Shader *shader, GLuint env_map, GLuint fallback_tex, const mat4 inv_view_proj, float blur_lod)
Renders the skybox to the current framebuffer.
Definition: skybox.c:36
void skybox_init(Skybox *skybox, Shader *shader)
Initializes skybox geometry and caches uniform locations.
Definition: skybox.c:8
Wrapper for an OpenGL program with uniform caching and automatic cleanup.
Definition: shader.h:71
Persistent state and resource handles for the environment renderer.
Definition: skybox.h:23
GLint u_inv_view_proj
Definition: skybox.h:28
GLuint vbo
Definition: skybox.h:25
GLuint vao
Definition: skybox.h:24
GLint u_env_map
Definition: skybox.h:31
GLint u_blur_lod
Definition: skybox.h:30