00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef VL_GL_FUNCTION_WRAPPERS
00033 #define VL_GL_FUNCTION_WRAPPERS
00034
00035 #ifndef VL_UNSUPPORTED_FUNC
00036 #define VL_UNSUPPORTED_FUNC() { Log::error( String().printf("The function \"%s\" is not supported by the current OpenGL implementation! (%s:%d).\n", __FUNCTION__, __FILE__, __LINE__) ); VL_TRAP(); }
00037 #endif
00038
00039 namespace vl
00040 {
00041
00042 inline void VL_glBindBuffer( GLenum target, GLuint buffer )
00043 {
00044 if (glBindBuffer)
00045 glBindBuffer(target,buffer);
00046 else
00047 if (glBindBufferARB)
00048 glBindBufferARB(target,buffer);
00049 else
00050 {
00051 VL_CHECK( buffer == 0 );
00052 }
00053 }
00054
00055 inline void VL_glGenBuffers( GLsizei n, GLuint * buffers)
00056 {
00057 if (glGenBuffers)
00058 glGenBuffers( n, buffers);
00059 else
00060 if (glGenBuffersARB)
00061 glGenBuffersARB( n, buffers);
00062 else
00063 VL_UNSUPPORTED_FUNC();
00064 }
00065
00066 inline void VL_glDeleteBuffers( GLsizei n, const GLuint * buffers)
00067 {
00068 if (glDeleteBuffers)
00069 glDeleteBuffers( n, buffers);
00070 else
00071 if (glDeleteBuffersARB)
00072 glDeleteBuffersARB( n, buffers);
00073 else
00074 VL_UNSUPPORTED_FUNC();
00075 }
00076
00077 inline void VL_glBufferData( GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage)
00078 {
00079 if (glBufferData)
00080 glBufferData( target, size, data, usage);
00081 else
00082 if (glBufferDataARB)
00083 glBufferDataARB( target, size, data, usage);
00084 else
00085 VL_UNSUPPORTED_FUNC();
00086 }
00087
00088 inline void VL_glBufferSubData( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data)
00089 {
00090 if (glBufferSubData)
00091 glBufferSubData( target, offset, size, data );
00092 else
00093 if (glBufferSubDataARB)
00094 glBufferSubDataARB( target, offset, size, data);
00095 else
00096 VL_UNSUPPORTED_FUNC();
00097 }
00098
00099 inline void* VL_glMapBuffer( GLenum target, GLenum access)
00100 {
00101 if (glMapBuffer)
00102 return glMapBuffer( target, access);
00103 else
00104 if (glMapBufferARB)
00105 return glMapBufferARB( target, access);
00106 else
00107 VL_UNSUPPORTED_FUNC();
00108 return 0;
00109 }
00110
00111 inline GLboolean VL_glUnmapBuffer(GLenum target)
00112 {
00113 if (glUnmapBuffer)
00114 return glUnmapBuffer( target );
00115 else
00116 if (glUnmapBufferARB)
00117 return glUnmapBufferARB( target );
00118 else
00119 VL_UNSUPPORTED_FUNC();
00120 return GL_FALSE;
00121 }
00122
00123
00124
00125 inline void VL_glSecondaryColor3f(float r, float g, float b)
00126 {
00127 if(glSecondaryColor3f)
00128 glSecondaryColor3f(r,g,b);
00129 else
00130 if(glSecondaryColor3fEXT)
00131 glSecondaryColor3fEXT(r,g,b);
00132 else
00133 VL_UNSUPPORTED_FUNC();
00134 }
00135
00136 inline void VL_glSecondaryColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
00137 {
00138 if(glSecondaryColorPointer)
00139 glSecondaryColorPointer(size, type, stride, (GLvoid*)pointer);
00140 else
00141 if(glSecondaryColorPointerEXT)
00142 glSecondaryColorPointerEXT(size, type, stride, (GLvoid*)pointer);
00143 else
00144 VL_UNSUPPORTED_FUNC();
00145 }
00146
00147
00148
00149 inline void VL_glFogCoordPointer( GLenum type, GLsizei stride, GLvoid* pointer )
00150 {
00151 if (glFogCoordPointer)
00152 glFogCoordPointer(type,stride,pointer);
00153 else
00154 if (glFogCoordPointerEXT)
00155 glFogCoordPointerEXT(type,stride,pointer);
00156 else
00157 VL_UNSUPPORTED_FUNC();
00158 }
00159
00160
00161
00162 inline void VL_glEnableVertexAttribArray( GLuint index )
00163 {
00164 if (glEnableVertexAttribArray)
00165 glEnableVertexAttribArray(index);
00166 else
00167 if (glEnableVertexAttribArrayARB)
00168 glEnableVertexAttribArrayARB(index);
00169 else
00170 VL_UNSUPPORTED_FUNC();
00171 }
00172
00173 inline void VL_glDisableVertexAttribArray( GLuint index )
00174 {
00175 if (glDisableVertexAttribArray)
00176 glDisableVertexAttribArray(index);
00177 else
00178 if (glDisableVertexAttribArrayARB)
00179 glDisableVertexAttribArrayARB(index);
00180 else
00181 VL_UNSUPPORTED_FUNC();
00182 }
00183
00184
00185
00186 inline void VL_glVertexAttribPointer( GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer)
00187 {
00188 if (glVertexAttribPointer)
00189 glVertexAttribPointer(index, size, type, normalized, stride, pointer);
00190 else
00191 if (glVertexAttribPointerARB)
00192 glVertexAttribPointerARB(index, size, type, normalized, stride, pointer);
00193 else
00194 VL_UNSUPPORTED_FUNC();
00195 }
00196
00197 inline void VL_glVertexAttribIPointer(GLuint name, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
00198 {
00199 if(glVertexAttribIPointer)
00200 glVertexAttribIPointer(name, size, type, stride, pointer);
00201 else
00202 if (glVertexAttribIPointerEXT)
00203 glVertexAttribIPointerEXT(name, size, type, stride, pointer);
00204 else
00205 VL_UNSUPPORTED_FUNC();
00206 }
00207
00208 inline void VL_glVertexAttribLPointer(GLuint name, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
00209 {
00210 if(glVertexAttribLPointer)
00211 glVertexAttribLPointer(name, size, type, stride, pointer);
00212 else
00213 if(glVertexAttribLPointerEXT)
00214 glVertexAttribLPointerEXT(name, size, type, stride, pointer);
00215 else
00216 VL_UNSUPPORTED_FUNC();
00217 }
00218
00219
00220
00221 inline void VL_glClientActiveTexture(GLenum texture)
00222 {
00223 if(glClientActiveTexture)
00224 glClientActiveTexture(texture);
00225 else
00226 if (glClientActiveTextureARB)
00227 glClientActiveTextureARB(texture);
00228 else
00229 {
00230 VL_CHECK(texture == GL_TEXTURE0);
00231 }
00232 }
00233
00234 inline void VL_glActiveTexture(GLenum texture)
00235 {
00236 if(glActiveTexture)
00237 glActiveTexture(texture);
00238 else
00239 if (glActiveTextureARB)
00240 glActiveTextureARB(texture);
00241 else
00242 {
00243 VL_CHECK(texture == GL_TEXTURE0);
00244 }
00245 }
00246
00247
00248
00249 inline void VL_glBlendFuncSeparate( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
00250 {
00251 if (glBlendFuncSeparate)
00252 glBlendFuncSeparate( srcRGB, dstRGB, srcAlpha, dstAlpha);
00253 else
00254 if (glBlendFuncSeparateEXT)
00255 glBlendFuncSeparateEXT( srcRGB, dstRGB, srcAlpha, dstAlpha);
00256 else
00257 VL_UNSUPPORTED_FUNC();
00258 }
00259
00260 inline void VL_glBlendEquationSeparate( GLenum modeRGB, GLenum modeAlpha)
00261 {
00262 if (glBlendEquationSeparate)
00263 glBlendEquationSeparate(modeRGB, modeAlpha);
00264 else
00265 if(glBlendEquationSeparateEXT)
00266 glBlendEquationSeparateEXT(modeRGB, modeAlpha);
00267 else
00268 VL_UNSUPPORTED_FUNC();
00269 }
00270
00271 inline void VL_glBlendEquation(GLenum mode)
00272 {
00273 if (glBlendEquation)
00274 glBlendEquation(mode);
00275 else
00276 if (glBlendEquationEXT)
00277 glBlendEquationEXT(mode);
00278 else
00279 VL_UNSUPPORTED_FUNC();
00280 }
00281
00282 inline void VL_glBlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
00283 {
00284 if(glBlendColor)
00285 glBlendColor(red,green,blue,alpha);
00286 else
00287 if (glBlendColorEXT)
00288 glBlendColorEXT(red,green,blue,alpha);
00289 else
00290 VL_UNSUPPORTED_FUNC();
00291 }
00292
00293
00294
00295 inline void VL_glPointParameterfv( GLenum pname, const GLfloat* params)
00296 {
00297 if (glPointParameterfv)
00298 glPointParameterfv(pname,(GLfloat*)params);
00299 else
00300 if (glPointParameterfvARB)
00301 glPointParameterfvARB(pname,(GLfloat*)params);
00302 else
00303 if (glPointParameterfvEXT)
00304 glPointParameterfvEXT(pname,(GLfloat*)params);
00305 else
00306 VL_UNSUPPORTED_FUNC();
00307 }
00308
00309 inline void VL_glPointParameterf( GLenum pname, GLfloat param)
00310 {
00311 if (glPointParameterf)
00312 glPointParameterf(pname,param);
00313 else
00314 if (glPointParameterfARB)
00315 glPointParameterfARB(pname,param);
00316 else
00317 if (glPointParameterfEXT)
00318 glPointParameterfEXT(pname,param);
00319 else
00320 VL_UNSUPPORTED_FUNC();
00321 }
00322
00323 inline void VL_glPointParameteri( GLenum pname, GLenum param)
00324 {
00325 if (glPointParameteri)
00326 glPointParameteri(pname,param);
00327 else
00328 if (glPointParameteriNV)
00329 glPointParameteriNV(pname,param);
00330 else
00331 VL_UNSUPPORTED_FUNC();
00332 }
00333
00334
00335
00336 inline void VL_glStencilFuncSeparate( GLenum face, GLenum func, GLint ref, GLuint mask)
00337 {
00338 if (glStencilFuncSeparate)
00339 glStencilFuncSeparate( face, func, ref, mask );
00340 else
00341 VL_UNSUPPORTED_FUNC();
00342
00343
00344
00345
00346
00347 }
00348
00349 inline void VL_glStencilOpSeparate( GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass)
00350 {
00351 if (glStencilOpSeparate)
00352 glStencilOpSeparate( face, sfail, dpfail, dppass );
00353 else
00354 VL_UNSUPPORTED_FUNC();
00355
00356
00357
00358
00359
00360 }
00361
00362
00363
00364 inline void VL_glSampleCoverage( GLclampf value, GLboolean invert)
00365 {
00366 if (glSampleCoverage)
00367 glSampleCoverage(value,invert);
00368 else
00369 if (glSampleCoverageARB)
00370 glSampleCoverageARB(value,invert);
00371 else
00372 VL_UNSUPPORTED_FUNC();
00373 }
00374
00375
00376
00377 inline void VL_glBindRenderbuffer(GLenum target, GLuint renderbuffer)
00378 {
00379 if (glBindRenderbuffer)
00380 glBindRenderbuffer(target, renderbuffer);
00381 else
00382 if (glBindRenderbufferEXT)
00383 glBindRenderbufferEXT(target, renderbuffer);
00384 else
00385 VL_UNSUPPORTED_FUNC();
00386 }
00387
00388 inline void VL_glDeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers)
00389 {
00390 if (glDeleteRenderbuffers)
00391 glDeleteRenderbuffers(n, renderbuffers);
00392 else
00393 if (glDeleteRenderbuffersEXT)
00394 glDeleteRenderbuffersEXT(n, renderbuffers);
00395 else
00396 VL_UNSUPPORTED_FUNC();
00397 }
00398
00399 inline void VL_glGenRenderbuffers(GLsizei n, GLuint *renderbuffers)
00400 {
00401 if (glGenRenderbuffers)
00402 glGenRenderbuffers(n, renderbuffers);
00403 else
00404 if (glGenRenderbuffersEXT)
00405 glGenRenderbuffersEXT(n, renderbuffers);
00406 else
00407 VL_UNSUPPORTED_FUNC();
00408 }
00409
00410 inline void VL_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
00411 {
00412 if (glRenderbufferStorage)
00413 glRenderbufferStorage(target, internalformat, width, height);
00414 else
00415 if (glRenderbufferStorageEXT)
00416 glRenderbufferStorageEXT(target, internalformat, width, height);
00417 else
00418 VL_UNSUPPORTED_FUNC();
00419 }
00420
00421 inline void VL_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint *params)
00422 {
00423 if (glGetRenderbufferParameteriv)
00424 glGetRenderbufferParameteriv(target, pname, params);
00425 else
00426 if (glGetRenderbufferParameterivEXT)
00427 glGetRenderbufferParameterivEXT(target, pname, params);
00428 else
00429 VL_UNSUPPORTED_FUNC();
00430 }
00431
00432 inline GLboolean VL_glIsFramebuffer(GLuint framebuffer)
00433 {
00434 if (glIsFramebuffer)
00435 return glIsFramebuffer(framebuffer);
00436 else
00437 if (glIsFramebufferEXT)
00438 return glIsFramebufferEXT(framebuffer);
00439 else
00440 VL_UNSUPPORTED_FUNC();
00441 return GL_FALSE;
00442 }
00443
00444 inline void VL_glBindFramebuffer(GLenum target, GLuint framebuffer)
00445 {
00446 if (glBindFramebuffer)
00447 glBindFramebuffer(target, framebuffer);
00448 else
00449 if (glBindFramebufferEXT)
00450 glBindFramebufferEXT(target, framebuffer);
00451 else
00452 {
00453 VL_CHECK(framebuffer == 0);
00454 }
00455 }
00456
00457 inline void VL_glDeleteFramebuffers(GLsizei n, const GLuint *framebuffers)
00458 {
00459 if (glDeleteFramebuffers)
00460 glDeleteFramebuffers(n, framebuffers);
00461 else
00462 if (glDeleteFramebuffersEXT)
00463 glDeleteFramebuffersEXT(n, framebuffers);
00464 else
00465 VL_UNSUPPORTED_FUNC();
00466 }
00467
00468 inline void VL_glGenFramebuffers(GLsizei n, GLuint *framebuffers)
00469 {
00470 if (glGenFramebuffers)
00471 glGenFramebuffers(n, framebuffers);
00472 else
00473 if (glGenFramebuffersEXT)
00474 glGenFramebuffersEXT(n, framebuffers);
00475 else
00476 VL_UNSUPPORTED_FUNC();
00477 }
00478
00479 inline GLenum VL_glCheckFramebufferStatus(GLenum target)
00480 {
00481 if (glCheckFramebufferStatus)
00482 return glCheckFramebufferStatus(target);
00483 else
00484 if (glCheckFramebufferStatusEXT)
00485 return glCheckFramebufferStatusEXT(target);
00486 else
00487 VL_UNSUPPORTED_FUNC();
00488
00489 return GL_FRAMEBUFFER_UNSUPPORTED;
00490 }
00491
00492 inline void VL_glFramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
00493 {
00494 if (glFramebufferTexture1D)
00495 glFramebufferTexture1D(target, attachment, textarget, texture, level);
00496 else
00497 if (glFramebufferTexture1DEXT)
00498 glFramebufferTexture1DEXT(target, attachment, textarget, texture, level);
00499 else
00500 VL_UNSUPPORTED_FUNC();
00501 }
00502
00503 inline void VL_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
00504 {
00505 if (glFramebufferTexture2D)
00506 glFramebufferTexture2D(target, attachment, textarget, texture, level);
00507 else
00508 if (glFramebufferTexture2DEXT)
00509 glFramebufferTexture2DEXT(target, attachment, textarget, texture, level);
00510 else
00511 VL_UNSUPPORTED_FUNC();
00512 }
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525 inline void VL_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
00526 {
00527 if (glFramebufferRenderbuffer)
00528 glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
00529 else
00530 if (glFramebufferRenderbufferEXT)
00531 glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer);
00532 else
00533 VL_UNSUPPORTED_FUNC();
00534 }
00535
00536 inline void VL_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params)
00537 {
00538 if (glGetFramebufferAttachmentParameteriv)
00539 glGetFramebufferAttachmentParameteriv(target,attachment,pname,params);
00540 else
00541 if (glGetFramebufferAttachmentParameterivEXT)
00542 glGetFramebufferAttachmentParameterivEXT(target,attachment,pname,params);
00543 else
00544 VL_UNSUPPORTED_FUNC();
00545 }
00546
00547 inline void VL_glGenerateMipmap(GLenum target)
00548 {
00549 if (glGenerateMipmap)
00550 glGenerateMipmap(target);
00551 else
00552 if (glGenerateMipmapEXT)
00553 glGenerateMipmapEXT(target);
00554 else
00555 VL_UNSUPPORTED_FUNC();
00556 }
00557
00558 inline void VL_glFramebufferTexture(GLenum target, GLenum attachment, GLuint texture, GLint level)
00559 {
00560
00561 if (glFramebufferTextureARB)
00562 glFramebufferTextureARB(target,attachment,texture,level);
00563 else
00564 if (glFramebufferTextureEXT)
00565 glFramebufferTextureEXT(target,attachment,texture,level);
00566 else
00567 VL_UNSUPPORTED_FUNC();
00568 }
00569
00570 inline void VL_glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
00571 {
00572 if (glFramebufferTextureLayer)
00573 glFramebufferTextureLayer(target, attachment, texture, level, layer);
00574 else
00575 if (glFramebufferTextureLayerARB)
00576 glFramebufferTextureLayerARB(target, attachment, texture, level, layer);
00577 else
00578 if (glFramebufferTextureLayerEXT)
00579 glFramebufferTextureLayerEXT(target, attachment, texture, level, layer);
00580 else
00581 VL_UNSUPPORTED_FUNC();
00582 }
00583
00584 inline void VL_glRenderbufferStorageMultisample( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height )
00585 {
00586 if (glRenderbufferStorageMultisample)
00587 glRenderbufferStorageMultisample(target, samples, internalformat, width, height);
00588 else
00589 if (glRenderbufferStorageMultisampleEXT)
00590 glRenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height);
00591 else
00592 VL_UNSUPPORTED_FUNC();
00593 }
00594
00595 inline void VL_glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
00596 {
00597 if (glBlitFramebuffer)
00598 glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
00599 else
00600 if (glBlitFramebufferEXT)
00601 glBlitFramebufferEXT(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
00602 else
00603 VL_UNSUPPORTED_FUNC();
00604 }
00605
00606
00607
00608 inline void VL_glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)
00609 {
00610 if (glDrawElementsInstanced)
00611 glDrawElementsInstanced(mode, count, type, indices, primcount);
00612 else
00613 if (glDrawElementsInstancedARB)
00614 glDrawElementsInstancedARB(mode, count, type, indices, primcount);
00615 else
00616 if (glDrawElementsInstancedEXT)
00617 glDrawElementsInstancedEXT(mode, count, type, indices, primcount);
00618 else
00619 VL_UNSUPPORTED_FUNC();
00620 }
00621
00622 inline void VL_glDrawElementsInstancedBaseVertex(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, int basevertex)
00623 {
00624 if (glDrawElementsInstancedBaseVertex)
00625 glDrawElementsInstancedBaseVertex(mode, count, type, indices, primcount, basevertex);
00626 else
00627 VL_UNSUPPORTED_FUNC();
00628 }
00629
00630 inline void VL_glDrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, int basevertex)
00631 {
00632 if (glDrawElementsBaseVertex)
00633 glDrawElementsBaseVertex(mode, count, type, (void*)indices, basevertex);
00634 else
00635 VL_UNSUPPORTED_FUNC();
00636 }
00637
00638 inline void VL_glDrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, int basevertex)
00639 {
00640 if (glDrawRangeElementsBaseVertex)
00641 glDrawRangeElementsBaseVertex(mode, start, end, count, type, (void*)indices, basevertex);
00642 else
00643 VL_UNSUPPORTED_FUNC();
00644 }
00645
00646 inline void VL_glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
00647 {
00648 if (glDrawArraysInstanced)
00649 glDrawArraysInstanced(mode, first, count, primcount);
00650 else
00651 if (glDrawArraysInstancedARB)
00652 glDrawArraysInstancedARB(mode, first, count, primcount);
00653 else
00654 if (glDrawArraysInstancedEXT)
00655 glDrawArraysInstancedEXT(mode, first, count, primcount);
00656 else
00657 VL_UNSUPPORTED_FUNC();
00658 }
00659
00660
00661
00662 inline void VL_glProgramParameteri(GLuint program, GLenum pname, GLint value)
00663 {
00664 if (glProgramParameteriARB)
00665 glProgramParameteriARB(program, pname, value);
00666 else
00667 if (glProgramParameteriEXT)
00668 glProgramParameteriEXT(program, pname, value);
00669 else
00670 VL_UNSUPPORTED_FUNC();
00671 }
00672
00673 inline void VL_glBindFragDataLocation(GLuint program, GLuint colorNumber, const GLchar *name)
00674 {
00675 if (glBindFragDataLocation)
00676 glBindFragDataLocation(program, colorNumber, name);
00677 else
00678 if (glBindFragDataLocationEXT)
00679 glBindFragDataLocationEXT(program, colorNumber, name);
00680 else
00681 VL_UNSUPPORTED_FUNC();
00682 }
00683
00684 inline void VL_glUniform1uiv(GLint location, GLsizei count, const GLuint *value)
00685 {
00686 if (glUniform1uiv)
00687 glUniform1uiv(location, count, value);
00688 else
00689 if (glUniform1uivEXT)
00690 glUniform1uivEXT(location, count, value);
00691 else
00692 VL_UNSUPPORTED_FUNC();
00693 }
00694
00695 inline void VL_glUniform2uiv(GLint location, GLsizei count, const GLuint *value)
00696 {
00697 if (glUniform2uiv)
00698 glUniform2uiv(location, count, value);
00699 else
00700 if (glUniform2uivEXT)
00701 glUniform2uivEXT(location, count, value);
00702 else
00703 VL_UNSUPPORTED_FUNC();
00704 }
00705
00706 inline void VL_glUniform3uiv(GLint location, GLsizei count, const GLuint *value)
00707 {
00708 if (glUniform3uiv)
00709 glUniform3uiv(location, count, value);
00710 else
00711 if (glUniform3uivEXT)
00712 glUniform3uivEXT(location, count, value);
00713 else
00714 VL_UNSUPPORTED_FUNC();
00715 }
00716
00717 inline void VL_glUniform4uiv(GLint location, GLsizei count, const GLuint *value)
00718 {
00719 if (glUniform4uiv)
00720 glUniform4uiv(location, count, value);
00721 else
00722 if (glUniform4uivEXT)
00723 glUniform4uivEXT(location, count, value);
00724 else
00725 VL_UNSUPPORTED_FUNC();
00726 }
00727
00728 inline void VL_glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary)
00729 {
00730 if (glGetProgramBinary)
00731 glGetProgramBinary(program, bufSize, length, binaryFormat, binary);
00732 else
00733 VL_UNSUPPORTED_FUNC();
00734 }
00735 inline void VL_glProgramBinary(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length)
00736 {
00737 if (glProgramBinary)
00738 glProgramBinary(program, binaryFormat, binary, length);
00739 else
00740 VL_UNSUPPORTED_FUNC();
00741 }
00742
00743 inline void VL_glTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
00744 {
00745 if (glTexImage3D)
00746 glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels);
00747 else
00748 VL_UNSUPPORTED_FUNC();
00749 }
00750 inline void VL_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)
00751 {
00752 if (glTexSubImage3D)
00753 glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
00754 else
00755 VL_UNSUPPORTED_FUNC();
00756 }
00757 inline void VL_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
00758 {
00759 if (glCopyTexSubImage3D)
00760 glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
00761 else
00762 VL_UNSUPPORTED_FUNC();
00763 }
00764 inline void VL_glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
00765 {
00766 if (glCompressedTexImage3D)
00767 glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data);
00768 else
00769 VL_UNSUPPORTED_FUNC();
00770 }
00771 inline void VL_glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
00772 {
00773 if (glCompressedTexSubImage3D)
00774 glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
00775 else
00776 VL_UNSUPPORTED_FUNC();
00777 }
00778 inline void VL_glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
00779 {
00780 if (glFramebufferTexture3D)
00781 glFramebufferTexture3D(target, attachment, textarget, texture, level, zoffset);
00782 else
00783 VL_UNSUPPORTED_FUNC();
00784 }
00785
00786
00787
00788 inline std::string getOpenGLExtensions()
00789 {
00790 std::string ext;
00791 if (Has_GL_Version_3_0||Has_GL_Version_4_0)
00792 {
00793 int count = 0;
00794 glGetIntegerv(GL_NUM_EXTENSIONS, &count);
00795 for( int i=0; i<count; ++i )
00796 {
00797 ext += std::string((char*)glGetStringi(GL_EXTENSIONS, i)) + " ";
00798 VL_CHECK_OGL();
00799 }
00800 }
00801 else
00802 {
00803 VL_CHECK(glGetString(GL_EXTENSIONS));
00804 ext = (const char*)glGetString(GL_EXTENSIONS);
00805
00806 ext.push_back(' ');
00807 }
00808
00809 return ext;
00810 }
00811
00812 }
00813
00814 #endif