SBgl 0.1.0
A graphics framework in C99
Loading...
Searching...
No Matches
sbgl_context_internal.h File Reference

Internal helpers for accessing context state from library subsystems. More...

#include "sbgl_types.h"
#include "core/sbl_arena.h"
Include dependency graph for sbgl_context_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

SblArenasbgl_GetContextArena (sbgl_Context *ctx)
 Retrieves the persistent arena associated with a context.
 

Detailed Description

Internal helpers for accessing context state from library subsystems.

These declarations are for internal use only and must not be included by external code.

Definition in file sbgl_context_internal.h.

Function Documentation

◆ sbgl_GetContextArena()

SblArena * sbgl_GetContextArena ( sbgl_Context * ctx)

Retrieves the persistent arena associated with a context.

Subsystems that need a lifetime-bound allocation region (e.g., the voxel engine) use this arena instead of malloc to remain consistent with the library's memory model.

Parameters
ctxThe engine context.
Returns
Pointer to the context's persistent arena, or NULL if the context is invalid.

Definition at line 62 of file sbgl_core.c.

62 {
63 if (!ctx || !ctx->inner)
64 return NULL;
66 return &inner->arena;
67}
void * inner
Opaque pointer to the internal engine state.
Definition sbgl_types.h:278
Internal state for the engine context.
Definition sbgl_core.c:40