TDME2 1.9.121
Classes | Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes | List of all members
GUIRenderer Class Referencefinal

GUI renderer. More...

#include <tdme/gui/renderer/GUIRenderer.h>

Collaboration diagram for GUIRenderer:
Collaboration graph

Classes

struct  GUIEffectStackEntity
 

Public Member Functions

 GUIRenderer (Renderer *renderer)
 Public constructor. More...
 
 ~GUIRenderer ()
 Destructor. More...
 
void setGUI (GUI *gui)
 Set GUI. More...
 
GUIgetGUI ()
 
void initialize ()
 Init. More...
 
void dispose ()
 Dispose. More...
 
void initRendering ()
 Init rendering. More...
 
void doneRendering ()
 Done rendering. More...
 
GUIScreenNodegetScreenNode ()
 
void initScreen (GUIScreenNode *screenNode)
 Init screen. More...
 
void doneScreen ()
 Done screen. More...
 
void setFontColor (const GUIColor &color)
 Set effect color mul. More...
 
void setEffectColorMul (const GUIColor &color)
 Set effect color mul. More...
 
void setEffectColorAdd (const GUIColor &color)
 Set effect color add. More...
 
const GUIColorgetGUIEffectColorMul ()
 
void setGUIEffectColorMul (const GUIColor &color)
 Set GUI effect color mul. More...
 
const GUIColorgetGUIEffectColorAdd ()
 
void setGUIEffectColorAdd (const GUIColor &color)
 Set GUI effect color add. More...
 
float getGUIEffectOffsetX ()
 
void setGUIEffectOffsetX (float guiEffectOffsetX)
 Set GUI effect offset X. More...
 
float getGUIEffectOffsetY ()
 
void setGUIEffectOffsetY (float guiEffectOffsetY)
 Set GUI effect offset Y. More...
 
float getRenderAreaLeft ()
 
void setRenderAreaLeft (float renderAreaLeft)
 Set up render area left. More...
 
void setSubRenderAreaLeft (float renderAreaLeft)
 Set sub render area left. More...
 
float getRenderAreaTop ()
 
void setRenderAreaTop (float renderAreaTop)
 Set up render area top. More...
 
void setSubRenderAreaTop (float renderAreaTop)
 Set sub render area top. More...
 
float getRenderAreaRight ()
 
void setRenderAreaRight (float renderAreaRight)
 Set up render area right. More...
 
void setSubRenderAreaRight (float renderAreaRight)
 Set sub render area right. More...
 
float getRenderAreaBottom ()
 
void setRenderAreaBottom (float renderAreaBottom)
 Set up render area bottom. More...
 
void setSubRenderAreaBottom (float renderAreaBottom)
 Set sub render area bottom. More...
 
float getRenderOffsetX ()
 
void setRenderOffsetX (float renderOffsetX)
 Set render offset x. More...
 
float getRenderOffsetY ()
 
void setRenderOffsetY (float renderOffsetY)
 Set render offset y. More...
 
void pushEffects (const vector< GUIEffect * > &effects)
 Push effects @oaran effects effects. More...
 
void popEffects ()
 Pop effects. More...
 
bool isQuadVisible (float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
 
void addQuad (float x1, float y1, float colorR1, float colorG1, float colorB1, float colorA1, float tu1, float tv1, float x2, float y2, float colorR2, float colorG2, float colorB2, float colorA2, float tu2, float tv2, float x3, float y3, float colorR3, float colorG3, float colorB3, float colorA3, float tu3, float tv3, float x4, float y4, float colorR4, float colorG4, float colorB4, float colorA4, float tu4, float tv4)
 Add quad Note: quad vertices order 1 2 +-—+ | | | | +-—+ 4 3. More...
 
void setTexureMatrix (const Matrix2D3x3 &textureMatrix)
 Set texture matrix. More...
 
void bindTexture (int32_t textureId)
 Bind texture. More...
 
void bindMask (int32_t textureId)
 Bind mask texture. More...
 
void setMaskMaxValue (float maskMaxValue)
 Set mask max value. More...
 
void setGradient (int count, array< GUIColor, 10 > &colors, array< float, 10 > &colorStarts, float rotationAngle)
 Set gradient properties. More...
 
void unsetGradient ()
 Disable gradient. More...
 
void render ()
 Render. More...
 

Static Public Attributes

static constexpr float SCREEN_LEFT { -1.0f }
 
static constexpr float SCREEN_TOP { 1.0f }
 
static constexpr float SCREEN_RIGHT { 1.0f }
 
static constexpr float SCREEN_BOTTOM { -1.0f }
 

Private Attributes

GUIgui { nullptr }
 
Rendererrenderer { nullptr }
 
vector< int32_t > * vboIds { nullptr }
 
int quadCount { 0 }
 
ByteBuffersbIndicesByteBuffer { nullptr }
 
ByteBufferfbVerticesByteBuffer { nullptr }
 
FloatBuffer fbVertices
 
ByteBufferfbColorsByteBuffer { nullptr }
 
FloatBuffer fbColors
 
ByteBufferfbTextureCoordinatesByteBuffer
 
FloatBuffer fbTextureCoordinates
 
float renderAreaLeft
 
float renderAreaTop
 
float renderAreaRight
 
float renderAreaBottom
 
float renderOffsetX
 
float renderOffsetY
 
GUIScreenNodescreenNode { nullptr }
 
GUIColor guiEffectColorMul
 
GUIColor guiEffectColorAdd
 
array< float, 4 > fontColor
 
array< float, 4 > effectColorMul
 
array< float, 4 > effectColorAdd
 
array< float, 4 > effectColorMulFinal
 
array< float, 4 > effectColorAddFinal
 
float guiEffectOffsetX
 
float guiEffectOffsetY
 
vector< GUIEffectStackEntitystackedEffects
 

Static Private Attributes

static constexpr int QUAD_COUNT { 1024 }
 

Detailed Description

GUI renderer.

Author
Andreas Drewke
Version
$Id$

Definition at line 39 of file GUIRenderer.h.

Constructor & Destructor Documentation

◆ GUIRenderer()

GUIRenderer ( Renderer renderer)

Public constructor.

Definition at line 43 of file GUIRenderer.cpp.

◆ ~GUIRenderer()

Destructor.

Definition at line 60 of file GUIRenderer.cpp.

Member Function Documentation

◆ addQuad()

void addQuad ( float  x1,
float  y1,
float  colorR1,
float  colorG1,
float  colorB1,
float  colorA1,
float  tu1,
float  tv1,
float  x2,
float  y2,
float  colorR2,
float  colorG2,
float  colorB2,
float  colorA2,
float  tu2,
float  tv2,
float  x3,
float  y3,
float  colorR3,
float  colorG3,
float  colorB3,
float  colorA3,
float  tu3,
float  tv3,
float  x4,
float  y4,
float  colorR4,
float  colorG4,
float  colorB4,
float  colorA4,
float  tu4,
float  tv4 
)

Add quad Note: quad vertices order 1 2 +-—+ | | | | +-—+ 4 3.

Parameters
x1x 1
y1y 1
colorR1color red 1
colorG1color green 1
colorB1color blue 1
colorA1color alpha 1
tu1texture u 1
tv1texture v 1
x2x 2
y2y 2
colorR2color red 2
colorG2color green 2
colorB2color blue 2
colorA2color alpha 2
tu2texture u 2
tv2texture v 2
x3x 3
y3y 3
colorR3color red 3
colorG3color green 3
colorB3color blue 3
colorA3color alpha 3
tu3texture u 3
tv3texture v 3
x4x 4
y4y 4
colorR4color red 4
colorG4color green 4
colorB4color blue 4
colorA4color alpha 4
tu4texture u 4
tv4texture v 4

Definition at line 151 of file GUIRenderer.cpp.

◆ bindMask()

void bindMask ( int32_t  textureId)

Bind mask texture.

Parameters
textureIdtexture

Definition at line 264 of file GUIRenderer.cpp.

◆ bindTexture()

void bindTexture ( int32_t  textureId)

Bind texture.

Parameters
textureIdtexture

Definition at line 259 of file GUIRenderer.cpp.

◆ dispose()

void dispose ( )

Dispose.

Definition at line 99 of file GUIRenderer.cpp.

◆ doneRendering()

void doneRendering ( )

Done rendering.

Definition at line 117 of file GUIRenderer.cpp.

◆ doneScreen()

void doneScreen ( )

Done screen.

Definition at line 132 of file GUIRenderer.cpp.

◆ getGUI()

GUI * getGUI ( )
inline
Returns
GUI

Definition at line 108 of file GUIRenderer.h.

◆ getGUIEffectColorAdd()

const GUIColor & getGUIEffectColorAdd ( )
inline
Returns
effect color add

Definition at line 192 of file GUIRenderer.h.

◆ getGUIEffectColorMul()

const GUIColor & getGUIEffectColorMul ( )
inline
Returns
effect color mul

Definition at line 177 of file GUIRenderer.h.

◆ getGUIEffectOffsetX()

float getGUIEffectOffsetX ( )
inline
Returns
GUI effect offset X

Definition at line 207 of file GUIRenderer.h.

◆ getGUIEffectOffsetY()

float getGUIEffectOffsetY ( )
inline
Returns
GUI effect offset Y

Definition at line 220 of file GUIRenderer.h.

◆ getRenderAreaBottom()

float getRenderAreaBottom ( )
inline
Returns
render area bottom

Definition at line 302 of file GUIRenderer.h.

◆ getRenderAreaLeft()

float getRenderAreaLeft ( )
inline
Returns
render area left

Definition at line 233 of file GUIRenderer.h.

◆ getRenderAreaRight()

float getRenderAreaRight ( )
inline
Returns
render area right

Definition at line 279 of file GUIRenderer.h.

◆ getRenderAreaTop()

float getRenderAreaTop ( )
inline
Returns
render area top

Definition at line 256 of file GUIRenderer.h.

◆ getRenderOffsetX()

float getRenderOffsetX ( )
inline
Returns
render offset x

Definition at line 325 of file GUIRenderer.h.

◆ getRenderOffsetY()

float getRenderOffsetY ( )
inline
Returns
render offset y

Definition at line 340 of file GUIRenderer.h.

◆ getScreenNode()

GUIScreenNode * getScreenNode ( )
inline
Returns
GUI screen node

Definition at line 135 of file GUIRenderer.h.

◆ initialize()

void initialize ( )

Init.

Definition at line 67 of file GUIRenderer.cpp.

◆ initRendering()

void initRendering ( )

Init rendering.

Definition at line 107 of file GUIRenderer.cpp.

◆ initScreen()

void initScreen ( GUIScreenNode screenNode)

Init screen.

Parameters
screenNodescreen node

Definition at line 123 of file GUIRenderer.cpp.

◆ isQuadVisible()

bool isQuadVisible ( float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3,
float  x4,
float  y4 
)
inline
Returns
if quad is visible

Definition at line 391 of file GUIRenderer.h.

◆ popEffects()

void popEffects ( )
inline

Pop effects.

Definition at line 371 of file GUIRenderer.h.

◆ pushEffects()

void pushEffects ( const vector< GUIEffect * > &  effects)
inline

Push effects @oaran effects effects.

Definition at line 356 of file GUIRenderer.h.

◆ render()

void render ( )

Render.

Definition at line 283 of file GUIRenderer.cpp.

◆ setEffectColorAdd()

void setEffectColorAdd ( const GUIColor color)
inline

Set effect color add.

Parameters
colorcolor

Definition at line 170 of file GUIRenderer.h.

◆ setEffectColorMul()

void setEffectColorMul ( const GUIColor color)
inline

Set effect color mul.

Parameters
colorcolor

Definition at line 162 of file GUIRenderer.h.

◆ setFontColor()

void setFontColor ( const GUIColor color)
inline

Set effect color mul.

Parameters
colorcolor

Definition at line 154 of file GUIRenderer.h.

◆ setGradient()

void setGradient ( int  count,
array< GUIColor, 10 > &  colors,
array< float, 10 > &  colorStarts,
float  rotationAngle 
)

Set gradient properties.

Deprecated:
use rather custom UI shader and parameters
Parameters
countcolor count
colorscolors
colorStartscolor starts
rotationAnglerotationAngle

Definition at line 275 of file GUIRenderer.cpp.

◆ setGUI()

void setGUI ( GUI gui)
inline

Set GUI.

Parameters
guigui

Definition at line 101 of file GUIRenderer.h.

◆ setGUIEffectColorAdd()

void setGUIEffectColorAdd ( const GUIColor color)
inline

Set GUI effect color add.

Parameters
colorcolor

Definition at line 200 of file GUIRenderer.h.

◆ setGUIEffectColorMul()

void setGUIEffectColorMul ( const GUIColor color)
inline

Set GUI effect color mul.

Parameters
colorcolor

Definition at line 185 of file GUIRenderer.h.

◆ setGUIEffectOffsetX()

void setGUIEffectOffsetX ( float  guiEffectOffsetX)

Set GUI effect offset X.

Parameters
guiEffectOffsetXgui effect offset X

Definition at line 139 of file GUIRenderer.cpp.

◆ setGUIEffectOffsetY()

void setGUIEffectOffsetY ( float  guiEffectOffsetY)

Set GUI effect offset Y.

Parameters
guiEffectOffsetYGUI effect offset Y

Definition at line 145 of file GUIRenderer.cpp.

◆ setMaskMaxValue()

void setMaskMaxValue ( float  maskMaxValue)

Set mask max value.

Parameters
maskMaxValuemask maximum value

Definition at line 271 of file GUIRenderer.cpp.

◆ setRenderAreaBottom()

void setRenderAreaBottom ( float  renderAreaBottom)
inline

Set up render area bottom.

Parameters
renderAreaBottomrender area bottom

Definition at line 310 of file GUIRenderer.h.

◆ setRenderAreaLeft()

void setRenderAreaLeft ( float  renderAreaLeft)
inline

Set up render area left.

Parameters
renderAreaLeftrender area left

Definition at line 241 of file GUIRenderer.h.

◆ setRenderAreaRight()

void setRenderAreaRight ( float  renderAreaRight)
inline

Set up render area right.

Parameters
renderAreaRightrender area right

Definition at line 287 of file GUIRenderer.h.

◆ setRenderAreaTop()

void setRenderAreaTop ( float  renderAreaTop)
inline

Set up render area top.

Parameters
renderAreaToprender area top

Definition at line 264 of file GUIRenderer.h.

◆ setRenderOffsetX()

void setRenderOffsetX ( float  renderOffsetX)
inline

Set render offset x.

Parameters
renderOffsetXrender offset x

Definition at line 333 of file GUIRenderer.h.

◆ setRenderOffsetY()

void setRenderOffsetY ( float  renderOffsetY)
inline

Set render offset y.

Parameters
renderOffsetYrender offset y

Definition at line 348 of file GUIRenderer.h.

◆ setSubRenderAreaBottom()

void setSubRenderAreaBottom ( float  renderAreaBottom)
inline

Set sub render area bottom.

Parameters
renderAreaBottomrender area bottom

Definition at line 318 of file GUIRenderer.h.

◆ setSubRenderAreaLeft()

void setSubRenderAreaLeft ( float  renderAreaLeft)
inline

Set sub render area left.

Parameters
renderAreaLeftrender area left

Definition at line 249 of file GUIRenderer.h.

◆ setSubRenderAreaRight()

void setSubRenderAreaRight ( float  renderAreaRight)
inline

Set sub render area right.

Parameters
renderAreaRightrender area right

Definition at line 295 of file GUIRenderer.h.

◆ setSubRenderAreaTop()

void setSubRenderAreaTop ( float  renderAreaTop)
inline

Set sub render area top.

Parameters
renderAreaToprender area top

Definition at line 272 of file GUIRenderer.h.

◆ setTexureMatrix()

void setTexureMatrix ( const Matrix2D3x3 textureMatrix)

Set texture matrix.

Parameters
textureMatrixtexture matrix

Definition at line 255 of file GUIRenderer.cpp.

◆ unsetGradient()

void unsetGradient ( )

Disable gradient.

Deprecated:
use rather custom UI shader and parameters

Definition at line 279 of file GUIRenderer.cpp.

Member Data Documentation

◆ effectColorAdd

array<float, 4> effectColorAdd
private

Definition at line 79 of file GUIRenderer.h.

◆ effectColorAddFinal

array<float, 4> effectColorAddFinal
private

Definition at line 81 of file GUIRenderer.h.

◆ effectColorMul

array<float, 4> effectColorMul
private

Definition at line 78 of file GUIRenderer.h.

◆ effectColorMulFinal

array<float, 4> effectColorMulFinal
private

Definition at line 80 of file GUIRenderer.h.

◆ fbColors

FloatBuffer fbColors
private

Definition at line 65 of file GUIRenderer.h.

◆ fbColorsByteBuffer

ByteBuffer* fbColorsByteBuffer { nullptr }
private

Definition at line 64 of file GUIRenderer.h.

◆ fbTextureCoordinates

FloatBuffer fbTextureCoordinates
private

Definition at line 67 of file GUIRenderer.h.

◆ fbTextureCoordinatesByteBuffer

ByteBuffer* fbTextureCoordinatesByteBuffer
private

Definition at line 66 of file GUIRenderer.h.

◆ fbVertices

FloatBuffer fbVertices
private

Definition at line 63 of file GUIRenderer.h.

◆ fbVerticesByteBuffer

ByteBuffer* fbVerticesByteBuffer { nullptr }
private

Definition at line 62 of file GUIRenderer.h.

◆ fontColor

array<float, 4> fontColor
private

Definition at line 77 of file GUIRenderer.h.

◆ gui

GUI* gui { nullptr }
private

Definition at line 57 of file GUIRenderer.h.

◆ guiEffectColorAdd

GUIColor guiEffectColorAdd
private

Definition at line 76 of file GUIRenderer.h.

◆ guiEffectColorMul

GUIColor guiEffectColorMul
private

Definition at line 75 of file GUIRenderer.h.

◆ guiEffectOffsetX

float guiEffectOffsetX
private

Definition at line 82 of file GUIRenderer.h.

◆ guiEffectOffsetY

float guiEffectOffsetY
private

Definition at line 83 of file GUIRenderer.h.

◆ QUAD_COUNT

constexpr int QUAD_COUNT { 1024 }
staticconstexprprivate

Definition at line 48 of file GUIRenderer.h.

◆ quadCount

int quadCount { 0 }
private

Definition at line 60 of file GUIRenderer.h.

◆ renderAreaBottom

float renderAreaBottom
private

Definition at line 71 of file GUIRenderer.h.

◆ renderAreaLeft

float renderAreaLeft
private

Definition at line 68 of file GUIRenderer.h.

◆ renderAreaRight

float renderAreaRight
private

Definition at line 70 of file GUIRenderer.h.

◆ renderAreaTop

float renderAreaTop
private

Definition at line 69 of file GUIRenderer.h.

◆ renderer

Renderer* renderer { nullptr }
private

Definition at line 58 of file GUIRenderer.h.

◆ renderOffsetX

float renderOffsetX
private

Definition at line 72 of file GUIRenderer.h.

◆ renderOffsetY

float renderOffsetY
private

Definition at line 73 of file GUIRenderer.h.

◆ sbIndicesByteBuffer

ByteBuffer* sbIndicesByteBuffer { nullptr }
private

Definition at line 61 of file GUIRenderer.h.

◆ SCREEN_BOTTOM

constexpr float SCREEN_BOTTOM { -1.0f }
staticconstexpr

Definition at line 45 of file GUIRenderer.h.

◆ SCREEN_LEFT

constexpr float SCREEN_LEFT { -1.0f }
staticconstexpr

Definition at line 42 of file GUIRenderer.h.

◆ SCREEN_RIGHT

constexpr float SCREEN_RIGHT { 1.0f }
staticconstexpr

Definition at line 44 of file GUIRenderer.h.

◆ SCREEN_TOP

constexpr float SCREEN_TOP { 1.0f }
staticconstexpr

Definition at line 43 of file GUIRenderer.h.

◆ screenNode

GUIScreenNode* screenNode { nullptr }
private

Definition at line 74 of file GUIRenderer.h.

◆ stackedEffects

vector<GUIEffectStackEntity> stackedEffects
private

Definition at line 84 of file GUIRenderer.h.

◆ vboIds

vector<int32_t>* vboIds { nullptr }
private

Definition at line 59 of file GUIRenderer.h.


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