Crazy Eddie's GUI System  0.8.7
Renderer.h
1 /***********************************************************************
2  created: 20/2/2004
3  author: Paul D Turner
4 
5  purpose: Defines interface for abstract Renderer class
6 *************************************************************************/
7 /***************************************************************************
8  * Copyright (C) 2004 - 2011 Paul D Turner & The CEGUI Development Team
9  *
10  * Permission is hereby granted, free of charge, to any person obtaining
11  * a copy of this software and associated documentation files (the
12  * "Software"), to deal in the Software without restriction, including
13  * without limitation the rights to use, copy, modify, merge, publish,
14  * distribute, sublicense, and/or sell copies of the Software, and to
15  * permit persons to whom the Software is furnished to do so, subject to
16  * the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be
19  * included in all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
25  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27  * OTHER DEALINGS IN THE SOFTWARE.
28  ***************************************************************************/
29 #ifndef _CEGUIRenderer_h_
30 #define _CEGUIRenderer_h_
31 
32 #include "CEGUI/Base.h"
33 #include "CEGUI/String.h"
34 #include "CEGUI/Size.h"
35 #include "CEGUI/Vector.h"
36 
37 // Start of CEGUI namespace section
38 namespace CEGUI
39 {
40 //----------------------------------------------------------------------------//
47 {
52 };
53 
54 //----------------------------------------------------------------------------//
55 
62 {
69 };
70 
71 //----------------------------------------------------------------------------//
72 
82 class CEGUIEXPORT Renderer :
83  public AllocatedObject<Renderer>
84 {
85 public:
95 
106 
117  virtual void destroyGeometryBuffer(const GeometryBuffer& buffer) = 0;
118 
123  virtual void destroyAllGeometryBuffers() = 0;
124 
137 
147  virtual void destroyTextureTarget(TextureTarget* target) = 0;
148 
153  virtual void destroyAllTextureTargets() = 0;
154 
171  virtual Texture& createTexture(const String& name) = 0;
172 
203  virtual Texture& createTexture(const String& name,
204  const String& filename,
205  const String& resourceGroup) = 0;
206 
232  virtual Texture& createTexture(const String& name, const Sizef& size) = 0;
233 
242  virtual void destroyTexture(Texture& texture) = 0;
243 
252  virtual void destroyTexture(const String& name) = 0;
253 
258  virtual void destroyAllTextures() = 0;
259 
272  virtual Texture& getTexture(const String& name) const = 0;
273 
275  virtual bool isTextureDefined(const String& name) const = 0;
276 
282  virtual void beginRendering() = 0;
283 
288  virtual void endRendering() = 0;
289 
307  virtual void setDisplaySize(const Sizef& size) = 0;
308 
317  virtual const Sizef& getDisplaySize() const = 0;
318 
327  virtual const Vector2f& getDisplayDPI() const = 0;
328 
336  virtual uint getMaxTextureSize() const = 0;
337 
345  virtual const String& getIdentifierString() const = 0;
346 
348  virtual ~Renderer() {}
349 };
350 
351 } // End of CEGUI namespace section
352 
353 
354 #endif // end of guard _CEGUIRenderer_h_
Definition: MemoryAllocatedObject.h:110
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: GeometryBuffer.h:44
Defines interface to some surface that can be rendered to. Concrete instances of objects that impleme...
Definition: RenderTarget.h:60
Abstract class defining the basic required interface for Renderer objects.
Definition: Renderer.h:84
virtual void destroyAllTextureTargets()=0
Destory all TextureTarget objects created by this Renderer.
virtual TextureTarget * createTextureTarget()=0
Create a TextureTarget that can be used to cache imagery; this is a RenderTarget that does not lose i...
virtual Texture & createTexture(const String &name, const String &filename, const String &resourceGroup)=0
Create a Texture object using the given image file.
virtual const Sizef & getDisplaySize() const =0
Return the size of the display or host window in pixels.
virtual void destroyAllGeometryBuffers()=0
Destroy all GeometryBuffer objects created by this Renderer.
virtual void destroyGeometryBuffer(const GeometryBuffer &buffer)=0
Destroy a GeometryBuffer that was returned when calling the createGeometryBuffer function....
virtual Texture & createTexture(const String &name)=0
Create a 'null' Texture object.
virtual void destroyTexture(const String &name)=0
Destroy a Texture object that was previously created by calling the createTexture functions.
virtual GeometryBuffer & createGeometryBuffer()=0
Create a new GeometryBuffer and return a reference to it. You should remove the GeometryBuffer from a...
virtual ~Renderer()
Destructor.
Definition: Renderer.h:348
virtual void destroyTexture(Texture &texture)=0
Destroy a Texture object that was previously created by calling the createTexture functions.
virtual void destroyAllTextures()=0
Destroy all Texture objects created by this Renderer.
virtual const Vector2f & getDisplayDPI() const =0
Return the resolution of the display or host window in dots per inch.
virtual void setDisplaySize(const Sizef &size)=0
Set the size of the display or host window in pixels for this Renderer object.
virtual RenderTarget & getDefaultRenderTarget()=0
Returns the default RenderTarget object. The default render target is is typically one that targets t...
virtual void beginRendering()=0
Perform any operations required to put the system into a state ready for rendering operations to begi...
virtual Texture & getTexture(const String &name) const =0
Return a Texture object that was previously created by calling the createTexture functions.
virtual bool isTextureDefined(const String &name) const =0
Return whether a texture with the given name exists.
virtual const String & getIdentifierString() const =0
Return identification string for the renderer module.
virtual uint getMaxTextureSize() const =0
Return the pixel size of the maximum supported texture.
virtual void endRendering()=0
Perform any operations required to finalise rendering.
virtual void destroyTextureTarget(TextureTarget *target)=0
Function that cleans up TextureTarget objects created with the createTextureTarget function.
virtual Texture & createTexture(const String &name, const Sizef &size)=0
Create a Texture object with the given pixel dimensions as specified by size.
String class used within the GUI system.
Definition: String.h:64
Specialisation of RenderTarget interface that should be used as the base class for RenderTargets that...
Definition: TextureTarget.h:41
Abstract base class specifying the required interface for Texture objects.
Definition: Texture.h:54
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
BlendMode
Enumerated type that contains the valid options that specify the type of blending that is to be perfo...
Definition: Renderer.h:62
@ BM_INVALID
Invalid mode indicator.
Definition: Renderer.h:64
@ BM_NORMAL
Use normal blending mode.
Definition: Renderer.h:66
@ BM_RTT_PREMULTIPLIED
Use blending mode suitable for textures with premultiplied colours.
Definition: Renderer.h:68
QuadSplitMode
Enumerated type that contains the valid diagonal-mode that specify how a quad is split into triangles...
Definition: Renderer.h:47
@ TopLeftToBottomRight
Diagonal split goes from top-left to bottom-right.
Definition: Renderer.h:49
@ BottomLeftToTopRight
Diagonal split goes from bottom-left to top-right.
Definition: Renderer.h:51