| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /****************************************************************************** 00002 * VRS - The Virtual Rendering System 00003 * Copyright (C) 2000-2004 Computer Graphics Systems Group at the 00004 * Hasso-Plattner-Institute (HPI), Potsdam, Germany. 00005 * 00006 * This library is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU Lesser General Public License as published by 00008 * the Free Software Foundation; either version 2.1 of the License, or (at 00009 * your option) any later version. This library is distributed in the hope 00010 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 00011 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Lesser General Public License for more details. You should have received 00013 * a copy of the GNU Lesser+ General Public License along with this library; if 00014 * not, write to the FreeSoftware Foundation, Inc., 59 Temple Place, Suite 330, 00015 * Boston, MA, 02111-1307, USA. 00016 ******************************************************************************/ 00017 00018 // $Id: occlusionquerygl.h 6701 2009-09-18 13:16:54Z Matthias_Trapp $ 00019 // $Date: 2009-09-18 15:16:54 +0200 (Fri, 18 Sep 2009) $ 00020 // $Revision: 6701 $ 00021 // $State$ 00022 // $Author: Matthias_Trapp $ 00023 // 00024 // $Log$ 00025 // Revision 1.17 2005/01/03 01:43:09 klimetschek 00026 // - modified win32 project layout, splitted vrs.vcproj into vrs_container, vrs_core, vrs_sg, vrs_image, vrs_opengl and vrs_io 00027 // - removed vrs.vcproj 00028 // minor things: 00029 // - added all glutexamples to vrs4glut.sln 00030 // - fixed some problems in glutexamples 00031 // - removed all project references from all VS projects (using solution wide project dependencies instead) 00032 // 00033 // Revision 1.16 2004/11/03 14:45:06 saar 00034 // Class comment changed (Doxygen style) 00035 // 00036 // Revision 1.15 2004/09/11 12:45:40 baumann 00037 // now using OpenGL 1.5, ARB or NV versions of occlusion query interface 00038 // 00039 // Revision 1.14 2004/07/04 15:15:36 kirsch 00040 // iVRS fixes 00041 // 00042 // Revision 1.13 2004/03/12 16:28:40 baumann 00043 // macros VRS_NAMESPACE_BEGIN/_END expanded and removed 00044 // 00045 // Revision 1.12 2004/02/19 11:44:16 kirsch 00046 // fixed comments 00047 // 00048 // Revision 1.11 2004/02/19 07:53:10 baumann 00049 // OcclusionQueryGL completely rewritten 00050 // 00051 // Revision 1.10 2004/01/19 11:43:58 baumann 00052 // serialization mechanism improved 00053 // 00054 // Revision 1.9 2004/01/19 07:28:02 baumann 00055 // serialization mechanism improved 00056 // 00057 // Revision 1.8 2003/11/07 14:19:25 kirsch 00058 // removed leading underscore from include guards 00059 // 00060 // Revision 1.7 2003/07/23 17:04:49 baumann 00061 // code cleanup (especially untabified) 00062 // 00063 // Revision 1.6 2002/09/03 12:46:44 kirsch 00064 // if NV_occlusion_query is not supported, fragmentCount() returns UINT(-1) 00065 // 00066 // Revision 1.5 2002/09/03 11:51:44 kirsch 00067 // added FragmentCount mode 00068 // 00069 // Revision 1.4 2002/05/15 08:26:14 baumann 00070 // comments added 00071 // flag for "self-nesting-detection" added 00072 // 00073 // Revision 1.3 2002/05/10 12:36:45 kirsch 00074 // fixed friend declaration 00075 // 00076 // Revision 1.2 2002/05/10 11:24:47 baumann 00077 // renamed isOccluded() to zTestPassed() 00078 // 00079 // Revision 1.1 2002/05/10 09:53:54 baumann 00080 // OcclusionQueryGL added 00081 // 00082 00083 #ifndef VRS_OPENGL_OCCLUSIONQUERYGL_H 00084 #define VRS_OPENGL_OCCLUSIONQUERYGL_H 00085 00086 #include <vrs/monoattribute.h> 00087 00088 namespace VRS { 00089 00090 class OcclusionQueryPainterGL; 00091 00093 class VRS_CORE_API OcclusionQueryGL : public MonoAttribute { 00094 public: 00095 enum QueryMode { QM_ImmediateMode, QM_DelayedMode }; 00096 VRS_SERIALIZABLE_CLASS_ENUM(QueryMode); 00097 00098 OcclusionQueryGL(QueryMode mode = OcclusionQueryGL::QM_ImmediateMode); 00115 virtual ~OcclusionQueryGL(); 00116 00117 bool isSupported() const; 00122 bool isAvailable() const; 00128 unsigned int fragmentCount() const; 00134 inline unsigned int getQueryID(void) const 00135 { 00136 return this->m_queryID; 00137 } 00138 00139 VRS_TYPEINFO(OcclusionQueryGL, MonoAttribute); 00140 00141 enum SupportedVersion { SV_OGL15, SV_ARB, SV_NV, SV_NotSupported }; 00142 00143 private: 00144 friend class OcclusionQueryPainterGL; 00145 00146 QueryMode m_queryMode; 00147 mutable unsigned int m_fragmentCount; 00148 mutable unsigned int m_queryID; 00149 00150 mutable SupportedVersion m_supportedVersion; 00151 mutable bool m_isAvailable; 00152 mutable bool m_inUse; 00153 }; 00154 00155 } // namespace VRS 00156 00157 #endif // VRS_OPENGL_OCCLUSIONQUERYGL_H