#include <SDL3/SDL.h>
#include <imgui.h>
#include <RHICore/Device.hpp>
#include <RenderCore/Renderer.hpp>
Go to the source code of this file.
|
| void | ImGui_ImplFoundation_ImplUpdateTexture (ImTextureData *tex) |
| |
| void | ImGui_ImplFoundation_ImplPassSetup (Foundation::RenderCore::PassHandle self, Foundation::RenderCore::Renderer *renderer, Foundation::RenderCore::ResourceHandle vtxBuffer, Foundation::RenderCore::ResourceHandle idxBuffer, Foundation::RenderCore::ResourceHandle linSampler, Foundation::RenderCore::ResourceHandle nearSampler) |
| |
| void | ImGui_ImplFoundation_ImplPassRecord (Foundation::RenderCore::PassHandle self, Foundation::RenderCore::Renderer *renderer, bool clear, Foundation::RHI::RHICommandList *cmd, Foundation::RenderCore::ResourceHandle vtxBuffer, Foundation::RenderCore::ResourceHandle idxBuffer) |
| |
| void | ImGui_ImplFoundation_ImplCreateResources (Foundation::RenderCore::Renderer *renderer, Foundation::RenderCore::ResourceHandle &outVtxBuffer, Foundation::RenderCore::ResourceHandle &outIdxBuffer, Foundation::RenderCore::ResourceHandle &outLinearSampler, Foundation::RenderCore::ResourceHandle &outNearestSampler) |
| |
| void | ImGui_ImplFoundation_Init (Foundation::RHI::RHIDevice *device, SDL_Window *window) |
| |
| void | ImGui_ImplFoundation_ProcessEvent (SDL_Event *event) |
| | Processes one SDL event and forwards it to ImGui.
|
| |
| void | ImGui_ImplFoundation_NewFrame () |
| | Starts a new ImGui frame.
|
| |
| void | ImGui_ImplFoundation_Shutdown () |
| | Shuts down the ImGui backend and releases all resources.
|
| |
| ImTextureID | ImGui_ImplFoundation_AddImage (Foundation::RHI::RHITextureView *textureView, ImGui_ImplFoundation_ImageSampler sampler=ImGuiImplFoundationImageSamplerLinear) |
| | Registers a texture with the ImGui backend so it can be displayed in the UI.
|
| |
| void | ImGui_ImplFoundation_RemoveImage (ImTextureID textureID) |
| | Unregisters a texture from the ImGui backend.
|
| |
| template<typename FSetup > |
| Foundation::RenderCore::PassHandle | 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.
|
| |
| void | ImGui_ImplFoundation_SetupContextWithDefaultStyles () |
| | Applies a default, vaguely stylish theme to the ImGui context.
|
| |
◆ IMGUI_DEFINE_MATH_OPERATORS
| #define IMGUI_DEFINE_MATH_OPERATORS |
◆ IMGUI_DISABLE_DEFAULT_ALLOCATORS
| #define IMGUI_DISABLE_DEFAULT_ALLOCATORS |
◆ IMGUI_DISABLE_OBSOLETE_FUNCTIONS
| #define IMGUI_DISABLE_OBSOLETE_FUNCTIONS |
◆ ImGui_ImplFoundation_ImageSampler
Sampler type for added image.
| Enumerator |
|---|
| ImGuiImplFoundationImageSamplerLinear | |
| ImGuiImplFoundationImageSamplerNearest | |
◆ ImGui_ImplFoundation_AddImage()
Registers a texture with the ImGui backend so it can be displayed in the UI.
- Parameters
-
| textureView | The texture view to be used. |
| sampler | The sampler to be used for the texture. |
- Returns
- An ImTextureID that you can use with ImGui::Image() and other functions.
◆ ImGui_ImplFoundation_CreatePass()
template<typename FSetup >
Creates a render pass that will draw the ImGui UI.
- Template Parameters
-
| FSetup | A callable type for custom render pass setup. You may want this when ImGui is the last pass of your Renderer setup, as you can declare dependencies here. See ModelViewer's OnRendererSetup for an example. However - if your prior pass writes to the backbuffer as well - dependency will be automatically created and this won't be required. |
- Parameters
-
| renderer | The main renderer object. |
| name | A name for the pass, for debugging purposes. |
| clear | Whether to clear the render target before drawing. |
◆ ImGui_ImplFoundation_ImplCreateResources()
◆ ImGui_ImplFoundation_ImplPassRecord()
◆ ImGui_ImplFoundation_ImplPassSetup()
◆ ImGui_ImplFoundation_ImplUpdateTexture()
| void ImGui_ImplFoundation_ImplUpdateTexture |
( |
ImTextureData * |
tex | ) |
|
◆ ImGui_ImplFoundation_Init()
@breif Initialize global context (TexturePool, etc.) for our ImGui backend Call this once context is created, within BeginSetup/EndSetup block of your Renderer.
- Parameters
-
| device | RHIDevice of the Renderer |
| window | SDL_Window |
| clear | Whether to clear the render target before drawing. |
| dependOn | (Optional) A pass to depend on. You may want this if the prior pass writes to resources ImGui may renderer (e.g. through ImGui_ImplFoundation_AddImage). If the prior pass writes to the backbuffer as well, this is not required as dependency will be automatically created. |
- Note
- You MUST call ImGui_ImplFoundation_Shutdown before the destruction of RHIDevice related objects. See Examples::ImGui or other ImGui backend usage for reference.
◆ ImGui_ImplFoundation_NewFrame()
| void ImGui_ImplFoundation_NewFrame |
( |
| ) |
|
Starts a new ImGui frame.
- Note
- You should call this once per frame, before any other ImGui calls. See Examples::ImGui or other ImGui backend usage for reference.
◆ ImGui_ImplFoundation_ProcessEvent()
| void ImGui_ImplFoundation_ProcessEvent |
( |
SDL_Event * |
event | ) |
|
Processes one SDL event and forwards it to ImGui.
- Parameters
-
| event | The SDL event to be processed. |
- Note
- You should call this for each SDL event in your main event loop, i.e. while (SDL_PollEvent(&event)) { ImGui_ImplFoundation_ProcessEvent(&event); }
◆ ImGui_ImplFoundation_RemoveImage()
| void ImGui_ImplFoundation_RemoveImage |
( |
ImTextureID |
textureID | ) |
|
Unregisters a texture from the ImGui backend.
- Parameters
-
- Note
- Call this when you no longer need the texture in the UI to free up resources.
◆ ImGui_ImplFoundation_SetupContextWithDefaultStyles()
| void ImGui_ImplFoundation_SetupContextWithDefaultStyles |
( |
| ) |
|
Applies a default, vaguely stylish theme to the ImGui context.
- Note
- Call this after ImGui_ImplFoundation_Init if you don't want to set up your own styles.
◆ ImGui_ImplFoundation_Shutdown()
| void ImGui_ImplFoundation_Shutdown |
( |
| ) |
|
Shuts down the ImGui backend and releases all resources.
- Note
- You MUST call ImGui_ImplFoundation_Shutdown before the destruction of RHIDevice related objects. See Examples::ImGui or other ImGui backend usage for reference.