CEGUIRenderer.h

00001 /***********************************************************************
00002         filename:       CEGUIRenderer.h
00003         created:        20/2/2004
00004         author:         Paul D Turner
00005         
00006         purpose:        Defines interface for abstract Renderer class
00007 *************************************************************************/
00008 /***************************************************************************
00009  *   Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
00010  *
00011  *   Permission is hereby granted, free of charge, to any person obtaining
00012  *   a copy of this software and associated documentation files (the
00013  *   "Software"), to deal in the Software without restriction, including
00014  *   without limitation the rights to use, copy, modify, merge, publish,
00015  *   distribute, sublicense, and/or sell copies of the Software, and to
00016  *   permit persons to whom the Software is furnished to do so, subject to
00017  *   the following conditions:
00018  *
00019  *   The above copyright notice and this permission notice shall be
00020  *   included in all copies or substantial portions of the Software.
00021  *
00022  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00023  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00024  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00025  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00026  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00027  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00028  *   OTHER DEALINGS IN THE SOFTWARE.
00029  ***************************************************************************/
00030 #ifndef _CEGUIRenderer_h_
00031 #define _CEGUIRenderer_h_
00032 
00033 #include "CEGUIBase.h"
00034 #include "CEGUIString.h"
00035 #include "CEGUIRect.h"
00036 #include "CEGUIColourRect.h"
00037 #include "CEGUIEventSet.h"
00038 
00039 
00040 // Start of CEGUI namespace section
00041 namespace CEGUI
00042 {
00047 enum OrientationFlags {
00048         FlipHorizontal          = 1,    
00049         FlipVertical            = 2,    
00050         RotateRightAngle        = 4             
00051 };
00052 
00057 enum QuadSplitMode
00058 {
00059         TopLeftToBottomRight,   
00060         BottomLeftToTopRight    
00061 };
00062 
00063 
00072 class CEGUIEXPORT Renderer : public EventSet
00073 {
00074 public:
00075         static const String EventNamespace;                             
00076 
00077         /*************************************************************************
00078                 Event name constants
00079         *************************************************************************/
00086         static const String EventDisplaySizeChanged;
00087 
00088 
00089         /*************************************************************************
00090                 Abstract interface methods
00091         *************************************************************************/
00117         virtual void    addQuad(const Rect& dest_rect, float z, const Texture* tex, const Rect& texture_rect, const ColourRect& colours, QuadSplitMode quad_split_mode) = 0;
00118 
00119 
00129         virtual void    doRender(void) = 0;
00130 
00131 
00139         virtual void    clearRenderList(void) = 0;
00140 
00141 
00157         virtual void    setQueueingEnabled(bool setting) = 0;
00158 
00159 
00168         virtual Texture*        createTexture(void) = 0;
00169 
00170 
00190         virtual Texture*        createTexture(const String& filename, const String& resourceGroup) = 0;
00191 
00192 
00208         virtual Texture*        createTexture(float size) = 0;
00209 
00210 
00221         virtual void            destroyTexture(Texture* texture) = 0;
00222 
00223         
00231         virtual void            destroyAllTextures(void) = 0;
00232 
00233 
00241         virtual bool    isQueueingEnabled(void) const = 0;
00242 
00243 
00251         virtual float   getWidth(void) const    = 0;
00252 
00253 
00261         virtual float   getHeight(void) const   = 0;
00262 
00263 
00271         virtual Size    getSize(void) const             = 0;
00272 
00273 
00282         virtual Rect    getRect(void) const             = 0;
00283 
00284 
00292         virtual uint    getMaxTextureSize(void) const   = 0;
00293 
00294 
00302         virtual uint    getHorzScreenDPI(void) const    = 0;
00303 
00304 
00312         virtual uint    getVertScreenDPI(void) const    = 0;
00313 
00314 
00315         /*************************************************************************
00316                 Basic stuff we provide in base class
00317         *************************************************************************/
00325         void    resetZValue(void)                               {d_current_z = GuiZInitialValue;}
00326 
00327 
00335         void    advanceZValue(void)                             {d_current_z -= GuiZElementStep;}
00336 
00337 
00345         float   getCurrentZ(void) const                 {return d_current_z;}
00346 
00347 
00359         float   getZLayer(uint layer) const             {return d_current_z - ((float)layer * GuiZLayerStep);}
00360 
00361 
00370     const String& getIdentifierString() const;
00371 
00372     virtual ResourceProvider* createResourceProvider(void);
00373 
00374 protected:
00375         /*************************************************************************
00376                 Construction and Destruction
00377         *************************************************************************/
00378         Renderer(void);
00379 
00380 public:         // for luabind support
00381         virtual ~Renderer(void);
00382 
00383 private:
00384         /*************************************************************************
00385                 Implementation constants
00386         *************************************************************************/
00387         static const float      GuiZInitialValue;               
00388         static const float      GuiZElementStep;                
00389         static const float      GuiZLayerStep;                  
00390 
00391 
00392         /*************************************************************************
00393                 Implementation Data
00394         *************************************************************************/
00395         float   d_current_z;            
00396 
00397 protected:
00398     ResourceProvider* d_resourceProvider;      
00399     String d_identifierString;                 
00400 };
00401 
00402 } // End of  CEGUI namespace section
00403 
00404 
00405 #endif  // end of guard _CEGUIRenderer_h_

Generated on Sun Nov 5 14:35:28 2006 for Crazy Eddies GUI System by  doxygen 1.4.7