VEX Engine
Retro looking game engine made in vulkan mostly because i wanted to understand it better.
Loading...
Searching...
No Matches
vex::ImGUIWrapper Class Referenceabstract

This class provides an interface template for ImGui Implementation. Every backend should implement this class. More...

#include <ImGUIWrapper.hpp>

Inheritance diagram for vex::ImGUIWrapper:
vex::VulkanImGUIWrapper EditorImGUIWrapper

Public Member Functions

virtual void init ()=0
 Initialization called inside Engine class.
virtual void beginFrame ()=0
 Begining of UI rendering called in vex::Renderer::renderFrame.
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.
void executeUIFunctions ()
 Called between beginFrame and endFrame, executes all imgui functions added by addUIFunction.

Protected Attributes

std::vector< std::function< void()> > m_uiFunctions

Detailed Description

This class provides an interface template for ImGui Implementation. Every backend should implement this class.

Definition at line 21 of file ImGUIWrapper.hpp.

Member Function Documentation

◆ addUIFunction()

void vex::ImGUIWrapper::addUIFunction ( const std::function< void()> & func)
inline

Adds a function to be executed during UI rendering.

Example usage:

#if DEBUG
m_imgui->addUIFunction([this]() {
ImGui::Begin("Window name");
ImGui::Text("Example test");
ImGui::Text("FPS: %i", (int)fps);
ImGui::End();
});
#endif

"#if DEBUG" is needed cause release builds dont compile with imgui support.

Definition at line 50 of file ImGUIWrapper.hpp.

◆ beginFrame()

virtual void vex::ImGUIWrapper::beginFrame ( )
pure virtual

Begining of UI rendering called in vex::Renderer::renderFrame.

Implemented in EditorImGUIWrapper, and vex::VulkanImGUIWrapper.

◆ endFrame()

virtual void vex::ImGUIWrapper::endFrame ( )
pure virtual

Ends UI rendering for frame.

Implemented in vex::VulkanImGUIWrapper.

◆ executeUIFunctions()

void vex::ImGUIWrapper::executeUIFunctions ( )
inline

Called between beginFrame and endFrame, executes all imgui functions added by addUIFunction.

Definition at line 55 of file ImGUIWrapper.hpp.

◆ init()

virtual void vex::ImGUIWrapper::init ( )
pure virtual

Initialization called inside Engine class.

Implemented in EditorImGUIWrapper, and vex::VulkanImGUIWrapper.

◆ processEvent()

virtual void vex::ImGUIWrapper::processEvent ( const SDL_Event * event)
pure virtual

Its used to process input needed by interaction with ImGui.

Implemented in EditorImGUIWrapper, and vex::VulkanImGUIWrapper.

Member Data Documentation

◆ m_uiFunctions

std::vector<std::function<void()> > vex::ImGUIWrapper::m_uiFunctions
protected

Definition at line 62 of file ImGUIWrapper.hpp.


The documentation for this class was generated from the following file: