Orxonox  0.0.5 Codename: Arcturus
RenderQueueListener.h
Go to the documentation of this file.
1 /*
2  * ORXONOX - the hottest 3D action shooter ever to exist
3  * > www.orxonox.net <
4  *
5  *
6  * License notice:
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  * Author:
23  * David 'davidsa' Salvisberg
24  * Co-authors:
25  * ...
26  *
27  */
28 
34 #ifndef _ORenderQueueListener_H__
35 #define _ORenderQueueListener_H__
36 
37 #include "OrxonoxPrereqs.h"
38 
39 #include <OgreRenderQueueListener.h>
40 #include <OgreHardwareOcclusionQuery.h>
41 
42 namespace orxonox
43 {
45  {
46  RENDER_QUEUE_MAIN = Ogre::RENDER_QUEUE_MAIN, //reference to the main render queue
49  RENDER_QUEUE_STENCIL_LAST = RENDER_QUEUE_STENCIL_GLOW, //this is a reference to the last render queue to be affected by stencil glow effects
50  RENDER_QUEUE_HOQ = RENDER_QUEUE_STENCIL_LAST+1 //this is where we render the objects for occlusion queries (use transparent material)
51  };
52 
53  constexpr int STENCIL_VALUE_FOR_GLOW = 1;
54  constexpr int STENCIL_FULL_MASK = 0xFFFFFFFF;
56 
65  class _OrxonoxExport RenderQueueListener : public Ogre::RenderQueueListener
66  {
67  public:
70 
78  unsigned int getPixelCount();
79 
86  virtual void renderQueueStarted(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& skipThisInvocation) override;
93  virtual void renderQueueEnded(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& repeatThisInvocation) override;
94 
95  private:
96  Ogre::HardwareOcclusionQuery* hardwareOcclusionQuery_;
97  unsigned int pixelCount_;
98 
99  enum class PixelState
100  {
101  READY_FOR_RENDER,
102  QUERY_STARTED,
103  READY_FOR_ACCESS
104  };
105 
107  };
108 }
109 
110 #endif /* _ORenderQueueListener_H__ */
unsigned int pixelCount_
this stores the last pixel count returned by the last HOQ in the corresponding render group ...
Definition: RenderQueueListener.h:97
Ogre::HardwareOcclusionQuery * hardwareOcclusionQuery_
this stores the current instance of the HOQ used in the render system
Definition: RenderQueueListener.h:96
Definition: RenderQueueListener.h:46
constexpr int STENCIL_VALUE_FOR_GLOW
this is a reference value for our mask,
Definition: RenderQueueListener.h:53
PixelState pixelState_
this stores the current state of the Hardware Occlusion Query
Definition: RenderQueueListener.h:106
Definition: RenderQueueListener.h:48
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Definition: RenderQueueListener.h:47
Shared library macros, enums, constants and forward declarations for the orxonox library ...
PixelState
< enum to distinguish the several HOQ pixel count states
Definition: RenderQueueListener.h:99
#define _OrxonoxExport
Definition: OrxonoxPrereqs.h:60
Definition: RenderQueueListener.h:50
This class derives from the Ogre-Class RenderQueueListener and provides a way to define new rendering...
Definition: RenderQueueListener.h:65
RenderQueueGroupID
< these are IDs for render queues that are executed just after the main render queue defined by Ogre...
Definition: RenderQueueListener.h:44
constexpr int STENCIL_FULL_MASK
this is a reference mask used in our stencil buffer
Definition: RenderQueueListener.h:55
Definition: RenderQueueListener.h:49