1 | /* |
---|
2 | ----------------------------------------------------------------------------- |
---|
3 | This source file is part of OGRE |
---|
4 | (Object-oriented Graphics Rendering Engine) |
---|
5 | For the latest info, see http://www.ogre3d.org/ |
---|
6 | |
---|
7 | Copyright (c) 2000-2013 Torus Knot Software Ltd |
---|
8 | |
---|
9 | Permission is hereby granted, free of charge, to any person obtaining a copy |
---|
10 | of this software and associated documentation files (the "Software"), to deal |
---|
11 | in the Software without restriction, including without limitation the rights |
---|
12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
---|
13 | copies of the Software, and to permit persons to whom the Software is |
---|
14 | furnished to do so, subject to the following conditions: |
---|
15 | |
---|
16 | The above copyright notice and this permission notice shall be included in |
---|
17 | all copies or substantial portions of the Software. |
---|
18 | |
---|
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
---|
20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
---|
21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
---|
22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
---|
23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
---|
24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
---|
25 | THE SOFTWARE. |
---|
26 | ----------------------------------------------------------------------------- |
---|
27 | */ |
---|
28 | #ifndef __RenderQueueListener_H__ |
---|
29 | #define __RenderQueueListener_H__ |
---|
30 | |
---|
31 | #include "OgrePrerequisites.h" |
---|
32 | #include "OgreRenderQueue.h" |
---|
33 | |
---|
34 | namespace Ogre { |
---|
35 | |
---|
36 | /** \addtogroup Core |
---|
37 | * @{ |
---|
38 | */ |
---|
39 | /** \addtogroup RenderSystem |
---|
40 | * @{ |
---|
41 | */ |
---|
42 | /** Abstract interface which classes must implement if they wish to receive |
---|
43 | events from the render queue. |
---|
44 | @remarks |
---|
45 | The OGRE render queue is divided into several queue groups, as defined by |
---|
46 | uint8. A class may implement this interface, and register itself |
---|
47 | as a listener by calling SceneManager::addRenderQueueListener. After doing so, |
---|
48 | the class will receive an event before and after each queue group is sent to |
---|
49 | the rendering system. |
---|
50 | @par |
---|
51 | The event listeners have an option to make a queue either be skipped, or to repeat. |
---|
52 | Note that if multiple listeners are registered, the one registered last has the final |
---|
53 | say, although options set by previous listeners will not be changed if the latest |
---|
54 | does not express a preference. |
---|
55 | */ |
---|
56 | class _OgreExport RenderQueueListener |
---|
57 | { |
---|
58 | public: |
---|
59 | virtual ~RenderQueueListener() {} |
---|
60 | |
---|
61 | /** Event raised before all render queues are processed. |
---|
62 | */ |
---|
63 | virtual void preRenderQueues() {} |
---|
64 | /** Event raised after all render queues are processed. |
---|
65 | */ |
---|
66 | virtual void postRenderQueues() {} |
---|
67 | |
---|
68 | /** Event raised before a queue group is rendered. |
---|
69 | @remarks |
---|
70 | This method is called by the SceneManager before each queue group is |
---|
71 | rendered. |
---|
72 | @param queueGroupId The id of the queue group which is about to be rendered |
---|
73 | @param invocation Name of the invocation which is causing this to be |
---|
74 | called (@see RenderQueueInvocation) |
---|
75 | @param skipThisInvocation A boolean passed by reference which is by default set to |
---|
76 | false. If the event sets this to true, the queue will be skipped and not |
---|
77 | rendered. Note that in this case the renderQueueEnded event will not be raised |
---|
78 | for this queue group. |
---|
79 | */ |
---|
80 | virtual void renderQueueStarted(uint8 queueGroupId, const String& invocation, |
---|
81 | bool& skipThisInvocation) |
---|
82 | { (void)queueGroupId; (void)invocation; (void)skipThisInvocation; } |
---|
83 | |
---|
84 | /** Event raised after a queue group is rendered. |
---|
85 | @remarks |
---|
86 | This method is called by the SceneManager after each queue group is |
---|
87 | rendered. |
---|
88 | @param queueGroupId The id of the queue group which has just been rendered |
---|
89 | @param invocation Name of the invocation which is causing this to be |
---|
90 | called (@see RenderQueueInvocation) |
---|
91 | @param repeatThisInvocation A boolean passed by reference which is by default set to |
---|
92 | false. If the event sets this to true, the queue which has just been |
---|
93 | rendered will be repeated, and the renderQueueStarted and renderQueueEnded |
---|
94 | events will also be fired for it again. |
---|
95 | */ |
---|
96 | virtual void renderQueueEnded(uint8 queueGroupId, const String& invocation, |
---|
97 | bool& repeatThisInvocation) |
---|
98 | { (void)queueGroupId; (void)invocation; (void)repeatThisInvocation; } |
---|
99 | }; |
---|
100 | /** @} */ |
---|
101 | /** @} */ |
---|
102 | |
---|
103 | } |
---|
104 | |
---|
105 | #endif |
---|
106 | |
---|