Crazy Eddie's GUI System  0.8.7
RenderingWindow.h
1 /***********************************************************************
2  created: Mon Jan 12 2009
3  author: Paul D Turner
4 *************************************************************************/
5 /***************************************************************************
6  * Copyright (C) 2004 - 2011 Paul D Turner & The CEGUI Development Team
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject to
14  * the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  ***************************************************************************/
27 #ifndef _CEGUIRenderingWindow_h_
28 #define _CEGUIRenderingWindow_h_
29 
30 #include "CEGUI/RenderingSurface.h"
31 #include "CEGUI/Vector.h"
32 #include "CEGUI/Quaternion.h"
33 #include "CEGUI/Size.h"
34 #include "CEGUI/Rect.h"
35 
36 #if defined(_MSC_VER)
37 # pragma warning(push)
38 # pragma warning(disable : 4251)
39 #endif
40 
41 // Start of CEGUI namespace section
42 namespace CEGUI
43 {
50 class CEGUIEXPORT RenderingWindow : public RenderingSurface
51 {
52 public:
71 
74 
94  void setClippingRegion(const Rectf& region);
95 
110  void setPosition(const Vector2f& position);
111 
120  void setSize(const Sizef& size);
121 
130  void setRotation(const Quaternion& rotation);
131 
141  void setPivot(const Vector3f& pivot);
142 
156  const Vector2f& getPosition() const;
157 
165  const Sizef& getSize() const;
166 
174  const Quaternion& getRotation()const;
175 
184  const Vector3f& getPivot() const;
185 
197  TextureTarget& getTextureTarget();
198 
211  void update(const float elapsed);
212 
224 
236 
248 
260 
271  const RenderingSurface& getOwner() const;
272  RenderingSurface& getOwner();
273 
279  void unprojectPoint(const Vector2f& p_in, Vector2f& p_out);
280 
281  // overrides from base
282  void draw();
283  void invalidate();
284  bool isRenderingWindow() const;
285 
286 protected:
288  virtual void realiseGeometry_impl();
289 
292  // friend is so that RenderingSurface can call setOwner to xfer ownership.
294 
313 };
314 
315 } // End of CEGUI namespace section
316 
317 #if defined(_MSC_VER)
318 # pragma warning(pop)
319 #endif
320 
321 #endif // end of guard _CEGUIRenderingWindow_h_
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: GeometryBuffer.h:44
Class to represent rotation, avoids Gimbal lock.
Definition: Quaternion.h:69
Interface for objects that hook into RenderingWindow to affect the rendering process,...
Definition: RenderEffect.h:42
Abstract class defining the basic required interface for Renderer objects.
Definition: Renderer.h:84
Class that represents a surface that can have geometry based imagery drawn to it.
Definition: RenderingSurface.h:111
virtual void transferRenderingWindow(RenderingWindow &window)
transfer ownership of the RenderingWindow to this RenderingSurface.
RenderingWindow is a RenderingSurface that can be "drawn back" onto another RenderingSurface and is p...
Definition: RenderingWindow.h:51
RenderingWindow(TextureTarget &target, RenderingSurface &owner)
Constructor for RenderingWindow objects.
void setRotation(const Quaternion &rotation)
Set the rotation quaternion to be used when rendering the RenderingWindow back onto it's owning Rende...
void unprojectPoint(const Vector2f &p_in, Vector2f &p_out)
Fill in Vector2 object p_out with an unprojected version of the point described by Vector2 p_in.
Renderer & d_renderer
holds ref to renderer
Definition: RenderingWindow.h:296
bool isRenderingWindow() const
Return whether this RenderingSurface is actually an instance of the RenderingWindow subclass.
RenderEffect * getRenderEffect()
Return a pointer to the RenderEffect currently being used with the RenderingWindow....
void update(const float elapsed)
Peform time based updated for the RenderingWindow.
const RenderingSurface & getOwner() const
Return the RenderingSurface that owns the RenderingWindow. This is also the RenderingSurface that wil...
Quaternion d_rotation
Rotation for this RenderingWindow.
Definition: RenderingWindow.h:310
Vector2f d_position
Position of this RenderingWindow.
Definition: RenderingWindow.h:306
const Quaternion & getRotation() const
Return the current rotation being applied to the RenderingWindow.
Vector3f d_pivot
Pivot point used for the rotation.
Definition: RenderingWindow.h:312
Sizef d_size
Size of this RenderingWindow.
Definition: RenderingWindow.h:308
void realiseGeometry()
generate geometry to be used when rendering back the RenderingWindow to it's owning RenderingSurface.
const Vector3f & getPivot() const
Return the rotation pivot point location for the RenderingWindow.
RenderingSurface * d_owner
RenderingSurface that owns this object, we render back to this object.
Definition: RenderingWindow.h:300
GeometryBuffer * d_geometry
GeometryBuffer that holds geometry for drawing this window.
Definition: RenderingWindow.h:302
void setPosition(const Vector2f &position)
Set the two dimensional position of the RenderingWindow in pixels. The origin is at the top-left corn...
void setPivot(const Vector3f &pivot)
Set the location of the pivot point around which the RenderingWindow will be rotated.
void setOwner(RenderingSurface &owner)
set a new owner for this RenderingWindow object
virtual void realiseGeometry_impl()
default generates geometry to draw window as a single quad.
void setClippingRegion(const Rectf &region)
Set the clipping region that will be used when rendering the imagery for this RenderingWindow back on...
~RenderingWindow()
Destructor for RenderingWindow objects.
void invalidate()
Marks the RenderingSurface as invalid, causing the geometry to be rerendered to the RenderTarget next...
void setRenderEffect(RenderEffect *effect)
Set the RenderEffect that should be used with the RenderingWindow. This may be 0 to remove a previous...
void draw()
Draw the GeometryBuffers for all rendering queues to the RenderTarget that this RenderingSurface is t...
const Vector2f & getPosition() const
Return the current pixel position of the RenderingWindow. The origin is at the top-left corner.
void setSize(const Sizef &size)
Set the size of the RenderingWindow in pixels.
TextureTarget & d_textarget
TextureTarget to draw to. Like d_target in base, but avoiding downcasts.
Definition: RenderingWindow.h:298
const TextureTarget & getTextureTarget() const
Return the TextureTarget object that is the target for content rendered to this RenderingWindows....
bool d_geometryValid
indicates whether data in GeometryBuffer is up-to-date
Definition: RenderingWindow.h:304
const Sizef & getSize() const
Return the current size of the RenderingWindow in pixels.
void invalidateGeometry()
Mark the geometry used when rendering the RenderingWindow back to it's owning RenderingSurface as inv...
Specialisation of RenderTarget interface that should be used as the base class for RenderTargets that...
Definition: TextureTarget.h:41
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1