Skip to content
modkitv0.2

backend.h

#include <modkit/backend.h>1 functions · 1 structs · 1 enums · 2 typedefs

Platform backend abstraction.

Each platform implements this interface to provide:Native window handle extraction for GPU initializationRenderer preferencesPlatform-specific initialization/polling hooks

Functions

mk_get_backendfunction

const mk_backend * mk_get_backend(void)

Get the platform backend for the current platform.

Implemented per-platform in src/backend_*.c

Returns A borrowed pointer, or NULL when unavailable.

Structs

mk_backendstruct

Data for backend.

FieldTypeDescription
get_native_window_handlevoid *(*)The get native window handle.
get_native_display_handlevoid *(*)The get native display handle.
get_window_handle_typemk_native_window_type_t(*)The get window handle type.
get_preferred_renderermk_renderer_type_t(*)The get preferred renderer.
get_initial_sizebool(*)Get initial window size.
poll_sizebool(*)Poll for size changes.
on_resizevoid(*)Called after window resize is processed.
run_loopvoid(*)Custom main loop runner (optional).
on_app_suspendvoid(*)The on app suspend.
on_app_resumevoid(*)The on app resume.

Enums

mk_native_window_typeenum

Native window handle type.

ValueDescription
MK_NATIVE_WINDOW_DEFAULTPlatform default (X11 on Linux).
MK_NATIVE_WINDOW_WAYLANDWayland.

Typedefs

mk_backendtypedef

typedef struct mk_backend mk_backend

Data for backend.

mk_native_window_type_ttypedef

typedef enum mk_native_window_type mk_native_window_type_t

Native window handle type.