$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
scene.h File Reference
#include "app_settings.h"
#include "billboard_rendering.h"
#include "billboard_sorting.h"
#include "icosphere.h"
#include "instanced_rendering.h"
#include "scene_config.h"
#include "scene_lighting.h"
#include <cglm/cglm.h>
Include dependency graph for scene.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Scene
 Encapsulates all 3D scene data, geometry, and rendering state. More...
 

Functions

int scene_init (Scene *scene)
 Initializes the scene resources. More...
 
void scene_cleanup (Scene *scene)
 Cleans up scene resources. More...
 
const char * aa_mode_to_string (AAMode mode)
 Returns a string representation of the AA mode. More...
 
void scene_render (Scene *scene, GPUProfiler *profiler, mat4 view, mat4 proj, vec3 camera_pos, mat4 previous_view_proj, int width, int height)
 Renders the scene. More...
 
void scene_update_gpu_buffers (Scene *scene)
 Updates GPU buffers for dynamic geometry (e.g. LOD changes). More...
 
void scene_toggle_nbody (Scene *scene)
 Toggles N-body simulation mode on/off. More...
 
void scene_nbody_update (Scene *scene, float delta_time)
 Advances the N-body simulation by one frame. More...
 

Function Documentation

◆ aa_mode_to_string()

const char* aa_mode_to_string ( AAMode  mode)

Returns a string representation of the AA mode.

Parameters
modeThe AA mode.
Returns
String representation.

◆ scene_cleanup()

void scene_cleanup ( Scene *  scene)

Cleans up scene resources.

Parameters
scenePointer to the scene structure.
Here is the call graph for this function:

◆ scene_init()

int scene_init ( Scene *  scene)

Initializes the scene resources.

Parameters
scenePointer to the scene structure.
Returns
1 on success, 0 on failure.
Here is the call graph for this function:

◆ scene_nbody_update()

void scene_nbody_update ( Scene *  scene,
float  delta_time 
)

Advances the N-body simulation by one frame.

Parameters
scenePointer to the scene.
delta_timeWall-clock time elapsed.
cam_posCamera world position (for trail billboard).
Here is the call graph for this function:

◆ scene_render()

void scene_render ( Scene *  scene,
GPUProfiler *  profiler,
mat4  view,
mat4  proj,
vec3  camera_pos,
mat4  previous_view_proj,
int  width,
int  height 
)

Renders the scene.

Parameters
scenePointer to the scene.
viewView matrix.
projProjection matrix.
camera_posCamera position.
previous_view_projPrevious frame's ViewProj matrix (for motion blur).
widthViewport width.
heightViewport height.
Here is the call graph for this function:

◆ scene_toggle_nbody()

void scene_toggle_nbody ( Scene *  scene)

Toggles N-body simulation mode on/off.

Parameters
scenePointer to the scene.
Here is the call graph for this function:

◆ scene_update_gpu_buffers()

void scene_update_gpu_buffers ( Scene *  scene)

Updates GPU buffers for dynamic geometry (e.g. LOD changes).

Parameters
scenePointer to the scene.