Crazy Eddie's GUI System  0.8.7
RenderingSurface.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 _CEGUIRenderingSurface_h_
28 #define _CEGUIRenderingSurface_h_
29 
30 #include "CEGUI/EventSet.h"
31 #include "CEGUI/EventArgs.h"
32 #include "CEGUI/RenderQueue.h"
33 
34 #if defined(_MSC_VER)
35 # pragma warning(push)
36 # pragma warning(disable : 4251)
37 #endif
38 
39 
40 // Start of CEGUI namespace section
41 namespace CEGUI
42 {
43 //----------------------------------------------------------------------------//
46 {
47  RQ_USER_0,
50  RQ_USER_1,
53  RQ_USER_2,
56  RQ_USER_3,
59  RQ_USER_4,
62  RQ_USER_5
63 };
64 
65 //----------------------------------------------------------------------------//
66 
73 class CEGUIEXPORT RenderQueueEventArgs : public EventArgs
74 {
75 public:
85 
88 };
89 
90 //----------------------------------------------------------------------------//
91 
108 class CEGUIEXPORT RenderingSurface :
109  public EventSet,
110  public AllocatedObject<RenderingSurface>
111 {
112 public:
114  static const String EventNamespace;
130 
149 
151  virtual ~RenderingSurface();
152 
174  const GeometryBuffer& buffer);
175 
188  const GeometryBuffer& buffer);
189 
202  void clearGeometry(const RenderQueueID queue);
203 
213 
224  virtual void draw();
225 
238  virtual void invalidate();
239 
255  bool isInvalidated() const;
256 
266  virtual bool isRenderingWindow() const;
267 
291 
306 
308 
319 
330  RenderTarget& getRenderTarget();
331 
332 protected:
336  virtual void drawContent();
337 
339  void draw(const RenderQueue& queue, RenderQueueEventArgs& args);
340 
343 
346 
348  typedef std::map<RenderQueueID, RenderQueue
349  /*CEGUI_MAP_ALLOC(RenderQueueID, RenderQueue)*/> RenderQueueList;
351  typedef std::vector<RenderingWindow*
352  CEGUI_VECTOR_ALLOC(RenderingWindow*)> RenderingWindowList;
361 };
362 
363 } // End of CEGUI namespace section
364 
365 #if defined(_MSC_VER)
366 # pragma warning(pop)
367 #endif
368 
369 #endif // end of guard _CEGUIRenderingSurface_h_
CEGUI::GeometryBuffer
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: GeometryBuffer.h:44
CEGUI::RenderingSurface::~RenderingSurface
virtual ~RenderingSurface()
Destructor for RenderingSurface objects.
CEGUI::RenderingSurface::invalidate
virtual void invalidate()
Marks the RenderingSurface as invalid, causing the geometry to be rerendered to the RenderTarget next...
CEGUI::RenderingSurface::getRenderTarget
const RenderTarget & getRenderTarget() const
Return the RenderTarget object that this RenderingSurface is drawing to.
CEGUI::RQ_BASE
@ RQ_BASE
Queue for base level rendering by the surface owner.
Definition: RenderingSurface.h:52
CEGUI::RenderingSurface::removeGeometryBuffer
void removeGeometryBuffer(const RenderQueueID queue, const GeometryBuffer &buffer)
Remove the specified GeometryBuffer from the specified queue.
CEGUI::RenderQueue
Class that represents a queue of GeometryBuffer objects to be rendered.
Definition: RenderQueue.h:54
CEGUI::RenderingSurface
Class that represents a surface that can have geometry based imagery drawn to it.
Definition: RenderingSurface.h:111
CEGUI::RenderingSurface::createRenderingWindow
virtual RenderingWindow & createRenderingWindow(TextureTarget &target)
Create and return a reference to a child RenderingWindow object that will render back onto this Rende...
CEGUI::RenderingSurface::attachWindow
void attachWindow(RenderingWindow &w)
attach ReneringWindow from this RenderingSurface
CEGUI::RenderingSurface::d_target
RenderTarget * d_target
RenderTarget that this surface actually draws to.
Definition: RenderingSurface.h:358
CEGUI::RenderingSurface::draw
virtual void draw()
Draw the GeometryBuffers for all rendering queues to the RenderTarget that this RenderingSurface is t...
CEGUI::RenderingSurface::clearGeometry
void clearGeometry(const RenderQueueID queue)
Clears all GeometryBuffers from the specified rendering queue.
CEGUI
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
CEGUI::EventSet
Interface providing event signaling and handling.
Definition: EventSet.h:167
CEGUI::AllocatedObject
Definition: MemoryAllocatedObject.h:110
CEGUI::RenderQueueEventArgs::RenderQueueEventArgs
RenderQueueEventArgs(const RenderQueueID id)
Constructor for RenderQueueEventArgs objects.
CEGUI::RenderingWindow
RenderingWindow is a RenderingSurface that can be "drawn back" onto another RenderingSurface and is p...
Definition: RenderingWindow.h:51
CEGUI::RenderingSurface::RenderingWindowList
std::vector< RenderingWindow *CEGUI_VECTOR_ALLOC(RenderingWindow *)> RenderingWindowList
collection type for created RenderingWindow objects
Definition: RenderingSurface.h:352
CEGUI::RQ_CONTENT_1
@ RQ_CONTENT_1
Queue for first level of 'content' rendering.
Definition: RenderingSurface.h:55
CEGUI::RenderingSurface::RenderQueueList
std::map< RenderQueueID, RenderQueue > RenderQueueList
collection type for the queues
Definition: RenderingSurface.h:349
CEGUI::RenderingSurface::clearGeometry
void clearGeometry()
Clears all GeometryBuffers from all rendering queues.
CEGUI::RenderingSurface::detatchWindow
void detatchWindow(RenderingWindow &w)
detatch ReneringWindow from this RenderingSurface
CEGUI::RenderingSurface::destroyRenderingWindow
virtual void destroyRenderingWindow(RenderingWindow &window)
Destroy a RenderingWindow we own. If we are not the present owner of the given RenderingWindow,...
CEGUI::RenderingSurface::d_windows
RenderingWindowList d_windows
collection of RenderingWindow object we own
Definition: RenderingSurface.h:356
CEGUI::RenderingSurface::drawContent
virtual void drawContent()
CEGUI::RenderingSurface::d_queues
RenderQueueList d_queues
the collection of RenderQueue objects.
Definition: RenderingSurface.h:354
CEGUI::RenderingSurface::transferRenderingWindow
virtual void transferRenderingWindow(RenderingWindow &window)
transfer ownership of the RenderingWindow to this RenderingSurface.
CEGUI::RenderQueueEventArgs
EventArgs based class that is passed to handlers subcribed to hear about begin/end events on renderin...
Definition: RenderingSurface.h:74
CEGUI::RenderTarget
Defines interface to some surface that can be rendered to. Concrete instances of objects that impleme...
Definition: RenderTarget.h:60
CEGUI::RenderingSurface::isInvalidated
bool isInvalidated() const
Return whether this RenderingSurface is invalidated.
CEGUI::RenderingSurface::EventRenderQueueStarted
static const String EventRenderQueueStarted
Definition: RenderingSurface.h:122
CEGUI::RQ_CONTENT_2
@ RQ_CONTENT_2
Queue for second level of 'content' rendering.
Definition: RenderingSurface.h:58
CEGUI::RenderQueueEventArgs::queueID
RenderQueueID queueID
ID of the queue that this event has been fired for.
Definition: RenderingSurface.h:87
CEGUI::TextureTarget
Specialisation of RenderTarget interface that should be used as the base class for RenderTargets that...
Definition: TextureTarget.h:41
CEGUI::String
String class used within the GUI system.
Definition: String.h:64
CEGUI::RenderingSurface::RenderingSurface
RenderingSurface(RenderTarget &target)
Constructor for RenderingSurface objects.
CEGUI::RQ_OVERLAY
@ RQ_OVERLAY
Queue for overlay rendering that appears above other regular rendering.
Definition: RenderingSurface.h:61
CEGUI::RenderQueueID
RenderQueueID
Enumerated type for valid render queue IDs.
Definition: RenderingSurface.h:46
CEGUI::RenderingSurface::EventRenderQueueEnded
static const String EventRenderQueueEnded
Definition: RenderingSurface.h:129
CEGUI::RenderingSurface::addGeometryBuffer
void addGeometryBuffer(const RenderQueueID queue, const GeometryBuffer &buffer)
Add the specified GeometryBuffer to the specified queue for rendering when the RenderingSurface is dr...
CEGUI::RenderingSurface::draw
void draw(const RenderQueue &queue, RenderQueueEventArgs &args)
draw a rendering queue, firing events before and after.
CEGUI::RenderingSurface::d_invalidated
bool d_invalidated
holds invalidated state of target (as far as we are concerned)
Definition: RenderingSurface.h:360
CEGUI::RQ_UNDERLAY
@ RQ_UNDERLAY
Queue for rendering that appears beneath base imagery.
Definition: RenderingSurface.h:49
CEGUI::RenderingSurface::isRenderingWindow
virtual bool isRenderingWindow() const
Return whether this RenderingSurface is actually an instance of the RenderingWindow subclass.
CEGUI::EventArgs
Base class used as the argument to all subscribers Event object.
Definition: EventArgs.h:51
CEGUI::RenderingSurface::EventNamespace
static const String EventNamespace
Namespace for global events from RenderingSurface objects.
Definition: RenderingSurface.h:114