Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/ogre_src_v1-9-0/OgreMain/include/OgreHardwareOcclusionQuery.h @ 148

Last change on this file since 148 was 148, checked in by patricwi, 6 years ago

Added new dependencies for ogre1.9 and cegui0.8

File size: 4.0 KB
Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4    (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org
6
7Copyright (c) 2000-2013 Torus Knot Software Ltd
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE SOFTWARE.
26-----------------------------------------------------------------------------
27*/
28#ifndef _HardwareOcclusionQuery__
29#define _HardwareOcclusionQuery__
30
31// Precompiler options
32#include "OgrePrerequisites.h"
33
34namespace Ogre {
35
36
37
38        /** \addtogroup Core
39        *  @{
40        */
41        /** \addtogroup RenderSystem
42        *  @{
43        */
44/**
45  * This is a abstract class that that provides the interface for the query class for
46  * hardware occlusion.
47  *
48  * @author Lee Sandberg
49  * Updated on 13/8/2005 by Tuan Kuranes email: tuan.kuranes@free.fr
50  */
51        class _OgreExport HardwareOcclusionQuery : public RenderSysAlloc
52{
53//----------------------------------------------------------------------
54// Public methods
55//--
56public:
57        /**
58          * Object public member functions
59          */
60
61        /**
62          * Default object constructor
63          *
64          */
65        HardwareOcclusionQuery();
66
67        /**
68          * Object destructor
69          */
70        virtual ~HardwareOcclusionQuery();
71
72        /**
73          * Starts the hardware occlusion query
74          * @remarks    Simple usage: Create one or more OcclusionQuery object one per outstanding query or one per tested object
75          *                             OcclusionQuery* mOcclusionQuery;
76          *                             createOcclusionQuery( &mOcclusionQuery );
77          *                             In the rendering loop:
78          *                             Draw all occluders
79          *                             mOcclusionQuery->startOcclusionQuery();
80          *                             Draw the polygons to be tested
81          *                             mOcclusionQuery->endOcclusionQuery();
82          *
83          *                             Results must be pulled using:
84          *                             UINT    mNumberOfPixelsVisable;
85          *                             pullOcclusionQuery( &mNumberOfPixelsVisable );
86          *                     
87          */
88        virtual void beginOcclusionQuery() = 0;
89
90        /**
91          * Ends the hardware occlusion test
92          */
93        virtual void endOcclusionQuery() = 0;
94
95        /**
96      * Pulls the hardware occlusion query.
97          * @note Waits until the query result is available; use isStillOutstanding
98          *             if just want to test if the result is available.
99      * @retval NumOfFragments will get the resulting number of fragments.
100      * @return True if success or false if not.
101      */
102        virtual bool pullOcclusionQuery(unsigned int* NumOfFragments) = 0;
103
104        /**
105          * Let's you get the last pixel count with out doing the hardware occlusion test
106          * @return The last fragment count from the last test.
107          * Remarks This function won't give you new values, just the old value.
108          */
109        unsigned int getLastQuerysPixelcount() const { return mPixelCount; }
110
111        /**
112          * Lets you know when query is done, or still be processed by the Hardware
113          * @return true if query isn't finished.
114          */
115         virtual bool isStillOutstanding(void) = 0; 
116
117
118    //----------------------------------------------------------------------
119    // protected members
120    //--
121    protected :
122        /// Number of visible pixels determined by last query
123        unsigned int mPixelCount;
124        /// Has the query returned a result yet?
125                bool             mIsQueryResultStillOutstanding;
126};
127
128        /** @} */
129        /** @} */
130}
131#endif
132
Note: See TracBrowser for help on using the repository browser.