Typedef in ldk_asset_manager.h

LDKAssetIterFn

Callback invoked for each live asset during enumeration.

typedef bool(*LDKAssetIterFn)(LDKAssetHandle asset, LDKAssetInfo *info, void *user);

Parameters

asset
Asset handle to inspect or modify.
info
Info used by this operation.
user
Opaque caller-supplied data passed to the callback.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_asset_manager.h

ldk_asset_manager_initialize

Initialize an asset manager with an asset source and storage capacity.

LDK_API bool ldk_asset_manager_initialize(
 LDKAssetManager *manager,
 LDKAssetSource *source,
 u32 page_capacity,
 u32 initial_pages
);

Parameters

LDKAssetManager *manager
Asset manager that owns or resolves the asset.
LDKAssetSource *source
Source object or source data for this operation.
u32 page_capacity
Number of entries per allocation page.
u32 initial_pages
Number of pages initially allocated.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_asset_manager.h

ldk_asset_manager_clear

Clear manager-owned assets except audio retained by active voices. Audio data still referenced by active voices is retained.

LDK_API void ldk_asset_manager_clear(LDKAssetManager *manager);

Parameters

LDKAssetManager *manager
Asset manager that owns or resolves the asset.
Function in ldk_asset_manager.h

ldk_asset_alive_count

Get the number of currently live asset handles.

LDK_API u32 ldk_asset_alive_count(LDKAssetManager *manager);

Parameters

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

Returns

Number of matching entries.

LDKAssetTextFileData

typedef struct LDKAssetTextFileData{
  char *text;
  u64 byte_count;
}LDKAssetTextFileData;
Function in ldk_asset_manager.h

ldk_asset_manager_text_file_is_alive

Check whether the asset manager text file refers to a live resource.

LDK_API bool ldk_asset_manager_text_file_is_alive(
 LDKAssetManager *manager,
 LDKAssetTextFile asset
);

Parameters

LDKAssetManager *manager
Asset manager that owns or resolves the asset.
LDKAssetTextFile asset
Asset handle to inspect or modify.

Returns

True when the queried condition holds; false otherwise.

Function in ldk_asset_manager.h

ldk_asset_manager_text_file_create

Create an in-memory text-file asset by copying source text.

LDK_API LDKAssetTextFile ldk_asset_manager_text_file_create(
 LDKAssetManager *manager,
 const char *text,
 u64 byte_count
);

Parameters

LDKAssetManager *manager
Asset manager that owns or resolves the asset.
const char *text
Text used by this operation.
u64 byte_count
Number of bytes in the supplied data.

Returns

Handle to the requested object or resource.

Function in ldk_asset_manager.h

ldk_asset_manager_text_file_load

Load the asset manager text file.

LDK_API LDKAssetTextFile ldk_asset_manager_text_file_load(
 LDKAssetManager *manager,
 const char *path
);

Parameters

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

Returns

Handle to the requested object or resource.

Function in ldk_asset_manager.h

ldk_asset_manager_keyframe_animation_create

Create a transient, manager-owned keyframe asset from a code-authored clip.

LDK_API LDKAssetKeyframeAnimation ldk_asset_manager_keyframe_animation_create(
 LDKAssetManager *manager,
 const LDKKeyframeAnimation *clip
);

Parameters

LDKAssetManager *manager
Initialized asset manager.
const LDKKeyframeAnimation *clip
Animation clip instance.

Returns

Live asset handle on success, null handle on failure. Clip is deep-copied. Note: The created asset has no path and is not automatically scene-persistent.

Function in ldk_asset_manager.h

ldk_asset_manager_keyframe_animation_load_shared

Load or reuse a version-2 .anim asset by path and source revision.

LDK_API LDKAssetKeyframeAnimation ldk_asset_manager_keyframe_animation_load_shared(
 LDKAssetManager *manager,
 const char *path
);

Parameters

LDKAssetManager *manager
Initialized asset manager.
const char *path
Logical path to an .anim asset.

Returns

Live shared handle, or null on failure. Owned by the manager.

Function in ldk_asset_manager.h

ldk_asset_manager_keyframe_animation_reload

Reload a cached shared animation asset from its source.

LDK_API bool ldk_asset_manager_keyframe_animation_reload(
 LDKAssetManager *manager,
 const char *path
);

Parameters

LDKAssetManager *manager
Initialized asset manager.
const char *path
Logical path to a cached .anim asset.

Returns

True on successful refresh or if not cached; false on I/O or parsing errors.

Function in ldk_asset_manager.h

ldk_asset_manager_keyframe_animation_get_const

Get immutable animation data for a live keyframe asset handle.

LDK_API const LDKAssetKeyframeAnimationData * ldk_asset_manager_keyframe_animation_get_const(
 LDKAssetManager *manager,
 LDKAssetKeyframeAnimation asset
);

Parameters

LDKAssetManager *manager
Initialized asset manager.
LDKAssetKeyframeAnimation asset
Keyframe animation asset handle.

Returns

Borrowed pointer or NULL. Invalidated when the asset is unloaded or reloaded.

Function in ldk_asset_manager.h

ldk_asset_manager_texture_atlas_load_shared

Load or reuse shared the asset manager texture atlas.

LDK_API LDKAssetTextureAtlas ldk_asset_manager_texture_atlas_load_shared(
 LDKAssetManager *manager,
 const char *path
);

Parameters

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

Returns

Handle to the requested object or resource.

Function in ldk_asset_manager.h

ldk_asset_manager_texture_atlas_reload

Reload the asset manager texture atlas.

LDK_API bool ldk_asset_manager_texture_atlas_reload(
 LDKAssetManager *manager,
 const char *path
);

Parameters

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

Returns

True if the operation succeeds; false otherwise.

LDKAssetImageData

typedef struct LDKAssetImageData{
  LDKImage *image;
  bool is_missing;
}LDKAssetImageData;
Function in ldk_asset_manager.h

ldk_asset_manager_image_is_alive

Check whether the asset manager image refers to a live resource.

LDK_API bool ldk_asset_manager_image_is_alive(
 LDKAssetManager *manager,
 LDKAssetImage asset
);

Parameters

LDKAssetManager *manager
Asset manager that owns or resolves the asset.
LDKAssetImage asset
Asset handle to inspect or modify.

Returns

True when the queried condition holds; false otherwise.

Function in ldk_asset_manager.h

ldk_asset_manager_image_create

Create the asset manager image.

LDK_API LDKAssetImage ldk_asset_manager_image_create(
 LDKAssetManager *manager,
 u32 width,
 u32 height,
 const void *pixels
);

Parameters

LDKAssetManager *manager
Asset manager that owns or resolves the asset.
u32 width
Width in pixels or the units expected by the API.
u32 height
Height in pixels or the units expected by the API.
const void *pixels
Image pixel data.

Returns

Handle to the requested object or resource.

Function in ldk_asset_manager.h

ldk_asset_manager_image_create_format

Create an image asset using an explicit pixel format.

LDK_API LDKAssetImage ldk_asset_manager_image_create_format(
 LDKAssetManager *manager,
 u32 width,
 u32 height,
 LDKImageFormat format,
 const void *pixels
);

Parameters

LDKAssetManager *manager
Asset manager that owns or resolves the asset.
u32 width
Width in pixels or the units expected by the API.
u32 height
Height in pixels or the units expected by the API.
LDKImageFormat format
Format to use for this resource.
const void *pixels
Image pixel data.

Returns

Handle to the requested object or resource.

Function in ldk_asset_manager.h

ldk_asset_manager_image_load

Load the asset manager image.

LDK_API LDKAssetImage ldk_asset_manager_image_load(
 LDKAssetManager *manager,
 const char *path
);

Parameters

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

Returns

Handle to the requested object or resource.

Function in ldk_asset_manager.h

ldk_asset_manager_image_load_shared

Load or reuse shared the asset manager image.

LDK_API LDKAssetImage ldk_asset_manager_image_load_shared(
 LDKAssetManager *manager,
 const char *path
);

Parameters

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

Returns

Handle to the requested object or resource.

Function in ldk_asset_manager.h

ldk_asset_manager_image_missing

Create or retrieve a missing-image placeholder asset.

LDK_API LDKAssetImage ldk_asset_manager_image_missing(
 LDKAssetManager *manager,
 const char *path
);

Parameters

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

Returns

Handle to the requested object or resource.

Function in ldk_asset_manager.h

ldk_asset_manager_font_is_alive

Check whether the asset manager font refers to a live resource.

LDK_API bool ldk_asset_manager_font_is_alive(
 LDKAssetManager *manager,
 LDKAssetFont asset
);

Parameters

LDKAssetManager *manager
Asset manager that owns or resolves the asset.
LDKAssetFont asset
Asset handle to inspect or modify.

Returns

True when the queried condition holds; false otherwise.

Function in ldk_asset_manager.h

ldk_asset_manager_font_create

Create the asset manager font.

LDK_API LDKAssetFont ldk_asset_manager_font_create(
 LDKAssetManager *manager,
 const void *data,
 u32 data_size
);

Parameters

LDKAssetManager *manager
Asset manager that owns or resolves the asset.
const void *data
Source data or system-owned context for this operation.
u32 data_size
Size of the data buffer or region.

Returns

Handle to the requested object or resource.

Function in ldk_asset_manager.h

ldk_asset_manager_font_load

Load the asset manager font.

LDK_API LDKAssetFont ldk_asset_manager_font_load(
 LDKAssetManager *manager,
 const char *path
);

Parameters

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

Returns

Handle to the requested object or resource.

Function in ldk_asset_manager.h

ldk_asset_manager_font_load_shared

Load or reuse shared the asset manager font.

LDK_API LDKAssetFont ldk_asset_manager_font_load_shared(
 LDKAssetManager *manager,
 const char *path
);

Parameters

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

Returns

Handle to the requested object or resource.

LDKAssetAudioData

typedef struct LDKAssetAudioData{
  LDKAssetSourceFile source_file;
  void *encoded_data;
  u64 encoded_size;
  u32 ref_count;
}LDKAssetAudioData;
Function in ldk_asset_manager.h

ldk_asset_manager_audio_is_alive

Check whether the asset manager audio refers to a live resource.

LDK_API bool ldk_asset_manager_audio_is_alive(
 LDKAssetManager *manager,
 LDKAssetAudio asset
);

Parameters

LDKAssetManager *manager
Asset manager that owns or resolves the asset.
LDKAssetAudio asset
Asset handle to inspect or modify.

Returns

True when the queried condition holds; false otherwise.

Function in ldk_asset_manager.h

ldk_asset_manager_audio_load_shared

Load or reuse shared the asset manager audio.

LDK_API LDKAssetAudio ldk_asset_manager_audio_load_shared(
 LDKAssetManager *manager,
 const char *path
);

Parameters

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

Returns

Handle to the requested object or resource.

Function in ldk_asset_manager.h

ldk_asset_manager_mesh_is_alive

Check whether the asset manager mesh refers to a live resource.

LDK_API bool ldk_asset_manager_mesh_is_alive(
 LDKAssetManager *manager,
 LDKAssetMesh asset
);

Parameters

LDKAssetManager *manager
Asset manager that owns or resolves the asset.
LDKAssetMesh asset
Asset handle to inspect or modify.

Returns

True when the queried condition holds; false otherwise.

Function in ldk_asset_manager.h

ldk_asset_manager_mesh_create

Create the asset manager mesh.

LDK_API LDKAssetMesh ldk_asset_manager_mesh_create(
 LDKAssetManager *manager,
 const LDKMeshVertex *vertices,
 u32 vertex_count,
 const u32 *indices,
 u32 index_count
);

Parameters

LDKAssetManager *manager
Asset manager that owns or resolves the asset.
const LDKMeshVertex *vertices
Array of mesh vertices.
u32 vertex_count
Number of vertex entries.
const u32 *indices
Array of mesh indices.
u32 index_count
Number of indices to submit.

Returns

Handle to the requested object or resource.