Struct in ldk_scene.h

LDKSceneSystems

struct LDKSceneSystems;
Macro in ldk_scene.h

LDK_SCENE_TML_VERSION

#define LDK_SCENE_TML_VERSION 1
Macro in ldk_scene.h

LDK_SCENE_NULL_ENTITY_ID

#define LDK_SCENE_NULL_ENTITY_ID(-1)
Struct in ldk_scene.h

LDKScene

Entry in the Scene Manager catalog. Scene pointers returned by the Scene Manager refer to its internal catalog and remain valid until the catalog is overridden or the manager is terminated.

typedef struct LDKScene{
  LDKAssetPath path;
  XSmallstr name;
  u32 index;
}LDKScene;
Struct in ldk_scene.h

LDKSceneProperties

typedef struct LDKSceneProperties{
  rgba32 ambient_color;
  float ambient_intensity;
}LDKSceneProperties;
Struct in ldk_scene.h

LDKSceneResult

typedef struct LDKSceneResult{
  bool ok;
  char error[256];
}LDKSceneResult;
Function in ldk_scene.h

ldk_scene_properties_get

Get the scene properties.

LDK_API const LDKSceneProperties * ldk_scene_properties_get(void);

Returns

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

Function in ldk_scene.h

ldk_scene_properties_set

Set the scene properties.

LDK_API bool ldk_scene_properties_set(const LDKSceneProperties *properties);

Parameters

const LDKSceneProperties *properties
Scene or other property values being operated on.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_scene.h

ldk_scene_properties_reset

Reset the state of the scene properties.

LDK_API void ldk_scene_properties_reset(void);
Function in ldk_scene.h

ldk_scene_result_clear

Clear the state of the scene result.

LDK_API void ldk_scene_result_clear(LDKSceneResult *result);

Parameters

LDKSceneResult *result
Optional result structure populated with error details.
Function in ldk_scene.h

ldk_scene_result_set_error

Store a scene diagnostic message in the result.

LDK_API void ldk_scene_result_set_error(
 LDKSceneResult *result,
 const char *error
);

Parameters

LDKSceneResult *result
Optional result structure populated with error details.
const char *error
Receives an error description when parsing fails.
Typedef in ldk_scene.h

LDKSceneDiagnosticFn

Callback for reporting a scene diagnostic.

typedef void(*LDKSceneDiagnosticFn)(const char *message, void *user);

Parameters

message
Message displayed to the user.
user
Opaque caller-supplied data passed to the callback.
Function in ldk_scene.h

ldk_scene_diagnostic_handler_set

Set the scene diagnostic handler.

LDK_API void ldk_scene_diagnostic_handler_set(
 LDKSceneDiagnosticFn handler,
 void *user
);

Parameters

LDKSceneDiagnosticFn handler
Handler called for the corresponding event or diagnostic.
void *user
Opaque caller-supplied data passed to the callback.
Function in ldk_scene.h

ldk_scene_from_tml

Loads entities and components from a TML string into the current ECS. This function does not clear existing entities and does not roll back entities created before an error. A caller performing a full scene replace is responsible for clearing the ECS before the call and after a failed call.

LDK_API bool ldk_scene_from_tml(
 const char *source,
 LDKSceneResult *result
);

Parameters

const char *source
Source object or source data for this operation.
LDKSceneResult *result
Optional result structure populated with error details.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_scene.h

ldk_scene_load_tml_file

Reads a TML file and loads it into the current ECS. This function has the same ECS ownership semantics as ldk_scene_from_tml().

LDK_API bool ldk_scene_load_tml_file(
 const char *path,
 LDKSceneResult *result
);

Parameters

const char *path
Path identifying the file or resource.
LDKSceneResult *result
Optional result structure populated with error details.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_scene.h

ldk_scene_from_tml_with_systems

Load entities and scene-owned system data together, resolving references with the same entity map. Systems is initialized with {0}; on failure its previous contents are unchanged. The caller owns ECS cleanup on failure, and must stop old systems before replacing a scene. No initialize runs.

LDK_API bool ldk_scene_from_tml_with_systems(
 const char *source,
 struct LDKSceneSystems *systems,
 LDKSceneResult *result
);

Parameters

const char *source
Source object or source data for this operation.
struct LDKSceneSystems *systems
Scene systems configuration being read or written.
LDKSceneResult *result
Optional result structure populated with error details.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_scene.h

ldk_scene_load_tml_file_with_systems

Load scene TML file with systems.

LDK_API bool ldk_scene_load_tml_file_with_systems(
 const char *path,
 struct LDKSceneSystems *systems,
 LDKSceneResult *result
);

Parameters

const char *path
Path identifying the file or resource.
struct LDKSceneSystems *systems
Scene systems configuration being read or written.
LDKSceneResult *result
Optional result structure populated with error details.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_scene.h

ldk_scene_to_tml_with_systems

Serialize a scene and its system configuration to TML.

LDK_API bool ldk_scene_to_tml_with_systems(
 XStrBuilder *out,
 const struct LDKSceneSystems *systems,
 LDKSceneResult *result
);

Parameters

XStrBuilder *out
Output object or buffer receiving the result.
const struct LDKSceneSystems *systems
Scene systems configuration being read or written.
LDKSceneResult *result
Optional result structure populated with error details.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_scene.h

ldk_scene_to_tml

Serializes the current ECS contents to TML.

LDK_API bool ldk_scene_to_tml(
 XStrBuilder *out,
 LDKSceneResult *result
);

Parameters

XStrBuilder *out
Output object or buffer receiving the result.
LDKSceneResult *result
Optional result structure populated with error details.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_scene.h

ldk_scene_save_tml_file

Serializes the current ECS contents and writes them to a TML file.

LDK_API bool ldk_scene_save_tml_file(
 const char *path,
 LDKSceneResult *result
);

Parameters

const char *path
Path identifying the file or resource.
LDKSceneResult *result
Optional result structure populated with error details.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_scene.h

ldk_scene_component_meta_runtime_type

Resolve the runtime component type for reflected scene metadata.

LDK_API u32 ldk_scene_component_meta_runtime_type(const LDKComponentMeta *meta);

Parameters

const LDKComponentMeta *meta
Meta used by this operation.

Returns

The resulting numeric value.

Function in ldk_scene.h

ldk_scene_component_meta_find_by_type

Find serialized component metadata for a runtime type.

LDK_API const LDKComponentMeta * ldk_scene_component_meta_find_by_type(
 LDKGame *game,
 u32 component_type
);

Parameters

LDKGame *game
Game instance associated with this operation.
u32 component_type
Registered ECS component type identifier.

Returns

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

Function in ldk_scene.h

ldk_scene_component_field_find

Find the scene component field.

LDK_API const LDKComponentFieldMeta * ldk_scene_component_field_find(
 const LDKComponentMeta *meta,
 const char *field_name
);

Parameters

const LDKComponentMeta *meta
Meta used by this operation.
const char *field_name
Field name used by this operation.

Returns

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

Function in ldk_scene.h

ldk_scene_component_field_is_serializable

Check whether a component field may be saved in a scene.

LDK_API bool ldk_scene_component_field_is_serializable(
 const LDKComponentMeta *meta,
 const LDKComponentFieldMeta *field
);

Parameters

const LDKComponentMeta *meta
Meta used by this operation.
const LDKComponentFieldMeta *field
Field used by this operation.

Returns

True when the queried condition holds; false otherwise.