|
SBgl 0.1.0
A graphics framework in C99
|
Public API for the SBgl voxel rendering system. More...
#include "sbgl.h"

Go to the source code of this file.
Data Structures | |
| struct | sbgl_VoxelConfig |
| Configuration parameters for initializing the voxel system. More... | |
| struct | sbgl_Material |
Typedefs | |
| typedef struct sbgl_VoxelSystem | sbgl_VoxelSystem |
| Opaque handle to the voxel system. The internal structure is hidden to maintain a clean public API and facilitate backend-agnostic module development. | |
Functions | |
| sbgl_VoxelSystem * | sbgl_Voxel_Create (sbgl_Context *ctx, const sbgl_VoxelConfig *config) |
| Creates and initializes a new voxel system. This operation allocates GPU resources and internal tracking structures. | |
| void | sbgl_Voxel_Update (sbgl_VoxelSystem *sys, sbgl_Vec3 camera_pos) |
| Updates the voxel system state based on the current camera position. This function handles chunk generation requests and manages the LRU cache. | |
| void | sbgl_Voxel_Cull (sbgl_VoxelSystem *sys, sbgl_Mat4 view_proj) |
| Performs GPU-driven frustum culling on voxel chunks. MUST be called BEFORE sbgl_BeginDrawing. | |
| void | sbgl_Voxel_Render (sbgl_VoxelSystem *sys) |
| Issues the indirect draw calls for visible voxel chunks. MUST be called BETWEEN sbgl_BeginDrawing and sbgl_EndDrawing. | |
| void | sbgl_Voxel_Destroy (sbgl_VoxelSystem *sys) |
| Destroys the voxel system and releases all associated resources. | |
| uint64_t | sbgl_Voxel_GetAABBAddress (sbgl_VoxelSystem *sys) |
| Returns the device address of the AABB buffer. | |
| uint64_t | sbgl_Voxel_GetInstanceAddress (sbgl_VoxelSystem *sys) |
| Returns the device address of the instance buffer. | |
| uint64_t | sbgl_Voxel_GetPaletteAddress (sbgl_VoxelSystem *sys) |
| Returns the device address of the material palette buffer. | |
Public API for the SBgl voxel rendering system.
Definition in file sbgl_voxel.h.
| typedef struct sbgl_VoxelSystem sbgl_VoxelSystem |
Opaque handle to the voxel system. The internal structure is hidden to maintain a clean public API and facilitate backend-agnostic module development.
Definition at line 16 of file sbgl_voxel.h.
| sbgl_VoxelSystem * sbgl_Voxel_Create | ( | sbgl_Context * | ctx, |
| const sbgl_VoxelConfig * | config ) |
Creates and initializes a new voxel system. This operation allocates GPU resources and internal tracking structures.
| ctx | Pointer to the active SBgl context. |
| config | Pointer to the configuration parameters. |
Definition at line 143 of file sbgl_voxel.c.
| void sbgl_Voxel_Cull | ( | sbgl_VoxelSystem * | sys, |
| sbgl_Mat4 | view_proj ) |
Performs GPU-driven frustum culling on voxel chunks. MUST be called BEFORE sbgl_BeginDrawing.
| sys | Pointer to the voxel system. |
| view_proj | The view-projection matrix for the current frame. |
Definition at line 436 of file sbgl_voxel.c.
| void sbgl_Voxel_Destroy | ( | sbgl_VoxelSystem * | sys | ) |
Destroys the voxel system and releases all associated resources.
| sys | Pointer to the voxel system to destroy. |
Definition at line 525 of file sbgl_voxel.c.
| uint64_t sbgl_Voxel_GetAABBAddress | ( | sbgl_VoxelSystem * | sys | ) |
Returns the device address of the AABB buffer.
Definition at line 558 of file sbgl_voxel.c.
| uint64_t sbgl_Voxel_GetInstanceAddress | ( | sbgl_VoxelSystem * | sys | ) |
Returns the device address of the instance buffer.
Definition at line 563 of file sbgl_voxel.c.
| uint64_t sbgl_Voxel_GetPaletteAddress | ( | sbgl_VoxelSystem * | sys | ) |
Returns the device address of the material palette buffer.
Definition at line 568 of file sbgl_voxel.c.
| void sbgl_Voxel_Render | ( | sbgl_VoxelSystem * | sys | ) |
Issues the indirect draw calls for visible voxel chunks. MUST be called BETWEEN sbgl_BeginDrawing and sbgl_EndDrawing.
| sys | Pointer to the voxel system. |
Definition at line 487 of file sbgl_voxel.c.
| void sbgl_Voxel_Update | ( | sbgl_VoxelSystem * | sys, |
| sbgl_Vec3 | camera_pos ) |
Updates the voxel system state based on the current camera position. This function handles chunk generation requests and manages the LRU cache.
| sys | Pointer to the voxel system. |
| camera_pos | The current world-space position of the camera. |
Definition at line 286 of file sbgl_voxel.c.