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-2013 Torus Knot Software Ltd 00008 00009 Permission is hereby granted, free of charge, to any person obtaining a copy 00010 of this software and associated documentation files (the "Software"), to deal 00011 in the Software without restriction, including without limitation the rights 00012 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00013 copies of the Software, and to permit persons to whom the Software is 00014 furnished to do so, subject to the following conditions: 00015 00016 The above copyright notice and this permission notice shall be included in 00017 all copies or substantial portions of the Software. 00018 00019 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00020 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00021 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00022 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00023 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00024 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 00025 THE SOFTWARE. 00026 ----------------------------------------------------------------------------- 00027 */ 00028 #ifndef __RenderQueue_H__ 00029 #define __RenderQueue_H__ 00030 00031 #include "OgrePrerequisites.h" 00032 #include "OgreIteratorWrappers.h" 00033 #include "OgreHeaderPrefix.h" 00034 00035 namespace Ogre { 00036 00037 class Camera; 00038 class MovableObject; 00039 struct VisibleObjectsBoundsInfo; 00040 00053 enum RenderQueueGroupID 00054 { 00056 RENDER_QUEUE_BACKGROUND = 0, 00058 RENDER_QUEUE_SKIES_EARLY = 5, 00059 RENDER_QUEUE_1 = 10, 00060 RENDER_QUEUE_2 = 20, 00061 RENDER_QUEUE_WORLD_GEOMETRY_1 = 25, 00062 RENDER_QUEUE_3 = 30, 00063 RENDER_QUEUE_4 = 40, 00065 RENDER_QUEUE_MAIN = 50, 00066 RENDER_QUEUE_6 = 60, 00067 RENDER_QUEUE_7 = 70, 00068 RENDER_QUEUE_WORLD_GEOMETRY_2 = 75, 00069 RENDER_QUEUE_8 = 80, 00070 RENDER_QUEUE_9 = 90, 00072 RENDER_QUEUE_SKIES_LATE = 95, 00074 RENDER_QUEUE_OVERLAY = 100, 00076 RENDER_QUEUE_MAX = 105 00077 }; 00078 00079 #define OGRE_RENDERABLE_DEFAULT_PRIORITY 100 00080 00092 class _OgreExport RenderQueue : public RenderQueueAlloc 00093 { 00094 public: 00095 00096 typedef map< uint8, RenderQueueGroup* >::type RenderQueueGroupMap; 00098 typedef MapIterator<RenderQueueGroupMap> QueueGroupIterator; 00099 typedef ConstMapIterator<RenderQueueGroupMap> ConstQueueGroupIterator; 00100 00106 class _OgreExport RenderableListener 00107 { 00108 public: 00109 RenderableListener() {} 00110 virtual ~RenderableListener() {} 00111 00131 virtual bool renderableQueued(Renderable* rend, uint8 groupID, 00132 ushort priority, Technique** ppTech, RenderQueue* pQueue) = 0; 00133 }; 00134 protected: 00135 RenderQueueGroupMap mGroups; 00137 uint8 mDefaultQueueGroup; 00139 ushort mDefaultRenderablePriority; 00140 00141 bool mSplitPassesByLightingType; 00142 bool mSplitNoShadowPasses; 00143 bool mShadowCastersCannotBeReceivers; 00144 00145 RenderableListener* mRenderableListener; 00146 public: 00147 RenderQueue(); 00148 virtual ~RenderQueue(); 00149 00154 void clear(bool destroyPassMaps = false); 00155 00161 RenderQueueGroup* getQueueGroup(uint8 qid); 00162 00185 void addRenderable(Renderable* pRend, uint8 groupID, ushort priority); 00186 00204 void addRenderable(Renderable* pRend, uint8 groupId); 00205 00218 void addRenderable(Renderable* pRend); 00219 00223 uint8 getDefaultQueueGroup(void) const; 00224 00229 void setDefaultRenderablePriority(ushort priority); 00230 00234 ushort getDefaultRenderablePriority(void) const; 00235 00240 void setDefaultQueueGroup(uint8 grp); 00241 00243 QueueGroupIterator _getQueueGroupIterator(void); 00244 ConstQueueGroupIterator _getQueueGroupIterator(void) const; 00245 00249 void setSplitPassesByLightingType(bool split); 00250 00254 bool getSplitPassesByLightingType(void) const; 00255 00260 void setSplitNoShadowPasses(bool split); 00261 00266 bool getSplitNoShadowPasses(void) const; 00267 00271 void setShadowCastersCannotBeReceivers(bool ind); 00272 00276 bool getShadowCastersCannotBeReceivers(void) const; 00277 00283 void setRenderableListener(RenderableListener* listener) 00284 { mRenderableListener = listener; } 00285 00286 RenderableListener* getRenderableListener(void) const 00287 { return mRenderableListener; } 00288 00291 void merge( const RenderQueue* rhs ); 00297 void processVisibleObject(MovableObject* mo, 00298 Camera* cam, 00299 bool onlyShadowCasters, 00300 VisibleObjectsBoundsInfo* visibleBounds); 00301 00302 }; 00303 00307 } 00308 00309 #include "OgreHeaderSuffix.h" 00310 00311 #endif
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Mon Jul 27 2020 13:40:45