Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

OgreRenderQueue.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://www.ogre3d.org/
00006 
00007 Copyright (c) 2000-2005 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 #ifndef __RenderQueue_H__
00026 #define __RenderQueue_H__
00027 
00028 #include "OgrePrerequisites.h"
00029 #include "OgreIteratorWrappers.h"
00030 
00031 namespace Ogre {
00032 
00039     enum RenderQueueGroupID
00040     {
00042         RENDER_QUEUE_BACKGROUND = 0,
00044         RENDER_QUEUE_SKIES_EARLY = 5,
00045         RENDER_QUEUE_1 = 10,
00046         RENDER_QUEUE_2 = 20,
00047         RENDER_QUEUE_WORLD_GEOMETRY_1 = 25,
00048         RENDER_QUEUE_3 = 30,
00049         RENDER_QUEUE_4 = 40,
00051         RENDER_QUEUE_MAIN = 50,
00052         RENDER_QUEUE_6 = 60,
00053         RENDER_QUEUE_7 = 70,
00054         RENDER_QUEUE_WORLD_GEOMETRY_2 = 75,
00055         RENDER_QUEUE_8 = 80,
00056         RENDER_QUEUE_9 = 90,
00058         RENDER_QUEUE_SKIES_LATE = 95,
00060         RENDER_QUEUE_OVERLAY = 100
00061     };
00062 
00063     #define OGRE_RENDERABLE_DEFAULT_PRIORITY  100
00064 
00076     class _OgreExport RenderQueue
00077     {
00078     public:
00079         typedef std::map< uint8, RenderQueueGroup* > RenderQueueGroupMap;
00081         typedef MapIterator<RenderQueueGroupMap> QueueGroupIterator;
00087         class _OgreExport RenderableListener
00088         {
00089         public:
00090             RenderableListener() {}
00091             virtual ~RenderableListener() {}
00092 
00109             virtual bool renderableQueued(Renderable* rend, uint8 groupID, 
00110                 ushort priority, Technique** ppTech) = 0;
00111         };
00112     protected:
00113         RenderQueueGroupMap mGroups;
00115         uint8 mDefaultQueueGroup;
00117         ushort mDefaultRenderablePriority;
00118 
00119         bool mSplitPassesByLightingType;
00120         bool mSplitNoShadowPasses;
00121         bool mShadowCastersCannotBeReceivers;
00122 
00123         RenderableListener* mRenderableListener;
00124     public:
00125         RenderQueue();
00126         virtual ~RenderQueue();
00127 
00132         void clear(bool destroyPassMaps = false);
00133 
00139         RenderQueueGroup* getQueueGroup(uint8 qid);
00140 
00163         void addRenderable(Renderable* pRend, uint8 groupID, ushort priority);
00164 
00182         void addRenderable(Renderable* pRend, uint8 groupId);
00183 
00196         void addRenderable(Renderable* pRend);
00197         
00201         uint8 getDefaultQueueGroup(void) const;
00202 
00207         void setDefaultRenderablePriority(ushort priority);
00208 
00212         ushort getDefaultRenderablePriority(void) const;
00213 
00217         void setDefaultQueueGroup(uint8 grp);
00218         
00220         QueueGroupIterator _getQueueGroupIterator(void);
00224         void setSplitPassesByLightingType(bool split);
00229         void setSplitNoShadowPasses(bool split);
00233         void setShadowCastersCannotBeReceivers(bool ind);
00234 
00240         void setRenderableListener(RenderableListener* listener)
00241         { mRenderableListener = listener; }
00242 
00243         RenderableListener* getRenderableListener(void) const
00244         { return mRenderableListener; }
00245 
00246     };
00247 
00248 
00249 }
00250 
00251 
00252 #endif

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:37:47 2006