OGRE
13.6
Object-Oriented Graphics Rendering Engine
|
An abstraction of a viewport, i.e. More...
#include <OgreViewport.h>
Classes | |
class | Listener |
Listener interface so you can be notified of Viewport changes. More... | |
Public Member Functions | |
Viewport (Camera *camera, RenderTarget *target, float left, float top, float width, float height, int ZOrder) | |
The usual constructor. More... | |
virtual | ~Viewport () |
Default destructor. More... | |
void | _clearUpdatedFlag (void) |
unsigned int | _getNumRenderedBatches (void) const |
Gets the number of rendered batches in the last update. More... | |
unsigned int | _getNumRenderedFaces (void) const |
Gets the number of rendered faces in the last update. More... | |
bool | _isUpdated (void) const |
void | _updateDimensions (void) |
Notifies the viewport of a possible change in dimensions. More... | |
void | addListener (Listener *l) |
Add a listener to this viewport. More... | |
void | clear (uint32 buffers=FBT_COLOUR|FBT_DEPTH, const ColourValue &colour=ColourValue::Black, float depth=1.0f, uint16 stencil=0) |
Instructs the viewport to clear itself, without performing an update. More... | |
Rect | getActualDimensions () const |
Access to actual dimensions (based on target size). More... | |
void | getActualDimensions (int &left, int &top, int &width, int &height) const |
int | getActualHeight (void) const |
Gets one of the actual dimensions of the viewport, a value in pixels. More... | |
int | getActualLeft (void) const |
Gets one of the actual dimensions of the viewport, a value in pixels. More... | |
int | getActualTop (void) const |
Gets one of the actual dimensions of the viewport, a value in pixels. More... | |
int | getActualWidth (void) const |
Gets one of the actual dimensions of the viewport, a value in pixels. More... | |
const ColourValue & | getBackgroundColour (void) const |
Gets the background colour. More... | |
Camera * | getCamera (void) const |
Retrieves a pointer to the camera for this viewport. More... | |
unsigned int | getClearBuffers (void) const |
Gets which buffers are to be cleared each frame. More... | |
bool | getClearEveryFrame (void) const |
Determines if the viewport is cleared before every frame. More... | |
float | getDepthClear (void) const |
Gets the default depth buffer value to which the viewport is cleared. More... | |
ColourBufferType | getDrawBuffer () const |
Returns the current colour buffer type for this viewport. More... | |
float | getHeight (void) const |
Gets one of the relative dimensions of the viewport, a value between 0.0 and 1.0. More... | |
float | getLeft (void) const |
Gets one of the relative dimensions of the viewport, a value between 0.0 and 1.0. More... | |
const String & | getMaterialScheme (void) const |
Get the material scheme which the viewport should use. More... | |
OrientationMode | getOrientationMode () const |
Get the orientation mode of the viewport. More... | |
bool | getOverlaysEnabled (void) const |
Returns whether or not Overlay objects (created in the SceneManager) are displayed in this viewport. More... | |
bool | getShadowsEnabled (void) const |
Returns whether or not shadows (defined in the SceneManager) are displayed in this viewport. More... | |
bool | getSkiesEnabled (void) const |
Returns whether or not skies (created in the SceneManager) are displayed in this viewport. More... | |
RenderTarget * | getTarget (void) const |
Retrieves a pointer to the render target for this viewport. More... | |
float | getTop (void) const |
Gets one of the relative dimensions of the viewport, a value between 0.0 and 1.0. More... | |
uint | getVisibilityMask (void) const |
Gets a per-viewport visibility mask. More... | |
float | getWidth (void) const |
Gets one of the relative dimensions of the viewport, a value between 0.0 and 1.0. More... | |
int | getZOrder (void) const |
Gets the Z-Order of this viewport. More... | |
bool | isAutoUpdated () const |
Gets whether this viewport is automatically updated if Ogre's rendering loop or RenderTarget::update is being used. More... | |
void | pointOrientedToScreen (const Vector2 &v, int orientationMode, Vector2 &outv) |
Convert oriented input point coordinates to screen coordinates. More... | |
void | pointOrientedToScreen (Real orientedX, Real orientedY, int orientationMode, Real &screenX, Real &screenY) |
void | removeListener (Listener *l) |
Remove a listener to this viewport. More... | |
void | setAutoUpdated (bool autoupdate) |
Sets whether this viewport should be automatically updated if Ogre's rendering loop or RenderTarget::update is being used. More... | |
void | setBackgroundColour (const ColourValue &colour) |
Sets the initial background colour of the viewport (before rendering). More... | |
void | setCamera (Camera *cam) |
Sets the camera to use for rendering to this viewport. More... | |
void | setClearEveryFrame (bool clear, unsigned int buffers=FBT_COLOUR|FBT_DEPTH) |
Determines whether to clear the viewport before rendering. More... | |
void | setDepthClear (float depth) |
Sets the initial depth buffer value of the viewport (before rendering). More... | |
void | setDimensions (float left, float top, float width, float height) |
Sets the dimensions (after creation). More... | |
void | setDrawBuffer (ColourBufferType colourBuffer) |
Sets the draw buffer type for the next frame. More... | |
void | setMaterialScheme (const String &schemeName) |
Set the material scheme which the viewport should use. More... | |
void | setOrientationMode (OrientationMode orientationMode, bool setDefault=true) |
Set the orientation mode of the viewport. More... | |
void | setOverlaysEnabled (bool enabled) |
Tells this viewport whether it should display Overlay objects. More... | |
void | setShadowsEnabled (bool enabled) |
Tells this viewport whether it should display shadows. More... | |
void | setSkiesEnabled (bool enabled) |
Tells this viewport whether it should display skies. More... | |
void | setVisibilityMask (uint32 mask) |
Sets a per-viewport visibility mask. More... | |
void | update (void) |
Instructs the viewport to updates its contents. More... | |
Static Public Member Functions | |
static OrientationMode | getDefaultOrientationMode () |
Get the initial orientation mode of viewports. More... | |
static void | setDefaultOrientationMode (OrientationMode orientationMode) |
Set the initial orientation mode of viewports. More... | |
An abstraction of a viewport, i.e.
a rendering region on a render target.
Ogre::Viewport::Viewport | ( | Camera * | camera, |
RenderTarget * | target, | ||
float | left, | ||
float | top, | ||
float | width, | ||
float | height, | ||
int | ZOrder | ||
) |
The usual constructor.
camera | Pointer to a camera to be the source for the image. |
target | Pointer to the render target to be the destination for the rendering. |
left,top,width,height | Dimensions of the viewport, expressed as a value between 0 and 1. This allows the dimensions to apply irrespective of changes in the target's size: e.g. to fill the whole area, values of 0,0,1,1 are appropriate. |
ZOrder | Relative Z-order on the target. Lower = further to the front. |
|
virtual |
Default destructor.
void Ogre::Viewport::_updateDimensions | ( | void | ) |
Notifies the viewport of a possible change in dimensions.
void Ogre::Viewport::update | ( | void | ) |
Instructs the viewport to updates its contents.
void Ogre::Viewport::clear | ( | uint32 | buffers = FBT_COLOUR|FBT_DEPTH , |
const ColourValue & | colour = ColourValue::Black , |
||
float | depth = 1.0f , |
||
uint16 | stencil = 0 |
||
) |
Instructs the viewport to clear itself, without performing an update.
buffers | Bitmask identifying which buffer elements to clear |
colour | The colour value to clear to, if FBT_COLOUR is included |
depth | The depth value to clear to, if FBT_DEPTH is included |
stencil | The stencil value to clear to, if FBT_STENCIL is included |
|
inline |
Retrieves a pointer to the render target for this viewport.
|
inline |
Retrieves a pointer to the camera for this viewport.
void Ogre::Viewport::setCamera | ( | Camera * | cam | ) |
Sets the camera to use for rendering to this viewport.
|
inline |
Gets the Z-Order of this viewport.
|
inline |
Gets one of the relative dimensions of the viewport, a value between 0.0 and 1.0.
|
inline |
Gets one of the relative dimensions of the viewport, a value between 0.0 and 1.0.
|
inline |
Gets one of the relative dimensions of the viewport, a value between 0.0 and 1.0.
|
inline |
Gets one of the relative dimensions of the viewport, a value between 0.0 and 1.0.
|
inline |
Gets one of the actual dimensions of the viewport, a value in pixels.
|
inline |
Gets one of the actual dimensions of the viewport, a value in pixels.
|
inline |
Gets one of the actual dimensions of the viewport, a value in pixels.
|
inline |
Gets one of the actual dimensions of the viewport, a value in pixels.
void Ogre::Viewport::setDimensions | ( | float | left, |
float | top, | ||
float | width, | ||
float | height | ||
) |
Sets the dimensions (after creation).
left | Left point of viewport. |
top | Top point of the viewport. |
width | Width of the viewport. |
height | Height of the viewport. |
void Ogre::Viewport::setOrientationMode | ( | OrientationMode | orientationMode, |
bool | setDefault = true |
||
) |
Set the orientation mode of the viewport.
OrientationMode Ogre::Viewport::getOrientationMode | ( | ) | const |
Get the orientation mode of the viewport.
|
static |
Set the initial orientation mode of viewports.
|
static |
Get the initial orientation mode of viewports.
|
inline |
Sets the initial background colour of the viewport (before rendering).
|
inline |
Gets the background colour.
|
inline |
Sets the initial depth buffer value of the viewport (before rendering).
Default is 1
|
inline |
Gets the default depth buffer value to which the viewport is cleared.
void Ogre::Viewport::setClearEveryFrame | ( | bool | clear, |
unsigned int | buffers = FBT_COLOUR|FBT_DEPTH |
||
) |
Determines whether to clear the viewport before rendering.
clear | Whether or not to clear any buffers |
buffers | One or more values from FrameBufferType denoting which buffers to clear, if clear is set to true. Note you should not clear the stencil buffer here unless you know what you're doing. |
|
inline |
Determines if the viewport is cleared before every frame.
|
inline |
Gets which buffers are to be cleared each frame.
|
inline |
Sets whether this viewport should be automatically updated if Ogre's rendering loop or RenderTarget::update is being used.
autoupdate | If true, the viewport is updated during the automatic render loop or when RenderTarget::update() is called. If false, the viewport is only updated when its update() method is called explicitly. |
|
inline |
Gets whether this viewport is automatically updated if Ogre's rendering loop or RenderTarget::update is being used.
|
inline |
Set the material scheme which the viewport should use.
|
inline |
Get the material scheme which the viewport should use.
|
inline |
Access to actual dimensions (based on target size).
void Ogre::Viewport::getActualDimensions | ( | int & | left, |
int & | top, | ||
int & | width, | ||
int & | height | ||
) | const |
bool Ogre::Viewport::_isUpdated | ( | void | ) | const |
void Ogre::Viewport::_clearUpdatedFlag | ( | void | ) |
unsigned int Ogre::Viewport::_getNumRenderedFaces | ( | void | ) | const |
Gets the number of rendered faces in the last update.
unsigned int Ogre::Viewport::_getNumRenderedBatches | ( | void | ) | const |
Gets the number of rendered batches in the last update.
|
inline |
Tells this viewport whether it should display Overlay objects.
enabled | If true, any overlays are displayed, if false they are not. |
|
inline |
Returns whether or not Overlay objects (created in the SceneManager) are displayed in this viewport.
|
inline |
Tells this viewport whether it should display skies.
enabled | If true, any skies are displayed, if false they are not. |
|
inline |
Returns whether or not skies (created in the SceneManager) are displayed in this viewport.
|
inline |
Tells this viewport whether it should display shadows.
enabled | If true, any shadows are displayed, if false they are not. |
|
inline |
Returns whether or not shadows (defined in the SceneManager) are displayed in this viewport.
|
inline |
Sets a per-viewport visibility mask.
|
inline |
Gets a per-viewport visibility mask.
void Ogre::Viewport::pointOrientedToScreen | ( | const Vector2 & | v, |
int | orientationMode, | ||
Vector2 & | outv | ||
) |
Convert oriented input point coordinates to screen coordinates.
void Ogre::Viewport::pointOrientedToScreen | ( | Real | orientedX, |
Real | orientedY, | ||
int | orientationMode, | ||
Real & | screenX, | ||
Real & | screenY | ||
) |
void Ogre::Viewport::addListener | ( | Listener * | l | ) |
Add a listener to this viewport.
void Ogre::Viewport::removeListener | ( | Listener * | l | ) |
Remove a listener to this viewport.
|
inline |
Sets the draw buffer type for the next frame.
colourBuffer | Specifies the particular buffer that will be targeted by the render target. |
|
inline |
Returns the current colour buffer type for this viewport.