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.

imgui.backends

Dear ImGui’s platform and renderer backends for GLFW, OpenGL 3 and OpenGL 2, for an app that runs its own loop.

Most apps do not need them: immapp.run and hello_imgui.run set up the backends. An app that creates its window itself (with GLFW, pygame, pyglet...) calls them at each frame: see imgui_bundle/python_backends/examples.

The module imgui_bundle.imgui.backends, the Python API of Dear ImGui, from bindings/imgui_bundle/imgui/backends.pyi: 30 functions, 0 classes, 0 enums. Each entry gives the Python signature, then the C++ one, then the doc of the C++ header. The sections are the header’s.

opengl3_init

def opengl3_init(glsl_version: str) -> bool

<bindings for imgui_impl_opengl3.h

opengl3_shutdown

def opengl3_shutdown() -> None

opengl3_new_frame

def opengl3_new_frame() -> None

opengl3_render_draw_data

def opengl3_render_draw_data(draw_data: ImDrawData) -> None

(Optional) Called by Init/NewFrame/Shutdown

opengl3_create_fonts_texture

def opengl3_create_fonts_texture() -> bool

opengl3_destroy_fonts_texture

def opengl3_destroy_fonts_texture() -> None

opengl3_create_device_objects

def opengl3_create_device_objects() -> bool

opengl3_destroy_device_objects

def opengl3_destroy_device_objects() -> None

opengl2_init

def opengl2_init() -> bool

<bindings for imgui_impl_opengl2.h

opengl2_shutdown

def opengl2_shutdown() -> None

opengl2_new_frame

def opengl2_new_frame() -> None

opengl2_render_draw_data

def opengl2_render_draw_data(draw_data: ImDrawData) -> None

Called by Init/NewFrame/Shutdown

opengl2_create_fonts_texture

def opengl2_create_fonts_texture() -> bool

opengl2_destroy_fonts_texture

def opengl2_destroy_fonts_texture() -> None

opengl2_create_device_objects

def opengl2_create_device_objects() -> bool

opengl2_destroy_device_objects

def opengl2_destroy_device_objects() -> None

glfw_init_for_opengl

def glfw_init_for_opengl(window_address: int, install_callbacks: bool) -> bool

<bindings for imgui_impl_glfw.h

glfw_init_for_vulkan

def glfw_init_for_vulkan(window_address: int, install_callbacks: bool) -> bool

glfw_init_for_other

def glfw_init_for_other(window_address: int, install_callbacks: bool) -> bool

glfw_shutdown

def glfw_shutdown() -> None

glfw_new_frame

def glfw_new_frame() -> None

GLFW callbacks (installer)

glfw_install_callbacks

def glfw_install_callbacks(window_address: int) -> None

glfw_restore_callbacks

def glfw_restore_callbacks(window_address: int) -> None

glfw_window_focus_callback

def glfw_window_focus_callback(window_address: int, focused: int) -> None

Since 1.84

GLFW callbacks (individual callbacks to call if you didn’t install callbacks)

glfw_cursor_enter_callback

def glfw_cursor_enter_callback(window_address: int, entered: int) -> None

Since 1.84

glfw_cursor_pos_callback

def glfw_cursor_pos_callback(window_address: int, x: float, y: float) -> None

Since 1.87

glfw_mouse_button_callback

def glfw_mouse_button_callback(window_address: int, button: int, action: int, mods: int) -> None

glfw_scroll_callback

def glfw_scroll_callback(window_address: int, xoffset: float, yoffset: float) -> None

glfw_key_callback

def glfw_key_callback(window_address: int, key: int, scancode: int, action: int, mods: int) -> None

glfw_char_callback

def glfw_char_callback(window_address: int, c: int) -> None