Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
Loading...
Searching...
No Matches
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
20typedef struct {
21 GLuint vao;
23 GLuint instance_vbo;
26
34 int count);
35
43void instanced_group_bind_mesh(InstancedGroup* group, GLuint vbo, GLuint nbo,
44 GLuint ebo);
45
53 int count);
54
60void 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:82
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:66
void instanced_group_init(InstancedGroup *group, const SphereInstance *data, int count)
Allocates the instance VBO on the GPU.
Definition instanced_rendering.c:8
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:21
void instanced_group_draw(InstancedGroup *group, size_t index_count)
Executes an indexed instanced draw call.
Definition instanced_rendering.c:75
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