Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::GUI Class Referencefinal

Graphical User Interface. More...

#include <GUI.h>

+ Inheritance diagram for Divide::GUI:

Public Types

using GUIMapPerScene = hashMap< I64, SceneGUIElements * >
 
- Public Types inherited from Divide::GUIInterface
using GUIMap = hashMap< U64, std::pair< GUIElement *, bool > >
 
using ButtonCallback = DELEGATE< void, I64 >
 

Public Member Functions

 GUI (Kernel &parent)
 
 ~GUI () override
 
ErrorCode init (PlatformContext &context)
 Create the GUI.
 
void destroy ()
 
void preDraw (GFXDevice &context, const Rect< I32 > &viewport, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
 Render all elements that need their own internal render targets (e.g. CEGUI)
 
void draw (GFXDevice &context, const Rect< I32 > &viewport, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
 Go through all of the registered scene gui elements and gather all of the render commands.
 
void drawText (const TextElementBatch &batch, const Rect< I32 > &targetViewport, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut, bool pushCamera=true)
 Text rendering is handled exclusively by Mikko Mononen's FontStash library (https://github.com/memononen/fontstash)
 
void onResolutionChange (const SizeChangeParams &params)
 Mostly used by CEGUI to keep track of screen dimensions.
 
void onChangeScene (Scene *newScene)
 When we change a scene, we want to toggle our current scene GUI elements off and toggle the new scene's elements on.
 
void onUnloadScene (Scene *scene)
 When we unload a scene, we unload all of its GUI elements. ToDo: Scene should own these and scene should submit to GUI for rendering. Current logic is backwards -Ionut.
 
void update (U64 deltaTimeUS)
 Main update call. Used to tick gui elements (cursors, animations, etc)
 
template<typename T >
requires std::is_base_of_v<GUIElement, T>
T * getSceneGUIElementImpl (const I64 sceneID, const U64 elementName)
 Find a return a gui element by name.
 
template<typename T >
requires std::is_base_of_v<GUIElement, T>
T * getSceneGUIElementImpl (const I64 sceneID, const I64 elementID)
 Find a return a gui element by ID.
 
GUIConsolegetConsole () noexcept
 Get a reference to our console window.
 
const GUIConsolegetConsole () const noexcept
 Get a const reference to our console window.
 
CEGUI::Window * rootSheet () const noexcept
 Get a pointer to the root sheet that CEGUI renders into.
 
GUIMessageBoxgetDefaultMessageBox () const noexcept
 Return a pointer to the default, general purpose message box.
 
void setCursorPosition (I32 x, I32 y)
 Mouse cursor forced to a certain position.
 
CEGUI::GUIContext * getCEGUIContext () noexcept
 Provides direct access to the CEGUI context. Used by plugins (e.g. GUIConsole, GUIInput, etc)
 
void showDebugCursor (bool state)
 Toggle debug cursor rendering on or off.
 
 PROPERTY_R (bool, showDebugCursor, false)
 Debug cursor state. The debug cursor is a the cursor as it's know internally to CEGUI (based on its internal position and state)
 
 PROPERTY_R (string, defaultGUIScheme, "GWEN")
 The "skin" used by CEGUI.
 
 PROPERTY_RW (U64, textRenderInterval, Time::MillisecondsToMicroseconds(10))
 We should avoid rendering text as fast as possible.
 
- Public Member Functions inherited from Divide::GUIInterface
 GUIInterface (GUI &context)
 
virtual ~GUIInterface ()
 
void onLanguageChange (std::string_view newLanguage)
 
GUIgetParentContext () noexcept
 
const GUIgetParentContext () const noexcept
 
template<typename T >
requires std::is_base_of_v<GUIElement, T>
T * getGUIElement (const U64 elementName) const
 Get a pointer to an element by name/id.
 
template<typename T >
requires std::is_base_of_v<GUIElement, T>
T * getGUIElement (const I64 elementID) const
 
virtual GUITextaddText (const char *name, const RelativePosition2D &position, const string &font, const UColour4 &colour, const string &text, bool multiLine=false, U8 fontSize=16u)
 
virtual GUITextmodifyText (const char *name, const string &text, bool multiLine)
 
virtual GUIMessageBoxaddMsgBox (const char *name, const string &title, const string &message, vec2< I32 > offsetFromCentre=vec2< I32 >(0))
 
virtual GUIButtonaddButton (const char *name, const string &text, const RelativePosition2D &offset, const RelativeScale2D &size, const string &rootSheetID="")
 
virtual GUIFlashaddFlash (const char *name, const RelativePosition2D &position, const RelativeScale2D &size)
 
virtual CEGUI::Window * createWindow (const CEGUI::String &type, const CEGUI::String &name)
 
virtual CEGUI::Window * loadWindowFromLayoutFile (const char *layoutFileName)
 
virtual bool unloadWindow (CEGUI::Window *&window)
 
- Public Member Functions inherited from Divide::KernelComponent
 KernelComponent (Kernel &parent) noexcept
 
virtual ~KernelComponent ()=default
 
Kernelparent () noexcept
 
const Kernelparent () const noexcept
 
- Public Member Functions inherited from Divide::NonCopyable
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 
 NonCopyable (NonCopyable &&)=default
 
NonCopyableoperator= (NonCopyable &&)=default
 
- Public Member Functions inherited from Divide::FrameListener
 FrameListener (const Str< 64 > &name, FrameListenerManager &parent, U32 callOrder)
 Either give it a name.
 
virtual ~FrameListener () override
 
bool operator< (FrameListener &that) const noexcept
 
- Public Member Functions inherited from Divide::GUIDWrapper
 GUIDWrapper () noexcept
 
 GUIDWrapper (const GUIDWrapper &old) noexcept
 
 GUIDWrapper (GUIDWrapper &&old) noexcept
 
virtual ~GUIDWrapper ()=default
 
FORCE_INLINE I64 getGUID () const noexcept
 
GUIDWrapperoperator= (const GUIDWrapper &old)=delete
 
GUIDWrapperoperator= (GUIDWrapper &&other)=delete
 
- Public Member Functions inherited from Divide::Input::InputAggregatorInterface
virtual ~InputAggregatorInterface ()=default
 
virtual bool onKeyDown (const KeyEvent &arg)=0
 Keyboard: return true if input was consumed.
 
virtual bool onKeyUp (const KeyEvent &arg)=0
 
virtual bool mouseMoved (const MouseMoveEvent &arg)=0
 Mouse: return true if input was consumed.
 
virtual bool mouseButtonPressed (const MouseButtonEvent &arg)=0
 
virtual bool mouseButtonReleased (const MouseButtonEvent &arg)=0
 
virtual bool joystickButtonPressed (const JoystickEvent &arg)=0
 Joystick or Gamepad: return true if input was consumed.
 
virtual bool joystickButtonReleased (const JoystickEvent &arg)=0
 
virtual bool joystickAxisMoved (const JoystickEvent &arg)=0
 
virtual bool joystickPovMoved (const JoystickEvent &arg)=0
 
virtual bool joystickBallMoved (const JoystickEvent &arg)=0
 
virtual bool joystickAddRemove (const JoystickEvent &arg)=0
 
virtual bool joystickRemap (const JoystickEvent &arg)=0
 
virtual bool onTextEvent (const TextEvent &arg)=0
 

Protected Member Functions

bool frameStarted (const FrameEvent &evt) override
 
bool onKeyDown (const Input::KeyEvent &key) override
 Key pressed: return true if input was consumed.
 
bool onKeyUp (const Input::KeyEvent &key) override
 Key released: return true if input was consumed.
 
bool joystickAxisMoved (const Input::JoystickEvent &arg) override
 Joystick axis change: return true if input was consumed.
 
bool joystickPovMoved (const Input::JoystickEvent &arg) override
 Joystick direction change: return true if input was consumed.
 
bool joystickButtonPressed (const Input::JoystickEvent &arg) override
 Joystick button pressed: return true if input was consumed.
 
bool joystickButtonReleased (const Input::JoystickEvent &arg) override
 Joystick button released: return true if input was consumed.
 
bool joystickBallMoved (const Input::JoystickEvent &arg) override
 
bool joystickAddRemove (const Input::JoystickEvent &arg) override
 
bool joystickRemap (const Input::JoystickEvent &arg) override
 
bool mouseMoved (const Input::MouseMoveEvent &arg) override
 Mouse moved: return true if input was consumed.
 
bool mouseButtonPressed (const Input::MouseButtonEvent &arg) override
 Mouse button pressed: return true if input was consumed.
 
bool mouseButtonReleased (const Input::MouseButtonEvent &arg) override
 Mouse button released: return true if input was consumed.
 
bool onTextEvent (const Input::TextEvent &arg) noexcept override
 Called when text input was detected.
 
- Protected Member Functions inherited from Divide::GUIInterface
void addElement (U64 id, GUIElement *element)
 
virtual GUIElementgetGUIElementImpl (U64 elementName, GUIType type) const
 
virtual GUIElementgetGUIElementImpl (I64 elementID, GUIType type) const
 
- Protected Member Functions inherited from Divide::NonCopyable
 NonCopyable ()=default
 
 ~NonCopyable ()=default
 
- Protected Member Functions inherited from Divide::FrameListener
void setCallOrder (const U32 order) noexcept
 
virtual bool frameStarted (const FrameEvent &evt)
 
virtual bool framePreRender (const FrameEvent &evt)
 framePreRenderStarted is called when we need to start processing the visual aspect of a scene
 
virtual bool frameSceneRenderStarted (const FrameEvent &evt)
 frameSceneRenderStarted is called right before rendering the scene for the current player starts
 
virtual bool frameSceneRenderEnded (const FrameEvent &evt)
 frameSceneRenderEnded is called immediately after scene rendering for the current player has ended but before any blitting operations
 
virtual bool frameRenderingQueued (const FrameEvent &evt)
 
virtual bool framePostRender (const FrameEvent &evt)
 
virtual bool frameEnded (const FrameEvent &evt)
 frameEnded is called after the buffers have been swapped
 
 PROPERTY_R_IW (bool, enabled, false)
 
 PROPERTY_RW (Str< 64 >, name)
 

Protected Attributes

CEGUI::Window * _rootSheet {nullptr}
 The root window into which CEGUI anchors all of its elements.
 
CEGUI::GUIContext * _ceguiContext {nullptr}
 The CEGUI context as returned by the library upon creation.
 
- Protected Attributes inherited from Divide::GUIInterface
GUI_context
 
std::array< GUIMap, to_base(GUIType::COUNT)> _guiElements
 
- Protected Attributes inherited from Divide::KernelComponent
Kernel_parent
 
- Protected Attributes inherited from Divide::GUIDWrapper
const I64 _guid
 

Private Member Functions

I32 getFont (const Str< 64 > &fontName)
 Try to find the requested font in the font cache. Load on cache miss.
 
GUIElementgetSceneGUIElementImpl (I64 sceneID, U64 elementName, GUIType type) const
 Internal lookup of a GUIElement by name.
 
GUIElementgetSceneGUIElementImpl (I64 sceneID, I64 elementID, GUIType type) const
 Internal lookup of a GUIElement by ID.
 
void recreateDefaultMessageBox ()
 Used to recreate and re-register the default message box if needed (usually on scene change)
 

Private Attributes

bool _init {false}
 Set to true when the GUI has finished loading.
 
CEGUIInput _ceguiInput
 Used to implement key repeat.
 
CEGUI::CEGUIRenderer_ceguiRenderer { nullptr }
 Used to render CEGUI to a texture; We want to port this to the Divide::GFX interface.
 
CEGUI::DVDTextureTarget_renderTextureTarget {nullptr}
 Used to render CEGUI elements into. We blit this on top of our scene target.
 
std::unique_ptr< GUIConsole_console
 Our custom in-game console (for logs and commands. A la Quake's ~-console)
 
std::unique_ptr< GUIMessageBox_defaultMsgBox
 Pointer to a default message box used for general purpose messages.
 
Scene_activeScene {nullptr}
 Each scene has its own gui elements! (0 = global). We keep a pointer to the scene but we really shouldn't. Scene should feed itself into GUI.
 
GUIMapPerScene _guiStack {}
 All the GUI elements created per scene.
 
SharedMutex _guiStackLock {}
 A lock to protect access to _guiStack.
 
DVDFONSContext_uptr _fonsContext
 We use Font Stash (https://github.com/memononen/fontstash) for rendering basic text on the screen. This is our own Divide::GFX based context object used for rendering.
 
hashMap< U64, I32_fonts
 A cache of all font IDs used by Font Stash stored by name ID.
 
hashAlg::pair< Str< 64 >, I32_fontCache = { "", -1 }
 A cache of the last requested font by name to avoid a lookup in the fonts map.
 
Pipeline_textRenderPipeline {nullptr}
 The text rendering pipeline we used to draw Font Stash text.
 
Handle< ShaderProgram_textRenderShader = INVALID_HANDLE<ShaderProgram>
 The text rendering shaderProgram we used to draw Font Stash text.
 
Handle< ShaderProgram_ceguiRenderShader = INVALID_HANDLE<ShaderProgram>
 

Friends

class SceneGUIElements
 

Additional Inherited Members

- Static Public Member Functions inherited from Divide::GUIDWrapper
static I64 generateGUID () noexcept
 

Detailed Description

Graphical User Interface.

Definition at line 77 of file GUI.h.

Member Typedef Documentation

◆ GUIMapPerScene

Definition at line 83 of file GUI.h.

Constructor & Destructor Documentation

◆ GUI()

Divide::GUI::GUI ( Kernel parent)
explicit

Definition at line 124 of file GUI.cpp.

◆ ~GUI()

Divide::GUI::~GUI ( )
override

Definition at line 135 of file GUI.cpp.

Member Function Documentation

◆ destroy()

void Divide::GUI::destroy ( )

Definition at line 662 of file GUI.cpp.

◆ draw()

void Divide::GUI::draw ( GFXDevice context,
const Rect< I32 > &  viewport,
GFX::CommandBuffer bufferInOut,
GFX::MemoryBarrierCommand memCmdInOut 
)

Go through all of the registered scene gui elements and gather all of the render commands.

Definition at line 302 of file GUI.cpp.

◆ drawText()

void Divide::GUI::drawText ( const TextElementBatch batch,
const Rect< I32 > &  targetViewport,
GFX::CommandBuffer bufferInOut,
GFX::MemoryBarrierCommand memCmdInOut,
bool  pushCamera = true 
)

Text rendering is handled exclusively by Mikko Mononen's FontStash library (https://github.com/memononen/fontstash)

Definition at line 180 of file GUI.cpp.

◆ frameStarted()

bool Divide::GUI::frameStarted ( const FrameEvent evt)
overrideprotectedvirtual

Adapter patern instead of pure interface for the same reason as the Ogre boys pointed out: Implement what you need without filling classes with dummy functions frameStarted is calld at the beggining of a new frame before processing the logic aspect of a scene

Reimplemented from Divide::FrameListener.

Definition at line 381 of file GUI.cpp.

◆ getCEGUIContext()

CEGUI::GUIContext * Divide::GUI::getCEGUIContext ( )
noexcept

Provides direct access to the CEGUI context. Used by plugins (e.g. GUIConsole, GUIInput, etc)

Definition at line 862 of file GUI.cpp.

◆ getConsole() [1/2]

const GUIConsole & Divide::GUI::getConsole ( ) const
inlinenoexcept

Get a const reference to our console window.

Definition at line 116 of file GUI.h.

◆ getConsole() [2/2]

GUIConsole & Divide::GUI::getConsole ( )
inlinenoexcept

Get a reference to our console window.

Definition at line 114 of file GUI.h.

◆ getDefaultMessageBox()

GUIMessageBox * Divide::GUI::getDefaultMessageBox ( ) const
inlinenoexcept

Return a pointer to the default, general purpose message box.

Definition at line 120 of file GUI.h.

◆ getFont()

I32 Divide::GUI::getFont ( const Str< 64 > &  fontName)
private

Try to find the requested font in the font cache. Load on cache miss.

Definition at line 868 of file GUI.cpp.

◆ getSceneGUIElementImpl() [1/4]

template<typename T >
requires std::is_base_of_v<GUIElement, T>
T * Divide::GUI::getSceneGUIElementImpl ( const I64  sceneID,
const I64  elementID 
)
inline

Find a return a gui element by ID.

Definition at line 112 of file GUI.h.

◆ getSceneGUIElementImpl() [2/4]

template<typename T >
requires std::is_base_of_v<GUIElement, T>
T * Divide::GUI::getSceneGUIElementImpl ( const I64  sceneID,
const U64  elementName 
)
inline

Find a return a gui element by name.

Definition at line 109 of file GUI.h.

◆ getSceneGUIElementImpl() [3/4]

GUIElement * Divide::GUI::getSceneGUIElementImpl ( I64  sceneID,
I64  elementID,
GUIType  type 
) const
private

Internal lookup of a GUIElement by ID.

Definition at line 844 of file GUI.cpp.

◆ getSceneGUIElementImpl() [4/4]

GUIElement * Divide::GUI::getSceneGUIElementImpl ( I64  sceneID,
U64  elementName,
GUIType  type 
) const
private

Internal lookup of a GUIElement by name.

Definition at line 825 of file GUI.cpp.

◆ init()

ErrorCode Divide::GUI::init ( PlatformContext context)

Create the GUI.

Definition at line 399 of file GUI.cpp.

◆ joystickAddRemove()

bool Divide::GUI::joystickAddRemove ( const Input::JoystickEvent arg)
overrideprotectedvirtual

Implements Divide::Input::InputAggregatorInterface.

Definition at line 810 of file GUI.cpp.

◆ joystickAxisMoved()

bool Divide::GUI::joystickAxisMoved ( const Input::JoystickEvent arg)
overrideprotectedvirtual

Joystick axis change: return true if input was consumed.

Implements Divide::Input::InputAggregatorInterface.

Definition at line 780 of file GUI.cpp.

◆ joystickBallMoved()

bool Divide::GUI::joystickBallMoved ( const Input::JoystickEvent arg)
overrideprotectedvirtual

Implements Divide::Input::InputAggregatorInterface.

Definition at line 804 of file GUI.cpp.

◆ joystickButtonPressed()

bool Divide::GUI::joystickButtonPressed ( const Input::JoystickEvent arg)
overrideprotectedvirtual

Joystick button pressed: return true if input was consumed.

Implements Divide::Input::InputAggregatorInterface.

Definition at line 792 of file GUI.cpp.

◆ joystickButtonReleased()

bool Divide::GUI::joystickButtonReleased ( const Input::JoystickEvent arg)
overrideprotectedvirtual

Joystick button released: return true if input was consumed.

Implements Divide::Input::InputAggregatorInterface.

Definition at line 798 of file GUI.cpp.

◆ joystickPovMoved()

bool Divide::GUI::joystickPovMoved ( const Input::JoystickEvent arg)
overrideprotectedvirtual

Joystick direction change: return true if input was consumed.

Implements Divide::Input::InputAggregatorInterface.

Definition at line 786 of file GUI.cpp.

◆ joystickRemap()

bool Divide::GUI::joystickRemap ( const Input::JoystickEvent arg)
overrideprotectedvirtual

Implements Divide::Input::InputAggregatorInterface.

Definition at line 815 of file GUI.cpp.

◆ mouseButtonPressed()

bool Divide::GUI::mouseButtonPressed ( const Input::MouseButtonEvent arg)
overrideprotectedvirtual

Mouse button pressed: return true if input was consumed.

Implements Divide::Input::InputAggregatorInterface.

Definition at line 768 of file GUI.cpp.

◆ mouseButtonReleased()

bool Divide::GUI::mouseButtonReleased ( const Input::MouseButtonEvent arg)
overrideprotectedvirtual

Mouse button released: return true if input was consumed.

Implements Divide::Input::InputAggregatorInterface.

Definition at line 774 of file GUI.cpp.

◆ mouseMoved()

bool Divide::GUI::mouseMoved ( const Input::MouseMoveEvent arg)
overrideprotectedvirtual

Mouse moved: return true if input was consumed.

Implements Divide::Input::InputAggregatorInterface.

Definition at line 762 of file GUI.cpp.

◆ onChangeScene()

void Divide::GUI::onChangeScene ( Scene newScene)

When we change a scene, we want to toggle our current scene GUI elements off and toggle the new scene's elements on.

Definition at line 140 of file GUI.cpp.

◆ onKeyDown()

bool Divide::GUI::onKeyDown ( const Input::KeyEvent key)
overrideprotectedvirtual

Key pressed: return true if input was consumed.

Implements Divide::Input::InputAggregatorInterface.

Definition at line 750 of file GUI.cpp.

◆ onKeyUp()

bool Divide::GUI::onKeyUp ( const Input::KeyEvent key)
overrideprotectedvirtual

Key released: return true if input was consumed.

Implements Divide::Input::InputAggregatorInterface.

Definition at line 756 of file GUI.cpp.

◆ onResolutionChange()

void Divide::GUI::onResolutionChange ( const SizeChangeParams params)

Mostly used by CEGUI to keep track of screen dimensions.

Definition at line 719 of file GUI.cpp.

◆ onTextEvent()

bool Divide::GUI::onTextEvent ( const Input::TextEvent arg)
overrideprotectedvirtualnoexcept

Called when text input was detected.

Implements Divide::Input::InputAggregatorInterface.

Definition at line 820 of file GUI.cpp.

◆ onUnloadScene()

void Divide::GUI::onUnloadScene ( Scene scene)

When we unload a scene, we unload all of its GUI elements. ToDo: Scene should own these and scene should submit to GUI for rendering. Current logic is backwards -Ionut.

Definition at line 169 of file GUI.cpp.

◆ preDraw()

void Divide::GUI::preDraw ( GFXDevice context,
const Rect< I32 > &  viewport,
GFX::CommandBuffer bufferInOut,
GFX::MemoryBarrierCommand memCmdInOut 
)

Render all elements that need their own internal render targets (e.g. CEGUI)

Definition at line 277 of file GUI.cpp.

◆ PROPERTY_R() [1/2]

Divide::GUI::PROPERTY_R ( bool  ,
showDebugCursor  ,
false   
)

Debug cursor state. The debug cursor is a the cursor as it's know internally to CEGUI (based on its internal position and state)

◆ PROPERTY_R() [2/2]

Divide::GUI::PROPERTY_R ( string  ,
defaultGUIScheme  ,
"GWEN"   
)

The "skin" used by CEGUI.

◆ PROPERTY_RW()

Divide::GUI::PROPERTY_RW ( U64  ,
textRenderInterval  ,
Time::MillisecondsToMicroseconds(10)   
)

We should avoid rendering text as fast as possible.

◆ recreateDefaultMessageBox()

void Divide::GUI::recreateDefaultMessageBox ( )
private

Used to recreate and re-register the default message box if needed (usually on scene change)

Definition at line 647 of file GUI.cpp.

◆ rootSheet()

CEGUI::Window * Divide::GUI::rootSheet ( ) const
inlinenoexcept

Get a pointer to the root sheet that CEGUI renders into.

Definition at line 118 of file GUI.h.

◆ setCursorPosition()

void Divide::GUI::setCursorPosition ( I32  x,
I32  y 
)

Mouse cursor forced to a certain position.

Definition at line 741 of file GUI.cpp.

◆ showDebugCursor()

void Divide::GUI::showDebugCursor ( bool  state)

Toggle debug cursor rendering on or off.

Definition at line 709 of file GUI.cpp.

◆ update()

void Divide::GUI::update ( U64  deltaTimeUS)

Main update call. Used to tick gui elements (cursors, animations, etc)

Definition at line 358 of file GUI.cpp.

Friends And Related Function Documentation

◆ SceneGUIElements

friend class SceneGUIElements
friend

Definition at line 173 of file GUI.h.

Member Data Documentation

◆ _activeScene

Scene* Divide::GUI::_activeScene {nullptr}
private

Each scene has its own gui elements! (0 = global). We keep a pointer to the scene but we really shouldn't. Scene should feed itself into GUI.

Definition at line 193 of file GUI.h.

◆ _ceguiContext

CEGUI::GUIContext* Divide::GUI::_ceguiContext {nullptr}
protected

The CEGUI context as returned by the library upon creation.

Definition at line 177 of file GUI.h.

◆ _ceguiInput

CEGUIInput Divide::GUI::_ceguiInput
private

Used to implement key repeat.

Definition at line 183 of file GUI.h.

◆ _ceguiRenderer

CEGUI::CEGUIRenderer* Divide::GUI::_ceguiRenderer { nullptr }
private

Used to render CEGUI to a texture; We want to port this to the Divide::GFX interface.

Definition at line 185 of file GUI.h.

◆ _ceguiRenderShader

Handle<ShaderProgram> Divide::GUI::_ceguiRenderShader = INVALID_HANDLE<ShaderProgram>
private

Definition at line 208 of file GUI.h.

◆ _console

std::unique_ptr<GUIConsole> Divide::GUI::_console
private

Our custom in-game console (for logs and commands. A la Quake's ~-console)

Definition at line 189 of file GUI.h.

◆ _defaultMsgBox

std::unique_ptr<GUIMessageBox> Divide::GUI::_defaultMsgBox
private

Pointer to a default message box used for general purpose messages.

Definition at line 191 of file GUI.h.

◆ _fonsContext

DVDFONSContext_uptr Divide::GUI::_fonsContext
private

We use Font Stash (https://github.com/memononen/fontstash) for rendering basic text on the screen. This is our own Divide::GFX based context object used for rendering.

Definition at line 199 of file GUI.h.

◆ _fontCache

hashAlg::pair<Str<64>, I32> Divide::GUI::_fontCache = { "", -1 }
private

A cache of the last requested font by name to avoid a lookup in the fonts map.

Definition at line 203 of file GUI.h.

◆ _fonts

hashMap<U64, I32> Divide::GUI::_fonts
private

A cache of all font IDs used by Font Stash stored by name ID.

Definition at line 201 of file GUI.h.

◆ _guiStack

GUIMapPerScene Divide::GUI::_guiStack {}
private

All the GUI elements created per scene.

Definition at line 195 of file GUI.h.

◆ _guiStackLock

SharedMutex Divide::GUI::_guiStackLock {}
mutableprivate

A lock to protect access to _guiStack.

Definition at line 197 of file GUI.h.

◆ _init

bool Divide::GUI::_init {false}
private

Set to true when the GUI has finished loading.

Definition at line 181 of file GUI.h.

◆ _renderTextureTarget

CEGUI::DVDTextureTarget* Divide::GUI::_renderTextureTarget {nullptr}
private

Used to render CEGUI elements into. We blit this on top of our scene target.

Definition at line 187 of file GUI.h.

◆ _rootSheet

CEGUI::Window* Divide::GUI::_rootSheet {nullptr}
protected

The root window into which CEGUI anchors all of its elements.

Definition at line 175 of file GUI.h.

◆ _textRenderPipeline

Pipeline* Divide::GUI::_textRenderPipeline {nullptr}
private

The text rendering pipeline we used to draw Font Stash text.

Definition at line 205 of file GUI.h.

◆ _textRenderShader

Handle<ShaderProgram> Divide::GUI::_textRenderShader = INVALID_HANDLE<ShaderProgram>
private

The text rendering shaderProgram we used to draw Font Stash text.

Definition at line 207 of file GUI.h.


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