Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | 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-2006 Torus Knot Software Ltd
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 You may alternatively use this source under the terms of a specific version of
00025 the OGRE Unrestricted License provided you have obtained such a license from
00026 Torus Knot Software Ltd.
00027 -----------------------------------------------------------------------------
00028 */
00029 #ifndef __RenderQueue_H__
00030 #define __RenderQueue_H__
00031 
00032 #include "OgrePrerequisites.h"
00033 #include "OgreIteratorWrappers.h"
00034 
00035 namespace Ogre {
00036 
00043     enum RenderQueueGroupID
00044     {
00046         RENDER_QUEUE_BACKGROUND = 0,
00048         RENDER_QUEUE_SKIES_EARLY = 5,
00049         RENDER_QUEUE_1 = 10,
00050         RENDER_QUEUE_2 = 20,
00051         RENDER_QUEUE_WORLD_GEOMETRY_1 = 25,
00052         RENDER_QUEUE_3 = 30,
00053         RENDER_QUEUE_4 = 40,
00055         RENDER_QUEUE_MAIN = 50,
00056         RENDER_QUEUE_6 = 60,
00057         RENDER_QUEUE_7 = 70,
00058         RENDER_QUEUE_WORLD_GEOMETRY_2 = 75,
00059         RENDER_QUEUE_8 = 80,
00060         RENDER_QUEUE_9 = 90,
00062         RENDER_QUEUE_SKIES_LATE = 95,
00064         RENDER_QUEUE_OVERLAY = 100
00065     };
00066 
00067     #define OGRE_RENDERABLE_DEFAULT_PRIORITY  100
00068 
00080     class _OgreExport RenderQueue
00081     {
00082     public:
00083         typedef std::map< uint8, RenderQueueGroup* > RenderQueueGroupMap;
00085         typedef MapIterator<RenderQueueGroupMap> QueueGroupIterator;
00091         class _OgreExport RenderableListener
00092         {
00093         public:
00094             RenderableListener() {}
00095             virtual ~RenderableListener() {}
00096 
00113             virtual bool renderableQueued(Renderable* rend, uint8 groupID, 
00114                 ushort priority, Technique** ppTech) = 0;
00115         };
00116     protected:
00117         RenderQueueGroupMap mGroups;
00119         uint8 mDefaultQueueGroup;
00121         ushort mDefaultRenderablePriority;
00122 
00123         bool mSplitPassesByLightingType;
00124         bool mSplitNoShadowPasses;
00125         bool mShadowCastersCannotBeReceivers;
00126 
00127         RenderableListener* mRenderableListener;
00128     public:
00129         RenderQueue();
00130         virtual ~RenderQueue();
00131 
00136         void clear(bool destroyPassMaps = false);
00137 
00143         RenderQueueGroup* getQueueGroup(uint8 qid);
00144 
00167         void addRenderable(Renderable* pRend, uint8 groupID, ushort priority);
00168 
00186         void addRenderable(Renderable* pRend, uint8 groupId);
00187 
00200         void addRenderable(Renderable* pRend);
00201         
00205         uint8 getDefaultQueueGroup(void) const;
00206 
00211         void setDefaultRenderablePriority(ushort priority);
00212 
00216         ushort getDefaultRenderablePriority(void) const;
00217 
00221         void setDefaultQueueGroup(uint8 grp);
00222         
00224         QueueGroupIterator _getQueueGroupIterator(void);
00228         void setSplitPassesByLightingType(bool split);
00233         void setSplitNoShadowPasses(bool split);
00237         void setShadowCastersCannotBeReceivers(bool ind);
00238 
00244         void setRenderableListener(RenderableListener* listener)
00245         { mRenderableListener = listener; }
00246 
00247         RenderableListener* getRenderableListener(void) const
00248         { return mRenderableListener; }
00249 
00250     };
00251 
00252 
00253 }
00254 
00255 
00256 #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 May 6 10:54:22 2007