mk_imgui_begin_framefunction
void mk_imgui_begin_frame(void)Begin a new ImGui frame.
Call this at the start of your frame, before any ImGui calls. Automatically handles input from modkit's input system.
#include <modkit/imgui.h>8 functions · 1 structs · 1 typedefs · 2 macros
Dear ImGui integration for modkit.
Provides a GPU backend for Dear ImGui with HiDPI support. Uses cimgui (C bindings) internally. When this module creates the ImGui context, it automatically uses window pixel density for font raster detail and mk_get_window_ui_scale() for portable font/style dimensions. If the application creates the ImGui context and font atlas first, it owns that sizing and should apply the same split itself. Basic usage:
mk_imgui_begin_framefunctionvoid mk_imgui_begin_frame(void)Begin a new ImGui frame.
Call this at the start of your frame, before any ImGui calls. Automatically handles input from modkit's input system.
mk_imgui_createfunctionmk_result mk_imgui_create(const mk_imgui_desc *desc)Initialize ImGui with modkit backend.
| Parameter | Type | Description |
|---|---|---|
desc | const mk_imgui_desc * | Configuration options, or NULL for defaults |
Returns MK_SUCCESS on success, error code on failure
mk_imgui_destroyfunctionvoid mk_imgui_destroy(void)Shutdown ImGui and release resources.
mk_imgui_end_framefunctionvoid mk_imgui_end_frame(void)End the ImGui frame and render.
Call this after all your ImGui calls are done.
mk_imgui_set_view_idfunctionvoid mk_imgui_set_view_id(mk_view_id_t view_id)Set the view ID for ImGui rendering.
| Parameter | Type | Description |
|---|---|---|
view_id | mk_view_id_t | modkit view ID |
mk_imgui_texture_idfunctionvoid * mk_imgui_texture_id(mk_texture_t texture)Create an ImGui texture ID from a modkit texture.
Use this to display textures in ImGui::Image() calls.
| Parameter | Type | Description |
|---|---|---|
texture | mk_texture_t | modkit texture handle |
Returns ImTextureID suitable for ImGui::Image() calls
mk_imgui_want_capture_keyboardfunctionbool mk_imgui_want_capture_keyboard(void)Check if ImGui wants to capture keyboard input.
Use this to avoid processing keyboard events in your app when ImGui needs them.
Returns true if ImGui wants keyboard input
mk_imgui_want_capture_mousefunctionbool mk_imgui_want_capture_mouse(void)Check if ImGui wants to capture mouse input.
Use this to avoid processing mouse events in your app when ImGui needs them.
Returns true if ImGui wants mouse input
mk_imgui_descstructImGui configuration options.
| Field | Type | Description |
|---|---|---|
font_size | float | Base font size in points (default: 16.0). |
font_data | const void * | Optional custom font data (TTF). |
font_data_size | uint32_t | Size of font data in bytes. |
view_id | mk_view_id_t | View ID for imgui rendering (default: 255). |
enable_docking | bool | Enable docking support (default: true). |
dark_style | bool | Use dark style (default: true). |
mk_imgui_desctypedeftypedef struct mk_imgui_desc mk_imgui_descImGui configuration options.
CIMGUI_DEFINE_ENUMS_AND_STRUCTSdefineCIMGUI_DEFINE_ENUMS_AND_STRUCTSConstant for cimgui define enums and structs.
igGetIOdefineigGetIOConstant for iggetio.