Ignore:
Timestamp:
05/15/05 04:08:02 (19 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/work/ogre_changes/RenderSystems/GL/src/OgreGLHardwareOcclusionQuery.cpp

    r97 r99  
    161161 
    162162        // 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 ) 
    165165        { 
    166166                m_bHWOcclusionSupport = true; 
     
    171171        } 
    172172 
    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); 
    177177        } 
    178178} 
     
    182182GLHardwareOcclusionQuery::~GLHardwareOcclusionQuery()  
    183183{  
    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]); 
    188188        }        
    189189} 
     
    192192void GLHardwareOcclusionQuery::beginOcclusionQuery()  
    193193{  
    194         if( m_bHWOcclusionSupport )     // Make it fail silently if hardware occlusion isn't supported 
     194        if ( m_bHWOcclusionSupport )    // Make it fail silently if hardware occlusion isn't supported 
    195195        { 
    196196                // 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]); 
    199199        } 
    200200} 
     
    202202void GLHardwareOcclusionQuery::endOcclusionQuery()  
    203203{  
    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); 
     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); 
    208208        } 
    209209} 
     
    211211bool GLHardwareOcclusionQuery::pullOcclusionQuery( unsigned int * NumOfFragments, const bool waitForResult)  
    212212{ 
    213         //unsigned int isAvailable = GL_TRUE; 
    214         int isAvailable = GL_TRUE; 
     213        unsigned int isAvailable = GL_TRUE; 
     214        //int isAvailable = GL_TRUE; 
    215215 
    216216        if( m_bHWOcclusionSupport )      
    217217        { 
    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                         glGetQueryObjectuivARB_ptr( m_uintQuery[0], GL_QUERY_RESULT_ARB, NumOfFragments); 
    227                         //glGetOcclusionQueryuivNV_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); 
    228228                } 
    229229        }  
Note: See TracChangeset for help on using the changeset viewer.