This class is for creating and managing viewports within a game window. More...
#include <viewport.h>
Public Member Functions | |
Viewport (CameraProxy *ViewportCamera, const Integer &ZOrder, GameWindow *ParentWindow) | |
Class constructor. More... | |
Viewport (const XML::Node &XMLNode, GameWindow *ParentWindow) | |
XML constructor. More... | |
~Viewport () | |
Class destructor. | |
Ogre::Viewport * | _GetOgreViewport () const |
Gets the internal Ogre Viewport. More... | |
Whole | GetActualHeight () const |
Gets the height of the viewport in pixels. More... | |
Whole | GetActualLeft () const |
Gets the left position of the viewport in pixels. More... | |
Vector2 | GetActualPosition () const |
Gets the position of this viewport in it's parent GameWindow in pixels. More... | |
Vector2 | GetActualSize () const |
Gets the size of this viewport in pixels. More... | |
Whole | GetActualTop () const |
Gets the top position of the viewport in pixels. More... | |
Whole | GetActualWidth () const |
Gets the width of the viewport in pixels. More... | |
CameraProxy * | GetCamera () const |
Gets the CameraProxy associated with this viewport. More... | |
Real | GetHeight () const |
Gets the relative height of the viewport. More... | |
Real | GetLeft () const |
Gets the relative left position of the viewport. More... | |
Mezzanine::OrientationMode | GetOrientationMode () const |
Gets the current Orientation of the viewport. More... | |
GameWindow * | GetParentWindow () const |
Gets the game window this viewport belongs to. More... | |
Vector2 | GetPosition () const |
Gets the position of this viewport in it's parent GameWindow in relative units. More... | |
Vector2 | GetSize () const |
Gets the size of this viewport relative to it's parent GameWindow. More... | |
Real | GetTop () const |
Gets the relative top position of the viewport. More... | |
Real | GetWidth () const |
Gets the relative width of the viewport. More... | |
Integer | GetZOrder () const |
Gets the Zorder assigned to this viewport. More... | |
void | ProtoDeSerialize (const XML::Node &SelfRoot) |
Take the data stored in an XML Node and overwrite this object with it. More... | |
void | ProtoSerialize (XML::Node &ParentNode) const |
Convert this class to an XML::Node ready for serialization. More... | |
void | SetCamera (CameraProxy *ViewportCamera) |
Sets which CameraProxy is bound to this viewport. More... | |
void | SetDimensions (const Vector2 &Position, const Vector2 &Size) |
Sets the position and size of this viewport within the game window. More... | |
void | SetDimensions (const Real &Left, const Real &Top, const Real &Width, const Real &Height) |
Sets the position and size of this viewport within the game window. More... | |
Static Public Member Functions | |
static String | GetSerializableName () |
Get the name of the the XML tag the Renderable class will leave behind as its instances are serialized. More... | |
Protected Attributes | |
Ogre::Viewport * | OgreViewport |
A pointer to the internal viewport providing this classes functionality. More... | |
GameWindow * | Parent |
A pointer to the window that created this viewport. More... | |
CameraProxy * | ViewportCam |
A pointer to the camera being used to render this viewport, or NULL if one isn't set. More... | |
This class is for creating and managing viewports within a game window.
A game window can contain several veiwports, and veiwports can overlap. This is useful for editors mostly, but can be of use in games as well. Be careful about positioning Veiwports in a game window.
Definition at line 65 of file viewport.h.
Mezzanine::Graphics::Viewport::Viewport | ( | CameraProxy * | ViewportCamera, |
const Integer & | ZOrder, | ||
GameWindow * | ParentWindow | ||
) |
Class constructor.
ViewportCamera | The CameraProxy that is to be attached to this veiwport. |
ZOrder | The render order of this viewport relative to other viewports in the game window. |
ParentWindow | The game window this viewport belongs to. |
Definition at line 56 of file viewport.cpp.
Mezzanine::Graphics::Viewport::Viewport | ( | const XML::Node & | XMLNode, |
GameWindow * | ParentWindow | ||
) |
XML constructor.
XMLNode | The node of the xml document to construct from. |
ParentWindow | The game window this viewport belongs to. |
Definition at line 64 of file viewport.cpp.
Ogre::Viewport * Mezzanine::Graphics::Viewport::_GetOgreViewport | ( | ) | const |
Whole Mezzanine::Graphics::Viewport::GetActualHeight | ( | ) | const |
Gets the height of the viewport in pixels.
Definition at line 150 of file viewport.cpp.
Whole Mezzanine::Graphics::Viewport::GetActualLeft | ( | ) | const |
Gets the left position of the viewport in pixels.
Definition at line 141 of file viewport.cpp.
Vector2 Mezzanine::Graphics::Viewport::GetActualPosition | ( | ) | const |
Gets the position of this viewport in it's parent GameWindow in pixels.
Definition at line 135 of file viewport.cpp.
Vector2 Mezzanine::Graphics::Viewport::GetActualSize | ( | ) | const |
Gets the size of this viewport in pixels.
Definition at line 138 of file viewport.cpp.
Whole Mezzanine::Graphics::Viewport::GetActualTop | ( | ) | const |
Gets the top position of the viewport in pixels.
Definition at line 144 of file viewport.cpp.
Whole Mezzanine::Graphics::Viewport::GetActualWidth | ( | ) | const |
Gets the width of the viewport in pixels.
Definition at line 147 of file viewport.cpp.
CameraProxy * Mezzanine::Graphics::Viewport::GetCamera | ( | ) | const |
Gets the CameraProxy associated with this viewport.
Definition at line 87 of file viewport.cpp.
Real Mezzanine::Graphics::Viewport::GetHeight | ( | ) | const |
Gets the relative height of the viewport.
Definition at line 132 of file viewport.cpp.
Real Mezzanine::Graphics::Viewport::GetLeft | ( | ) | const |
Gets the relative left position of the viewport.
Definition at line 123 of file viewport.cpp.
Mezzanine::OrientationMode Mezzanine::Graphics::Viewport::GetOrientationMode | ( | ) | const |
Gets the current Orientation of the viewport.
Definition at line 99 of file viewport.cpp.
GameWindow * Mezzanine::Graphics::Viewport::GetParentWindow | ( | ) | const |
Gets the game window this viewport belongs to.
Definition at line 90 of file viewport.cpp.
Vector2 Mezzanine::Graphics::Viewport::GetPosition | ( | ) | const |
Gets the position of this viewport in it's parent GameWindow in relative units.
Definition at line 117 of file viewport.cpp.
|
static |
Get the name of the the XML tag the Renderable class will leave behind as its instances are serialized.
Definition at line 224 of file viewport.cpp.
Vector2 Mezzanine::Graphics::Viewport::GetSize | ( | ) | const |
Gets the size of this viewport relative to it's parent GameWindow.
Definition at line 120 of file viewport.cpp.
Real Mezzanine::Graphics::Viewport::GetTop | ( | ) | const |
Gets the relative top position of the viewport.
Definition at line 126 of file viewport.cpp.
Real Mezzanine::Graphics::Viewport::GetWidth | ( | ) | const |
Gets the relative width of the viewport.
Definition at line 129 of file viewport.cpp.
Integer Mezzanine::Graphics::Viewport::GetZOrder | ( | ) | const |
Gets the Zorder assigned to this viewport.
Definition at line 96 of file viewport.cpp.
void Mezzanine::Graphics::Viewport::ProtoDeSerialize | ( | const XML::Node & | SelfRoot | ) |
Take the data stored in an XML Node and overwrite this object with it.
SelfRoot | An XML::Node containing the data to populate this class with. |
Definition at line 176 of file viewport.cpp.
void Mezzanine::Graphics::Viewport::ProtoSerialize | ( | XML::Node & | ParentNode | ) | const |
Convert this class to an XML::Node ready for serialization.
Definition at line 156 of file viewport.cpp.
void Mezzanine::Graphics::Viewport::SetCamera | ( | CameraProxy * | ViewportCamera | ) |
Sets which CameraProxy is bound to this viewport.
ViewportCamera | Pointer to the CameraProxy to be bount to this viewport, or NULL to simply unbind a CameraProxy. |
Definition at line 75 of file viewport.cpp.
void Mezzanine::Graphics::Viewport::SetDimensions | ( | const Vector2 & | Position, |
const Vector2 & | Size | ||
) |
Sets the position and size of this viewport within the game window.
Position | Vector2 of relative values(range: 0-1) representing the top left corner of the viewport. Values are relative to the game window this viewport belongs to. |
Size | Vector2 of relative values(range: 0-1) representing the width and height of the viewport. Values are relative to the game window this viewport belongs to. |
Definition at line 111 of file viewport.cpp.
void Mezzanine::Graphics::Viewport::SetDimensions | ( | const Real & | Left, |
const Real & | Top, | ||
const Real & | Width, | ||
const Real & | Height | ||
) |
Sets the position and size of this viewport within the game window.
Left | A relative value(range: 0-1) representing the leftmost position of the viewport. |
Top | A relative value(range: 0-1) representing the topmost position of the viewport. |
Width | A relative value(range: 0-1) representing the width of the viewport. |
Height | A relative value(range: 0-1) representing the height of the viewport. |
Definition at line 114 of file viewport.cpp.
|
protected |
A pointer to the internal viewport providing this classes functionality.
Definition at line 70 of file viewport.h.
|
protected |
A pointer to the window that created this viewport.
Definition at line 73 of file viewport.h.
|
protected |
A pointer to the camera being used to render this viewport, or NULL if one isn't set.
Definition at line 76 of file viewport.h.