Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Intro to Runners

ImGui Bundle uses two main libraries to manage the application lifecycle: Hello ImGui and ImmApp.

Hello ImGui vs ImmApp

Starting an Application

The simplest way to start an application is to use immapp.run() (Python) or ImmApp::Run() (C++).

Python
C++

In Python, immapp.run accepts a gui_function and several optional parameters to quickly configure the window and add-ons.

from imgui_bundle import immapp, imgui

def gui():
    imgui.text("My App")

immapp.run(
    gui,
    window_title="Hello",
    window_size=(800, 600)
)

Activating Add-ons with ImmApp

Many libraries in the bundle (like ImPlot or imgui_md) require initialization at startup (e.g., creating contexts or loading specific fonts). ImmApp manages this via AddOnsParams.

Python
C++
from imgui_bundle import immapp, implot, imgui_md

def gui():
    imgui_md.render("# Title")
    if implot.begin_plot("My Plot"):
        # ...
        implot.end_plot()

immapp.run(
    gui,
    with_implot=True,   # Activates ImPlot context
    with_markdown=True  # Loads Markdown fonts
)

Advanced: Manual Rendering

If you need complete control over the render loop, you can use the functions inside hello_imgui.manual_render, or immapp.manual_render, instead of the standard run() functions.

Python
C++
from imgui_bundle import imgui, hello_imgui, immapp

# Setup
runner_params = hello_imgui.RunnerParams()
runner_params.callbacks.show_gui = lambda: imgui.text("Hello, ImGui Bundle!")
addons = immapp.AddOnsParams()
addons.with_implot = True
immapp.manual_render.setup_from_runner_params(runner_params, addons)

# Render loop
while not hello_imgui.get_runner_params().app_shall_exit:
    hello_imgui.manual_render.render()
    # Do other work here if needed

# Cleanup
hello_imgui.manual_render.tear_down()

This approach is useful for:

(For python users, also see the page on async usage for more info and performance tips.)