Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
Loading...
Searching...
No Matches
scene.h File Reference
#include "app_settings.h"
#include "billboard_renderer.h"
#include "icosphere.h"
#include "instanced_rendering.h"
#include "scene_config.h"
#include "scene_lighting.h"
#include <cglm/cglm.h>
#include "app_subsystem.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...
 

Macros

#define APP_SCENE_DESCRIPTOR   {"scene", scene_subsys_init, scene_subsys_cleanup}
 

Functions

int scene_init (Scene *scene)
 Initializes the scene resources.
 
void scene_cleanup (Scene *scene)
 Cleans up scene resources.
 
const char * aa_mode_to_string (AAMode mode)
 Returns a string representation of the AA mode.
 
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.
 
void scene_update_gpu_buffers (Scene *scene)
 Updates GPU buffers for dynamic geometry (e.g. LOD changes).
 
void scene_toggle_nbody (Scene *scene)
 Toggles N-body simulation mode on/off.
 
void scene_nbody_update (Scene *scene, float delta_time)
 Advances the N-body simulation by one frame.
 
int scene_subsys_init (struct App *app)
 
void scene_subsys_cleanup (struct App *app)
 

Macro Definition Documentation

◆ APP_SCENE_DESCRIPTOR

#define APP_SCENE_DESCRIPTOR   {"scene", scene_subsys_init, scene_subsys_cleanup}

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_subsys_cleanup()

void scene_subsys_cleanup ( struct App *  app)
Here is the call graph for this function:

◆ scene_subsys_init()

int scene_subsys_init ( struct App *  app)
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.