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.
#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
mk_get_backendfunctionconst 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.
mk_backendstructData for backend.
| Field | Type | Description |
|---|---|---|
get_native_window_handle | void *(*) | The get native window handle. |
get_native_display_handle | void *(*) | The get native display handle. |
get_window_handle_type | mk_native_window_type_t(*) | The get window handle type. |
get_preferred_renderer | mk_renderer_type_t(*) | The get preferred renderer. |
get_initial_size | bool(*) | Get initial window size. |
poll_size | bool(*) | Poll for size changes. |
on_resize | void(*) | Called after window resize is processed. |
run_loop | void(*) | Custom main loop runner (optional). |
on_app_suspend | void(*) | The on app suspend. |
on_app_resume | void(*) | The on app resume. |
mk_native_window_typeenumNative window handle type.
| Value | Description |
|---|---|
MK_NATIVE_WINDOW_DEFAULT | Platform default (X11 on Linux). |
MK_NATIVE_WINDOW_WAYLAND | Wayland. |
mk_backendtypedeftypedef struct mk_backend mk_backendData for backend.
mk_native_window_type_ttypedeftypedef enum mk_native_window_type mk_native_window_type_tNative window handle type.