Ignore:
Timestamp:
01/03/08 15:53:44 (17 years ago)
Author:
bittner
Message:

big merge: preparation for havran ray caster, check if everything works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/OcclusionQuery.cpp

    r2023 r2575  
    11#include "OcclusionQuery.h" 
    22#include <iostream> 
     3 
     4 
     5#ifdef _WIN32 
    36#include <glInterface.h> 
    4  
     7#else 
     8#include <GL/gl.h> 
     9#include <GL/glu.h> 
     10//#include <GL/glxext.h> 
     11#include <SDL/SDL_opengl.h> 
     12#endif 
    513 
    614using namespace std; 
     
    1725        if (sUseArbQueries) 
    1826        { 
    19                 glGenQueriesARB(1, &id); 
     27#ifdef _ARBGL 
     28          // VH 
     29          glGenQueriesARB(1, &id); 
     30#endif 
    2031        } 
    2132        else 
    2233        {                
     34#ifdef _ARBGL 
     35          // VH 
    2336                glGenOcclusionQueriesNV(1, &id); 
     37#endif 
    2438        } 
    2539} 
     
    3448        if (sUseArbQueries) 
    3549        { 
     50#ifdef _ARBGL 
     51          // VH 
    3652                glDeleteQueriesARB(1, &mId); 
     53#endif 
    3754        } 
    3855        else 
    3956        { 
     57#ifdef _ARBGL 
     58          // VH 
    4059                glDeleteOcclusionQueriesNV(1, &mId); 
     60#endif 
    4161        } 
    4262         
     
    4767        if (sUseArbQueries) 
    4868        { 
     69#ifdef _ARBGL 
     70          // VH 
    4971                glBeginQueryARB(GL_SAMPLES_PASSED_ARB, mId); 
     72#endif 
    5073        } 
    5174        else 
    5275        { 
     76#ifdef _ARBGL 
     77          // VH 
    5378                glBeginOcclusionQueryNV(mId); 
     79#endif 
    5480        } 
    5581} 
     
    5985        if (sUseArbQueries) 
    6086        { 
     87#ifdef _ARBGL 
     88          // VH 
    6189                glEndQueryARB(GL_SAMPLES_PASSED_ARB); 
     90#endif 
    6291        } 
    6392        else 
    6493        { 
     94#ifdef _ARBGL 
     95          // VH 
    6596                glEndOcclusionQueryNV();         
     97#endif 
    6698        } 
    6799} 
     
    79111        if (sUseArbQueries) 
    80112        { 
     113#ifdef _ARBGL 
     114          // VH 
    81115                //GLint available; 
    82116                glGetQueryObjectuivARB(mId, 
    83117                                                           GL_QUERY_RESULT_AVAILABLE_ARB, 
    84                                &available); 
     118                                       &available); 
     119#endif           
    85120                return available == GL_TRUE; 
    86121        } 
    87122        else 
    88123        { 
    89                  
    90                 glGetOcclusionQueryuivNV(mId, GL_PIXEL_COUNT_AVAILABLE_NV, &available); 
    91  
     124#ifdef _ARBGL 
     125          // VH 
     126          glGetOcclusionQueryuivNV(mId, GL_PIXEL_COUNT_AVAILABLE_NV, &available); 
     127#endif 
    92128                return available == GL_TRUE; 
    93129        } 
     
    102138        if (sUseArbQueries) 
    103139        { 
     140#ifdef _ARBGL 
     141          // VH 
    104142                glGetQueryObjectuivARB(mId, GL_QUERY_RESULT_ARB, &sampleCount); 
     143#endif 
    105144                return sampleCount; 
    106145        } 
    107146        else 
    108147        {        
    109  
     148#ifdef _ARBGL 
     149          // VH 
    110150                glGetOcclusionQueryuivNV(mId, GL_PIXEL_COUNT_NV, &sampleCount); 
     151#endif           
    111152                return sampleCount; 
    112153        }        
     
    124165                if (sUseArbQueries) 
    125166                { 
     167#ifdef _ARBGL 
     168          // VH 
    126169                        glGenQueriesARB(n, (unsigned int *)newQueries); 
     170#endif 
    127171                } 
    128172                else 
    129173                { 
    130                         glGenOcclusionQueriesNV(n, (unsigned int *)newQueries); 
     174#ifdef _ARBGL 
     175          // VH            
     176                  glGenOcclusionQueriesNV(n, (unsigned int *)newQueries); 
     177#endif             
    131178                } 
    132179 
Note: See TracChangeset for help on using the changeset viewer.