Changeset 99 for trunk/VUT/work/ogre_changes/RenderSystems
- Timestamp:
- 05/15/05 04:08:02 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/ogre_changes/RenderSystems/GL/src/OgreGLHardwareOcclusionQuery.cpp
r97 r99 161 161 162 162 // Check for hardware occlusion support 163 // if( glDeleteOcclusionQueriesNV_ptr != 0 ) // This is a hack to see if hw occlusion is supported. pointer is 0 if it's not supported.164 if( glDeleteQueriesARB_ptr != 0 )163 if ( glDeleteOcclusionQueriesNV_ptr != 0 ) // This is a hack to see if hw occlusion is supported. pointer is 0 if it's not supported. 164 //if ( glDeleteQueriesARB_ptr != 0 ) 165 165 { 166 166 m_bHWOcclusionSupport = true; … … 171 171 } 172 172 173 if ( m_bHWOcclusionSupport )174 { 175 //glGenOcclusionQueriesNV_ptr( 1, m_uintQuery );176 glGenQueriesARB_ptr(1, m_uintQuery);173 if ( m_bHWOcclusionSupport ) 174 { 175 glGenOcclusionQueriesNV_ptr( 1, m_uintQuery ); 176 //glGenQueriesARB_ptr(1, m_uintQuery); 177 177 } 178 178 } … … 182 182 GLHardwareOcclusionQuery::~GLHardwareOcclusionQuery() 183 183 { 184 if ( m_bHWOcclusionSupport )185 { 186 //glDeleteOcclusionQueriesNV_ptr( 1, &m_uintQuery[0] );187 glDeleteQueriesARB_ptr(1, &m_uintQuery[0]);184 if ( m_bHWOcclusionSupport ) 185 { 186 glDeleteOcclusionQueriesNV_ptr( 1, &m_uintQuery[0] ); 187 //glDeleteQueriesARB_ptr(1, &m_uintQuery[0]); 188 188 } 189 189 } … … 192 192 void GLHardwareOcclusionQuery::beginOcclusionQuery() 193 193 { 194 if ( m_bHWOcclusionSupport ) // Make it fail silently if hardware occlusion isn't supported194 if ( m_bHWOcclusionSupport ) // Make it fail silently if hardware occlusion isn't supported 195 195 { 196 196 // do the actual occlusion query for this node 197 //glBeginOcclusionQueryNV_ptr( m_uintQuery[0] );198 glBeginQueryARB_ptr(GL_SAMPLES_PASSED_ARB, m_uintQuery[0]);197 glBeginOcclusionQueryNV_ptr( m_uintQuery[0] ); 198 //glBeginQueryARB_ptr(GL_SAMPLES_PASSED_ARB, m_uintQuery[0]); 199 199 } 200 200 } … … 202 202 void GLHardwareOcclusionQuery::endOcclusionQuery() 203 203 { 204 if ( m_bHWOcclusionSupport ) // Make it fail silently if hardware occlusion isn't supported205 { 206 //glEndOcclusionQueryNV_ptr();207 glEndQueryARB_ptr(GL_SAMPLES_PASSED_ARB);204 if ( m_bHWOcclusionSupport ) // Make it fail silently if hardware occlusion isn't supported 205 { 206 glEndOcclusionQueryNV_ptr(); 207 //glEndQueryARB_ptr(GL_SAMPLES_PASSED_ARB); 208 208 } 209 209 } … … 211 211 bool GLHardwareOcclusionQuery::pullOcclusionQuery( unsigned int * NumOfFragments, const bool waitForResult) 212 212 { 213 //unsigned int isAvailable = GL_TRUE;214 int isAvailable = GL_TRUE;213 unsigned int isAvailable = GL_TRUE; 214 //int isAvailable = GL_TRUE; 215 215 216 216 if( m_bHWOcclusionSupport ) 217 217 { 218 if (!waitForResult)219 { 220 //glGetOcclusionQueryuivNV_ptr( m_uintQuery[0], GL_PIXEL_COUNT_AVAILABLE_NV, &isAvailable );221 glGetQueryivARB_ptr(m_uintQuery[0], GL_QUERY_RESULT_AVAILABLE_ARB, &isAvailable);222 } 223 224 if (isAvailable == GL_TRUE)225 { 226 glGet QueryObjectuivARB_ptr( m_uintQuery[0], GL_QUERY_RESULT_ARB, NumOfFragments);227 //glGet OcclusionQueryuivNV_ptr( m_uintQuery[0], GL_PIXEL_COUNT_NV, NumOfFragments);218 if (!waitForResult) 219 { 220 glGetOcclusionQueryuivNV_ptr( m_uintQuery[0], GL_PIXEL_COUNT_AVAILABLE_NV, &isAvailable ); 221 //glGetQueryivARB_ptr(m_uintQuery[0], GL_QUERY_RESULT_AVAILABLE_ARB, &isAvailable); 222 } 223 224 if (isAvailable == GL_TRUE) 225 { 226 glGetOcclusionQueryuivNV_ptr( m_uintQuery[0], GL_PIXEL_COUNT_NV, NumOfFragments ); 227 //glGetQueryObjectuivARB_ptr( m_uintQuery[0], GL_QUERY_RESULT_ARB, NumOfFragments); 228 228 } 229 229 }
Note: See TracChangeset
for help on using the changeset viewer.