MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 ()
 Class destructor.
 
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...
 
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...
 
Real GetHeight () const
 Gets the relative height of the viewport. More...
 
Real GetLeft () const
 Gets the relative left position of the viewport. More...
 
Ogre::Viewport * GetOgreViewport () const
 Gets the internal Ogre 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...
 
Real GetTop () const
 Gets the relative top position of the viewport. More...
 
CameraProxyGetViewportCamera () const
 Gets the CameraProxy associated with this 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 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...
 

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 54 of file viewport.cpp.

Member Function Documentation

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 133 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 124 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 127 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 130 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 121 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 112 of file viewport.cpp.

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 139 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 94 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 85 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 115 of file viewport.cpp.

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

Gets the CameraProxy associated with this viewport.

Returns
Returns a pointer to the CameraProxy using this viewport.

Definition at line 82 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 118 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 91 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 70 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 106 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 109 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: