Foundation
Loading...
Searching...
No Matches
ImGui.cpp

Absolutely minimal example for integrating our ImGui backend.

#include "Examples.hpp"
namespace Examples
{
class ImGuiDemoApp : public RenderApplication
{
void OnDeviceSetup() override
{
}
void OnRendererSetup() override { ImGui_ImplFoundation_CreatePass(mRenderer.get(), "ImGui"); }
void OnBeforeFrame() override
{
ImGui::NewFrame();
ImGui::ShowDemoWindow();
}
};
} // namespace Examples
int main(int argc, char** argv)
{
app.Initialize<VulkanApplication>({.windowTitle = "ImGui"});
app.RunForever();
}
int main(int argc, char **argv)
Definition ImGui.cpp:26
auto * ImGui_ImplFoundation_CreatePass(Foundation::RenderCore::Renderer *renderer, Foundation::Core::StringView name, bool clear, FSetup &&setup)
Creates a render pass that will draw the ImGui UI.
Definition ImGui.hpp:97
void ImGui_ImplFoundation_Init(RHIDevice *device, Native::NativeWindow *window, Allocator *allocator)
Definition ImGui.cpp:35
void ImGui_ImplFoundation_NewFrame()
Starts a new ImGui frame.
Definition ImGui.cpp:52
void ImGui_ImplFoundation_Shutdown()
Shuts down the ImGui backend and releases all resources.
Definition ImGui.cpp:57
void ImGui_ImplFoundation_SetupContextWithDefaultStyles()
Applies a default, vaguely stylish theme to the ImGui context.
Definition ImGui.cpp:296
Definition ImGui.cpp:10
void OnBeforeFrame() override
Action to take before each frame is executed.
Definition ImGui.cpp:17
void OnRendererSetup() override
Set up the renderer by creating passes, resources, and other configurations.
Definition ImGui.cpp:16
void OnDeviceSetup() override
Actions to take after device specific resources has been set up.
Definition ImGui.cpp:11
Allocator * Ptr()
Definition Allocator.hpp:38
void Initialize(ApplicationInitDesc const &desc={}, Args &&... args)
Initialize the application with the specified RHI backend.
Definition Application.hpp:205
RHIApplicationScopedObjectHandle< RHIDevice > mDevice
Definition Application.hpp:99
Native::NativeWindow * GetNativeWindow()
Retrieve the current NativeWindow instance.
Definition Application.hpp:240
DefaultAllocator mAlloc
Definition Application.hpp:95
UniquePtr< Renderer > mRenderer
Definition Application.hpp:102
void RunForever()
Start the Render thread and run the application loop indefinitely, until the window is closed or the ...
Definition Application.cpp:127
For a complete list of examples, see the Examples Page.
Definition Examples.hpp:12