[692] | 1 | /*
|
---|
| 2 | -----------------------------------------------------------------------------
|
---|
| 3 | This source file is part of OGRE
|
---|
| 4 | (Object-oriented Graphics Rendering Engine)
|
---|
| 5 | For the latest info, see http://ogre.sourceforge.net/
|
---|
| 6 |
|
---|
| 7 | Copyright (c) 2000-2005 The OGRE Team
|
---|
| 8 | Also see acknowledgements in Readme.html
|
---|
| 9 |
|
---|
| 10 | This program is free software; you can redistribute it and/or modify it under
|
---|
| 11 | the terms of the GNU Lesser General Public License as published by the Free Software
|
---|
| 12 | Foundation; either version 2 of the License, or (at your option) any later
|
---|
| 13 | version.
|
---|
| 14 |
|
---|
| 15 | This program is distributed in the hope that it will be useful, but WITHOUT
|
---|
| 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
| 17 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
---|
| 18 |
|
---|
| 19 | You should have received a copy of the GNU Lesser General Public License along with
|
---|
| 20 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
---|
| 21 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to
|
---|
| 22 | http://www.gnu.org/copyleft/lesser.txt.
|
---|
| 23 | -----------------------------------------------------------------------------
|
---|
| 24 | */
|
---|
| 25 |
|
---|
| 26 | #ifndef _D3D9HARWAREOCCLUSIONQUERY_H__
|
---|
| 27 | #define _D3D9HARWAREOCCLUSIONQUERY_H__
|
---|
| 28 |
|
---|
| 29 | #include "OgreD3D9Prerequisites.h"
|
---|
| 30 | #include "OgreHardwareOcclusionQuery.h"
|
---|
| 31 |
|
---|
| 32 |
|
---|
| 33 | namespace Ogre {
|
---|
| 34 |
|
---|
| 35 | // If you use multiple rendering passes you can test only the first pass and all other passes don't have to be rendered
|
---|
| 36 | // if the first pass results has too few pixels visible.
|
---|
| 37 |
|
---|
| 38 | // Be sure to render all occluder first and whats out so the RenderQue don't switch places on
|
---|
| 39 | // the occluding objects and the tested objects because it thinks it's more effective..
|
---|
| 40 |
|
---|
| 41 | /**
|
---|
| 42 | * This is a class that is the DirectX9 implementation of
|
---|
| 43 | * hardware occlusion testing.
|
---|
| 44 | *
|
---|
| 45 | * @author Lee Sandberg, email lee@abcmedia.se
|
---|
| 46 | *
|
---|
| 47 | * Updated on 12/7/2004 by Chris McGuirk
|
---|
| 48 | * Updated on 4/8/2005 by Tuan Kuranes email: tuan.kuranes@free.fr
|
---|
| 49 | */
|
---|
| 50 | class D3D9HardwareOcclusionQuery : public HardwareOcclusionQuery
|
---|
| 51 | {
|
---|
| 52 | //----------------------------------------------------------------------
|
---|
| 53 | // Public methods
|
---|
| 54 | //--
|
---|
| 55 | public:
|
---|
| 56 |
|
---|
| 57 | /**
|
---|
| 58 | * Default object constructor
|
---|
| 59 | *
|
---|
| 60 | */
|
---|
| 61 | D3D9HardwareOcclusionQuery( IDirect3DDevice9* pD3DDevice );
|
---|
| 62 |
|
---|
| 63 | /**
|
---|
| 64 | * Object destructor
|
---|
| 65 | */
|
---|
| 66 | ~D3D9HardwareOcclusionQuery();
|
---|
| 67 |
|
---|
| 68 | //------------------------------------------------------------------
|
---|
| 69 | // Occlusion query functions (see base class documentation for this)
|
---|
| 70 | //--
|
---|
| 71 |
|
---|
| 72 | void beginOcclusionQuery();
|
---|
| 73 | void endOcclusionQuery();
|
---|
| 74 | bool pullOcclusionQuery( unsigned int* NumOfFragments);
|
---|
| 75 | unsigned int getLastQuerysPixelcount() { return mPixelCount; }
|
---|
| 76 | bool isStillOutstanding(void);
|
---|
| 77 |
|
---|
| 78 |
|
---|
| 79 |
|
---|
| 80 | //----------------------------------------------------------------------
|
---|
| 81 | // private members
|
---|
| 82 | //--
|
---|
| 83 | private:
|
---|
| 84 | IDirect3DQuery9* mpQuery;
|
---|
| 85 | IDirect3DDevice9* mpDevice;
|
---|
| 86 | };
|
---|
| 87 |
|
---|
| 88 |
|
---|
| 89 | }
|
---|
| 90 |
|
---|
| 91 |
|
---|
| 92 | #endif
|
---|