xoreos
0.0.5
|
#include <guiquad.h>
Public Member Functions | |
GUIQuad (const Common::UString &texture, float x1, float y1, float x2, float y2, float tX1=0.0f, float tY1=0.0f, float tX2=1.0f, float tY2=1.0f) | |
GUIQuad (Graphics::GUIElement::GUIElementType type, const Common::UString &texture, float x1, float y1, float x2, float y2, float tX1=0.0f, float tY1=0.0f, float tX2=1.0f, float tY2=1.0f) | |
GUIQuad (TextureHandle texture, float x1, float y1, float x2, float y2, float tX1=0.0f, float tY1=0.0f, float tX2=1.0f, float tY2=1.0f) | |
~GUIQuad () | |
void | getPosition (float &x, float &y, float &z) const |
Get the current position of the quad. More... | |
void | setPosition (float x, float y, float z=-FLT_MAX) |
Set the current position of the quad. More... | |
void | setRotation (float angle) |
Set the current rotation of the quad in degrees. More... | |
void | getColor (float &r, float &g, float &b, float &a) const |
Get the current color of the quad. More... | |
void | setColor (float r, float g, float b, float a) |
Set the current color of the quad. More... | |
void | setTexture (const Common::UString &texture) |
Set the current texture of the quad. More... | |
void | setTexture (TextureHandle texture) |
Set the current texture of the quad. More... | |
void | setScissor (int x, int y, int width, int height) |
Set the scissor test parameters. More... | |
float | getWidth () const |
Return the quad's width. More... | |
float | getHeight () const |
Return the quad's height. More... | |
void | setWidth (float w) |
Set the quad's width. More... | |
void | setHeight (float h) |
Set the quad's height. More... | |
void | setXOR (bool enabled) |
Enable/Disable XOR mode. More... | |
void | setScissor (bool enabled) |
Enable/Disable Scissor Test. More... | |
bool | isIn (float x, float y) const |
Is the point within the quad? More... | |
void | calculateDistance () |
Calculate the object's distance. More... | |
void | render (RenderPass pass) |
Render the object. More... | |
Public Member Functions inherited from Graphics::GUIElement | |
GUIElement (GUIElementType type) | |
~GUIElement () | |
Public Member Functions inherited from Graphics::Renderable | |
Renderable (RenderableType type) | |
~Renderable () | |
bool | operator< (const Queueable &q) const |
virtual void | advanceTime (float dt) |
Advance time (used by renderables with animations). More... | |
virtual void | renderImmediate (const glm::mat4 &parentTransform) |
For shader based systems, don't sort anything, render this right_now. More... | |
virtual void | queueRender (const glm::mat4 &parentTransform) |
Queue the object for later rendering. More... | |
double | getDistance () const |
Get the distance of the object from the viewer. More... | |
uint32 | getID () const |
Get the object's unique ID. More... | |
bool | isClickable () const |
Is the object clickable? More... | |
void | setClickable (bool clickable) |
Set the object's clickable state. More... | |
const Common::UString & | getTag () const |
Get the object's tag. More... | |
void | setTag (const Common::UString &tag) |
Set the object's tag. More... | |
bool | isVisible () const |
Is the object visible? More... | |
virtual void | show () |
Show the object. More... | |
virtual void | hide () |
Hide the object. More... | |
virtual bool | isIn (float x, float y, float z) const |
Is that point within the object? More... | |
virtual bool | isIn (float x1, float y1, float z1, float x2, float y2, float z2) const |
Does the line from x1.y1.z1 to x2.y2.z2 intersect with the object? More... | |
Public Member Functions inherited from Graphics::Queueable | |
Queueable () | |
virtual | ~Queueable () |
Private Attributes | |
TextureHandle | _texture |
float | _r |
float | _g |
float | _b |
float | _a |
float | _angle |
float | _x1 |
float | _y1 |
float | _x2 |
float | _y2 |
float | _tX1 |
float | _tY1 |
float | _tX2 |
float | _tY2 |
int | _scissorX |
int | _scissorY |
int | _scissorWidth |
int | _scissorHeight |
bool | _xor |
bool | _scissor |
bool | _additiveBlending |
Additional Inherited Members | |
Public Types inherited from Graphics::GUIElement | |
enum | GUIElementType { kGUIElementFront = kRenderableTypeGUIFront, kGUIElementBack = kRenderableTypeGUIBack, kGUIElementConsole = kRenderableTypeConsole } |
Protected Member Functions inherited from Graphics::Renderable | |
void | resort () |
void | lockFrame () |
void | unlockFrame () |
void | lockFrameIfVisible () |
void | unlockFrameIfVisible () |
Protected Member Functions inherited from Graphics::Queueable | |
bool | isInQueue (QueueType queue) const |
void | addToQueue (QueueType queue) |
void | removeFromQueue (QueueType queue) |
void | lockQueue (QueueType queue) |
void | unlockQueue (QueueType queue) |
void | sortQueue (QueueType queue) |
Protected Attributes inherited from Graphics::Renderable | |
QueueType | _queueExists |
QueueType | _queueVisible |
uint32 | _id |
bool | _clickable |
Common::UString | _tag |
double | _distance |
The distance of the object from the viewer. More... | |
Graphics::Aurora::GUIQuad::GUIQuad | ( | const Common::UString & | texture, |
float | x1, | ||
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | tX1 = 0.0f , |
||
float | tY1 = 0.0f , |
||
float | tX2 = 1.0f , |
||
float | tY2 = 1.0f |
||
) |
Definition at line 37 of file guiquad.cpp.
References _a, _additiveBlending, _b, Graphics::Renderable::_distance, _g, _r, _texture, Graphics::TXI::Features::blending, Graphics::Aurora::TextureHandle::clear(), Graphics::Aurora::TextureHandle::empty(), Common::UString::empty(), FLT_MAX, Graphics::TXI::getFeatures(), Graphics::Aurora::TextureHandle::getTexture(), Graphics::Aurora::Texture::getTXI(), Graphics::TXI::kBlendingAdditive, and TextureMan.
Graphics::Aurora::GUIQuad::GUIQuad | ( | Graphics::GUIElement::GUIElementType | type, |
const Common::UString & | texture, | ||
float | x1, | ||
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | tX1 = 0.0f , |
||
float | tY1 = 0.0f , |
||
float | tX2 = 1.0f , |
||
float | tY2 = 1.0f |
||
) |
Definition at line 65 of file guiquad.cpp.
References _a, _additiveBlending, _b, Graphics::Renderable::_distance, _g, _r, _texture, Graphics::TXI::Features::blending, Graphics::Aurora::TextureHandle::clear(), Graphics::Aurora::TextureHandle::empty(), Common::UString::empty(), FLT_MAX, Graphics::TXI::getFeatures(), Graphics::Aurora::TextureHandle::getTexture(), Graphics::Aurora::Texture::getTXI(), Graphics::TXI::kBlendingAdditive, and TextureMan.
Graphics::Aurora::GUIQuad::GUIQuad | ( | TextureHandle | texture, |
float | x1, | ||
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | tX1 = 0.0f , |
||
float | tY1 = 0.0f , |
||
float | tX2 = 1.0f , |
||
float | tY2 = 1.0f |
||
) |
Definition at line 93 of file guiquad.cpp.
References Graphics::Renderable::_distance, and FLT_MAX.
Graphics::Aurora::GUIQuad::~GUIQuad | ( | ) |
Definition at line 106 of file guiquad.cpp.
References Graphics::Renderable::hide().
|
virtual |
Calculate the object's distance.
Implements Graphics::Renderable.
Definition at line 237 of file guiquad.cpp.
void Graphics::Aurora::GUIQuad::getColor | ( | float & | r, |
float & | g, | ||
float & | b, | ||
float & | a | ||
) | const |
Get the current color of the quad.
Definition at line 135 of file guiquad.cpp.
References _a, _b, _g, and _r.
Referenced by Graphics::Aurora::HighlightableGUIQuad::render().
float Graphics::Aurora::GUIQuad::getHeight | ( | ) | const |
Return the quad's height.
Definition at line 192 of file guiquad.cpp.
References _y1, _y2, and ABS().
void Graphics::Aurora::GUIQuad::getPosition | ( | float & | x, |
float & | y, | ||
float & | z | ||
) | const |
Get the current position of the quad.
Definition at line 110 of file guiquad.cpp.
References Graphics::Renderable::_distance, _x1, _x2, _y1, _y2, and MIN().
float Graphics::Aurora::GUIQuad::getWidth | ( | ) | const |
Return the quad's width.
Definition at line 188 of file guiquad.cpp.
References _x1, _x2, and ABS().
|
virtual |
Is the point within the quad?
Reimplemented from Graphics::Renderable.
Definition at line 228 of file guiquad.cpp.
|
virtual |
Render the object.
Implements Graphics::Renderable.
Reimplemented in Graphics::Aurora::HighlightableGUIQuad.
Definition at line 240 of file guiquad.cpp.
References _a, _additiveBlending, _angle, _b, _g, _r, _scissor, _scissorHeight, _scissorWidth, _scissorX, _scissorY, _texture, _tX1, _tX2, _tY1, _tY2, _x1, _x2, _xor, _y1, _y2, Graphics::Aurora::TextureHandle::empty(), Graphics::Aurora::TextureHandle::getTexture(), Graphics::Aurora::Texture::hasAlpha(), Graphics::kRenderPassOpaque, Graphics::kRenderPassTransparent, pass, and TextureMan.
Referenced by Graphics::Aurora::HighlightableGUIQuad::render().
void Graphics::Aurora::GUIQuad::setColor | ( | float | r, |
float | g, | ||
float | b, | ||
float | a | ||
) |
Set the current color of the quad.
Definition at line 143 of file guiquad.cpp.
References _a, _b, _g, _r, Graphics::Renderable::lockFrameIfVisible(), and Graphics::Renderable::unlockFrameIfVisible().
Referenced by Graphics::Aurora::HighlightableGUIQuad::render().
void Graphics::Aurora::GUIQuad::setHeight | ( | float | h | ) |
Set the quad's height.
Definition at line 204 of file guiquad.cpp.
References _y1, _y2, Graphics::Renderable::lockFrameIfVisible(), and Graphics::Renderable::unlockFrameIfVisible().
void Graphics::Aurora::GUIQuad::setPosition | ( | float | x, |
float | y, | ||
float | z = -FLT_MAX |
||
) |
Set the current position of the quad.
Definition at line 116 of file guiquad.cpp.
References Graphics::Renderable::_distance, _x1, _x2, _y1, _y2, Graphics::Renderable::lockFrameIfVisible(), Graphics::Renderable::resort(), and Graphics::Renderable::unlockFrameIfVisible().
Referenced by Engines::Sonic::Game::showChapter1(), Engines::Sonic::Game::showLicenseSplash(), Engines::Sonic::Game::showMainMenu(), and Engines::Sonic::Game::showTitle().
void Graphics::Aurora::GUIQuad::setRotation | ( | float | angle | ) |
Set the current rotation of the quad in degrees.
Definition at line 131 of file guiquad.cpp.
References _angle.
void Graphics::Aurora::GUIQuad::setScissor | ( | int | x, |
int | y, | ||
int | width, | ||
int | height | ||
) |
Set the scissor test parameters.
Definition at line 181 of file guiquad.cpp.
References _scissorHeight, _scissorWidth, _scissorX, and _scissorY.
void Graphics::Aurora::GUIQuad::setScissor | ( | bool | enabled | ) |
Enable/Disable Scissor Test.
Definition at line 220 of file guiquad.cpp.
References _scissor, Graphics::Renderable::lockFrameIfVisible(), and Graphics::Renderable::unlockFrameIfVisible().
void Graphics::Aurora::GUIQuad::setTexture | ( | const Common::UString & | texture | ) |
Set the current texture of the quad.
Definition at line 154 of file guiquad.cpp.
References _a, _b, _g, _r, _texture, Graphics::Aurora::TextureHandle::clear(), Common::UString::empty(), Graphics::Renderable::lockFrameIfVisible(), TextureMan, and Graphics::Renderable::unlockFrameIfVisible().
void Graphics::Aurora::GUIQuad::setTexture | ( | TextureHandle | texture | ) |
Set the current texture of the quad.
Definition at line 173 of file guiquad.cpp.
References _texture, Graphics::Renderable::lockFrameIfVisible(), and Graphics::Renderable::unlockFrameIfVisible().
void Graphics::Aurora::GUIQuad::setWidth | ( | float | w | ) |
Set the quad's width.
Definition at line 196 of file guiquad.cpp.
References _x1, _x2, Graphics::Renderable::lockFrameIfVisible(), and Graphics::Renderable::unlockFrameIfVisible().
void Graphics::Aurora::GUIQuad::setXOR | ( | bool | enabled | ) |
Enable/Disable XOR mode.
Definition at line 212 of file guiquad.cpp.
References _xor, Graphics::Renderable::lockFrameIfVisible(), and Graphics::Renderable::unlockFrameIfVisible().
|
private |
Definition at line 98 of file guiquad.h.
Referenced by getColor(), GUIQuad(), render(), setColor(), and setTexture().
|
private |
|
private |
Definition at line 100 of file guiquad.h.
Referenced by render(), and setRotation().
|
private |
Definition at line 97 of file guiquad.h.
Referenced by getColor(), GUIQuad(), render(), setColor(), and setTexture().
|
private |
Definition at line 96 of file guiquad.h.
Referenced by getColor(), GUIQuad(), render(), setColor(), and setTexture().
|
private |
Definition at line 95 of file guiquad.h.
Referenced by getColor(), GUIQuad(), render(), setColor(), and setTexture().
|
private |
Definition at line 118 of file guiquad.h.
Referenced by render(), and setScissor().
|
private |
Definition at line 115 of file guiquad.h.
Referenced by render(), and setScissor().
|
private |
Definition at line 114 of file guiquad.h.
Referenced by render(), and setScissor().
|
private |
Definition at line 112 of file guiquad.h.
Referenced by render(), and setScissor().
|
private |
Definition at line 113 of file guiquad.h.
Referenced by render(), and setScissor().
|
private |
Definition at line 93 of file guiquad.h.
Referenced by GUIQuad(), render(), and setTexture().
|
private |
|
private |
|
private |
|
private |
|
private |
Definition at line 102 of file guiquad.h.
Referenced by getPosition(), getWidth(), isIn(), render(), setPosition(), and setWidth().
|
private |
Definition at line 104 of file guiquad.h.
Referenced by getPosition(), getWidth(), isIn(), render(), setPosition(), and setWidth().
|
private |
|
private |
Definition at line 103 of file guiquad.h.
Referenced by getHeight(), getPosition(), isIn(), render(), setHeight(), and setPosition().
|
private |
Definition at line 105 of file guiquad.h.
Referenced by getHeight(), getPosition(), isIn(), render(), setHeight(), and setPosition().