OGRE: OgreRenderQueue.h Source File - OGRE Documentation

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,
    00066         RENDER_QUEUE_MAX = 105
    00067     };
    00068
    00069     #define OGRE_RENDERABLE_DEFAULT_PRIORITY  100
    00070
    00082     class _OgreExport RenderQueue
    00083     {
    00084     public:
    00085         typedef std::map< uint8, RenderQueueGroup* > RenderQueueGroupMap;
    00087         typedef MapIterator<RenderQueueGroupMap> QueueGroupIterator;
    00093         class _OgreExport RenderableListener
    00094         {
    00095         public:
    00096             RenderableListener() {}
    00097             virtual ~RenderableListener() {}
    00098
    00115             virtual bool renderableQueued(Renderable* rend, uint8 groupID,
    00116                 ushort priority, Technique** ppTech) = 0;
    00117         };
    00118     protected:
    00119         RenderQueueGroupMap mGroups;
    00121         uint8 mDefaultQueueGroup;
    00123         ushort mDefaultRenderablePriority;
    00124
    00125         bool mSplitPassesByLightingType;
    00126         bool mSplitNoShadowPasses;
    00127         bool mShadowCastersCannotBeReceivers;
    00128
    00129         RenderableListener* mRenderableListener;
    00130     public:
    00131         RenderQueue();
    00132         virtual ~RenderQueue();
    00133
    00138         void clear(bool destroyPassMaps = false);
    00139
    00145         RenderQueueGroup* getQueueGroup(uint8 qid);
    00146
    00169         void addRenderable(Renderable* pRend, uint8 groupID, ushort priority);
    00170
    00188         void addRenderable(Renderable* pRend, uint8 groupId);
    00189
    00202         void addRenderable(Renderable* pRend);
    00203
    00207         uint8 getDefaultQueueGroup(void) const;
    00208
    00213         void setDefaultRenderablePriority(ushort priority);
    00214
    00218         ushort getDefaultRenderablePriority(void) const;
    00219
    00223         void setDefaultQueueGroup(uint8 grp);
    00224
    00226         QueueGroupIterator _getQueueGroupIterator(void);
    00230         void setSplitPassesByLightingType(bool split);
    00235         void setSplitNoShadowPasses(bool split);
    00239         void setShadowCastersCannotBeReceivers(bool ind);
    00240
    00246         void setRenderableListener(RenderableListener* listener)
    00247         { mRenderableListener = listener; }
    00248
    00249         RenderableListener* getRenderableListener(void) const
    00250         { return mRenderableListener; }
    00251
    00252     };
    00253
    00254
    00255 }
    00256
    00257
    00258 #endif

Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Thu Mar 6 09:46:26 2008