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 
73  ~RenderingWindow();
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 
196  const TextureTarget& getTextureTarget() const;
197  TextureTarget& getTextureTarget();
198 
211  void update(const float elapsed);
212 
223  void setRenderEffect(RenderEffect* effect);
224 
235  RenderEffect* getRenderEffect();
236 
247  void realiseGeometry();
248 
259  void invalidateGeometry();
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 
291  void setOwner(RenderingSurface& owner);
292  // friend is so that RenderingSurface can call setOwner to xfer ownership.
294 
296  Renderer& d_renderer;
298  TextureTarget& d_textarget;
300  RenderingSurface* d_owner;
302  GeometryBuffer* d_geometry;
304  bool d_geometryValid;
306  Vector2f d_position;
308  Sizef d_size;
310  Quaternion d_rotation;
312  Vector3f d_pivot;
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_
CEGUI::GeometryBuffer
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: GeometryBuffer.h:62
CEGUI::RenderingSurface
Class that represents a surface that can have geometry based imagery drawn to it.
Definition: RenderingSurface.h:128
CEGUI
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
CEGUI::Quaternion
Class to represent rotation, avoids Gimbal lock.
Definition: Quaternion.h:89
CEGUI::Vector2< float >
CEGUI::Vector3< float >
CEGUI::RenderingWindow
RenderingWindow is a RenderingSurface that can be "drawn back" onto another RenderingSurface and is p...
Definition: RenderingWindow.h:70
CEGUI::RenderingSurface::transferRenderingWindow
virtual void transferRenderingWindow(RenderingWindow &window)
transfer ownership of the RenderingWindow to this RenderingSurface.
CEGUI::Size< float >
CEGUI::TextureTarget
Specialisation of RenderTarget interface that should be used as the base class for RenderTargets that...
Definition: TextureTarget.h:60
CEGUI::Rect< float >
CEGUI::RenderEffect
Interface for objects that hook into RenderingWindow to affect the rendering process,...
Definition: RenderEffect.h:60
CEGUI::Renderer
Abstract class defining the basic required interface for Renderer objects.
Definition: Renderer.h:104