OGRE: OgreRenderQueue.h Source File - OGRE Documentation

# 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 : public RenderQueueAlloc
    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
    00118             virtual bool renderableQueued(Renderable* rend, uint8 groupID,
    00119                 ushort priority, Technique** ppTech, RenderQueue* pQueue) = 0;
    00120         };
    00121     protected:
    00122         RenderQueueGroupMap mGroups;
    00124         uint8 mDefaultQueueGroup;
    00126         ushort mDefaultRenderablePriority;
    00127
    00128         bool mSplitPassesByLightingType;
    00129         bool mSplitNoShadowPasses;
    00130         bool mShadowCastersCannotBeReceivers;
    00131
    00132         RenderableListener* mRenderableListener;
    00133     public:
    00134         RenderQueue();
    00135         virtual ~RenderQueue();
    00136
    00141         void clear(bool destroyPassMaps = false);
    00142
    00148         RenderQueueGroup* getQueueGroup(uint8 qid);
    00149
    00172         void addRenderable(Renderable* pRend, uint8 groupID, ushort priority);
    00173
    00191         void addRenderable(Renderable* pRend, uint8 groupId);
    00192
    00205         void addRenderable(Renderable* pRend);
    00206
    00210         uint8 getDefaultQueueGroup(void) const;
    00211
    00216         void setDefaultRenderablePriority(ushort priority);
    00217
    00221         ushort getDefaultRenderablePriority(void) const;
    00222
    00226         void setDefaultQueueGroup(uint8 grp);
    00227
    00229         QueueGroupIterator _getQueueGroupIterator(void);
    00233         void setSplitPassesByLightingType(bool split);
    00238         void setSplitNoShadowPasses(bool split);
    00242         void setShadowCastersCannotBeReceivers(bool ind);
    00243
    00249         void setRenderableListener(RenderableListener* listener)
    00250         { mRenderableListener = listener; }
    00251
    00252         RenderableListener* getRenderableListener(void) const
    00253         { return mRenderableListener; }
    00254
    00255     };
    00256
    00257
    00258 }
    00259
    00260
    00261 #endif

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Jul 26 11:32:19 2009