Changeset 2575 for GTP/trunk/Lib/Vis/Preprocessing/src/OcclusionQuery.cpp
- Timestamp:
- 01/03/08 15:53:44 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/OcclusionQuery.cpp
r2023 r2575 1 1 #include "OcclusionQuery.h" 2 2 #include <iostream> 3 4 5 #ifdef _WIN32 3 6 #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 5 13 6 14 using namespace std; … … 17 25 if (sUseArbQueries) 18 26 { 19 glGenQueriesARB(1, &id); 27 #ifdef _ARBGL 28 // VH 29 glGenQueriesARB(1, &id); 30 #endif 20 31 } 21 32 else 22 33 { 34 #ifdef _ARBGL 35 // VH 23 36 glGenOcclusionQueriesNV(1, &id); 37 #endif 24 38 } 25 39 } … … 34 48 if (sUseArbQueries) 35 49 { 50 #ifdef _ARBGL 51 // VH 36 52 glDeleteQueriesARB(1, &mId); 53 #endif 37 54 } 38 55 else 39 56 { 57 #ifdef _ARBGL 58 // VH 40 59 glDeleteOcclusionQueriesNV(1, &mId); 60 #endif 41 61 } 42 62 … … 47 67 if (sUseArbQueries) 48 68 { 69 #ifdef _ARBGL 70 // VH 49 71 glBeginQueryARB(GL_SAMPLES_PASSED_ARB, mId); 72 #endif 50 73 } 51 74 else 52 75 { 76 #ifdef _ARBGL 77 // VH 53 78 glBeginOcclusionQueryNV(mId); 79 #endif 54 80 } 55 81 } … … 59 85 if (sUseArbQueries) 60 86 { 87 #ifdef _ARBGL 88 // VH 61 89 glEndQueryARB(GL_SAMPLES_PASSED_ARB); 90 #endif 62 91 } 63 92 else 64 93 { 94 #ifdef _ARBGL 95 // VH 65 96 glEndOcclusionQueryNV(); 97 #endif 66 98 } 67 99 } … … 79 111 if (sUseArbQueries) 80 112 { 113 #ifdef _ARBGL 114 // VH 81 115 //GLint available; 82 116 glGetQueryObjectuivARB(mId, 83 117 GL_QUERY_RESULT_AVAILABLE_ARB, 84 &available); 118 &available); 119 #endif 85 120 return available == GL_TRUE; 86 121 } 87 122 else 88 123 { 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 92 128 return available == GL_TRUE; 93 129 } … … 102 138 if (sUseArbQueries) 103 139 { 140 #ifdef _ARBGL 141 // VH 104 142 glGetQueryObjectuivARB(mId, GL_QUERY_RESULT_ARB, &sampleCount); 143 #endif 105 144 return sampleCount; 106 145 } 107 146 else 108 147 { 109 148 #ifdef _ARBGL 149 // VH 110 150 glGetOcclusionQueryuivNV(mId, GL_PIXEL_COUNT_NV, &sampleCount); 151 #endif 111 152 return sampleCount; 112 153 } … … 124 165 if (sUseArbQueries) 125 166 { 167 #ifdef _ARBGL 168 // VH 126 169 glGenQueriesARB(n, (unsigned int *)newQueries); 170 #endif 127 171 } 128 172 else 129 173 { 130 glGenOcclusionQueriesNV(n, (unsigned int *)newQueries); 174 #ifdef _ARBGL 175 // VH 176 glGenOcclusionQueriesNV(n, (unsigned int *)newQueries); 177 #endif 131 178 } 132 179
Note: See TracChangeset
for help on using the changeset viewer.