LDKSceneManagerConfig

typedef struct LDKSceneManagerConfig{
  const LDKAssetPath *scenes;
  u32 scene_count;
  const XSmallstr *names;
}LDKSceneManagerConfig;

LDKSceneManager

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;
Function in ldk_scene_manager.h

ldk_scene_manager_initialize

Initializes an empty Scene Manager.

LDK_API bool ldk_scene_manager_initialize(LDKSceneManager *manager);

Parameters

LDKSceneManager *manager
Asset manager that owns or resolves the asset.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_scene_manager.h

ldk_scene_manager_override

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
);

Parameters

LDKSceneManager *manager
Asset manager that owns or resolves the asset.
const LDKSceneManagerConfig *config
Configuration for this operation.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_scene_manager.h

ldk_scene_manager_catalog_validate

Validate editable catalog entries without loading any scene.

LDK_API bool ldk_scene_manager_catalog_validate(
 const LDKScene *scenes,
 u32 count
);

Parameters

const LDKScene *scenes
Scenes used by this operation.
u32 count
Number of items to process.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_scene_manager.h

ldk_scene_manager_catalog_exchange

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
);

Parameters

LDKSceneManager *manager
Asset manager that owns or resolves the asset.
LDKScene **scenes
Scenes used by this operation.
u32 *count
Number of items to process.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_scene_manager.h

ldk_scene_manager_configure_file

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
);

Parameters

LDKSceneManager *manager
Asset manager that owns or resolves the asset.
const char *ini_path
Path to the INI configuration.
LDKSceneResult *result
Optional result structure populated with error details.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_scene_manager.h

ldk_scene_manager_count

Get the number of scenes in the scene manager.

LDK_API u32 ldk_scene_manager_count(const LDKSceneManager *manager);

Parameters

const LDKSceneManager *manager
Asset manager that owns or resolves the asset.

Returns

Number of matching entries.

Function in ldk_scene_manager.h

ldk_scene_manager_at

Get a scene by its index in the scene manager.

LDK_API const LDKScene * ldk_scene_manager_at(
 const LDKSceneManager *manager,
 u32 index
);

Parameters

const LDKSceneManager *manager
Asset manager that owns or resolves the asset.
u32 index
Zero-based index of the selected item.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_scene_manager.h

ldk_scene_manager_find

Find a scene registered with the manager.

LDK_API const LDKScene * ldk_scene_manager_find(
 const LDKSceneManager *manager,
 const char *path
);

Parameters

const LDKSceneManager *manager
Asset manager that owns or resolves the asset.
const char *path
Path identifying the file or resource.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_scene_manager.h

ldk_scene_manager_load

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
);

Parameters

LDKSceneManager *manager
Asset manager that owns or resolves the asset.
u32 index
Zero-based index of the selected item.
LDKSceneResult *result
Optional result structure populated with error details.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_scene_manager.h

ldk_scene_manager_load_path

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
);

Parameters

LDKSceneManager *manager
Asset manager that owns or resolves the asset.
const char *path
Path identifying the file or resource.
LDKSceneResult *result
Optional result structure populated with error details.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_scene_manager.h

ldk_scene_manager_load_next

Loads the catalog entry immediately after the current scene.

LDK_API const LDKScene * ldk_scene_manager_load_next(
 LDKSceneManager *manager,
 LDKSceneResult *result
);

Parameters

LDKSceneManager *manager
Asset manager that owns or resolves the asset.
LDKSceneResult *result
Optional result structure populated with error details.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_scene_manager.h

ldk_scene_manager_unload

Removes all current ECS contents and clears current_scene.

LDK_API bool ldk_scene_manager_unload(LDKSceneManager *manager);

Parameters

LDKSceneManager *manager
Asset manager that owns or resolves the asset.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_scene_manager.h

ldk_scene_manager_current

Get the currently active scene.

LDK_API const LDKScene * ldk_scene_manager_current(const LDKSceneManager *manager);

Parameters

const LDKSceneManager *manager
Asset manager that owns or resolves the asset.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_scene_manager.h

ldk_scene_manager_systems_get

The associations of the scene currently open in the ECS.

LDK_API const LDKSceneSystems * ldk_scene_manager_systems_get(const LDKSceneManager *manager);

Parameters

const LDKSceneManager *manager
Asset manager that owns or resolves the asset.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_scene_manager.h

ldk_scene_manager_current_reset

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);

Parameters

LDKSceneManager *manager
Asset manager that owns or resolves the asset.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_scene_manager.h

ldk_scene_manager_process_pending

Process/cancel a scene switch requested during an update callback.

LDK_API bool ldk_scene_manager_process_pending(LDKSceneManager *manager);

Parameters

LDKSceneManager *manager
Asset manager that owns or resolves the asset.

Returns

True if the operation succeeds; false otherwise.