LDKSceneManagerConfig
typedef struct LDKSceneManagerConfig{
const LDKAssetPath *scenes;
u32 scene_count;
const XSmallstr *names;
}LDKSceneManagerConfig;
Runtime scene catalog and scene switching.
typedef struct LDKSceneManagerConfig{
const LDKAssetPath *scenes;
u32 scene_count;
const XSmallstr *names;
}LDKSceneManagerConfig;
typedef struct LDKSceneManager{
LDKScene *scenes;
u32 scene_count;
const LDKScene *current_scene;
LDKSceneSystems current_systems;
u32 pending_scene_index;
bool has_pending_scene;
bool is_initialized;
}LDKSceneManager;
Initializes an empty Scene Manager.
LDK_API bool ldk_scene_manager_initialize(LDKSceneManager *manager);
LDKSceneManager *managerTrue if the operation succeeds; false otherwise.
Replaces the current game scene catalog. The supplied catalog is copied. Passing NULL removes the current catalog and leaves the Scene Manager initialized but unconfigured. Replacing or removing the catalog unloads the complete current ECS scene. If a new catalog cannot be copied or the ECS cannot be cleared, the previous configuration remains unchanged.
LDK_API bool ldk_scene_manager_override(
LDKSceneManager *manager,
const LDKSceneManagerConfig *config
);
LDKSceneManager *managerconst LDKSceneManagerConfig *configTrue if the operation succeeds; false otherwise.
Validate editable catalog entries without loading any scene.
LDK_API bool ldk_scene_manager_catalog_validate(
const LDKScene *scenes,
u32 count
);
const LDKScene *scenesu32 countTrue if the operation succeeds; false otherwise.
Exchange ownership of catalog arrays while stopped, without touching ECS, systems or pending scene contents. The caller receives the old catalog and must free it. The current scene is remapped by path, or detached if removed. No allocation is performed. On failure neither array changes ownership.
LDK_API bool ldk_scene_manager_catalog_exchange(
LDKSceneManager *manager,
LDKScene **scenes,
u32 *count
);
LDKSceneManager *managerLDKScene **scenesu32 *countTrue if the operation succeeds; false otherwise.
Reads [scenes] from a project manifest or runtime INI. count=N, 0.path=relative.scene, 0.name=Friendly name, ... Indices are contiguous from zero; names are optional. Paths are logical asset paths. An absent/empty catalog configures no scenes. On parse failure the existing catalog and scene remain unchanged.
LDK_API bool ldk_scene_manager_configure_file(
LDKSceneManager *manager,
const char *ini_path,
LDKSceneResult *result
);
LDKSceneManager *managerconst char *ini_pathLDKSceneResult *resultTrue if the operation succeeds; false otherwise.
Unloads the current scene and frees the copied catalog.
LDK_API void ldk_scene_manager_terminate(LDKSceneManager *manager);
LDKSceneManager *managerGet the number of scenes in the scene manager.
LDK_API u32 ldk_scene_manager_count(const LDKSceneManager *manager);
const LDKSceneManager *managerNumber of matching entries.
Get a scene by its index in the scene manager.
LDK_API const LDKScene * ldk_scene_manager_at(
const LDKSceneManager *manager,
u32 index
);
const LDKSceneManager *manageru32 indexPointer to the requested object or data; NULL when unavailable.
Find a scene registered with the manager.
LDK_API const LDKScene * ldk_scene_manager_find(
const LDKSceneManager *manager,
const char *path
);
const LDKSceneManager *managerconst char *pathPointer to the requested object or data; NULL when unavailable.
Replaces all current ECS contents with the registered scene at index. During an engine update the request is deferred to the safe frame boundary. A successful deferred request returns the target descriptor, but current() continues to report the old scene until the switch completes. Failures during deferred execution are logged. A failed target preflight leaves the old scene running; a failure after replacement begins ends the session.
LDK_API const LDKScene * ldk_scene_manager_load(
LDKSceneManager *manager,
u32 index,
LDKSceneResult *result
);
LDKSceneManager *manageru32 indexLDKSceneResult *resultPointer to the requested object or data; NULL when unavailable.
Loads a registered path, with the same deferred semantics as load().
LDK_API const LDKScene * ldk_scene_manager_load_path(
LDKSceneManager *manager,
const char *path,
LDKSceneResult *result
);
LDKSceneManager *managerconst char *pathLDKSceneResult *resultPointer to the requested object or data; NULL when unavailable.
Loads the catalog entry immediately after the current scene.
LDK_API const LDKScene * ldk_scene_manager_load_next(
LDKSceneManager *manager,
LDKSceneResult *result
);
LDKSceneManager *managerLDKSceneResult *resultPointer to the requested object or data; NULL when unavailable.
Removes all current ECS contents and clears current_scene.
LDK_API bool ldk_scene_manager_unload(LDKSceneManager *manager);
LDKSceneManager *managerTrue if the operation succeeds; false otherwise.
Get the currently active scene.
LDK_API const LDKScene * ldk_scene_manager_current(const LDKSceneManager *manager);
const LDKSceneManager *managerPointer to the requested object or data; NULL when unavailable.
The associations of the scene currently open in the ECS.
LDK_API const LDKSceneSystems * ldk_scene_manager_systems_get(const LDKSceneManager *manager);
const LDKSceneManager *managerPointer to the requested object or data; NULL when unavailable.
Forgets which catalog scene owns the ECS without modifying ECS contents. Use this when another loader, such as the editor direct-file loader, takes ownership of the current ECS while gameplay is stopped.
LDK_API bool ldk_scene_manager_current_reset(LDKSceneManager *manager);
LDKSceneManager *managerTrue if the operation succeeds; false otherwise.
Process/cancel a scene switch requested during an update callback.
LDK_API bool ldk_scene_manager_process_pending(LDKSceneManager *manager);
LDKSceneManager *managerTrue if the operation succeeds; false otherwise.
Clear the state of the scene manager pending.
LDK_API void ldk_scene_manager_pending_clear(LDKSceneManager *manager);
LDKSceneManager *manager