IrrIMGUI
0.3.1
|
Use an object of this class to setup the IMGUI for Irrlicht and to render the content. More...
#include <CIMGUIHandle.h>
Public Member Functions | |
Constructor and Destructor | |
CIMGUIHandle (irr::IrrlichtDevice *pDevice, CIMGUIEventStorage *pEventStorage=nullptr, SIMGUISettings const *pSettings=nullptr) | |
Use this constructor when you want special settings. More... | |
CIMGUIHandle (irr::IrrlichtDevice *pDevice, CIMGUIEventStorage *pEventStorage, SIMGUISettings const &rSettings) | |
Use this constructor when you want special settings. More... | |
virtual | ~CIMGUIHandle (void) |
Destructor. More... | |
Render and drawing methods | |
virtual void | startGUI (void) |
Call this methods before you draw the IMGUI elements and before calling "drawAll()". More... | |
virtual void | drawAll (void) |
Call this function after "startGUI()" and after you draw your GUI elements. It will render all elements to the screen (do not call it before rendering the 3D Scene!). More... | |
GUI settings | |
virtual SIMGUISettings const & | getSettings (void) const |
virtual void | setSettings (SIMGUISettings const &rSettings) |
Font operations | |
virtual ImFont * | addFont (ImFontConfig const *pFontConfig) |
Adds a font to the IMGUI memory. More... | |
virtual ImFont * | addDefaultFont (ImFontConfig const *pFontConfig=NULL) |
Adds the default font to the IMGUI memory. More... | |
virtual ImFont * | addFontFromFileTTF (char const *pFileName, float FontSizeInPixel, ImFontConfig const *pFontConfig=NULL, ImWchar const *pGlyphRanges=NULL) |
Adds a font from a TTF file to the IMGUI memory. More... | |
virtual ImFont * | addFontFromMemoryTTF (void *pTTFData, int TTFSize, float FontSizeInPixel, ImFontConfig const *pFontConfig=NULL, ImWchar const *pGlyphRanges=NULL) |
Adds a font from a TTF byte array to the IMGUI memory. More... | |
virtual ImFont * | addFontFromMemoryCompressedTTF (void const *pCompressedTTFData, int CompressedTTFSize, float FontSizeInPixel, ImFontConfig const *pFontConfig=NULL, ImWchar const *pGlyphRanges=NULL) |
Adds a font from a compressed TTF byte array to the IMGUI memory. More... | |
virtual ImFont * | addFontFromMemoryCompressedBase85TTF (char const *pCompressedTTFDataBase85, float FontSizeInPixel, ImFontConfig const *pFontConfig=NULL, const ImWchar *pGlyphRanges=NULL) |
Adds a font from a compressed TTF byte array that uses the base85 character encoding to the IMGUI memory. More... | |
virtual void | compileFonts (void) |
This function copies all fonts that have been added with "addFont/addDefaultFont" into graphic memory. More... | |
virtual void | resetFonts (void) |
Resets the font memory and restores the default font as the one and only font in the system. More... | |
Common Font Glyph-Ranges | |
virtual ImWchar const * | getGlyphRangesDefault (void) |
virtual ImWchar const * | getGlyphRangesJapanese (void) |
virtual ImWchar const * | getGlyphRangesChinese (void) |
virtual ImWchar const * | getGlyphRangesCyrillic (void) |
Image and Texture methods | |
virtual IGUITexture * | createTexture (irr::video::IImage *pImage) |
Creates a GUI texture object out of an Irrlicht image. More... | |
virtual IGUITexture * | createTexture (irr::video::ITexture *pTexture) |
Creates a GUI texture object out of an Irrlicht texture. More... | |
virtual void | updateTexture (IGUITexture *pGUITexture, irr::video::IImage *pImage) |
Updates a GUI texture object with an Irrlicht image. More... | |
virtual void | updateTexture (IGUITexture *pGUITexture, irr::video::ITexture *pTexture) |
Updates a GUI texture object with an Irrlicht texture. More... | |
virtual void | deleteTexture (IGUITexture *pGUITexture) |
Deletes an texture from graphic memory. More... | |
Public Member Functions inherited from IrrIMGUI::IIMGUIHandle | |
virtual | ~IIMGUIHandle (void) |
Destructor. More... | |
Public Member Functions inherited from IrrIMGUI::IReferenceCounter | |
IReferenceCounter (void) | |
Constructor. More... | |
virtual | ~IReferenceCounter (void) |
Destructor. More... | |
virtual void | grab (void) |
Call this method to grab an instance. More... | |
virtual void | drop (void) |
Call this method to drop an instance. If you drop the last used instance, the object is destroyed. More... | |
virtual irr::u32 | getReferenceCount (void) const |
Private Member Functions | |
void | updateScreenSize (void) |
Updates the screen size used for IMGUI. More... | |
void | updateTimer (void) |
Updated the IMGUI timers. More... | |
void | updateMouse (void) |
Update Mouse input information. More... | |
void | updateKeyboard (void) |
Update Keyboard input information. More... | |
Private Attributes | |
Private::IIMGUIDriver * | mpGUIDriver |
irr::f32 | mLastTime |
CIMGUIEventStorage * | mpEventStorage |
Static Private Attributes | |
static irr::u32 | mHandleInstances = 0 |
Additional Inherited Members | |
Protected Member Functions inherited from IrrIMGUI::IIMGUIHandle | |
IIMGUIHandle (void) | |
Forbidden Constructor. More... | |
Use an object of this class to setup the IMGUI for Irrlicht and to render the content.
Create an object of this handle in your project, when you need the IMGUI. You can create multiple object, but all of them will just use a single instance of the GUI (this is an IMGUI limitation). You can setup and use the same GUI from all instances of this handle.
If the last instance is destroyed, the IMGUI system will be shutdown.
To create an instance of this handle you need to pass an Irrlicht device object to the constructor. The Event-Storage pointer can be an "nullptr" or NULL, if you don't need mouse or keyboard input for your GUI.
To draw a GUI add the corresponding IMGUI element functions to your main loop between calling "startGUI()" and "drawAll()" of this class.
Definition at line 99 of file CIMGUIHandle.h.
IrrIMGUI::Private::CIMGUIHandle::CIMGUIHandle | ( | irr::IrrlichtDevice * | pDevice, |
CIMGUIEventStorage * | pEventStorage = nullptr , |
||
SIMGUISettings const * | pSettings = nullptr |
||
) |
Use this constructor when you want special settings.
pDevice | Is a pointer to the Irrlicht Device. |
pEventStorage | Is a pointer to the Event Storage that is used to transfer Mouse and Key input informations to the IMGUI. If you pass NULL or nullptr, no input informations are passed to the GUI. |
pSettings | Is a pointer to the a Settings structure. |
Definition at line 55 of file CIMGUIHandle.cpp.
IrrIMGUI::Private::CIMGUIHandle::CIMGUIHandle | ( | irr::IrrlichtDevice * | pDevice, |
CIMGUIEventStorage * | pEventStorage, | ||
SIMGUISettings const & | rSettings | ||
) |
Use this constructor when you want special settings.
pDevice | Is a pointer to the Irrlicht Device. |
pEventStorage | Is a pointer to the Event Storage that is used to transfer Mouse and Key input informations to the IMGUI. If you pass NULL or nullptr, no input informations are passed to the GUI. |
rSettings | Is a reference to the a Settings structure. |
Definition at line 49 of file CIMGUIHandle.cpp.
|
virtual |
Destructor.
Definition at line 70 of file CIMGUIHandle.cpp.
|
virtual |
Adds the default font to the IMGUI memory.
pFontConfig | Is a pointer to the font configuration. |
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 124 of file CIMGUIHandle.cpp.
|
virtual |
Adds a font to the IMGUI memory.
pFontConfig | Is a pointer to the font configuration. |
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 119 of file CIMGUIHandle.cpp.
|
virtual |
Adds a font from a TTF file to the IMGUI memory.
pFileName | Is the name of the file to add. |
FontSizeInPixel | Is the desired font size to use. |
pFontConfig | Is a pointer to the font configuration. |
pGlyphRanges | Is the Glyph-Range to select the correct character set. |
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 129 of file CIMGUIHandle.cpp.
|
virtual |
Adds a font from a compressed TTF byte array that uses the base85 character encoding to the IMGUI memory.
pCompressedTTFDataBase85 | Is a pointer to the char array. |
FontSizeInPixel | Is the desired font size to use. |
pFontConfig | Is a pointer to the font configuration. |
pGlyphRanges | Is the Glyph-Range to select the correct character set. |
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 144 of file CIMGUIHandle.cpp.
|
virtual |
Adds a font from a compressed TTF byte array to the IMGUI memory.
pCompressedTTFData | Is a pointer to the byte array. |
CompressedTTFSize | Is the size of the array in byte. |
FontSizeInPixel | Is the desired font size to use. |
pFontConfig | Is a pointer to the font configuration. |
pGlyphRanges | Is the Glyph-Range to select the correct character set. |
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 139 of file CIMGUIHandle.cpp.
|
virtual |
Adds a font from a TTF byte array to the IMGUI memory.
pTTFData | Is a pointer to the byte array. |
TTFSize | Is the size of the array in byte. |
FontSizeInPixel | Is the desired font size to use. |
pFontConfig | Is a pointer to the font configuration. |
pGlyphRanges | Is the Glyph-Range to select the correct character set. |
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 134 of file CIMGUIHandle.cpp.
|
virtual |
This function copies all fonts that have been added with "addFont/addDefaultFont" into graphic memory.
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 149 of file CIMGUIHandle.cpp.
|
virtual |
Creates a GUI texture object out of an Irrlicht image.
pImage | Is a pointer to an Irrlicht image object. |
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 183 of file CIMGUIHandle.cpp.
|
virtual |
Creates a GUI texture object out of an Irrlicht texture.
pTexture | Is a pointer to an Irrlicht texture object. |
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 188 of file CIMGUIHandle.cpp.
|
virtual |
Deletes an texture from graphic memory.
pGUITexture | Is a pointer to the texture to delete. Do not use it afterwards! |
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 205 of file CIMGUIHandle.cpp.
|
virtual |
Call this function after "startGUI()" and after you draw your GUI elements. It will render all elements to the screen (do not call it before rendering the 3D Scene!).
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 91 of file CIMGUIHandle.cpp.
|
virtual |
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 173 of file CIMGUIHandle.cpp.
|
virtual |
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 178 of file CIMGUIHandle.cpp.
|
virtual |
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 163 of file CIMGUIHandle.cpp.
|
virtual |
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 168 of file CIMGUIHandle.cpp.
|
virtual |
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 109 of file CIMGUIHandle.cpp.
|
virtual |
Resets the font memory and restores the default font as the one and only font in the system.
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 155 of file CIMGUIHandle.cpp.
|
virtual |
rSettings | is a reference to a Setting structure that should be applied. |
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 114 of file CIMGUIHandle.cpp.
|
virtual |
Call this methods before you draw the IMGUI elements and before calling "drawAll()".
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 98 of file CIMGUIHandle.cpp.
|
private |
Update Keyboard input information.
|
private |
Update Mouse input information.
|
private |
Updates the screen size used for IMGUI.
|
virtual |
Updates a GUI texture object with an Irrlicht image.
pGUITexture | Is a pointer to the GUI texture object. |
pImage | Is a pointer to an Irrlicht image object. |
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 193 of file CIMGUIHandle.cpp.
|
virtual |
Updates a GUI texture object with an Irrlicht texture.
pGUITexture | Is a pointer to the GUI texture object. |
pTexture | Is a pointer to an Irrlicht image object. |
Implements IrrIMGUI::IIMGUIHandle.
Definition at line 199 of file CIMGUIHandle.cpp.
|
private |
Updated the IMGUI timers.
|
staticprivate |
Definition at line 293 of file CIMGUIHandle.h.
|
private |
Definition at line 291 of file CIMGUIHandle.h.
|
private |
Definition at line 292 of file CIMGUIHandle.h.
|
private |
Definition at line 290 of file CIMGUIHandle.h.