Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Mezzanine::Graphics::Viewport Class Reference

This class is for creating and managing viewports within a game window. More...

#include <viewport.h>

+ Collaboration diagram for Mezzanine::Graphics::Viewport:

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...
 
CameraProxyGetCamera () 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...
 
GameWindowGetParentWindow () 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...
 
GameWindowParent
 A pointer to the window that created this viewport. More...
 
CameraProxyViewportCam
 A pointer to the camera being used to render this viewport, or NULL if one isn't set. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

Mezzanine::Graphics::Viewport::Viewport ( CameraProxy ViewportCamera,
const Integer ZOrder,
GameWindow ParentWindow 
)

Class constructor.

Parameters
ViewportCameraThe CameraProxy that is to be attached to this veiwport.
ZOrderThe render order of this viewport relative to other viewports in the game window.
ParentWindowThe 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.

Parameters
XMLNodeThe node of the xml document to construct from.
ParentWindowThe game window this viewport belongs to.

Definition at line 64 of file viewport.cpp.

Member Function Documentation

Ogre::Viewport * Mezzanine::Graphics::Viewport::_GetOgreViewport ( ) const

Gets the internal Ogre Viewport.

Returns
Returns a pointer to the Ogre Viewport this class is based on.

Definition at line 230 of file viewport.cpp.

Whole Mezzanine::Graphics::Viewport::GetActualHeight ( ) const

Gets the height of the viewport in pixels.

Returns
Returns a whole representing the height of this veiwport 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.

Returns
Returns a whole representing the left position of this veiwport 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.

Returns
Returns a Vector2 containing the pixel position of this viewport within the GameWindow.

Definition at line 135 of file viewport.cpp.

Vector2 Mezzanine::Graphics::Viewport::GetActualSize ( ) const

Gets the size of this viewport in pixels.

Returns
Returns a Vector2 containing the pixel size of this viewport.

Definition at line 138 of file viewport.cpp.

Whole Mezzanine::Graphics::Viewport::GetActualTop ( ) const

Gets the top position of the viewport in pixels.

Returns
Returns a whole representing the top position of this veiwport in pixels.

Definition at line 144 of file viewport.cpp.

Whole Mezzanine::Graphics::Viewport::GetActualWidth ( ) const

Gets the width of the viewport in pixels.

Returns
Returns a whole representing the width of this veiwport in pixels.

Definition at line 147 of file viewport.cpp.

CameraProxy * Mezzanine::Graphics::Viewport::GetCamera ( ) const

Gets the CameraProxy associated with this viewport.

Returns
Returns a pointer to the CameraProxy using this viewport.

Definition at line 87 of file viewport.cpp.

Real Mezzanine::Graphics::Viewport::GetHeight ( ) const

Gets the relative height of the viewport.

Returns
Returns a real representing the relative height of this veiwport.

Definition at line 132 of file viewport.cpp.

Real Mezzanine::Graphics::Viewport::GetLeft ( ) const

Gets the relative left position of the viewport.

Returns
Returns a real representing the relative left position of this veiwport.

Definition at line 123 of file viewport.cpp.

Mezzanine::OrientationMode Mezzanine::Graphics::Viewport::GetOrientationMode ( ) const

Gets the current Orientation of the viewport.

Returns
Returns an enum representing 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.

Returns
Returns a pointer to the game window that created this viewport.

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.

Returns
Returns a Vector2 containing the relative position of this viewport within the GameWindow.

Definition at line 117 of file viewport.cpp.

String Mezzanine::Graphics::Viewport::GetSerializableName ( )
static

Get the name of the the XML tag the Renderable class will leave behind as its instances are serialized.

Returns
A string containing the name of this class.

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.

Returns
Returns a Vector2 containing the relative size of this viewport.

Definition at line 120 of file viewport.cpp.

Real Mezzanine::Graphics::Viewport::GetTop ( ) const

Gets the relative top position of the viewport.

Returns
Returns a real representing the relative top position of this veiwport.

Definition at line 126 of file viewport.cpp.

Real Mezzanine::Graphics::Viewport::GetWidth ( ) const

Gets the relative width of the viewport.

Returns
Returns a real representing the relative width of this veiwport.

Definition at line 129 of file viewport.cpp.

Integer Mezzanine::Graphics::Viewport::GetZOrder ( ) const

Gets the Zorder assigned to this viewport.

Returns
Returns an integer that represents this viewports rendering order in it's parent GameWindow.

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.

Parameters
SelfRootAn 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.

Parameters
ParentNodeThe point in the XML hierarchy that all this Viewport should be appended to.

Definition at line 156 of file viewport.cpp.

void Mezzanine::Graphics::Viewport::SetCamera ( CameraProxy ViewportCamera)

Sets which CameraProxy is bound to this viewport.

Parameters
ViewportCameraPointer 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.

Parameters
PositionVector2 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.
SizeVector2 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.

Parameters
LeftA relative value(range: 0-1) representing the leftmost position of the viewport.
TopA relative value(range: 0-1) representing the topmost position of the viewport.
WidthA relative value(range: 0-1) representing the width of the viewport.
HeightA relative value(range: 0-1) representing the height of the viewport.

Definition at line 114 of file viewport.cpp.

Member Data Documentation

Ogre::Viewport* Mezzanine::Graphics::Viewport::OgreViewport
protected

A pointer to the internal viewport providing this classes functionality.

Definition at line 70 of file viewport.h.

GameWindow* Mezzanine::Graphics::Viewport::Parent
protected

A pointer to the window that created this viewport.

Definition at line 73 of file viewport.h.

CameraProxy* Mezzanine::Graphics::Viewport::ViewportCam
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.


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