Crazy Eddies GUI System: CEGUI::RenderingWindow Class Reference

Crazy Eddies GUI System 0.7.6

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes | Friends
CEGUI::RenderingWindow Class Reference

RenderingWindow is a RenderingSurface that can be "drawn back" onto another RenderingSurface and is primarily intended to be used as a kind of cache for rendered imagery. More...

Inheritance diagram for CEGUI::RenderingWindow:
[legend]
Collaboration diagram for CEGUI::RenderingWindow:
[legend]

List of all members.

## Public Member Functions
| RenderingWindow (TextureTarget &target, RenderingSurface &owner)
| Constructor for RenderingWindow objects.
| ~RenderingWindow ()
| Destructor for RenderingWindow objects.
void | setClippingRegion (const Rect &region)
| Set the clipping region that will be used when rendering the imagery for this RenderingWindow back onto the RenderingSurface that owns it.
void | setPosition (const Vector2 &position)
| Set the two dimensional position of the RenderingWindow in pixels. The origin is at the top-left corner.
void | setSize (const Size &size)
| Set the size of the RenderingWindow in pixels.
void | setRotation (const Vector3 &rotation)
| Set the rotation factors to be used when rendering the RenderingWindow back onto it's owning RenderingSurface.
void | setPivot (const Vector3 &pivot)
| Set the location of the pivot point around which the RenderingWindow will be rotated.
const Vector2 & | getPosition () const
| Return the current pixel position of the RenderingWindow. The origin is at the top-left corner.
const Size & | getSize () const
| Return the current size of the RenderingWindow in pixels.
const Vector3 & | getRotation () const
| Return the current rotations being applied to the RenderingWindow, in degrees.
const Vector3 & | getPivot () const
| Return the rotation pivot point location for the RenderingWindow.
const TextureTarget & | getTextureTarget () const
| Return the TextureTarget object that is the target for content rendered to this RenderingWindows. This is the same object passed into the constructor.
TextureTarget & | getTextureTarget ()
void | update (const float elapsed)
| Peform time based updated for the RenderingWindow.
void | setRenderEffect (RenderEffect *effect)
| Set the RenderEffect that should be used with the RenderingWindow. This may be 0 to remove a previously set RenderEffect.
RenderEffect * | getRenderEffect ()
| Return a pointer to the RenderEffect currently being used with the RenderingWindow. A return value of 0 indicates that no RenderEffect is being used.
void | realiseGeometry ()
| generate geometry to be used when rendering back the RenderingWindow to it's owning RenderingSurface.
void | invalidateGeometry ()
| Mark the geometry used when rendering the RenderingWindow back to it's owning RenderingSurface as invalid so that it gets regenerated on the next rendering pass.
const RenderingSurface & | getOwner () const
| Return the RenderingSurface that owns the RenderingWindow. This is also the RenderingSurface that will be used when the RenderingWindow renders back it's cached imagery content.
RenderingSurface & | getOwner ()
void | unprojectPoint (const Vector2 &p_in, Vector2 &p_out)
| Fill in Vector2 object p_out with an unprojected version of the point described by Vector2 p_in.
void | draw ()
| Draw the GeometryBuffers for all rendering queues to the RenderTarget that this RenderingSurface is targetting.
void | invalidate ()
| Marks the RenderingSurface as invalid, causing the geometry to be rerendered to the RenderTarget next time draw is called.
bool | isRenderingWindow () const
| Return whether this RenderingSurface is actually an instance of the RenderingWindow subclass.
## Protected Member Functions
virtual void | realiseGeometry_impl ()
| default generates geometry to draw window as a single quad.
void | setOwner (RenderingSurface &owner)
| set a new owner for this RenderingWindow object
## Protected Attributes
Renderer & | d_renderer
| holds ref to renderer
TextureTarget & | d_textarget
| TextureTarget to draw to. Like d_target in base, but avoiding downcasts.
RenderingSurface * | d_owner
| RenderingSurface that owns this object, we render back to this object.
GeometryBuffer * | d_geometry
| GeometryBuffer that holds geometry for drawing this window.
bool | d_geometryValid
| indicates whether data in GeometryBuffer is up-to-date
Vector2 | d_position
| Position of this RenderingWindow.
Size | d_size
| Size of this RenderingWindow.
Vector3 | d_rotation
| Rotaions for this RenderingWindow.
Vector3 | d_pivot
| Pivot point used for the rotation.
## Friends
void | RenderingSurface::transferRenderingWindow (RenderingWindow &)

## Detailed Description

RenderingWindow is a RenderingSurface that can be "drawn back" onto another RenderingSurface and is primarily intended to be used as a kind of cache for rendered imagery.

## Constructor & Destructor Documentation

CEGUI::RenderingWindow::RenderingWindow | ( | TextureTarget & | target,
|  | RenderingSurface & | owner
| ) |  |

Constructor for RenderingWindow objects.

Parameters:

  target | The TextureTarget based object that will be used as the target for content rendering done by the RenderingWindow.
  owner | The RenderingSurface object that will be our initial owner. This RenderingSurface is also the target where our cached imagery will be rendered back to.

Note:
  The TextureTarget target remains under it's original ownership, and the RenderingSurface owner actually owns this object.

## Member Function Documentation

void CEGUI::RenderingWindow::draw | ( |  | ) | `[virtual]`

Draw the GeometryBuffers for all rendering queues to the RenderTarget that this RenderingSurface is targetting.

The GeometryBuffers remain in the rendering queues after the draw operation is complete. This allows the next draw operation to occur without needing to requeue all the GeometryBuffers (if for instance the sequence of buffers to be drawn remains unchanged).

Reimplemented from CEGUI::RenderingSurface.

const RenderingSurface& CEGUI::RenderingWindow::getOwner | ( |  | ) | const

Return the RenderingSurface that owns the RenderingWindow. This is also the RenderingSurface that will be used when the RenderingWindow renders back it's cached imagery content.

Returns:
  RenderingSurface object that owns, and is targetted by, the RenderingWindow.

const Vector3& CEGUI::RenderingWindow::getPivot | ( |  | ) | const

Return the rotation pivot point location for the RenderingWindow.

Returns:
  Vector3 object describing the current location of the pivot point used when rotating the RenderingWindow.

const Vector2& CEGUI::RenderingWindow::getPosition | ( |  | ) | const

Return the current pixel position of the RenderingWindow. The origin is at the top-left corner.

Returns:
  Vector2 object describing the pixel position of the RenderingWindow.

Note:
  This position is an absolute pixel location relative to the screen or other root surface. It is not relative to the owner of the RenderingWindow.

RenderEffect* CEGUI::RenderingWindow::getRenderEffect | ( |  | ) |

Return a pointer to the RenderEffect currently being used with the RenderingWindow. A return value of 0 indicates that no RenderEffect is being used.

Returns:
  Pointer to the RenderEffect used with this RenderingWindow, or 0 for none.

const Vector3& CEGUI::RenderingWindow::getRotation | ( |  | ) | const

Return the current rotations being applied to the RenderingWindow, in degrees.

Returns:
  Vector3 object describing the rotations for the RenderingWindow.

const Size& CEGUI::RenderingWindow::getSize | ( |  | ) | const

Return the current size of the RenderingWindow in pixels.

Returns:
  Size object describing the current pixel size of the RenderingWindow.

const TextureTarget& CEGUI::RenderingWindow::getTextureTarget | ( |  | ) | const

Return the TextureTarget object that is the target for content rendered to this RenderingWindows. This is the same object passed into the constructor.

Returns:
  The TextureTarget object that receives the rendered output resulting from geometry queued to this RenderingWindow.

void CEGUI::RenderingWindow::invalidate | ( |  | ) | `[virtual]`

Marks the RenderingSurface as invalid, causing the geometry to be rerendered to the RenderTarget next time draw is called.

Note that some surface types can never be in a 'valid' state and so rerendering occurs whenever draw is called. This function mainly exists as a means to hint to other surface types - those that physically cache the rendered output - that geometry content has changed and the cached imagery should be cleared and redrawn.

Reimplemented from CEGUI::RenderingSurface.

void CEGUI::RenderingWindow::invalidateGeometry | ( |  | ) |

Mark the geometry used when rendering the RenderingWindow back to it's owning RenderingSurface as invalid so that it gets regenerated on the next rendering pass.

This is separate from the main invalidate() function because in most cases invalidating the cached imagery will not require the potentially expensive regeneration of the geometry for the RenderingWindow itself.

bool CEGUI::RenderingWindow::isRenderingWindow | ( |  | ) | const`[virtual]`

Return whether this RenderingSurface is actually an instance of the RenderingWindow subclass.

Returns:
  - true to indicate the RenderingSurface is a RenderingWindow instance.
  - false to indicate the RenderingSurface is not a RenderingWindow.

Reimplemented from CEGUI::RenderingSurface.

void CEGUI::RenderingWindow::realiseGeometry | ( |  | ) |

generate geometry to be used when rendering back the RenderingWindow to it's owning RenderingSurface.

Note:
  In normal usage you should never have to call this directly. There may be certain cases where it might be useful to call this when using the RenderEffect system.

void CEGUI::RenderingWindow::setClippingRegion | ( | const Rect & | region | ) |

Set the clipping region that will be used when rendering the imagery for this RenderingWindow back onto the RenderingSurface that owns it.

Note:
  This is not the clipping region used when rendering the queued geometry onto the RenderingWindow, that still uses whatever regions are set on the queued GeometryBuffer objects.

Parameters:

  region | Rect object describing a rectangular clipping region.

Note:
  The region should be described as absolute pixel locations relative to the screen or other root surface. The region should not be described relative to the owner of the RenderingWindow.

void CEGUI::RenderingWindow::setPivot | ( | const Vector3 & | pivot | ) |

Set the location of the pivot point around which the RenderingWindow will be rotated.

Parameters:

  pivot | Vector3 describing the three dimensional point around which the RenderingWindow will be rotated.

void CEGUI::RenderingWindow::setPosition | ( | const Vector2 & | position | ) |

Set the two dimensional position of the RenderingWindow in pixels. The origin is at the top-left corner.

Parameters:

  position | Vector2 object describing the desired location of the RenderingWindow, in pixels.

Note:
  This position is an absolute pixel location relative to the screen or other root surface. It is not relative to the owner of the RenderingWindow.

void CEGUI::RenderingWindow::setRenderEffect | ( | RenderEffect * | effect | ) |

Set the RenderEffect that should be used with the RenderingWindow. This may be 0 to remove a previously set RenderEffect.

Note:
  Ownership of the RenderEffect does not change; the RenderingWindow will not delete a RenderEffect assigned to it when the RenderingWindow is destroyed.

void CEGUI::RenderingWindow::setRotation | ( | const Vector3 & | rotation | ) |

Set the rotation factors to be used when rendering the RenderingWindow back onto it's owning RenderingSurface.

Parameters:

  rotation | Vector3 object describing the rotaions to be used. Values are in degrees.

void CEGUI::RenderingWindow::setSize | ( | const Size & | size | ) |

Set the size of the RenderingWindow in pixels.

Parameters:

  size | Size object that describes the desired size of the RenderingWindow, in pixels.

void CEGUI::RenderingWindow::update | ( | const float | elapsed | ) |

Peform time based updated for the RenderingWindow.

Note:
  Currently this really only has meaning for RenderingWindow objects that have RenderEffect objects set. Though this may not always be the case.

Parameters:

  elapsed | float value describing the number of seconds that have passed since the previous call to update.