# 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
    00037     class Camera;
    00038     class MovableObject;
    00039     struct VisibleObjectsBoundsInfo;
    00040
    00047     enum RenderQueueGroupID
    00048     {
    00050         RENDER_QUEUE_BACKGROUND = 0,
    00052         RENDER_QUEUE_SKIES_EARLY = 5,
    00053         RENDER_QUEUE_1 = 10,
    00054         RENDER_QUEUE_2 = 20,
    00055         RENDER_QUEUE_WORLD_GEOMETRY_1 = 25,
    00056         RENDER_QUEUE_3 = 30,
    00057         RENDER_QUEUE_4 = 40,
    00059         RENDER_QUEUE_MAIN = 50,
    00060         RENDER_QUEUE_6 = 60,
    00061         RENDER_QUEUE_7 = 70,
    00062         RENDER_QUEUE_WORLD_GEOMETRY_2 = 75,
    00063         RENDER_QUEUE_8 = 80,
    00064         RENDER_QUEUE_9 = 90,
    00066         RENDER_QUEUE_SKIES_LATE = 95,
    00068         RENDER_QUEUE_OVERLAY = 100,
    00070         RENDER_QUEUE_MAX = 105
    00071     };
    00072
    00073     #define OGRE_RENDERABLE_DEFAULT_PRIORITY  100
    00074
    00086     class _OgreExport RenderQueue : public RenderQueueAlloc
    00087     {
    00088     public:
    00089         typedef std::map< uint8, RenderQueueGroup* > RenderQueueGroupMap;
    00091         typedef MapIterator<RenderQueueGroupMap> QueueGroupIterator;
    00097         class _OgreExport RenderableListener
    00098         {
    00099         public:
    00100             RenderableListener() {}
    00101             virtual ~RenderableListener() {}
    00102
    00122             virtual bool renderableQueued(Renderable* rend, uint8 groupID,
    00123                 ushort priority, Technique** ppTech, RenderQueue* pQueue) = 0;
    00124         };
    00125     protected:
    00126         RenderQueueGroupMap mGroups;
    00128         uint8 mDefaultQueueGroup;
    00130         ushort mDefaultRenderablePriority;
    00131
    00132         bool mSplitPassesByLightingType;
    00133         bool mSplitNoShadowPasses;
    00134         bool mShadowCastersCannotBeReceivers;
    00135
    00136         RenderableListener* mRenderableListener;
    00137     public:
    00138         RenderQueue();
    00139         virtual ~RenderQueue();
    00140
    00145         void clear(bool destroyPassMaps = false);
    00146
    00152         RenderQueueGroup* getQueueGroup(uint8 qid);
    00153
    00176         void addRenderable(Renderable* pRend, uint8 groupID, ushort priority);
    00177
    00195         void addRenderable(Renderable* pRend, uint8 groupId);
    00196
    00209         void addRenderable(Renderable* pRend);
    00210
    00214         uint8 getDefaultQueueGroup(void) const;
    00215
    00220         void setDefaultRenderablePriority(ushort priority);
    00221
    00225         ushort getDefaultRenderablePriority(void) const;
    00226
    00231         void setDefaultQueueGroup(uint8 grp);
    00232
    00234         QueueGroupIterator _getQueueGroupIterator(void);
    00238         void setSplitPassesByLightingType(bool split);
    00243         void setSplitNoShadowPasses(bool split);
    00247         void setShadowCastersCannotBeReceivers(bool ind);
    00248
    00254         void setRenderableListener(RenderableListener* listener)
    00255         { mRenderableListener = listener; }
    00256
    00257         RenderableListener* getRenderableListener(void) const
    00258         { return mRenderableListener; }
    00259
    00265         void processVisibleObject(MovableObject* mo,
    00266             Camera* cam,
    00267             bool onlyShadowCasters,
    00268             VisibleObjectsBoundsInfo* visibleBounds);
    00269
    00270     };
    00271
    00272
    00273 }
    00274
    00275
    00276 #endif

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Dec 27 17:31:07 2009