# `imgui_bundle.hello_imgui` Hello ImGui: the app runner. It creates the window and the rendering backend, and runs the loop, on desktop, mobile and the web. Around Dear ImGui, it adds what an app needs: dockable windows and layouts, a menu and a status bar, fonts and icons, assets, DPI awareness, themes, power saving when idle, and the user's settings. Start with `hello_imgui.run(gui_function)`; for more control, fill a `RunnerParams`. `immapp.run` does the same, and also sets up the add-ons (ImPlot, markdown, the node editor...): most apps of the bundle use it. Docs: https://pthom.github.io/hello_imgui/book/ Generated from the Python stubs of Dear ImGui Bundle. Each entry gives its Python signature, its C++ declaration ("C++:"), and the first paragraph of its doc. The Python names follow the C++ ones (`ImGui::Button` is `imgui.button`, `ImPlotFlags_` is `implot.Flags_`). The full docs: https://imgui-bundle.pages.dev/doc/api/hello-imgui/ Demos using it (all the demos: https://imgui-bundle.pages.dev/llms/demos.txt): - Assets and add-ons: Load images and icons from your assets folder, and use two add-ons: markdown and ImPlot. Python: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_python/demos_immapp/demo_assets_addons.py, C++: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_cpp/demos_immapp/demo_assets_addons.cpp - Dockable windows: Hello ImGui provides a docking system: define named dock spaces, then assign windows to them. Python: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_python/demos_immapp/layout_docking.py, C++: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_cpp/demos_immapp/layout_docking.cpp - A full app: docking, fonts, logs: A template for a real application, built with Hello ImGui: copy it and start from there. Python: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_python/demos_immapp/demo_docking.py, C++: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_cpp/demos_immapp/demo_docking.cpp - Power save when idle: When nothing happens, Hello ImGui lowers the frame rate to spare the CPU: after 3 seconds, the live plot and the spinner become choppy. Python: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_python/demos_immapp/demo_powersave.py, C++: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_cpp/demos_immapp/demo_powersave.cpp - Chinese and other non-Latin fonts: The bundled fonts cover Latin, Greek and Cyrillic only: other scripts show up as ???. Python: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_python/demos_immapp/demo_chinese_font.py, C++: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_cpp/demos_immapp/demo_chinese_font.cpp - Command palette: A searchable list of commands, as in VS Code: press Ctrl+Shift+P (Cmd+Shift+P on macOS), or its button. Python: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_python/demos_immapp/demo_command_palette.py, C++: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_cpp/demos_immapp/demo_command_palette.cpp - Test engine: Watch a ImGui Test Engine drive the mouse and the keyboard: it clicks buttons, types text, etc., and checks the results. Python: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_python/demos_immapp/demo_testengine.py, C++: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_cpp/demos_immapp/demo_testengine.cpp - Themes and theme tweaking: Pick a complete look for your app, then fine-tune its colors, rounding and spacing. Python: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_python/playground/examples/themes.py - Log window: A log window for your app, with four levels: debug, info, warning and error. Python: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_python/demo_logger.py, C++: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_cpp/demo_logger.cpp - Async: compute beside the GUI: The GUI runs as an asyncio task, while a Python loop keeps computing. Python: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_python/demos_python_specifics/demo_run_async.py - 3D sea in OpenGL (desktop): Draw anything behind your GUI with OpenGL: here, an animated sea whose waves and colors you can tune. Python: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_python/demos_immapp/demo_custom_background.py, C++: https://github.com/pthom/imgui_bundle/blob/main/bindings/imgui_bundle/demos_cpp/demos_immapp/demo_custom_background.cpp ### hello_imgui/hello_imgui.h def run(runner_params: RunnerParams) -> None C++: void Run(RunnerParams &runnerParams); def run(simple_params: SimpleRunnerParams) -> None C++: void Run(const SimpleRunnerParams &simpleParams); def run(gui_function: VoidFunction, window_title: str = '', window_size_auto: bool = False, window_restore_previous_geometry: bool = False, window_size: Optional[ScreenSize] = None, fps_idle: float = 10.0, top_most: bool = False) -> None C++: void Run( const VoidFunction &guiFunction, const std::string &windowTitle = "", bool windowSizeAuto = false, bool windowRestorePreviousGeometry = false, const ScreenSize &windowSize = DefaultWindowSize, float fpsIdle = 10.f, bool topMost = false ); `HelloImGui::Run(RunnerParams &)`: full signature, the most customizable version. Runs an application whose params and Gui are provided by runnerParams. def get_runner_params() -> RunnerParams C++: RunnerParams* GetRunnerParams(); `get_runner_params()`: a convenience function that will return the runnerParams of the current application def is_using_hello_imgui() -> bool C++: bool IsUsingHelloImGui(); `is_using_hello_imgui()`: returns True if the application is using HelloImGui def init_gl_loader() -> bool C++: bool InitGlLoader(); `init_gl_loader()`: initializes HelloImGui's OpenGL function loader (GLAD). Required ONLY when using HelloImGui's image / texture helpers (`image_and_size_from_asset`, `create_texture_gpu_from_rgba_data`, anything that uploads to a `TextureGpuOpenGl`) OUTSIDE a `hello_imgui.run()` context. Inside ... def set_tap_opens_url(rect_min: ImVec2Like, rect_max: ImVec2Like, url: str) -> bool C++: bool SetTapOpensUrl(ImVec2 rectMin, ImVec2 rectMax, const std::string& url); `set_tap_opens_url(rect_min, rect_max, url)`: in the browser, a tap or a click on this rectangle (screen coordinates) opens the url in a new tab, whatever the browser and the pointer. Call it each frame while the button or the link is shown (several rectangles per frame: the links of a text). ... def set_item_takes_touch_drags(long_press_is_right_click: bool = True) -> None C++: void SetItemTakesTouchDrags(bool longPressIsRightClick = true); `set_item_takes_touch_drags(long_press_is_right_click = True)`: call it right after a widget that is dragged (a plot, a node editor, a canvas). On a touch screen, a press on it goes to the widget at once, without the hold, even in a window that scrolls: its drags move the widget's content, in any ... def set_item_is_live(live: bool = True) -> None C++: void SetItemIsLive(bool live = true); `set_item_is_live(live = True)`: call it right after a widget whose content changes on its own (an animation, a live image, a plot of varying data), at each frame: while it is live and visible, the app does not idle (see RunnerParams.fpsIdling). def request_refresh() -> None C++: void RequestRefresh(); `request_refresh()`: the next frame comes at full speed, even without user input: the app does not idle. Callable from any thread: call it when new data arrives (a camera, a socket), or at each frame while something that is no widget moves (a background, a drawing). def prefers_reduced_motion() -> bool C++: bool PrefersReducedMotion(); `prefers_reduced_motion()`: True when the system asks for less motion: "Reduce motion" on macOS and iOS, "Show animations in Windows" turned off, a browser's prefers-reduced-motion. An application can then skip its animations (a scroll, a transition). False where the system has no such setting ... def frame_rate(duration_for_mean: float = 0.5) -> float C++: float FrameRate(float durationForMean = 0.5f); `frame_rate(duration_for_mean = 0.5)`: Returns the current FrameRate. May differ from ImGui::GetIO().FrameRate, since one can choose the duration for the calculation of the mean value of the fps Returns the current FrameRate. May differ from ImGui::GetIO().FrameRate, since one can choose the ... def get_imgui_test_engine() -> ImGuiTestEngine C++: ImGuiTestEngine* GetImGuiTestEngine(); `ImGuiTestEngine* GetImGuiTestEngine()`: returns a pointer to the global instance of ImGuiTestEngine that was initialized by HelloImGui (iif ImGui Test Engine is active). def get_backend_description() -> str C++: std::string GetBackendDescription(); `get_backend_description()`: returns a string with the backend info Could be for example: "Glfw - OpenGL3" "Glfw - Metal" "Sdl - Vulkan" def change_window_size(window_size: ScreenSize) -> None C++: void ChangeWindowSize(const ScreenSize &windowSize); `ChangeWindowSize(const ScreenSize &windowSize)`: sets the window size (useful if you want to change the window size during execution) def use_window_full_monitor_work_area() -> None C++: void UseWindowFullMonitorWorkArea(); `use_window_full_monitor_work_area()`: sets the window size to the monitor work area (useful if you want to change the window size during execution) def switch_layout(layout_name: str) -> None C++: void SwitchLayout(const std::string& layoutName); `switch_layout(layout_name)` Changes the application current layout. Only used in advanced cases when several layouts are available, i.e. if you filled runnerParams.alternativeDockingLayouts. def current_layout_name() -> str C++: std::string CurrentLayoutName(); `current_layout_name()`: returns the name of the current layout def add_dockable_window(dockable_window: DockableWindow, force_dockspace: bool = False) -> None C++: void AddDockableWindow(const DockableWindow& dockableWindow, bool forceDockspace = false); `add_dockable_window()`: will add a dockable window to the current layout. Will dock the window to the dockspace it belongs to if forceDockspace is True, otherwise will dock it to the last space it was docked to (using saved settings) def remove_dockable_window(dockable_window_name: str) -> None C++: void RemoveDockableWindow(const std::string& dockableWindowName); `remove_dockable_window()`: will remove a dockable window from the current layout. (dockableWindowName is the label of the window, as provided in the DockableWindow struct) def save_user_pref(user_pref_name: str, user_pref_content: str) -> None C++: void SaveUserPref(const std::string& userPrefName, const std::string& userPrefContent); `SaveUserPref(string userPrefName, string userPrefContent)`: Shall be called in the callback runnerParams.callbacks.BeforeExit On the web, the user prefs live in memory, like the ini file: a reload loses them. For a value that the user should find again at the next visit, use SaveLastingPref ... def load_user_pref(user_pref_name: str) -> str C++: std::string LoadUserPref(const std::string& userPrefName); `string LoadUserPref(string& userPrefName)` Shall be called in the callback runnerParams.callbacks.PostInit def save_lasting_pref(pref_name: str, pref_content: str) -> None C++: void SaveLastingPref(const std::string& prefName, const std::string& prefContent); `SaveLastingPref(string prefName, string prefContent)`: Call it when the value changes: on the web, BeforeExit does not run when a tab closes. def load_lasting_pref(pref_name: str) -> str C++: std::string LoadLastingPref(const std::string& prefName); `string LoadLastingPref(string prefName)`: Returns "" if the pref was never saved. Call it in PostInit, or later: after its first read, it is cheap enough to call at each frame (so that several views of an app can share a pref). def show_view_menu(runner_params: RunnerParams) -> None C++: void ShowViewMenu(RunnerParams & runnerParams); `ShowViewMenu(RunnerParams & runnerParams)`: shows the View menu (where you can select the layout and docked windows visibility def show_app_menu(runner_params: RunnerParams) -> None C++: void ShowAppMenu(RunnerParams & runnerParams); `ShowAppMenu(RunnerParams & runnerParams)`: shows the default App menu (including the Quit item) ### hello_imgui/hello_imgui_assets.h #### Handling screens with high DPI class AssetFileData C++: struct AssetFileData data: Optional[Any] data_size: int def __init__(self, data_size: int = 0) -> None def load_asset_file_data(asset_path: str) -> AssetFileData C++: AssetFileData LoadAssetFileData(const char *assetPath); LoadAssetFileData(const char *assetPath)` Will load an entire asset file into memory. This works on all platforms, including android. You *have* to call FreeAssetFileData to free the memory, except if you use ImGui::GetIO().Fonts->AddFontFromMemoryTTF, which will take ownership of the data and free ... def free_asset_file_data(asset_file_data: AssetFileData) -> None C++: void FreeAssetFileData(AssetFileData * assetFileData); FreeAssetFileData(AssetFileData *) Will free the memory. Note: "ImGui::GetIO().Fonts->AddFontFromMemoryTTF" takes ownership of the data and will free the memory for you. def default_load_asset_file_data(asset_path: str) -> AssetFileData C++: AssetFileData DefaultLoadAssetFileData(const char *assetPath); This function actually performs the asset load, as described in LoadAssetFileData def asset_file_full_path(asset_relative_filename: str, assert_if_not_found: bool = True) -> str C++: std::string AssetFileFullPath(const std::string& assetRelativeFilename, bool assertIfNotFound = true); `std::string AssetFileFullPath(const std::string& assetRelativeFilename)` will return the path to assets. def asset_exists(asset_relative_filename: str) -> bool C++: bool AssetExists(const std::string& assetRelativeFilename); Returns True if this asset file exists def set_assets_folder(folder: str) -> None C++: void SetAssetsFolder(const std::string& folder); Sets the assets folder location (when using this, automatic assets installation on mobile platforms may not work) def add_assets_search_path(folder: str) -> None C++: void AddAssetsSearchPath(const std::string& folder); Add a folder to the asset search paths. def clear_assets_search_paths() -> None C++: void ClearAssetsSearchPaths(); Remove all previously added search paths. def get_assets_search_paths() -> List[str] C++: const std::vector& GetAssetsSearchPaths(); Return the current list of search paths. def override_assets_folder(folder: str) -> None C++: void overrideAssetsFolder(const char* folder); synonym of SetAssetsFolder ### hello_imgui/hello_imgui_logger.h enum LogLevel C++: enum class LogLevel debug = 0 info = 1 warning = 2 error = 3 def log(level: LogLevel, format: str) -> None C++: void Log(LogLevel level, char const* const format, ...); def log_clear() -> None C++: void LogClear(); def log_gui(size: Optional[ImVec2Like] = None) -> None C++: void LogGui(ImVec2 size=ImVec2(0.f, 0.f)); ### hello_imgui/image_from_asset.h #### Images from the assets def image_from_asset(asset_path: str, size: Optional[ImVec2Like] = None, uv0: Optional[ImVec2Like] = None, uv1: Optional[ImVec2Like] = None) -> None C++: void ImageFromAsset(const char *assetPath, const ImVec2& size = ImVec2(0, 0), const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1,1)); `HelloImGui::ImageFromAsset(const char *assetPath, size, ...)`: will display a static image from the assets. def image_from_asset_with_bg(asset_path: str, size: Optional[ImVec2Like] = None, uv0: Optional[ImVec2Like] = None, uv1: Optional[ImVec2Like] = None, tint_col: Optional[ImVec4Like] = None, border_col: Optional[ImVec4Like] = None) -> None C++: void ImageFromAssetWithBg(const char *assetPath, const ImVec2& size = ImVec2(0, 0), const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1,1), const ImVec4& tint_col = ImVec4(1,1,1,1), const ImVec4& border_col = ImVec4(0,0,0,0)); `HelloImGui::ImageFromAssetWithBg(const char *assetPath, size, ...)`: will display a static image from the assets, with a colored background and a border. def image_button_from_asset(asset_path: str, size: Optional[ImVec2Like] = None, uv0: Optional[ImVec2Like] = None, uv1: Optional[ImVec2Like] = None, frame_padding: int = -1, bg_col: Optional[ImVec4Like] = None, tint_col: Optional[ImVec4Like] = None) -> bool C++: bool ImageButtonFromAsset(const char *assetPath, const ImVec2& size = ImVec2(0, 0), const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1,1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0,0,0,0), const ImVec4& tint_col = ImVec4(1,1,1,1)); `bool HelloImGui::ImageButtonFromAsset(const char *assetPath, size, ...)`: will display a button using an image from the assets. def im_texture_id_from_asset(asset_path: str) -> ImTextureID C++: ImTextureID ImTextureIdFromAsset(const char *assetPath); `ImTextureID HelloImGui::ImTextureIdFromAsset(assetPath)`: will return a texture ID for an image loaded from the assets. def image_size_from_asset(asset_path: str) -> ImVec2 C++: ImVec2 ImageSizeFromAsset(const char *assetPath); `ImVec2 HelloImGui::ImageSizeFromAsset(assetPath)`: will return the size of an image loaded from the assets. class ImageAndSize C++: struct ImageAndSize `HelloImGui::ImageAndSize HelloImGui::ImageAndSizeFromAsset(assetPath)`: will return the texture ID and the size of an image loaded from the assets. texture_id: ImTextureID size: ImVec2 def __init__(self, texture_id: Optional[ImTextureID] = None, size: Optional[ImVec2Like] = None) -> None def image_and_size_from_asset(asset_path: str) -> ImageAndSize C++: ImageAndSize ImageAndSizeFromAsset(const char *assetPath); def image_proportional_size(asked_size: ImVec2Like, image_size: ImVec2Like) -> ImVec2 C++: ImVec2 ImageProportionalSize(const ImVec2& askedSize, const ImVec2& imageSize); `ImVec2 HelloImGui::ImageProportionalSize(askedSize, imageSize)`: will return the displayed size of an image. - if askedSize.x or askedSize.y is 0, then the corresponding dimension will be computed from the image size, keeping the aspect ratio. - if askedSize.x>0 and askedSize.y> 0, then the image ... def free_image_cache() -> None C++: void FreeImageCache(); `hello_imgui.free_image_cache()`: clears the asset image cache shared by `image_from_asset`, `image_and_size_from_asset` and `image_and_size_from_encoded_data`. Inside a `hello_imgui.run()` context this is called automatically at shutdown. When using imgui_md (or any of the helpers above) without ... ### hello_imgui/texture_gpu.h class TextureGpu Opaque RAII handle owning a GPU texture. width: int height: int def texture_id(self) -> int Returns the underlying ImTextureID as a Python int. Pass it to imgui.image() etc. ### hello_imgui/imgui_theme.h enum ImGuiTheme_ C++: enum ImGuiTheme_ imgui_colors_classic = 0 imgui_colors_dark = 1 imgui_colors_light = 2 material_flat = 3 photoshop_style = 4 gray_variations = 5 gray_variations_darker = 6 microsoft_style = 7 cherry = 8 darcula = 9 darcula_darker = 10 light_rounded = 11 so_dark_accent_blue = 12 so_dark_accent_yellow = 13 so_dark_accent_red = 14 black_is_black = 15 white_is_white = 16 count = 17 def imgui_theme_name(theme: ImGuiTheme_) -> str C++: const char* ImGuiTheme_Name(ImGuiTheme_ theme); def imgui_theme_from_name(theme_name: str) -> ImGuiTheme_ C++: ImGuiTheme_ ImGuiTheme_FromName(const char* themeName); def theme_to_style(theme: ImGuiTheme_) -> ImGuiStyle C++: ImGuiStyle ThemeToStyle(ImGuiTheme_ theme); def apply_theme(theme: ImGuiTheme_) -> None C++: void ApplyTheme(ImGuiTheme_ theme); class ImGuiThemeTweaks C++: struct ImGuiThemeTweaks rounding: float rounding_scrollbar_ratio: float alpha_multiplier: float hue: float saturation_multiplier: float value_multiplier_front: float value_multiplier_bg: float value_multiplier_text: float value_multiplier_frame_bg: float def __init__(self) -> None C++: ImGuiThemeTweaks(); class ImGuiTweakedTheme C++: struct ImGuiTweakedTheme theme: ImGuiTheme_ tweaks: ImGuiThemeTweaks def __init__(self, theme: ImGuiTheme_ = ImGuiTheme_.darcula_darker, tweaks: Optional[ImGuiThemeTweaks] = None) -> None C++: ImGuiTweakedTheme(ImGuiTheme_ theme = ImGuiTheme_DarculaDarker, const ImGuiThemeTweaks& tweaks = ImGuiThemeTweaks()) def tweaked_theme_theme_to_style(tweaked_theme: ImGuiTweakedTheme) -> ImGuiStyle C++: ImGuiStyle TweakedThemeThemeToStyle(const ImGuiTweakedTheme& tweaked_theme); def apply_tweaked_theme(tweaked_theme: ImGuiTweakedTheme) -> None C++: void ApplyTweakedTheme(const ImGuiTweakedTheme& tweaked_theme); #### PushTweakedTheme() / PopTweakedTheme() def push_tweaked_theme(tweaked_theme: ImGuiTweakedTheme) -> None C++: void PushTweakedTheme(const ImGuiTweakedTheme& tweaked_theme); def pop_tweaked_theme() -> None C++: void PopTweakedTheme(); def show_theme_tweak_gui(tweaked_theme: ImGuiTweakedTheme) -> bool C++: bool ShowThemeTweakGui(ImGuiTweakedTheme *tweaked_theme); Show the theme selection listbox, the theme tweak widgets, as well as ImGui::ShowStyleEditor. Returns True if modified (Warning, when using ShowStyleEditor, no info about modification is transmitted) #### Some tweakable themes def so_dark(hue: float) -> ImGuiStyle C++: ImGuiStyle SoDark(float hue); def shades_of_gray(rounding: float = 0.0, value_multiplier_front: float = 1.0, value_multiplier_bg: float = 1.0) -> ImGuiStyle C++: ImGuiStyle ShadesOfGray(float rounding=0.f, float value_multiplier_front=1.f, float value_multiplier_bg=1.f); def darcula(rounding: float = 1.0, hue: float = -1.0, saturation_multiplier: float = 1.0, value_multiplier_front: float = 1.0, value_multiplier_bg: float = 1.0, alpha_bg_transparency: float = 1.0) -> ImGuiStyle C++: ImGuiStyle Darcula( float rounding=1.f, float hue=-1.f, float saturation_multiplier=1.f, float value_multiplier_front=1.f, float value_multiplier_bg=1.f, float alpha_bg_transparency=1.f ); ### hello_imgui/hello_imgui_theme.h def show_theme_tweak_gui_window(p_open: Optional[bool] = None) -> Optional[bool] C++: void ShowThemeTweakGuiWindow(bool* p_open = nullptr); ### hello_imgui/hello_imgui_font.h #### Font loading class FontLoadingParams C++: struct FontLoadingParams Font loading parameters: several options are available (color, merging, range, ...) merge_to_last_font: bool load_color: bool inside_assets: bool font_config: ImFontConfig def __init__(self, merge_to_last_font: bool = False, load_color: bool = False, inside_assets: bool = True, font_config: Optional[ImFontConfig] = None) -> None def load_font(font_filename: str, font_size: float, params: Optional[FontLoadingParams] = None) -> ImFont C++: ImFont* LoadFont( const std::string & fontFilename, float fontSize, const FontLoadingParams & params = __srcmlcpp_brace_init__()); def load_font_ttf(font_filename: str, font_size: float, config: Optional[ImFontConfig] = None) -> ImFont C++: ImFont* LoadFontTTF( const std::string & fontFilename, float fontSize, ImFontConfig config = ImFontConfig() ); Loads a font from the assets, with an ImGui font config def load_font_ttf_with_font_awesome_icons(font_filename: str, font_size: float, config_font: Optional[ImFontConfig] = None) -> ImFont C++: ImFont* LoadFontTTF_WithFontAwesomeIcons( const std::string & fontFilename, float fontSize, ImFontConfig configFont = ImFontConfig() ); Loads a font from the assets and merges the icons of Font Awesome into it (Font Awesome 4 or 6, as set by RunnerParams.callbacks.defaultIconFont) ### hello_imgui/runner_params.h enum PlatformBackendType C++: enum class PlatformBackendType Platform backend type (SDL, GLFW) They are listed in the order of preference when FirstAvailable is selected. first_available = 0 glfw = 1 sdl = 2 null = 3 enum RendererBackendType C++: enum class RendererBackendType Rendering backend type (OpenGL3, Metal, Vulkan, DirectX11, DirectX12) They are listed in the order of preference when FirstAvailable is selected. first_available = 0 open_gl3 = 1 metal = 2 vulkan = 3 direct_x11 = 4 direct_x12 = 5 null = 6 def platform_backend_type_to_string(platform_backend_type: PlatformBackendType) -> str C++: std::string PlatformBackendTypeToString(PlatformBackendType platformBackendType); def renderer_backend_type_to_string(renderer_backend_type: RendererBackendType) -> str C++: std::string RendererBackendTypeToString(RendererBackendType rendererBackendType); enum IniFolderType C++: enum class IniFolderType IniFolderType is an enum which describes where is the base path to store the ini file for the application settings. current_folder = 0 absolute_path = 1 app_user_config_folder = 2 app_executable_folder = 3 home_folder = 4 documents_folder = 5 temp_folder = 6 def ini_folder_location(ini_folder_type: IniFolderType) -> str C++: std::string IniFolderLocation(IniFolderType iniFolderType); Returns the path corresponding to the given IniFolderType enum FpsIdlingMode C++: enum class FpsIdlingMode FpsIdlingMode is an enum that describes the different modes of idling when rendering the GUI. sleep = 0 early_return = 1 auto = 2 class FpsIdling C++: struct FpsIdling FpsIdling is a struct that contains parameters controlling the application's frame pacing, idling behavior, and performance. fps_idle: float time_active_after_last_event: float enable_idling: bool is_idling: bool remember_enable_idling: bool fps_idling_mode: FpsIdlingMode vsync_to_monitor: bool fps_max: float def __init__(self, fps_idle: float = 9.0, time_active_after_last_event: float = 3.0, enable_idling: bool = True, is_idling: bool = False, remember_enable_idling: bool = False, fps_idling_mode: FpsIdlingMode = FpsIdlingMode.auto, vsync_to_monitor: bool = True, fps_max: float = 0.0) -> None def ini_settings_location(runner_params: RunnerParams) -> Optional[str] C++: std::optional IniSettingsLocation(const RunnerParams& runnerParams); IniSettingsLocation returns the path to the ini file for the application settings. def has_ini_settings(runner_params: RunnerParams) -> bool C++: bool HasIniSettings(const RunnerParams& runnerParams); HasIniSettings returns True if the ini file for the application settings exists. def delete_ini_settings(runner_params: RunnerParams) -> None C++: void DeleteIniSettings(const RunnerParams& runnerParams); DeleteIniSettings deletes the ini file for the application settings. class SimpleRunnerParams C++: struct SimpleRunnerParams SimpleRunnerParams is a struct that contains simpler params adapted for simple use cases. For example, this is sufficient to run an application: ```cpp None MyGui() { ImGui::Text("Hello, world"); if (ImGui::Button("Exit")) HelloImGui::GetRunnerParams()->appShallExit = True; } gui_function: VoidFunction window_title: str window_size_auto: bool window_restore_previous_geometry: bool window_size: ScreenSize fps_idle: float enable_idling: bool top_most: bool ini_disable: bool def to_runner_params(self) -> RunnerParams C++: RunnerParams ToRunnerParams() const; def __init__(self, gui_function: Optional[VoidFunction] = None, window_title: str = '', window_size_auto: bool = False, window_restore_previous_geometry: bool = False, window_size: Optional[ScreenSize] = None, fps_idle: float = 9.0, enable_idling: bool = True, top_most: bool = False, ini_disable: bool = False) -> None ### hello_imgui/app_window_params.h enum FullScreenMode C++: enum class FullScreenMode no_full_screen = 0 full_screen = 1 # Full screen with specified resolution full_screen_desktop_resolution = 2 # Full screen with current desktop mode & resolution full_monitor_work_area = 3 # Fake full screen, maximized window on the selected monitor enum WindowSizeState C++: enum class WindowSizeState standard = 0 minimized = 1 maximized = 2 enum WindowPositionMode C++: enum class WindowPositionMode os_default = 0 monitor_center = 1 from_coords = 2 enum EmscriptenKeyboardElement C++: enum class EmscriptenKeyboardElement window = 0 document = 1 screen = 2 canvas = 3 default = 4 enum WindowSizeMeasureMode C++: enum class WindowSizeMeasureMode screen_coords = 0 relative_to96_ppi = 1 class WindowGeometry C++: struct WindowGeometry WindowGeometry is a struct that defines the window geometry. size: ScreenSize size_auto: bool window_size_state: WindowSizeState window_size_measure_mode: WindowSizeMeasureMode position_mode: WindowPositionMode position: ScreenPosition monitor_idx: int full_screen_mode: FullScreenMode resize_app_window_at_next_frame: bool def __init__(self, size: Optional[ScreenSize] = None, size_auto: bool = False, window_size_state: WindowSizeState = WindowSizeState.standard, window_size_measure_mode: WindowSizeMeasureMode = WindowSizeMeasureMode.relative_to96_ppi, position_mode: WindowPositionMode = WindowPositionMode.os_default, position: Optional[ScreenPosition] = None, monitor_idx: int = 0, full_screen_mode: FullScreenMode = FullScreenMode.no_full_screen, resize_app_window_at_next_frame: bool = False) -> None class EdgeInsets C++: struct EdgeInsets If there is a notch on the iPhone, you should not display inside these insets top: float # Typically around 47 left: float # Typically 0 bottom: float # Typically around 34 right: float # Typically 0 def __init__(self, top: float = 0.0, left: float = 0.0, bottom: float = 0.0, right: float = 0.0) -> None class AppWindowParams C++: struct AppWindowParams AppWindowParams is a struct that defines the application window display params. See https://raw.githubusercontent.com/pthom/hello_imgui/master/src/hello_imgui/doc_src/hello_imgui_diagram.jpg for details. window_title: str window_geometry: WindowGeometry restore_previous_geometry: bool resizable: bool hidden: bool top_most: bool borderless: bool borderless_movable: bool borderless_resizable: bool borderless_closable: bool borderless_highlight_color: ImVec4 edge_insets: EdgeInsets handle_edge_insets: bool emscripten_keyboard_element: EmscriptenKeyboardElement emscripten_allow_browser_zoom_shortcuts: bool repaint_during_resize_gotcha_reentrant_repaint: bool def __init__(self, window_title: str = '', window_geometry: Optional[WindowGeometry] = None, restore_previous_geometry: bool = False, resizable: bool = True, hidden: bool = False, top_most: bool = False, borderless: bool = False, borderless_movable: bool = True, borderless_resizable: bool = True, borderless_closable: bool = True, borderless_highlight_color: Optional[ImVec4Like] = None, edge_insets: Optional[EdgeInsets] = None, handle_edge_insets: bool = True, emscripten_keyboard_element: EmscriptenKeyboardElement = EmscriptenKeyboardElement.default, emscripten_allow_browser_zoom_shortcuts: bool = True, repaint_during_resize_gotcha_reentrant_repaint: bool = False) -> None ### hello_imgui/screen_bounds.h #### Screen coordinates and high DPI screens class ScreenBounds C++: struct ScreenBounds position: ScreenPosition size: ScreenSize def top_left_corner(self) -> ScreenPosition C++: ScreenPosition TopLeftCorner() const; def bottom_right_corner(self) -> ScreenPosition C++: ScreenPosition BottomRightCorner() const; def center(self) -> ScreenPosition C++: ScreenPosition Center() const; def contains(self, pixel: ScreenPosition) -> bool C++: bool Contains(ScreenPosition pixel) const; def win_position_centered(self, window_size: ScreenSize) -> ScreenPosition C++: ScreenPosition WinPositionCentered(ScreenSize windowSize) const; def distance_from_pixel(self, point: ScreenPosition) -> int C++: int DistanceFromPixel(ScreenPosition point) const; def ensure_window_fits_this_monitor(self, window_bounds_original: ScreenBounds) -> ScreenBounds C++: ScreenBounds EnsureWindowFitsThisMonitor(ScreenBounds windowBoundsOriginal) const; def __init__(self, position: Optional[ScreenPosition] = None, size: Optional[ScreenSize] = None) -> None ### hello_imgui/imgui_window_params.h enum DefaultImGuiWindowType C++: enum class DefaultImGuiWindowType `DefaultImGuiWindowType` is an enum class that defines whether a full screen background window is provided or not provide_full_screen_window = 0 provide_full_screen_dock_space = 1 no_default_window = 2 class ImGuiWindowParams C++: struct ImGuiWindowParams `ImGuiWindowParams` is a struct that defines the ImGui inner windows params These settings affect the imgui inner windows inside the application window. In order to change the application window settings, change the `AppWindowsParams` default_imgui_window_type: DefaultImGuiWindowType enable_viewports: bool config_windows_move_from_title_bar_only: bool menu_app_title: str show_menu_bar: bool show_menu_app: bool show_menu_app_quit: bool show_menu_view: bool show_menu_view_themes: bool remember_theme: bool show_status_bar: bool show_status_fps: bool remember_status_bar_settings: bool full_screen_window_margin_top_left: ImVec2 full_screen_window_margin_bottom_right: ImVec2 tweaked_theme: ImGuiTweakedTheme background_color: ImVec4 def __init__(self, default_imgui_window_type: DefaultImGuiWindowType = DefaultImGuiWindowType.provide_full_screen_window, enable_viewports: bool = False, config_windows_move_from_title_bar_only: bool = True, menu_app_title: str = '', show_menu_bar: bool = False, show_menu_app: bool = True, show_menu_app_quit: bool = True, show_menu_view: bool = True, show_menu_view_themes: bool = True, remember_theme: bool = True, show_status_bar: bool = False, show_status_fps: bool = True, remember_status_bar_settings: bool = True, full_screen_window_margin_top_left: Optional[ImVec2Like] = None, full_screen_window_margin_bottom_right: Optional[ImVec2Like] = None, tweaked_theme: Optional[ImGuiTweakedTheme] = None, background_color: Optional[ImVec4Like] = None) -> None ### hello_imgui/runner_callbacks.h def empty_void_function() -> VoidFunction C++: inline VoidFunction EmptyVoidFunction(); def sequence_functions(f1: VoidFunction, f2: VoidFunction) -> VoidFunction C++: VoidFunction SequenceFunctions(const VoidFunction& f1, const VoidFunction& f2); SequenceFunctions: returns a function that will call f1 and f2 in sequence def empty_event_callback() -> AnyEventCallback C++: inline AnyEventCallback EmptyEventCallback(); def empty_confirm_exit_callback() -> ConfirmExitCallback C++: inline ConfirmExitCallback EmptyConfirmExitCallback(); class MobileCallbacks C++: struct MobileCallbacks MobileCallbacks is a struct that contains callbacks that are called by the application when running under "Android, iOS and WinRT". These events are specific to mobile and embedded devices that have different requirements from your usual desktop application. These events must be handled quickly, ... on_destroy: VoidFunction on_low_memory: VoidFunction on_pause: VoidFunction on_resume: VoidFunction def __init__(self, on_destroy: Optional[VoidFunction] = None, on_low_memory: Optional[VoidFunction] = None, on_pause: Optional[VoidFunction] = None, on_resume: Optional[VoidFunction] = None) -> None enum EdgeToolbarType C++: enum class EdgeToolbarType EdgeToolbarType: location of an Edge Toolbar top = 0 bottom = 1 left = 2 right = 3 class EdgeToolbarOptions C++: struct EdgeToolbarOptions size_em: float window_padding_em: ImVec2 window_bg: ImVec4 def __init__(self, size_em: float = 2.5, window_padding_em: Optional[ImVec2Like] = None, window_bg: Optional[ImVec4Like] = None) -> None class EdgeToolbar C++: struct EdgeToolbar EdgeToolbar :a toolbar that can be placed on the edges of the App window It will be placed in a non-dockable window show_toolbar: VoidFunction options: EdgeToolbarOptions def __init__(self, show_toolbar: Optional[VoidFunction] = None, options: Optional[EdgeToolbarOptions] = None) -> None def all_edge_toolbar_types() -> List[EdgeToolbarType] C++: std::vector AllEdgeToolbarTypes(); def edge_toolbar_type_name(e: EdgeToolbarType) -> str C++: std::string EdgeToolbarTypeName(EdgeToolbarType e); enum DefaultIconFont C++: enum class DefaultIconFont HelloImGui can optionally merge an icon font (FontAwesome 4 or 6) to the default font - you need to include manually icons_font_awesome_4.h or icons_font_awesome_6.h: #include "hello_imgui/icons_font_awesome_6.h" or #include "hello_imgui/icons_font_awesome_4.h" no_icons = 0 font_awesome4 = 1 font_awesome6 = 2 class RunnerCallbacks C++: struct RunnerCallbacks RunnerCallbacks is a struct that contains the callbacks that are called by the application show_gui: VoidFunction show_menus: VoidFunction show_app_menu_items: VoidFunction show_status: VoidFunction edges_toolbars: Dict[EdgeToolbarType, EdgeToolbar] def add_edge_toolbar(self, edge_toolbar_type: EdgeToolbarType, gui_function: VoidFunction, options: Optional[EdgeToolbarOptions] = None) -> None C++: void AddEdgeToolbar(EdgeToolbarType edgeToolbarType, VoidFunction guiFunction, const EdgeToolbarOptions& options = EdgeToolbarOptions()); `add_edge_toolbar`: Add a toolbar that can be placed on the edges of the App window post_init_add_platform_backend_callbacks: VoidFunction post_init: VoidFunction def enqueue_post_init(self, callback: VoidFunction) -> None C++: void EnqueuePostInit(const VoidFunction& callback); `enqueue_post_init`: Add a function that will be called once after OpenGL and ImGui are inited, but before the backend callback are initialized. (this will modify the `post_init` callback by appending the new callback (using `sequence_functions`) load_additional_fonts: VoidFunction default_icon_font: DefaultIconFont setup_imgui_config: VoidFunction setup_imgui_style: VoidFunction register_tests: VoidFunction register_tests_called: bool confirm_exit: ConfirmExitCallback before_exit: VoidFunction def enqueue_before_exit(self, callback: VoidFunction) -> None C++: void EnqueueBeforeExit(const VoidFunction& callback); `enqueue_before_exit`: Add a function that will be called once before exiting (when OpenGL and ImGui are still inited) (this will modify the `before_exit` callback by appending the new callback (using `sequence_functions`) before_exit_post_cleanup: VoidFunction pre_new_frame: VoidFunction post_new_frame: VoidFunction before_imgui_render: VoidFunction before_swap: VoidFunction after_swap: VoidFunction custom_background: VoidFunction post_render_dockable_windows: VoidFunction theme_changed: VoidFunction any_backend_event_callback: AnyEventCallback def __init__(self, show_gui: Optional[VoidFunction] = None, show_menus: Optional[VoidFunction] = None, show_app_menu_items: Optional[VoidFunction] = None, show_status: Optional[VoidFunction] = None, post_init_add_platform_backend_callbacks: Optional[VoidFunction] = None, post_init: Optional[VoidFunction] = None, load_additional_fonts: Optional[VoidFunction] = None, default_icon_font: DefaultIconFont = DefaultIconFont.font_awesome4, setup_imgui_config: Optional[VoidFunction] = None, setup_imgui_style: Optional[VoidFunction] = None, register_tests: Optional[VoidFunction] = None, register_tests_called: bool = False, confirm_exit: Optional[ConfirmExitCallback] = None, before_exit: Optional[VoidFunction] = None, before_exit_post_cleanup: Optional[VoidFunction] = None, pre_new_frame: Optional[VoidFunction] = None, post_new_frame: Optional[VoidFunction] = None, before_imgui_render: Optional[VoidFunction] = None, before_swap: Optional[VoidFunction] = None, after_swap: Optional[VoidFunction] = None, custom_background: Optional[VoidFunction] = None, post_render_dockable_windows: Optional[VoidFunction] = None, theme_changed: Optional[VoidFunction] = None, any_backend_event_callback: Optional[AnyEventCallback] = None) -> None def append_callback(previous_callback: VoidFunction, new_callback: VoidFunction) -> VoidFunction C++: VoidFunction AppendCallback(const VoidFunction& previousCallback, const VoidFunction& newCallback); AppendCallback: legacy synonym for SequenceFunctions ### hello_imgui/docking_params.h #### HelloImGui makes it easy to use dockable windows class DockingSplit C++: struct DockingSplit DockingSplit is a struct that defines the way the docking splits should be applied on the screen in order to create new Dock Spaces. DockingParams contains a vector in order to partition the screen at your will. initial_dock: DockSpaceName new_dock: DockSpaceName direction: ImGuiDir ratio: float node_flags: ImGuiDockNodeFlags def __init__(self, initial_dock_: DockSpaceName = '', new_dock_: DockSpaceName = '', direction_: Optional[ImGuiDir] = None, ratio_: float = 0.25, node_flags_: Optional[ImGuiDockNodeFlags] = None) -> None C++: DockingSplit(const DockSpaceName& initialDock_ = "", const DockSpaceName& newDock_ = "", ImGuiDir direction_ = ImGuiDir_Down, float ratio_ = 0.25f, ImGuiDockNodeFlags nodeFlags_ = ImGuiDockNodeFlags_None) : initialDock(initialDock_), newDock(newDock_), direction(direction_), ratio(ratio_), nodeFlags(nodeFlags_); Constructor class DockableWindow C++: struct DockableWindow DockableWindow is a struct that represents a window that can be docked. label: str dock_space_name: DockSpaceName gui_function: VoidFunction is_visible: bool remember_is_visible: bool can_be_closed: bool call_begin_end: bool include_in_view_menu: bool imgui_window_flags: ImGuiWindowFlags focus_window_at_next_frame: bool window_size: ImVec2 window_size_condition: ImGuiCond window_position: ImVec2 window_position_condition: ImGuiCond def __init__(self, label_: str = '', dock_space_name_: DockSpaceName = '', gui_function_: Optional[VoidFunction] = None, is_visible_: bool = True, can_be_closed_: bool = True) -> None C++: DockableWindow( const std::string & label_ = "", const DockSpaceName & dockSpaceName_ = "", const VoidFunction guiFunction_ = EmptyVoidFunction(), bool isVisible_ = true, bool canBeClosed_ = true) : label(label_), dockSpaceName(dockSpaceName_), GuiFunction(guiFunction_), isVisible(isVisible_), canBeClosed(canBeClosed_); --------------- Constructor ------------------------------ Constructor enum DockingLayoutCondition C++: enum class DockingLayoutCondition first_use_ever = 0 application_start = 1 never = 2 class DockingParams C++: struct DockingParams DockingParams contains all the settings concerning the docking: - list of splits - list of dockable windows docking_splits: List[DockingSplit] dockable_windows: List[DockableWindow] layout_name: str main_dock_space_node_flags: ImGuiDockNodeFlags layout_condition: DockingLayoutCondition layout_reset: bool def dockable_window_of_name(self, name: str) -> DockableWindow C++: DockableWindow * dockableWindowOfName(const std::string& name); `DockableWindow * dockableWindowOfName(const std::string & name)`: returns a pointer to a dockable window def focus_dockable_window(self, window_name: str) -> bool C++: bool focusDockableWindow(const std::string& windowName); `bool focusDockableWindow(const std::string& name)`: will focus a dockable window (and make its tab visible if needed) def dock_space_id_from_name(self, dock_space_name: str) -> Optional[ImGuiID] C++: std::optional dockSpaceIdFromName(const std::string& dockSpaceName); `optional dockSpaceIdFromName(const std::string& dockSpaceName)`: returns the ImGuiID corresponding to the dockspace with this name def __init__(self, docking_splits: Optional[List[DockingSplit]] = None, dockable_windows: Optional[List[DockableWindow]] = None, layout_name: str = 'Default', main_dock_space_node_flags: Optional[ImGuiDockNodeFlags] = None, layout_condition: DockingLayoutCondition = DockingLayoutCondition.first_use_ever, layout_reset: bool = False) -> None class RunnerParams C++: struct RunnerParams RunnerParams contains the settings and callbacks needed to run an application. callbacks: RunnerCallbacks app_window_params: AppWindowParams imgui_window_params: ImGuiWindowParams docking_params: DockingParams alternative_docking_layouts: List[DockingParams] remember_selected_alternative_layout: bool backend_pointers: BackendPointers renderer_backend_options: RendererBackendOptions platform_backend_type: PlatformBackendType renderer_backend_type: RendererBackendType ini_folder_type: IniFolderType ini_filename: str # relative to iniFolderType ini_filename_use_app_window_title: bool ini_disable: bool ini_clear_previous_settings: bool app_shall_exit: bool fps_idling: FpsIdling dpi_aware_params: DpiAwareParams use_imgui_test_engine: bool emscripten_fps: int touch_config: ImGuiTouchConfig wheel_session: bool def __init__(self, callbacks: Optional[RunnerCallbacks] = None, app_window_params: Optional[AppWindowParams] = None, imgui_window_params: Optional[ImGuiWindowParams] = None, docking_params: Optional[DockingParams] = None, alternative_docking_layouts: Optional[List[DockingParams]] = None, remember_selected_alternative_layout: bool = True, backend_pointers: Optional[BackendPointers] = None, renderer_backend_options: Optional[RendererBackendOptions] = None, platform_backend_type: PlatformBackendType = PlatformBackendType.first_available, renderer_backend_type: RendererBackendType = RendererBackendType.first_available, ini_folder_type: IniFolderType = IniFolderType.current_folder, ini_filename: str = '', ini_filename_use_app_window_title: bool = True, ini_disable: bool = False, ini_clear_previous_settings: bool = False, app_shall_exit: bool = False, fps_idling: Optional[FpsIdling] = None, dpi_aware_params: Optional[DpiAwareParams] = None, use_imgui_test_engine: bool = False, emscripten_fps: int = 0, touch_config: Optional[ImGuiTouchConfig] = None, wheel_session: bool = True) -> None ### hello_imgui/backend_pointers.h class BackendPointers C++: struct BackendPointers BackendPointers is a struct that contains optional pointers to the backend implementations (for SDL and GLFW). glfw_window: Optional[Any] # GLFWwindow* sdl_window: Optional[Any] # SDL_Window* sdl_gl_context: Optional[Any] # SDL_GLContext def __init__(self) -> None ### hello_imgui/renderer_backend_options.h class OpenGlOptions C++: struct OpenGlOptions OpenGlOptions contains advanced options used at the startup of OpenGL. These parameters are reserved for advanced users. By default, Hello ImGui will select reasonable default values, and these parameters are not used. Use at your own risk, as they make break the multi-platform compatibility of ... glsl_version: Optional[str] major_version: Optional[int] minor_version: Optional[int] use_core_profile: Optional[bool] use_forward_compat: Optional[bool] anti_aliasing_samples: Optional[int] def __init__(self, glsl_version: Optional[str] = None, major_version: Optional[int] = None, minor_version: Optional[int] = None, use_core_profile: Optional[bool] = None, use_forward_compat: Optional[bool] = None, anti_aliasing_samples: Optional[int] = None) -> None def has_edr_support() -> bool C++: bool hasEdrSupport(); `bool hasEdrSupport()`: Check whether extended dynamic range (EDR), i.e. the ability to reproduce intensities exceeding the standard dynamic range from 0.0-1.0, is supported. class RendererBackendOptions C++: struct RendererBackendOptions RendererBackendOptions is a struct that contains options for the renderer backend (Metal, Vulkan, DirectX, OpenGL) request_float_buffer: bool open_gl_options: OpenGlOptions def __init__(self, request_float_buffer: bool = False, open_gl_options: Optional[OpenGlOptions] = None) -> None class OpenGlOptionsFilled_ C++: struct OpenGlOptionsFilled_ (Private structure, not part of the public API) OpenGlOptions after selecting the default platform-dependent values + after applying the user settings glsl_version: str major_version: int minor_version: int use_core_profile: bool use_forward_compat: bool anti_aliasing_samples: int def __init__(self, glsl_version: str = '150', major_version: int = 3, minor_version: int = 3, use_core_profile: bool = True, use_forward_compat: bool = True, anti_aliasing_samples: int = 8) -> None #### Submodule imgui_default_settings class imgui_default_settings @staticmethod def load_default_font_with_font_awesome_icons() -> None C++: void LoadDefaultFont_WithFontAwesomeIcons(); LoadDefaultFont_WithFontAwesome will load from assets/fonts and reverts to the imgui embedded font if not found. @staticmethod def setup_default_imgui_config() -> None C++: void SetupDefaultImGuiConfig(); @staticmethod def setup_default_imgui_style() -> None C++: void SetupDefaultImGuiStyle(); #### Submodule manual_render class manual_render @staticmethod def setup_from_runner_params(runner_params: RunnerParams) -> None C++: void SetupFromRunnerParams(RunnerParams& runnerParams); Initializes the rendering with the full customizable `RunnerParams`. This will initialize the platform backend (SDL, Glfw, etc.) and the rendering backend (OpenGL, Vulkan, etc.). A reference to the user's `RunnerParams` is kept internally (similar to HelloImGui::Run). @staticmethod def setup_from_simple_runner_params(simple_params: SimpleRunnerParams) -> None C++: void SetupFromSimpleRunnerParams(const SimpleRunnerParams& simpleParams); Initializes the rendering with `SimpleRunnerParams`. This will initialize the platform backend (SDL, Glfw, etc.) and the rendering backend (OpenGL, Vulkan, etc.). @staticmethod def setup_from_gui_function(gui_function: VoidFunction, window_title: str = '', window_size_auto: bool = False, window_restore_previous_geometry: bool = False, window_size: Optional[ScreenSize] = None, fps_idle: float = 10.0, top_most: bool = False) -> None C++: void SetupFromGuiFunction( const VoidFunction& guiFunction, const std::string& windowTitle = "", bool windowSizeAuto = false, bool windowRestorePreviousGeometry = false, const ScreenSize& windowSize = DefaultWindowSize, float fpsIdle = 10.f, bool topMost = false ); Initializes the renderer with a simple GUI function and additional parameters. This will initialize the platform backend (SDL, Glfw, etc.) and the rendering backend (OpenGL, Vulkan, etc.). @staticmethod def render() -> None C++: void Render(); Renders the current frame. Should be called regularly to maintain the application's responsiveness. @staticmethod def tear_down() -> None C++: void TearDown(); Tears down the renderer and releases all associated resources. This will release the platform backend (SDL, Glfw, etc.) and the rendering backend (OpenGL, Vulkan, etc.). After calling `tear_down()`, the InitFromXXX can be called with new parameters. def final_app_window_screenshot() -> np.ndarray Return a screenshot of the final screen of the last (exited) app def final_app_window_screenshot_framebuffer_scale() -> float Returns the scale of the framebuffer used to take the screenshot def load_image_data_from_encoded_data(file_bytes: bytes, desired_channels: int = 4) -> np.ndarray Decodes an image file's bytes (PNG, JPEG, BMP, GIF, TGA...; the format is detected) with stb_image. desired_channels: 0 = as in the file, 1 = gray, 3 = RGB, 4 = RGBA. Returns a numpy array of uint8: (height, width, channels), or (height, width) for one channel. Raises ValueError when the bytes are ... def EmptyVoidFunction() -> VoidFunction def EmptyEventCallback() -> AnyEventCallback def set_load_asset_file_data_function(fn: Callable[[str], bytes]) -> None Register a Python callback that receives an asset and returns the file contents as a **bytes** object. ### hello_imgui/dpi_aware.h class DpiAwareParams C++: struct DpiAwareParams Hello ImGui will try its best to automatically handle DPI scaling for you. dpi_window_size_factor: float def __init__(self, dpi_window_size_factor: float = 0.0) -> None def em_to_vec2(x: float, y: float) -> ImVec2 C++: ImVec2 EmToVec2(float x, float y); def em_to_vec2(v: ImVec2Like) -> ImVec2 C++: ImVec2 EmToVec2(ImVec2 v); def em_size() -> float C++: float EmSize(); def em_size(nb_lines: float) -> float C++: float EmSize(float nbLines); __HelloImGui::EmSize()__ returns the visible font size on the screen. def pixels_to_em(pixels: ImVec2Like) -> ImVec2 C++: ImVec2 PixelsToEm(ImVec2 pixels); __HelloImGui::PixelToEm()__ converts a Vec2 in pixels coord to a Vec2 in em units def pixel_size_to_em(pixel_size: float) -> float C++: float PixelSizeToEm(float pixelSize); __HelloImGui::PixelSizeToEm()__ converts a size in pixels coord to a size in em units def get_dpi_aware_params() -> DpiAwareParams C++: DpiAwareParams* GetDpiAwareParams(); Returns the current DpiAwareParams, which are used for font loading and window size scaling def dpi_window_size_factor() -> float C++: float DpiWindowSizeFactor(); DpiWindowSizeFactor() is the factor by which window size should be multiplied to get a similar visible size on different OSes. It returns ApplicationScreenPixelPerInch / 96 under windows and linux. Under macOS, it will return 1. ### hello_imgui/remote_params.h class RemoteParams C++: struct RemoteParams RemoteParams is a struct that contains the settings for displaying the application on a remote device. using https://github.com/sammyfreg/netImgui or using https://github.com/ggerganov/imgui-ws Those features are experimental and not supported with the standard version of HelloImGui, enable_remoting: bool ws_port: int ws_http_root_folder: str # Optional folder were some additional files can be served ws_provide_index_html: bool # If True, will automatically serve a simple index.html file that contains the canvas and the imgui-ws client code exit_when_server_disconnected: bool duration_max_disconnected: float server_host: str server_port: int transmit_window_size: bool def __init__(self, enable_remoting: bool = False, ws_port: int = 5003, ws_http_root_folder: str = '', ws_provide_index_html: bool = True, exit_when_server_disconnected: bool = False, duration_max_disconnected: float = 30.0, server_host: str = 'localhost', server_port: int = 8888, transmit_window_size: bool = False) -> None ### hello_imgui/hello_imgui_widgets.h def begin_group_column() -> None C++: void BeginGroupColumn(); calls ImGui::BeginGroup() def end_group_column() -> None C++: void EndGroupColumn(); calls ImGui::EndGroup() + ImGui::SameLine() def widget_with_resize_handle(id: str, widget_gui_function: VoidFunction, handle_size_em: float = 1.0, on_item_resized: Optional[VoidFunction] = None, on_item_hovered: Optional[VoidFunction] = None) -> ImVec2 C++: ImVec2 WidgetWithResizeHandle( const char* id, VoidFunction widgetGuiFunction, float handleSizeEm = 1.0f, std::optional onItemResized = std::nullopt, std::optional onItemHovered = std::nullopt ); WidgetWithResizeHandle: adds a resize handle to a widget Example usage with ImPlot: None gui() { static ImVec2 widget_size(200, 200); auto myWidgetFunction = []() { if (ImPlot::BeginPlot("My Plot", widget_size)) { ImPlot::PlotLine("My Line", x.data(), y.data(), 1000); ImPlot::EndPlot(); } }; ... class InputTextData C++: struct InputTextData `input_text_resizable`: displays a resizable text input widget text: str hint: str multiline: bool resizable: bool size_em: ImVec2 def __init__(self, text: str = '', multiline: bool = False, size_em: Optional[ImVec2Like] = None) -> None C++: InputTextData(const std::string& text = "", bool multiline = false, ImVec2 size_em = ImVec2(0, 0)) : Text(text), Multiline(multiline), SizeEm(size_em); def input_text_resizable(label: str, text_input: InputTextData) -> bool C++: bool InputTextResizable(const char* label, InputTextData* textInput); def input_text_data_to_dict(data: InputTextData) -> DictTypeInputTextData C++: DictTypeInputTextData InputTextDataToDict(const InputTextData& data); def input_text_data_from_dict(dict: DictTypeInputTextData) -> InputTextData C++: InputTextData InputTextDataFromDict(const DictTypeInputTextData& dict); #### to/from string def input_text_data_to_string(data: InputTextData) -> str C++: std::string InputTextDataToString(const InputTextData& data); def input_text_data_from_string(str: str) -> InputTextData C++: InputTextData InputTextDataFromString(const std::string& str); def image_and_size_from_encoded_data(data: bytes, cache_key: str = '') -> ImageAndSize Create a texture from encoded image data (PNG, JPEG, BMP, GIF, etc.). - data: bytes containing the encoded image - cache_key: if non-empty, the texture is cached and reused on subsequent calls with the same key Returns an ImageAndSize with texture_id and size. def create_texture_gpu_from_rgba_data(rgba: np.ndarray) -> TextureGpu Upload an HxWx4 uint8 RGBA numpy array to a new GPU texture.