VEX Engine
Retro looking game engine made in vulkan mostly because i wanted to understand it better.
Loading...
Searching...
No Matches
ImGUIWrapper.hpp
Go to the documentation of this file.
1
6
7#pragma once
8#define SDL_MAIN_HANDLED
9#include <SDL3/SDL.h>
10#include <functional>
11#include <memory>
12#include <vector>
13
14#if DEBUG
15#include <imgui.h>
16#include <ImGuizmo.h>
17#endif
18
19namespace vex {
22 public:
23 virtual ~ImGUIWrapper() = default;
24
26 virtual void init() = 0;
28 virtual void beginFrame() = 0;
30 virtual void endFrame() = 0;
32 virtual void processEvent(const SDL_Event* event) = 0;
33#if DEBUG
34 virtual ImGuiIO& getIO() = 0;
35#endif
36
50 void addUIFunction(const std::function<void()>& func) {
51 m_uiFunctions.push_back(func);
52 }
53
56 for (auto& func : m_uiFunctions) {
57 func();
58 }
59 }
60
61 protected:
62 std::vector<std::function<void()>> m_uiFunctions;
63 };
64}
This class provides an interface template for ImGui Implementation. Every backend should implement th...
void executeUIFunctions()
Called between beginFrame and endFrame, executes all imgui functions added by addUIFunction.
virtual void init()=0
Initialization called inside Engine class.
virtual void endFrame()=0
Ends UI rendering for frame.
virtual void processEvent(const SDL_Event *event)=0
Its used to process input needed by interaction with ImGui.
void addUIFunction(const std::function< void()> &func)
Adds a function to be executed during UI rendering.
virtual void beginFrame()=0
Begining of UI rendering called in vex::Renderer::renderFrame.