$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
instanced_rendering.h
Go to the documentation of this file.
1 
10 #ifndef INSTANCED_RENDERING_H
11 #define INSTANCED_RENDERING_H
12 
13 #include "gl_common.h"
14 #include "sphere_types.h"
15 
20 typedef struct {
21  GLuint vao;
23  GLuint instance_vbo;
26 
33 void instanced_group_init(InstancedGroup* group, const SphereInstance* data,
34  int count);
35 
43 void instanced_group_bind_mesh(InstancedGroup* group, GLuint vbo, GLuint nbo,
44  GLuint ebo);
45 
53  int count);
54 
60 void instanced_group_draw(InstancedGroup* group, size_t index_count);
61 
67 
68 #endif /* INSTANCED_RENDERING_H */
Common OpenGL definitions, RAII helpers, and utilities.
void instanced_group_cleanup(InstancedGroup *group)
Releases all GPU resources for the instanced group.
Definition: instanced_rendering.c:84
void instanced_group_update(InstancedGroup *group, const SphereInstance *data, int count)
Updates the instance VBO with new data (e.g., N-body positions).
Definition: instanced_rendering.c:68
void instanced_group_init(InstancedGroup *group, const SphereInstance *data, int count)
Allocates the instance VBO on the GPU.
Definition: instanced_rendering.c:7
void instanced_group_bind_mesh(InstancedGroup *group, GLuint vbo, GLuint nbo, GLuint ebo)
Binds a procedural mesh (e.g., icosphere) to the instanced group.
Definition: instanced_rendering.c:29
void instanced_group_draw(InstancedGroup *group, size_t index_count)
Executes an indexed instanced draw call.
Definition: instanced_rendering.c:77
Pure-data type for per-instance sphere attributes.
Manages mesh-based instanced spheres on the GPU.
Definition: instanced_rendering.h:20
GLuint vao
Definition: instanced_rendering.h:21
GLuint instance_vbo
Definition: instanced_rendering.h:23
int instance_count
Definition: instanced_rendering.h:24
Per-instance data sent to the shader via an instanced VBO.
Definition: sphere_types.h:25