ezEngine  Milestone 9
ezImgui Class Reference

Singleton class through which one can control the third-party library 'Dear Imgui'. More...

#include <DearImgui.h>

Public Member Functions

 ezImgui (ezImguiConfigFontCallback configFontCallback=ezImguiConfigFontCallback(), ezImguiConfigStyleCallback configStyleCallback=ezImguiConfigStyleCallback())
 
void SetCurrentContextForView (const ezViewHandle &hView)
 Sets the ImGui context for the given view.
 
ezSizeU32 GetCurrentWindowResolution () const
 Returns the value that was passed to BeginFrame(). Useful for positioning UI elements.
 
void SetPassInputToImgui (bool bPassInput)
 When this is disabled, the GUI will be rendered, but it will not react to any input. Useful if something else shall get exclusive input.
 
bool WantsInput () const
 If this returns true, the GUI wants to use the input, and thus you might want to not use the input for anything else. More...
 
ImFontAtlas & GetFontAtlas ()
 Returns the shared font atlas.
 

Friends

class ezImguiExtractor
 
class ezImguiRenderer
 

Detailed Description

Singleton class through which one can control the third-party library 'Dear Imgui'.

Instance has to be manually created and destroyed. Do this for example in ezGameState::OnActivation() and ezGameState::OnDeactivation(). You need to call SetCurrentContextForView before you can use the Imgui functions directly. E.g. 'ImGui::Text("Hello, world!");' To prevent Imgui from using mouse and keyboard input (but still do rendering) use SetPassInputToImgui(). To prevent you app from using mouse and keyboard input when Imgui has focus, query WantsInput().

Note
Don't forget that to see the GUI on screen, your render pipeline must contain an ezImguiExtractor and you need to have an ezImguiRenderer set (typically on an ezSimpleRenderPass).

Member Function Documentation

◆ WantsInput()

bool ezImgui::WantsInput ( ) const
inline

If this returns true, the GUI wants to use the input, and thus you might want to not use the input for anything else.

This is the case when the mouse hovers over any window or a text field has keyboard focus.


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