![]() |
PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
|
Definition at line 53 of file PureUiManager.cpp.
Public Member Functions | |
virtual | ~PureUiManagerImpl () |
void | Initialize (HWND wnd_handle, HDC wnd_dc) override |
Sets members to real values within the singleton instance. | |
void | Deinitialize () override |
This deletes all UI elements and allocated resources, Initialize() can be called again later. | |
TPureBool | isInitialized () const override |
Gets whether we are initialized. | |
const std::function< void()> & | getGuiDrawCallback () const override |
Returns the previously set GUI callback function. | |
void | setGuiDrawCallback (const std::function< void()> &cb) override |
Sets the given GUI draw callback function to be invoked by the renderer in every frame. | |
PureUiText * | textPermanentLegacy (const std::string &txt, int x, int y, const std::string &fontface, int height, bool bold, bool italic, bool underline, bool strikeout) override |
Adds permanent text to the UI. | |
PureUiText * | textPermanentLegacy (const std::string &txt, int x, int y) override |
Adds permanent text to the UI with default properties. | |
void | removeTextPermanentLegacy (const std::string &text, int x, int y, int height) override |
Deletes permanent text from the UI that was previously added by textPermanentLegacy(). | |
void | removeAllTextPermanentLegacy () override |
Deletes all permanent texts from the UI that were previously added by textPermanentLegacy(). | |
PureUiText * | textTemporalLegacy (const std::string &txt, int x, int y, const std::string &fontface, int height, bool bold, bool italic, bool underline, bool strikeout) override |
Adds temporary text to the UI. | |
PureUiText * | textTemporalLegacy (const std::string &txt, int x, int y) override |
Adds temporary text to the UI. | |
const std::string & | getDefaultFontFaceLegacy () const override |
Gets the default font face used by legacy functions textPermanentLegacy() and textTemporalLegacy(). | |
void | setDefaultFontFaceLegacy (const std::string &face) override |
Sets the default font face used by legacy functions textPermanentLegacy() and textTemporalLegacy(). | |
int | getDefaultFontSizeLegacy () const override |
Gets the default font size used by legacy functions textPermanentLegacy() and textTemporalLegacy(). | |
void | setDefaultFontSizeLegacy (int size) override |
Sets the default font size used by legacy functions textPermanentLegacy() and textTemporalLegacy(). | |
bool | getDefaultFontBoldLegacy () const override |
Gets the default font bold property used by legacy functions textPermanentLegacy() and textTemporalLegacy(). | |
void | setDefaultFontBoldLegacy (bool bold) override |
Sets the default font bold property used by legacy functions textPermanentLegacy() and textTemporalLegacy(). | |
bool | getDefaultFontItalicLegacy () const override |
Gets the default font italic property used by legacy functions textPermanentLegacy() and textTemporalLegacy(). | |
void | setDefaultFontItalicLegacy (bool italic) override |
Sets the default font italic property used by legacy functions textPermanentLegacy() and textTemporalLegacy(). | |
bool | getDefaultFontUnderlineLegacy () const override |
Gets the default font underlined property used by legacy functions textPermanentLegacy() and textTemporalLegacy(). | |
void | setDefaultFontUnderlineLegacy (bool underline) override |
Sets the default font underlined property used by legacy functions textPermanentLegacy() and textTemporalLegacy(). | |
bool | getDefaultFontStrikeoutLegacy () const override |
Gets the default font strikeout property used by legacy functions textPermanentLegacy() and textTemporalLegacy(). | |
void | setDefaultFontStrikeoutLegacy (bool strikeout) override |
Sets the default font strikeout property used by legacy functions textPermanentLegacy() and textTemporalLegacy(). | |
const PureColor & | getDefaultColorLegacy () const override |
Returns reference to default color used by legacy functions textPermanentLegacy() and textTemporalLegacy() This default color is black by default. | |
PureColor & | getDefaultColorLegacy () override |
Returns reference to default color used by legacy functions textPermanentLegacy() and textTemporalLegacy() This default color is black by default. | |
void | render () override |
![]() | |
CConsole & | getConsole () const |
Returns access to console preset with logger module name as this class. | |
Private Member Functions | |
PureUiManagerImpl () | |
This is the only usable ctor, this is used by the static createAndGet(). | |
PureUiManagerImpl (const PureUiManagerImpl &) | |
PureUiManagerImpl & | operator= (const PureUiManagerImpl &) |
Private Attributes | |
bool | bInitialized |
HDC | hDC |
ImGuiContext * | pImGuiCtx |
Dear ImGui context that we share with user application so it can use OUR ImGui instance. | |
GLfloat | mat4x4Identity [4][4] |
std::map< unsigned long, PureUiText > | mTexts |
std::vector< PureUiFontWin * > | vFonts |
std::function< void()> | pfGuiCallback |
std::string | sDefaultFont |
int | nDefaultFontSize |
bool | bDefaultFontBold |
bool | bDefaultFontItalic |
bool | bDefaultFontUnderline |
bool | bDefaultFontStrikeout |
PureColor | clrDefault |
Friends | |
class | PureUiManager |
Additional Inherited Members | |
![]() | |
static PureUiManager & | createAndGet () |
Creates and gets the singleton instance. | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
|
virtual |
Definition at line 149 of file PureUiManager.cpp.
|
private |
This is the only usable ctor, this is used by the static createAndGet().
Definition at line 531 of file PureUiManager.cpp.
|
private |
Definition at line 544 of file PureUiManager.cpp.
|
overridevirtual |
This deletes all UI elements and allocated resources, Initialize() can be called again later.
Application doesn't need to call this, PURE shutdown takes care of this.
Implements PureUiManager.
Definition at line 234 of file PureUiManager.cpp.
|
overridevirtual |
Returns reference to default color used by legacy functions textPermanentLegacy() and textTemporalLegacy() This default color is black by default.
Implements PureUiManager.
Definition at line 453 of file PureUiManager.cpp.
|
overridevirtual |
Returns reference to default color used by legacy functions textPermanentLegacy() and textTemporalLegacy() This default color is black by default.
Implements PureUiManager.
Definition at line 458 of file PureUiManager.cpp.
|
overridevirtual |
Gets the default font bold property used by legacy functions textPermanentLegacy() and textTemporalLegacy().
Implements PureUiManager.
Definition at line 413 of file PureUiManager.cpp.
|
overridevirtual |
Gets the default font face used by legacy functions textPermanentLegacy() and textTemporalLegacy().
Implements PureUiManager.
Definition at line 393 of file PureUiManager.cpp.
|
overridevirtual |
Gets the default font italic property used by legacy functions textPermanentLegacy() and textTemporalLegacy().
Implements PureUiManager.
Definition at line 423 of file PureUiManager.cpp.
|
overridevirtual |
Gets the default font size used by legacy functions textPermanentLegacy() and textTemporalLegacy().
Implements PureUiManager.
Definition at line 403 of file PureUiManager.cpp.
|
overridevirtual |
Gets the default font strikeout property used by legacy functions textPermanentLegacy() and textTemporalLegacy().
Implements PureUiManager.
Definition at line 443 of file PureUiManager.cpp.
|
overridevirtual |
Gets the default font underlined property used by legacy functions textPermanentLegacy() and textTemporalLegacy().
Implements PureUiManager.
Definition at line 433 of file PureUiManager.cpp.
|
overridevirtual |
Returns the previously set GUI callback function.
Implements PureUiManager.
Definition at line 282 of file PureUiManager.cpp.
|
overridevirtual |
Sets members to real values within the singleton instance.
Does nothing if wnd_handle or wnd_dc is NULL.
Application doesn't need to call this, PURE initialization takes care of this.
Implements PureUiManager.
Definition at line 155 of file PureUiManager.cpp.
|
overridevirtual |
Gets whether we are initialized.
Implements PureUiManager.
Definition at line 276 of file PureUiManager.cpp.
|
private |
Definition at line 550 of file PureUiManager.cpp.
|
overridevirtual |
Deletes all permanent texts from the UI that were previously added by textPermanentLegacy().
This command is not needed to be used on temporary texts added by textTemporalLegacy().
Implements PureUiManager.
Definition at line 368 of file PureUiManager.cpp.
|
overridevirtual |
Deletes permanent text from the UI that was previously added by textPermanentLegacy().
This command is not needed to be used on temporary texts added by textTemporalLegacy().
Implements PureUiManager.
Definition at line 361 of file PureUiManager.cpp.
|
overridevirtual |
Implements PureUiManager.
Definition at line 463 of file PureUiManager.cpp.
|
overridevirtual |
Sets the default font bold property used by legacy functions textPermanentLegacy() and textTemporalLegacy().
Implements PureUiManager.
Definition at line 418 of file PureUiManager.cpp.
|
overridevirtual |
Sets the default font face used by legacy functions textPermanentLegacy() and textTemporalLegacy().
Implements PureUiManager.
Definition at line 398 of file PureUiManager.cpp.
|
overridevirtual |
Sets the default font italic property used by legacy functions textPermanentLegacy() and textTemporalLegacy().
Implements PureUiManager.
Definition at line 428 of file PureUiManager.cpp.
|
overridevirtual |
Sets the default font size used by legacy functions textPermanentLegacy() and textTemporalLegacy().
Implements PureUiManager.
Definition at line 408 of file PureUiManager.cpp.
|
overridevirtual |
Sets the default font strikeout property used by legacy functions textPermanentLegacy() and textTemporalLegacy().
Implements PureUiManager.
Definition at line 448 of file PureUiManager.cpp.
|
overridevirtual |
Sets the default font underlined property used by legacy functions textPermanentLegacy() and textTemporalLegacy().
Implements PureUiManager.
Definition at line 438 of file PureUiManager.cpp.
|
overridevirtual |
Sets the given GUI draw callback function to be invoked by the renderer in every frame.
This callback should invoke Dear ImGui (https://github.com/ocornut/imgui) functions to draw GUI. The caller is not responsible for compiling or initializing Dear ImGui, PURE is in charge for that. PURE is already built with Dear ImGui code. Only the platform-agnostic, actual GUI drawing functions should be invoked that are listed in imgui.h. This header file is in the external include directory of PURE. None of these should be called either:
For an example on how to use this function, see a real-life game project: https://github.com/proof88/PRooFPS-dd .
Note: this function is invoked every frame, AFTER rendering the 2D sticked-to-screen objects (PureObject3D::SetStickedToScreen()). Thus, if you also do calculations in the specified callback function that have effect on those PURE sticked-to-screen objects, the visible effects will be delayed to the next frame. So in general it is highly recommended to do ONLY Dear ImGui-specific stuff in the specified callback function.
Implements PureUiManager.
Definition at line 288 of file PureUiManager.cpp.
|
overridevirtual |
Adds permanent text to the UI with default properties.
Basically this has the same effect as calling the other textPermanentLegacy() with default font properties.
Implements PureUiManager.
Definition at line 355 of file PureUiManager.cpp.
|
overridevirtual |
Adds permanent text to the UI.
Permanent texts live until explicit deletion. This means that after you add a permanent text to the UI, it will be displayed in all next rendered frames.
This function is considered as legacy now because it uses an old technique to render text, however it is still being used here and there (including the original PR00FPS thru the gfxcore2 wrapper library) thus I'm not planning to delete it soon. It depends on the platform-specific PureUiFontWin class and I'm not planning to create something similar for Linux, so multiplatform support is not possible now with this legacy way.
Another way of text rendering can be done using Dear ImGui text-rendering functions that you can invoke in your own function that you pass to PURE using setGuiDrawCallback().
This function has nothing to do with Dear ImGui. You can add text using this function or with Dear ImGui API, they can be rendered on-screen at the same time too.
Implements PureUiManager.
Definition at line 314 of file PureUiManager.cpp.
|
overridevirtual |
Adds temporary text to the UI.
Basically this has the same effect as calling the other textTemporalLegacy() with default font properties.
Implements PureUiManager.
Definition at line 388 of file PureUiManager.cpp.
|
overridevirtual |
Adds temporary text to the UI.
Temporary texts live only in the next rendered frame. This means that in order to display the same temporary text for more than 1 frame, you have to issue this command before rendering every single frame.
If you want to display the same text in multiple frame, from performance perspective it is better to add permanent text using textPermanentLegacy() instead.
This function is considered as legacy now because it uses an old technique to render text, however it is still being used here and there (including the original PR00FPS thru the gfxcore2 wrapper library) thus I'm not planning to delete it soon. It depends on the platform-specific PureUiFontWin class and I'm not planning to create something similar for Linux, so multiplatform support is not possible now with this legacy way.
Another way of text rendering can be done using Dear ImGui text-rendering functions that you can invoke in your own function that you pass to PURE using setGuiDrawCallback().
This function has nothing to do with Dear ImGui. You can add text using this function or with Dear ImGui API, they can be rendered on-screen at the same time too.
Implements PureUiManager.
Definition at line 379 of file PureUiManager.cpp.
|
friend |
Definition at line 141 of file PureUiManager.cpp.
|
private |
Definition at line 126 of file PureUiManager.cpp.
|
private |
Definition at line 127 of file PureUiManager.cpp.
|
private |
Definition at line 129 of file PureUiManager.cpp.
|
private |
Definition at line 128 of file PureUiManager.cpp.
|
private |
Definition at line 114 of file PureUiManager.cpp.
|
private |
Definition at line 131 of file PureUiManager.cpp.
|
private |
Definition at line 115 of file PureUiManager.cpp.
|
private |
Definition at line 117 of file PureUiManager.cpp.
|
private |
Definition at line 118 of file PureUiManager.cpp.
|
private |
Definition at line 125 of file PureUiManager.cpp.
|
private |
Definition at line 121 of file PureUiManager.cpp.
|
private |
Dear ImGui context that we share with user application so it can use OUR ImGui instance.
Definition at line 116 of file PureUiManager.cpp.
|
private |
Definition at line 124 of file PureUiManager.cpp.
|
private |
Definition at line 119 of file PureUiManager.cpp.