Macro in ldk.h

ldk_log_raw

#define ldk_log_raw(out, level, fg, bg, components, fmt, ...) \
x_log_raw(ldk_module_get(LDK_MODULE_LOG), (out), (level), (fg), (bg), \
(components), fmt, ##__VA_ARGS__)
Macro in ldk.h

ldk_log_debug

#define ldk_log_debug(fmt, ...) \
x_log_debug(ldk_module_get(LDK_MODULE_LOG), fmt, ##__VA_ARGS__)
Macro in ldk.h

ldk_log_info

#define ldk_log_info(fmt, ...) \
x_log_info(ldk_module_get(LDK_MODULE_LOG), fmt, ##__VA_ARGS__)
Macro in ldk.h

ldk_log_warning

#define ldk_log_warning(fmt, ...) \
x_log_warning(ldk_module_get(LDK_MODULE_LOG), fmt, ##__VA_ARGS__)
Macro in ldk.h

ldk_log_error

#define ldk_log_error(fmt, ...) \
x_log_error(ldk_module_get(LDK_MODULE_LOG), fmt, ##__VA_ARGS__)
Macro in ldk.h

ldk_log_fatal

#define ldk_log_fatal(fmt, ...) \
x_log_fatal(ldk_module_get(LDK_MODULE_LOG), fmt, ##__VA_ARGS__)
Struct in ldk.h

LDKRoot

typedef struct LDKRoot LDKRoot;
Enum in ldk.h

LDKModuleType

typedef enum LDKModuleType{
  LDK_MODULE_ASSET_MANAGER,
  LDK_MODULE_ECS,
  LDK_MODULE_EVENT,
  LDK_MODULE_LOG,
  LDK_MODULE_RENDERER,
  LDK_MODULE_SCENE_MANAGER,
  LDK_MODULE_ASSET_SOURCE,
  LDK_MODULE_AUDIO,
  LDK_MODULE_JOBS,
}LDKModuleType;
Struct in ldk.h

LDKConfig

typedef struct LDKConfig{
  XSmallstr title;
  XFSPath config_file_path;
  XFSPath runtree_path;
  XFSPath icon_path;
  XFSPath asset_root;
  XFSPath log_file;
  XFSPath game_dll;
  i32 display_width;
  i32 display_height;
  i32 resolution_width;
  i32 resolution_height;
  u32 shadow_map_resolution;
  float shadow_distance;
  i32 initial_ui_index_capacity;
  i32 initial_ui_vertex_capacity;
  bool fullscreen;
}LDKConfig;
Function in ldk.h

ldk_engine_initialize

Initialize the engine.

LDK_API bool ldk_engine_initialize(const char *config_ini_path);

Parameters

const char *config_ini_path
Path to the engine configuration INI.

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_engine_config_from_ini

Populate an engine configuration from parsed INI settings.

LDK_API bool ldk_engine_config_from_ini(
 LDKConfig *out_config,
 XIni *ini,
 const char *config_ini_path
);

Parameters

LDKConfig *out_config
Receives the resulting config.
XIni *ini
Ini used by this operation.
const char *config_ini_path
Path to the engine configuration INI.

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_engine_initialize_with_config

Initialize the engine from a configuration supplied by the caller.

LDK_API bool ldk_engine_initialize_with_config(const LDKConfig *config);

Parameters

const LDKConfig *config
Configuration for this operation.

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_engine_render_resolution_set

Set the internal resolution used for game rendering.

LDK_API bool ldk_engine_render_resolution_set(
 i32 width,
 i32 height
);

Parameters

i32 width
Width in pixels or the units expected by the API.
i32 height
Height in pixels or the units expected by the API.

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_engine_shadow_settings_set

Set shadow map resolution and shadow distance.

LDK_API bool ldk_engine_shadow_settings_set(
 u32 resolution,
 float distance
);

Parameters

u32 resolution
Resolution setting.
float distance
Distance in world-space units.

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_engine_is_initialized

Check whether the engine is initialized.

LDK_API bool ldk_engine_is_initialized(void);

Returns

True when the queried condition holds; false otherwise.

Function in ldk.h

ldk_engine_frame

Process one engine frame.

LDK_API void ldk_engine_frame(void);
Function in ldk.h

ldk_module_get

Access the context of a registered engine module.

LDK_API void * ldk_module_get(LDKModuleType module_type);

Parameters

LDKModuleType module_type
Module type used by this operation.

Returns

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

Function in ldk.h

ldk_engine_run

Enter the engine main loop and return its exit code.

LDK_API i32 ldk_engine_run(void);

Returns

Process or engine exit code.

Function in ldk.h

ldk_input_mouse_state_get

Get the input mouse state.

LDK_API void ldk_input_mouse_state_get(LDKMouseState *out_state);

Parameters

LDKMouseState *out_state
Receives the requested input state snapshot.
Function in ldk.h

ldk_input_mouse_button_is_pressed

Test whether the button is currently held.

LDK_API bool ldk_input_mouse_button_is_pressed(
 LDKMouseState *state,
 LDKMouseButton button
);

Parameters

LDKMouseState *state
Input snapshot or state object to query.
LDKMouseButton button
Mouse or input button to query.

Returns

True when the queried condition holds; false otherwise.

Function in ldk.h

ldk_input_mouse_button_down

Test whether the button was pressed during the current input update.

LDK_API bool ldk_input_mouse_button_down(
 LDKMouseState *state,
 LDKMouseButton button
);

Parameters

LDKMouseState *state
Input snapshot or state object to query.
LDKMouseButton button
Mouse or input button to query.

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_input_mouse_button_up

Test whether the button was released during the current input update.

LDK_API bool ldk_input_mouse_button_up(
 LDKMouseState *state,
 LDKMouseButton button
);

Parameters

LDKMouseState *state
Input snapshot or state object to query.
LDKMouseButton button
Mouse or input button to query.

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_input_mouse_wheel_delta

Get the accumulated mouse wheel movement in the input snapshot.

LDK_API i32 ldk_input_mouse_wheel_delta(LDKMouseState *state);

Parameters

LDKMouseState *state
Input snapshot or state object to query.

Returns

The resulting integer value.

Function in ldk.h

ldk_input_mouse_cursor

Get the mouse cursor position.

LDK_API LDKPoint ldk_input_mouse_cursor(LDKMouseState *state);

Parameters

LDKMouseState *state
Input snapshot or state object to query.

Returns

The resulting point.

Function in ldk.h

ldk_input_mouse_cursor_relative

Get the mouse cursor position relative to the active client area.

LDK_API LDKPoint ldk_input_mouse_cursor_relative(LDKMouseState *state);

Parameters

LDKMouseState *state
Input snapshot or state object to query.

Returns

The resulting point.

Function in ldk.h

ldk_input_keyboard_state_get

Get the input keyboard state.

LDK_API void ldk_input_keyboard_state_get(LDKKeyboardState *out_state);

Parameters

LDKKeyboardState *out_state
Receives the requested input state snapshot.
Function in ldk.h

ldk_input_keyboard_key_is_pressed

Test whether the key is currently held.

LDK_API bool ldk_input_keyboard_key_is_pressed(
 LDKKeyboardState *state,
 LDKKeycode keycode
);

Parameters

LDKKeyboardState *state
Input snapshot or state object to query.
LDKKeycode keycode
Keyboard key to query.

Returns

True when the queried condition holds; false otherwise.

Function in ldk.h

ldk_input_keyboard_key_down

Test whether the key was pressed during the current input update.

LDK_API bool ldk_input_keyboard_key_down(
 LDKKeyboardState *state,
 LDKKeycode keycode
);

Parameters

LDKKeyboardState *state
Input snapshot or state object to query.
LDKKeycode keycode
Keyboard key to query.

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_input_keyboard_key_up

Test whether the key was released during the current input update.

LDK_API bool ldk_input_keyboard_key_up(
 LDKKeyboardState *state,
 LDKKeycode keycode
);

Parameters

LDKKeyboardState *state
Input snapshot or state object to query.
LDKKeycode keycode
Keyboard key to query.

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_input_game_view_set

Set the embedded editor game viewport used for input remapping.

LDK_API void ldk_input_game_view_set(
 float x,
 float y,
 float width,
 float height,
 u32 game_width,
 u32 game_height
);

Parameters

float x
X coordinate or component.
float y
Y coordinate or component.
float width
Width in pixels or the units expected by the API.
float height
Height in pixels or the units expected by the API.
u32 game_width
Game width used by this operation.
u32 game_height
Game height used by this operation.
Function in ldk.h

ldk_input_game_view_clear

Clear the editor game viewport input remapping.

LDK_API void ldk_input_game_view_clear(void);
Function in ldk.h

ldk_game_get

Get the game.

LDK_API LDKGame * ldk_game_get(void);

Returns

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

Function in ldk.h

ldk_game_instance_load_static

Load a statically linked game instance.

LDK_API bool ldk_game_instance_load_static(void);

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_engine_terminate

Shut down the engine.

LDK_API void ldk_engine_terminate(void);
Function in ldk.h

ldk_engine_stop

Request termination of the engine main loop with an exit code.

LDK_API void ldk_engine_stop(i32 exit_code);

Parameters

i32 exit_code
Exit code used by this operation.
Function in ldk.h

ldk_game_instance_load_from_shared_lib

Load a game module from a dynamic library.

LDK_API bool ldk_game_instance_load_from_shared_lib(const char *path);

Parameters

const char *path
Path identifying the file or resource.

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_game_instance_initialize

Initialize the game instance.

LDK_API bool ldk_game_instance_initialize(void);

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_game_instance_start

Start the game instance.

LDK_API bool ldk_game_instance_start(void);

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_game_instance_stop

Stop gameplay without unloading the game module or clearing the ECS. The editor may then reload the original scene from disk. A stop requested during an update is completed at the safe frame boundary.

LDK_API bool ldk_game_instance_stop(void);

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_game_instance_pause

Pause the game instance.

LDK_API bool ldk_game_instance_pause(void);

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_game_instance_resume

Resume the game instance.

LDK_API bool ldk_game_instance_resume(void);

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_game_instance_step

Advance a paused game by one update step.

LDK_API bool ldk_game_instance_step(void);

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_game_instance_is_started

Check whether the game instance is started.

LDK_API bool ldk_game_instance_is_started(void);

Returns

True when the queried condition holds; false otherwise.

Function in ldk.h

ldk_game_instance_is_paused

Check whether the game instance is paused.

LDK_API bool ldk_game_instance_is_paused(void);

Returns

True when the queried condition holds; false otherwise.

Function in ldk.h

ldk_game_instance_is_stepping

Check whether the game instance is in a single-step update.

LDK_API bool ldk_game_instance_is_stepping(void);

Returns

True when the queried condition holds; false otherwise.

Function in ldk.h

ldk_game_instance_is_updating

Check whether the game instance is currently updating.

LDK_API bool ldk_game_instance_is_updating(void);

Returns

True when the queried condition holds; false otherwise.

Function in ldk.h

ldk_game_instance_terminate

Shut down the game instance.

LDK_API void ldk_game_instance_terminate(void);
Function in ldk.h

ldk_game_instance_unload

Unload the game instance.

LDK_API bool ldk_game_instance_unload(void);

Returns

True if the operation succeeds; false otherwise.

Function in ldk.h

ldk_engine_main_window_get

Get the engine main window.

LDK_API LDKWindow ldk_engine_main_window_get(void);

Returns

Handle to the requested object or resource.

Function in ldk.h

ldk_main_window

Get the engine main window handle.

LDK_API LDKWindow ldk_main_window(void);

Returns

Handle to the requested object or resource.

Function in ldk.h

ldk_engine_config_get

Get a read-only pointer to the active engine configuration.

LDK_API const LDKConfig * ldk_engine_config_get(void);

Returns

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