ImGuiGlfwOpenGLBackend Class
ImGui backend for GLFW windowing and OpenGL 4.1 rendering. More...
Declaration
Base class
| class | ImGuiBackend |
|
Platform-agnostic interface for ImGui backend implementations. More... | |
Public Constructors Index
| ImGuiGlfwOpenGLBackend (const ImGuiGlfwOpenGLBackend &)=delete | |
| ImGuiGlfwOpenGLBackend (ImGuiGlfwOpenGLBackend &&other) noexcept=delete | |
| ImGuiGlfwOpenGLBackend (WindowHandle window, PlatformWorld &platformWorld) | |
|
Constructs the ImGui backend for GLFW+OpenGL. More... | |
Public Destructor Index
| ~ImGuiGlfwOpenGLBackend () override | |
|
Destructor; shuts down ImGui backend and releases resources. More... | |
Public Operators Index
| ImGuiGlfwOpenGLBackend & | operator= (const ImGuiGlfwOpenGLBackend &)=delete |
| ImGuiGlfwOpenGLBackend & | operator= (ImGuiGlfwOpenGLBackend &&other) noexcept=delete |
Public Member Functions Index
| void | renderDrawData (ImDrawData *drawData) override |
|
Renders ImGui draw data using OpenGL. More... | |
| bool | newFrame () override |
|
Starts a new ImGui frame. More... | |
Private Member Functions Index
| void | shutdown () noexcept |
|
Shuts down the ImGui GLFW and OpenGL backend. More... | |
| bool | initialize () noexcept |
|
Performs one-time backend initialization. More... | |
Private Member Attributes Index
| bool | initialized_ = false |
|
Indicates whether the backend has been successfully initialized. More... | |
| WindowHandle | windowHandle_ |
|
Window entity handle used to resolve the native GLFW window. More... | |
| PlatformWorld & | platformWorld_ |
|
Platform world that stores the GLFW window-handle component. More... | |
Description
ImGui backend for GLFW windowing and OpenGL 4.1 rendering.
Initializes ImGui context, GLFW platform layer, and OpenGL renderer. This backend is non-copyable and non-movable due to resource ownership semantics.
Only one instance should exist per application. Creating multiple instances will throw a std::runtime_error.
Definition at line 37 of file ImGuiGlfwOpenGLBackend.ixx.
Public Constructors
ImGuiGlfwOpenGLBackend()
| delete |
Definition at line 127 of file ImGuiGlfwOpenGLBackend.ixx.
ImGuiGlfwOpenGLBackend()
| noexcept delete |
Definition at line 129 of file ImGuiGlfwOpenGLBackend.ixx.
ImGuiGlfwOpenGLBackend()
| inline explicit |
Constructs the ImGui backend for GLFW+OpenGL.
- Parameters
-
window GLFW window handle. Must be valid for the lifetime of this backend.
platformWorld Platform world used to resolve the native GLFW window handle.
- Exceptions
-
std::runtime_error if an ImGui context already exists.
Definition at line 140 of file ImGuiGlfwOpenGLBackend.ixx.
Public Destructor
~ImGuiGlfwOpenGLBackend()
| inline |
Destructor; shuts down ImGui backend and releases resources.
- See Also
shutdown()
Definition at line 193 of file ImGuiGlfwOpenGLBackend.ixx.
Public Operators
operator=()
| delete |
Definition at line 128 of file ImGuiGlfwOpenGLBackend.ixx.
operator=()
| noexcept delete |
Definition at line 130 of file ImGuiGlfwOpenGLBackend.ixx.
Public Member Functions
newFrame()
| inline virtual |
Starts a new ImGui frame.
- Returns
true if frame setup succeeded; otherwise false.
Definition at line 174 of file ImGuiGlfwOpenGLBackend.ixx.
renderDrawData()
| inline virtual |
Renders ImGui draw data using OpenGL.
- Parameters
-
drawData Pointer to ImGui draw data.
If the backend is not initialized yet, this call is a no-op.
Definition at line 163 of file ImGuiGlfwOpenGLBackend.ixx.
Private Member Functions
initialize()
| inline noexcept |
Performs one-time backend initialization.
Resolves the GLFW window entity, initializes the ImGui GLFW binding, and initializes the OpenGL renderer backend.
- Returns
true if the backend is initialized and ready; otherwise false.
Definition at line 90 of file ImGuiGlfwOpenGLBackend.ixx.
shutdown()
| inline noexcept |
Shuts down the ImGui GLFW and OpenGL backend.
Ensures proper cleanup of the ImGui context, OpenGL, and GLFW resources. After calling this method, the backend will no longer be initialized, and associated resources will be released.
This function is safe to call multiple times but has no effect if the backend is not currently initialized.
This method is noexcept and will not throw exceptions.
Definition at line 63 of file ImGuiGlfwOpenGLBackend.ixx.
Private Member Attributes
initialized_
|
Indicates whether the backend has been successfully initialized.
Tracks the initialization state of the ImGui backend to prevent multiple redundant initialization attempts and manage proper shutdown procedures.
Modified during initialization and shutdown processes.
Definition at line 49 of file ImGuiGlfwOpenGLBackend.ixx.
platformWorld_
|
Platform world that stores the GLFW window-handle component.
Definition at line 80 of file ImGuiGlfwOpenGLBackend.ixx.
windowHandle_
|
Window entity handle used to resolve the native GLFW window.
Definition at line 75 of file ImGuiGlfwOpenGLBackend.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.