From 409cdd0b2897e7605cfc64b17042ee41c52804fa Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 10 Sep 2007 15:19:23 +0000 Subject: [PATCH] Intoduced a new setGLExtensions template method to do a copy of void* pointer to local function pointer to avoid compiler warnings related to case void*. Moved various OSG classes across to using setGLExtensions instead of getGLExtensions, and changed them to use typedef declarations in the headers rather than casts in the .cpp. Updated wrappers --- genwrapper.conf | 72 ++++++++++++++++++++++ include/osg/BlendColor | 6 +- include/osg/BlendEquation | 11 ++-- include/osg/BlendFunc | 9 ++- include/osg/ClampColor | 7 +-- include/osg/FragmentProgram | 16 +++-- include/osg/GLExtensions | 34 ++++++++++ include/osg/Multisample | 5 +- include/osg/Point | 10 ++- include/osg/Texture | 18 +++--- src/osg/BlendColor.cpp | 5 +- src/osg/BlendEquation.cpp | 5 +- src/osg/BlendFunc.cpp | 11 +--- src/osg/BufferObject.cpp | 22 +++---- src/osg/ClampColor.cpp | 5 +- src/osg/Drawable.cpp | 82 ++++++++++++------------- src/osg/FragmentProgram.cpp | 25 +++----- src/osg/FrameBufferObject.cpp | 2 +- src/osg/GraphicsContext.cpp | 1 - src/osg/GraphicsThread.cpp | 1 - src/osg/Multisample.cpp | 5 +- src/osg/Point.cpp | 21 +++---- src/osg/Texture.cpp | 15 ++--- src/osgWrappers/osg/BlendColor.cpp | 9 +-- src/osgWrappers/osg/BlendEquation.cpp | 9 +-- src/osgWrappers/osg/BlendFunc.cpp | 9 +-- src/osgWrappers/osg/ClampColor.cpp | 9 +-- src/osgWrappers/osg/FragmentProgram.cpp | 5 ++ src/osgWrappers/osg/Multisample.cpp | 9 +-- src/osgWrappers/osg/Point.cpp | 3 + src/osgWrappers/osg/Texture.cpp | 31 ++-------- 31 files changed, 259 insertions(+), 213 deletions(-) diff --git a/genwrapper.conf b/genwrapper.conf index e422c7ae7..f58d4e48b 100644 --- a/genwrapper.conf +++ b/genwrapper.conf @@ -363,6 +363,78 @@ configure reflector "osg::Drawable::Extensions" end end +configure reflector "osg::BlendColor::Extensions" + configure method "__typedef__void__APIENTRY_P1" + replace with "" + end + configure method "__typedef__GLboolean__APIENTRY_P1" + replace with "" + end +end + +configure reflector "osg::BlendEquation::Extensions" + configure method "__typedef__void__APIENTRY_P1" + replace with "" + end + configure method "__typedef__GLboolean__APIENTRY_P1" + replace with "" + end +end + +configure reflector "osg::BlendFunc::Extensions" + configure method "__typedef__void__APIENTRY_P1" + replace with "" + end + configure method "__typedef__GLboolean__APIENTRY_P1" + replace with "" + end +end + +configure reflector "osg::FragmentProgram::Extensions" + configure method "__typedef__void__APIENTRY_P1" + replace with "" + end + configure method "__typedef__GLboolean__APIENTRY_P1" + replace with "" + end +end + +configure reflector "osg::Multisample::Extensions" + configure method "__typedef__void__APIENTRY_P1" + replace with "" + end + configure method "__typedef__GLboolean__APIENTRY_P1" + replace with "" + end +end + +configure reflector "osg::Point::Extensions" + configure method "__typedef__void__APIENTRY_P1" + replace with "" + end + configure method "__typedef__GLboolean__APIENTRY_P1" + replace with "" + end +end + +configure reflector "osg::ClampColor::Extensions" + configure method "__typedef__void__APIENTRY_P1" + replace with "" + end + configure method "__typedef__GLboolean__APIENTRY_P1" + replace with "" + end +end + +configure reflector "osg::Texture::Extensions" + configure method "__typedef__void__APIENTRY_P1" + replace with "" + end + configure method "__typedef__GLboolean__APIENTRY_P1" + replace with "" + end +end + configure reflector "osg::State" configure method "__typedef__void__APIENTRY_P1" replace with "" diff --git a/include/osg/BlendColor b/include/osg/BlendColor index 660f23b0b..7bfc2732d 100644 --- a/include/osg/BlendColor +++ b/include/osg/BlendColor @@ -86,16 +86,16 @@ class OSG_EXPORT BlendColor : public StateAttribute void setBlendColorSupported(bool flag) { _isBlendColorSupported=flag; } bool isBlendColorSupported() const { return _isBlendColorSupported; } - void setBlendColorProc(void* ptr) { _glBlendColor = ptr; } void glBlendColor(GLclampf red , GLclampf green , GLclampf blue , GLclampf alpha) const; protected: ~Extensions() {} - bool _isBlendColorSupported; - void* _glBlendColor; + typedef void (APIENTRY * GLBlendColorProc) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); + bool _isBlendColorSupported; + GLBlendColorProc _glBlendColor; }; diff --git a/include/osg/BlendEquation b/include/osg/BlendEquation index f40478db9..d6035832c 100644 --- a/include/osg/BlendEquation +++ b/include/osg/BlendEquation @@ -110,18 +110,19 @@ class OSG_EXPORT BlendEquation : public StateAttribute bool isSGIXMinMaxSupported() const { return _isSGIXMinMaxSupported; } bool isLogicOpSupported() const { return _isLogicOpSupported; } - void setBlendEquationProc(void* ptr) { _glBlendEquation = ptr; } void glBlendEquation(GLenum mode) const; protected: ~Extensions() {} - bool _isBlendEquationSupported; - bool _isSGIXMinMaxSupported; - bool _isLogicOpSupported; + typedef void (APIENTRY * GLBlendEquationProc) (GLenum mode); - void* _glBlendEquation; + bool _isBlendEquationSupported; + bool _isSGIXMinMaxSupported; + bool _isLogicOpSupported; + + GLBlendEquationProc _glBlendEquation; }; diff --git a/include/osg/BlendFunc b/include/osg/BlendFunc index 4995ced3f..20ea94bcf 100644 --- a/include/osg/BlendFunc +++ b/include/osg/BlendFunc @@ -147,7 +147,6 @@ class OSG_EXPORT BlendFunc : public StateAttribute void setBlendFuncSeparateSupported(bool flag) { _isBlendFuncSeparateSupported=flag; } bool isBlendFuncSeparateSupported() const { return _isBlendFuncSeparateSupported; } - void setBlendFuncSeparateProc(void* ptr) { _glBlendFuncSeparate = ptr; } void glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, @@ -157,9 +156,13 @@ class OSG_EXPORT BlendFunc : public StateAttribute ~Extensions() {} - bool _isBlendFuncSeparateSupported; - void* _glBlendFuncSeparate; + typedef void (APIENTRY * GLBlendFuncSeparateProc) (GLenum sfactorRGB, + GLenum dfactorRGB, + GLenum sfactorAlpha, + GLenum dfactorAlpha); + bool _isBlendFuncSeparateSupported; + GLBlendFuncSeparateProc _glBlendFuncSeparate; }; diff --git a/include/osg/ClampColor b/include/osg/ClampColor index 90222767f..342623069 100644 --- a/include/osg/ClampColor +++ b/include/osg/ClampColor @@ -94,16 +94,15 @@ class OSG_EXPORT ClampColor : public StateAttribute void setClampColorSupported(bool flag) { _isClampColorSupported=flag; } bool isClampColorSupported() const { return _isClampColorSupported; } - void setClampColorProc(void* ptr) { _glClampColor = ptr; } void glClampColor(GLenum target, GLenum mode) const; protected: ~Extensions() {} - bool _isClampColorSupported; - - void* _glClampColor; + typedef void (APIENTRY * GLClampColorProc) (GLenum target, GLenum mode); + bool _isClampColorSupported; + GLClampColorProc _glClampColor; }; diff --git a/include/osg/FragmentProgram b/include/osg/FragmentProgram index 252f1ea5c..b3c332cdd 100644 --- a/include/osg/FragmentProgram +++ b/include/osg/FragmentProgram @@ -257,11 +257,17 @@ class OSG_EXPORT FragmentProgram : public StateAttribute bool _isFragmentProgramSupported; - void* _glBindProgram; - void* _glGenPrograms; - void *_glDeletePrograms; - void* _glProgramString; - void* _glProgramLocalParameter4fv; + typedef void (APIENTRY * BindProgramProc) (GLenum target, GLuint id); + typedef void (APIENTRY * GenProgramsProc) (GLsizei n, GLuint *programs); + typedef void (APIENTRY * DeleteProgramsProc) (GLsizei n, GLuint *programs); + typedef void (APIENTRY * ProgramStringProc) (GLenum target, GLenum format, GLsizei len, const void *string); + typedef void (APIENTRY * ProgramLocalParameter4fvProc) (GLenum target, GLuint index, const GLfloat *params); + + BindProgramProc _glBindProgram; + GenProgramsProc _glGenPrograms; + DeleteProgramsProc _glDeletePrograms; + ProgramStringProc _glProgramString; + ProgramLocalParameter4fvProc _glProgramLocalParameter4fv; }; /** Function to call to get the extension of a specified context. diff --git a/include/osg/GLExtensions b/include/osg/GLExtensions index bf6d58cf3..c80230d36 100644 --- a/include/osg/GLExtensions +++ b/include/osg/GLExtensions @@ -68,6 +68,40 @@ inline void* getGLExtensionFuncPtr(const char *funcName,const char *fallbackFunc return getGLExtensionFuncPtr(fallbackFuncName); } + +template +bool setGLExtensionFuncPtr(T& t, const char* str1) +{ + void* data = osg::getGLExtensionFuncPtr(str1); + if (data) + { + memcpy(&t, &data, sizeof(T)); + return false; + } + else + { + t = 0; + return false; + } +} + +template +bool setGLExtensionFuncPtr(T& t, const char* str1, const char* str2) +{ + void* data = osg::getGLExtensionFuncPtr(str1,str2); + if (data) + { + memcpy(&t, &data, sizeof(T)); + return false; + } + else + { + t = 0; + return false; + } +} + + /** Return true if OpenGL "extension" is supported. * Note: Must only be called within a valid OpenGL context, * undefined behavior may occur otherwise. diff --git a/include/osg/Multisample b/include/osg/Multisample index 853feae78..cebb077d5 100644 --- a/include/osg/Multisample +++ b/include/osg/Multisample @@ -112,7 +112,6 @@ class OSG_EXPORT Multisample : public StateAttribute bool isMultisampleSupported() const { return _isMultisampleSupported; } bool isMultisampleFilterHintSupported() const { return _isMultisampleFilterHintSupported; } - void setSampleCoverageProc(void* ptr) { _glSampleCoverage = ptr; } void glSampleCoverage(GLclampf value, GLboolean invert) const; protected: @@ -121,7 +120,9 @@ class OSG_EXPORT Multisample : public StateAttribute bool _isMultisampleSupported; bool _isMultisampleFilterHintSupported; - void* _glSampleCoverage; + + typedef void (APIENTRY * GLSampleCoverageProc) (GLclampf value, GLboolean invert); + GLSampleCoverageProc _glSampleCoverage; }; diff --git a/include/osg/Point b/include/osg/Point index 44d6f79cf..161e2ae5f 100644 --- a/include/osg/Point +++ b/include/osg/Point @@ -108,9 +108,13 @@ class OSG_EXPORT Point : public StateAttribute bool _isPointParametersSupported; bool _isPointSpriteCoordOriginSupported; - void* _glPointParameteri; - void* _glPointParameterf; - void* _glPointParameterfv; + typedef void (APIENTRY * GLPointParameteriProc) (GLenum pname, GLint param); + typedef void (APIENTRY * GLPointParameterfProc) (GLenum pname, GLfloat param); + typedef void (APIENTRY * GLPointParameterfvProc) (GLenum pname, const GLfloat *params); + + GLPointParameteriProc _glPointParameteri; + GLPointParameterfProc _glPointParameterf; + GLPointParameterfvProc _glPointParameterfv; }; diff --git a/include/osg/Texture b/include/osg/Texture index dd9c3032e..2485a56f1 100644 --- a/include/osg/Texture +++ b/include/osg/Texture @@ -522,16 +522,10 @@ class OSG_EXPORT Texture : public osg::StateAttribute GLint numTextureUnits() const { return _numTextureUnits; } bool isCompressedTexImage2DSupported() const { return _glCompressedTexImage2D!=0; } - - void setCompressedTexImage2DProc(void* ptr) { _glCompressedTexImage2D = ptr; } - void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) const; - bool isCompressedTexSubImage2DSupported() const { return _glCompressedTexSubImage2D!=0; } - void setCompressedTexSubImage2DProc(void* ptr) { _glCompressedTexSubImage2D = ptr; } + void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) const; void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei type, const GLvoid *data) const; - - void setGetCompressedTexImageProc(void* ptr) { _glGetCompressedTexImage = ptr; } void glGetCompressedTexImage(GLenum target, GLint level, GLvoid *data) const; bool isClientStorageSupported() const { return _isClientStorageSupported; } @@ -564,9 +558,13 @@ class OSG_EXPORT Texture : public osg::StateAttribute GLint _maxTextureSize; GLint _numTextureUnits; - void* _glCompressedTexImage2D; - void* _glCompressedTexSubImage2D; - void* _glGetCompressedTexImage; + typedef void (APIENTRY * CompressedTexImage2DArbProc) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); + typedef void (APIENTRY * CompressedTexSubImage2DArbProc) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); + typedef void (APIENTRY * GetCompressedTexImageArbProc) (GLenum target, GLint level, GLvoid *data); + + CompressedTexImage2DArbProc _glCompressedTexImage2D; + CompressedTexSubImage2DArbProc _glCompressedTexSubImage2D; + GetCompressedTexImageArbProc _glGetCompressedTexImage; }; diff --git a/src/osg/BlendColor.cpp b/src/osg/BlendColor.cpp index 202be5ffc..e4347e613 100644 --- a/src/osg/BlendColor.cpp +++ b/src/osg/BlendColor.cpp @@ -92,15 +92,14 @@ void BlendColor::Extensions::setupGLExtensions(unsigned int contextID) _isBlendColorSupported = isGLExtensionSupported(contextID,"GL_EXT_blend_color") || strncmp((const char*)glGetString(GL_VERSION),"1.2",3)>=0; - _glBlendColor = getGLExtensionFuncPtr("glBlendColor", "glBlendColorEXT"); + setGLExtensionFuncPtr(_glBlendColor, "glBlendColor", "glBlendColorEXT"); } void BlendColor::Extensions::glBlendColor(GLclampf red , GLclampf green , GLclampf blue , GLclampf alpha) const { if (_glBlendColor) { - typedef void (APIENTRY * GLBlendColorProc) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); - ((GLBlendColorProc)_glBlendColor)(red, green, blue, alpha); + _glBlendColor(red, green, blue, alpha); } else { diff --git a/src/osg/BlendEquation.cpp b/src/osg/BlendEquation.cpp index 839ca830b..bda807d44 100644 --- a/src/osg/BlendEquation.cpp +++ b/src/osg/BlendEquation.cpp @@ -111,15 +111,14 @@ void BlendEquation::Extensions::setupGLExtensions(unsigned int contextID) _isSGIXMinMaxSupported = isGLExtensionSupported(contextID, "GL_SGIX_blend_alpha_minmax"); _isLogicOpSupported = isGLExtensionSupported(contextID, "GL_EXT_blend_logic_op"); - _glBlendEquation = getGLExtensionFuncPtr("glBlendEquation", "glBlendEquationEXT"); + setGLExtensionFuncPtr(_glBlendEquation, "glBlendEquation", "glBlendEquationEXT"); } void BlendEquation::Extensions::glBlendEquation(GLenum mode) const { if (_glBlendEquation) { - typedef void (APIENTRY * GLBlendEquationProc) (GLenum mode); - ((GLBlendEquationProc)_glBlendEquation)(mode); + _glBlendEquation(mode); } else { diff --git a/src/osg/BlendFunc.cpp b/src/osg/BlendFunc.cpp index ca269b8a3..7ffa5e185 100644 --- a/src/osg/BlendFunc.cpp +++ b/src/osg/BlendFunc.cpp @@ -109,7 +109,7 @@ void BlendFunc::Extensions::setupGLExtensions(unsigned int contextID) _isBlendFuncSeparateSupported = isGLExtensionSupported(contextID, "GL_EXT_blend_func_separate") || strncmp((const char*)glGetString(GL_VERSION), "1.4", 3) >= 0; - _glBlendFuncSeparate = getGLExtensionFuncPtr("glBlendFuncSeparate", "glBlendFuncSeparateEXT"); + setGLExtensionFuncPtr(_glBlendFuncSeparate, "glBlendFuncSeparate", "glBlendFuncSeparateEXT"); } void BlendFunc::Extensions::glBlendFuncSeparate(GLenum sfactorRGB, @@ -119,14 +119,7 @@ void BlendFunc::Extensions::glBlendFuncSeparate(GLenum sfactorRGB, { if (_glBlendFuncSeparate) { - typedef void (APIENTRY * GLBlendFuncSeparateProc) (GLenum sfactorRGB, - GLenum dfactorRGB, - GLenum sfactorAlpha, - GLenum dfactorAlpha); - ((GLBlendFuncSeparateProc)_glBlendFuncSeparate)(sfactorRGB, - dfactorRGB, - sfactorAlpha, - dfactorAlpha); + _glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); } else { diff --git a/src/osg/BufferObject.cpp b/src/osg/BufferObject.cpp index 2dcd7d04f..557591efd 100644 --- a/src/osg/BufferObject.cpp +++ b/src/osg/BufferObject.cpp @@ -191,17 +191,17 @@ void BufferObject::Extensions::lowestCommonDenominator(const Extensions& rhs) void BufferObject::Extensions::setupGLExtensions(unsigned int contextID) { - _glGenBuffers = ((GenBuffersProc)osg::getGLExtensionFuncPtr("glGenBuffers","glGenBuffersARB")); - _glBindBuffer = ((BindBufferProc)osg::getGLExtensionFuncPtr("glBindBuffer","glBindBufferARB")); - _glBufferData = ((BufferDataProc)osg::getGLExtensionFuncPtr("glBufferData","glBufferDataARB")); - _glBufferSubData = ((BufferSubDataProc)osg::getGLExtensionFuncPtr("glBufferSubData","glBufferSubDataARB")); - _glDeleteBuffers = ((DeleteBuffersProc)osg::getGLExtensionFuncPtr("glDeleteBuffers","glDeleteBuffersARB")); - _glIsBuffer = ((IsBufferProc)osg::getGLExtensionFuncPtr("glIsBuffer","glIsBufferARB")); - _glGetBufferSubData = ((GetBufferSubDataProc)osg::getGLExtensionFuncPtr("glGetBufferSubData","glGetBufferSubDataARB")); - _glMapBuffer = ((MapBufferProc)osg::getGLExtensionFuncPtr("glMapBuffer","glMapBufferARB")); - _glUnmapBuffer = ((UnmapBufferProc)osg::getGLExtensionFuncPtr("glUnmapBuffer","glUnmapBufferARB")); - _glGetBufferParameteriv = ((GetBufferParameterivProc)osg::getGLExtensionFuncPtr("glGetBufferParameteriv","glGetBufferParameterivARB")); - _glGetBufferPointerv = ((GetBufferPointervProc)osg::getGLExtensionFuncPtr("glGetBufferPointerv","glGetBufferPointervARB")); + setGLExtensionFuncPtr(_glGenBuffers, "glGenBuffers","glGenBuffersARB"); + setGLExtensionFuncPtr(_glBindBuffer, "glBindBuffer","glBindBufferARB"); + setGLExtensionFuncPtr(_glBufferData, "glBufferData","glBufferDataARB"); + setGLExtensionFuncPtr(_glBufferSubData, "glBufferSubData","glBufferSubDataARB"); + setGLExtensionFuncPtr(_glDeleteBuffers, "glDeleteBuffers","glDeleteBuffersARB"); + setGLExtensionFuncPtr(_glIsBuffer, "glIsBuffer","glIsBufferARB"); + setGLExtensionFuncPtr(_glGetBufferSubData, "glGetBufferSubData","glGetBufferSubDataARB"); + setGLExtensionFuncPtr(_glMapBuffer, "glMapBuffer","glMapBufferARB"); + setGLExtensionFuncPtr(_glUnmapBuffer, "glUnmapBuffer","glUnmapBufferARB"); + setGLExtensionFuncPtr(_glGetBufferParameteriv, "glGetBufferParameteriv","glGetBufferParameterivARB"); + setGLExtensionFuncPtr(_glGetBufferPointerv, "glGetBufferPointerv","glGetBufferPointervARB"); _isPBOSupported = osg::isGLExtensionSupported(contextID,"GL_ARB_pixel_buffer_object"); } diff --git a/src/osg/ClampColor.cpp b/src/osg/ClampColor.cpp index 266268af7..281713fd6 100644 --- a/src/osg/ClampColor.cpp +++ b/src/osg/ClampColor.cpp @@ -96,15 +96,14 @@ void ClampColor::Extensions::setupGLExtensions(unsigned int contextID) _isClampColorSupported = isGLExtensionSupported(contextID,"GL_ARB_color_buffer_float") || strncmp((const char*)glGetString(GL_VERSION),"2.0",3)>=0; - _glClampColor = getGLExtensionFuncPtr("glClampColor", "glClampColorARB"); + setGLExtensionFuncPtr(_glClampColor, "glClampColor", "glClampColorARB"); } void ClampColor::Extensions::glClampColor(GLenum target, GLenum mode) const { if (_glClampColor) { - typedef void (APIENTRY * GLClampColorProc) (GLenum target, GLenum mode); - ((GLClampColorProc)_glClampColor)(target,mode); + _glClampColor(target,mode); } else { diff --git a/src/osg/Drawable.cpp b/src/osg/Drawable.cpp index 15af2fe85..f9ed1070f 100644 --- a/src/osg/Drawable.cpp +++ b/src/osg/Drawable.cpp @@ -961,51 +961,51 @@ void Drawable::Extensions::setupGLExtensions(unsigned int contextID) _isTimerQuerySupported = osg::isGLExtensionSupported(contextID, "GL_EXT_timer_query" );; - _glFogCoordfv = ((FogCoordProc)osg::getGLExtensionFuncPtr("glFogCoordfv","glFogCoordfvEXT")); - _glSecondaryColor3ubv = ((SecondaryColor3ubvProc)osg::getGLExtensionFuncPtr("glSecondaryColor3ubv","glSecondaryColor3ubvEXT")); - _glSecondaryColor3fv = ((SecondaryColor3fvProc)osg::getGLExtensionFuncPtr("glSecondaryColor3fv","glSecondaryColor3fvEXT")); - _glMultiTexCoord1f = ((MultiTexCoord1fProc)osg::getGLExtensionFuncPtr("glMultiTexCoord1f","glMultiTexCoord1fARB")); - _glMultiTexCoord2fv = ((MultiTexCoordfvProc)osg::getGLExtensionFuncPtr("glMultiTexCoord2fv","glMultiTexCoord2fvARB")); - _glMultiTexCoord3fv = ((MultiTexCoordfvProc)osg::getGLExtensionFuncPtr("glMultiTexCoord3fv","glMultiTexCoord3fvARB")); - _glMultiTexCoord4fv = ((MultiTexCoordfvProc)osg::getGLExtensionFuncPtr("glMultiTexCoord4fv","glMultiTexCoord4fvARB")); + setGLExtensionFuncPtr(_glFogCoordfv, "glFogCoordfv","glFogCoordfvEXT"); + setGLExtensionFuncPtr(_glSecondaryColor3ubv, "glSecondaryColor3ubv","glSecondaryColor3ubvEXT"); + setGLExtensionFuncPtr(_glSecondaryColor3fv, "glSecondaryColor3fv","glSecondaryColor3fvEXT"); + setGLExtensionFuncPtr(_glMultiTexCoord1f, "glMultiTexCoord1f","glMultiTexCoord1fARB"); + setGLExtensionFuncPtr(_glMultiTexCoord2fv, "glMultiTexCoord2fv","glMultiTexCoord2fvARB"); + setGLExtensionFuncPtr(_glMultiTexCoord3fv, "glMultiTexCoord3fv","glMultiTexCoord3fvARB"); + setGLExtensionFuncPtr(_glMultiTexCoord4fv, "glMultiTexCoord4fv","glMultiTexCoord4fvARB"); - _glVertexAttrib1s = ((VertexAttrib1sProc)osg::getGLExtensionFuncPtr("glVertexAttrib1s","glVertexAttrib1sARB")); - _glVertexAttrib1f = ((VertexAttrib1fProc)osg::getGLExtensionFuncPtr("glVertexAttrib1f","glVertexAttrib1fARB")); - _glVertexAttrib2fv = ((VertexAttribfvProc)osg::getGLExtensionFuncPtr("glVertexAttrib2fv","glVertexAttrib2fvARB")); - _glVertexAttrib3fv = ((VertexAttribfvProc)osg::getGLExtensionFuncPtr("glVertexAttrib3fv","glVertexAttrib3fvARB")); - _glVertexAttrib4fv = ((VertexAttribfvProc)osg::getGLExtensionFuncPtr("glVertexAttrib4fv","glVertexAttrib4fvARB")); - _glVertexAttrib4ubv = ((VertexAttribubvProc)osg::getGLExtensionFuncPtr("glVertexAttrib4ubv","glVertexAttrib4ubvARB")); - _glVertexAttrib4Nubv = ((VertexAttribubvProc)osg::getGLExtensionFuncPtr("glVertexAttrib4Nubv","glVertexAttrib4NubvARB")); + setGLExtensionFuncPtr(_glVertexAttrib1s, "glVertexAttrib1s","glVertexAttrib1sARB"); + setGLExtensionFuncPtr(_glVertexAttrib1f, "glVertexAttrib1f","glVertexAttrib1fARB"); + setGLExtensionFuncPtr(_glVertexAttrib2fv, "glVertexAttrib2fv","glVertexAttrib2fvARB"); + setGLExtensionFuncPtr(_glVertexAttrib3fv, "glVertexAttrib3fv","glVertexAttrib3fvARB"); + setGLExtensionFuncPtr(_glVertexAttrib4fv, "glVertexAttrib4fv","glVertexAttrib4fvARB"); + setGLExtensionFuncPtr(_glVertexAttrib4ubv, "glVertexAttrib4ubv","glVertexAttrib4ubvARB"); + setGLExtensionFuncPtr(_glVertexAttrib4Nubv, "glVertexAttrib4Nubv","glVertexAttrib4NubvARB"); - _glGenBuffers = ((GenBuffersProc)osg::getGLExtensionFuncPtr("glGenBuffers","glGenBuffersARB")); - _glBindBuffer = ((BindBufferProc)osg::getGLExtensionFuncPtr("glBindBuffer","glBindBufferARB")); - _glBufferData = ((BufferDataProc)osg::getGLExtensionFuncPtr("glBufferData","glBufferDataARB")); - _glBufferSubData = ((BufferSubDataProc)osg::getGLExtensionFuncPtr("glBufferSubData","glBufferSubDataARB")); - _glDeleteBuffers = ((DeleteBuffersProc)osg::getGLExtensionFuncPtr("glDeleteBuffers","glDeleteBuffersARB")); - _glIsBuffer = ((IsBufferProc)osg::getGLExtensionFuncPtr("glIsBuffer","glIsBufferARB")); - _glGetBufferSubData = ((GetBufferSubDataProc)osg::getGLExtensionFuncPtr("glGetBufferSubData","glGetBufferSubDataARB")); - _glMapBuffer = ((MapBufferProc)osg::getGLExtensionFuncPtr("glMapBuffer","glMapBufferARB")); - _glUnmapBuffer = ((UnmapBufferProc)osg::getGLExtensionFuncPtr("glUnmapBuffer","glUnmapBufferARB")); - _glGetBufferParameteriv = ((GetBufferParameterivProc)osg::getGLExtensionFuncPtr("glGetBufferParameteriv","glGetBufferParameterivARB")); - _glGetBufferPointerv = ((GetBufferPointervProc)osg::getGLExtensionFuncPtr("glGetBufferPointerv","glGetBufferPointervARB")); + setGLExtensionFuncPtr(_glGenBuffers, "glGenBuffers","glGenBuffersARB"); + setGLExtensionFuncPtr(_glBindBuffer, "glBindBuffer","glBindBufferARB"); + setGLExtensionFuncPtr(_glBufferData, "glBufferData","glBufferDataARB"); + setGLExtensionFuncPtr(_glBufferSubData, "glBufferSubData","glBufferSubDataARB"); + setGLExtensionFuncPtr(_glDeleteBuffers, "glDeleteBuffers","glDeleteBuffersARB"); + setGLExtensionFuncPtr(_glIsBuffer, "glIsBuffer","glIsBufferARB"); + setGLExtensionFuncPtr(_glGetBufferSubData, "glGetBufferSubData","glGetBufferSubDataARB"); + setGLExtensionFuncPtr(_glMapBuffer, "glMapBuffer","glMapBufferARB"); + setGLExtensionFuncPtr(_glUnmapBuffer, "glUnmapBuffer","glUnmapBufferARB"); + setGLExtensionFuncPtr(_glGetBufferParameteriv, "glGetBufferParameteriv","glGetBufferParameterivARB"); + setGLExtensionFuncPtr(_glGetBufferPointerv, "glGetBufferPointerv","glGetBufferPointervARB"); - _glGenOcclusionQueries = ((GenOcclusionQueriesProc)osg::getGLExtensionFuncPtr("glGenOcclusionQueries","glGenOcclusionQueriesNV")); - _glDeleteOcclusionQueries = ((DeleteOcclusionQueriesProc)osg::getGLExtensionFuncPtr("glDeleteOcclusionQueries","glDeleteOcclusionQueriesNV")); - _glIsOcclusionQuery = ((IsOcclusionQueryProc)osg::getGLExtensionFuncPtr("glIsOcclusionQuery","_glIsOcclusionQueryNV")); - _glBeginOcclusionQuery = ((BeginOcclusionQueryProc)osg::getGLExtensionFuncPtr("glBeginOcclusionQuery","glBeginOcclusionQueryNV")); - _glEndOcclusionQuery = ((EndOcclusionQueryProc)osg::getGLExtensionFuncPtr("glEndOcclusionQuery","glEndOcclusionQueryNV")); - _glGetOcclusionQueryiv = ((GetOcclusionQueryivProc)osg::getGLExtensionFuncPtr("glGetOcclusionQueryiv","glGetOcclusionQueryivNV")); - _glGetOcclusionQueryuiv = ((GetOcclusionQueryuivProc)osg::getGLExtensionFuncPtr("glGetOcclusionQueryuiv","glGetOcclusionQueryuivNV")); + setGLExtensionFuncPtr(_glGenOcclusionQueries, "glGenOcclusionQueries","glGenOcclusionQueriesNV"); + setGLExtensionFuncPtr(_glDeleteOcclusionQueries, "glDeleteOcclusionQueries","glDeleteOcclusionQueriesNV"); + setGLExtensionFuncPtr(_glIsOcclusionQuery, "glIsOcclusionQuery","_glIsOcclusionQueryNV"); + setGLExtensionFuncPtr(_glBeginOcclusionQuery, "glBeginOcclusionQuery","glBeginOcclusionQueryNV"); + setGLExtensionFuncPtr(_glEndOcclusionQuery, "glEndOcclusionQuery","glEndOcclusionQueryNV"); + setGLExtensionFuncPtr(_glGetOcclusionQueryiv, "glGetOcclusionQueryiv","glGetOcclusionQueryivNV"); + setGLExtensionFuncPtr(_glGetOcclusionQueryuiv, "glGetOcclusionQueryuiv","glGetOcclusionQueryuivNV"); - _gl_gen_queries_arb = (GenQueriesProc)osg::getGLExtensionFuncPtr("glGenQueries", "glGenQueriesARB"); - _gl_delete_queries_arb = (DeleteQueriesProc)osg::getGLExtensionFuncPtr("glDeleteQueries", "glDeleteQueriesARB"); - _gl_is_query_arb = (IsQueryProc)osg::getGLExtensionFuncPtr("glIsQuery", "glIsQueryARB"); - _gl_begin_query_arb = (BeginQueryProc)osg::getGLExtensionFuncPtr("glBeginQuery", "glBeginQueryARB"); - _gl_end_query_arb = (EndQueryProc)osg::getGLExtensionFuncPtr("glEndQuery", "glEndQueryARB"); - _gl_get_queryiv_arb = (GetQueryivProc)osg::getGLExtensionFuncPtr("glGetQueryiv", "glGetQueryivARB"); - _gl_get_query_objectiv_arb = (GetQueryObjectivProc)osg::getGLExtensionFuncPtr("glGetQueryObjectiv","glGetQueryObjectivARB"); - _gl_get_query_objectuiv_arb = (GetQueryObjectuivProc)osg::getGLExtensionFuncPtr("glGetQueryObjectuiv","glGetQueryObjectuivARB"); - _gl_get_query_objectui64v = (GetQueryObjectui64vProc)osg::getGLExtensionFuncPtr("glGetQueryObjectui64v","glGetQueryObjectui64vEXT"); + setGLExtensionFuncPtr(_gl_gen_queries_arb, "glGenQueries", "glGenQueriesARB"); + setGLExtensionFuncPtr(_gl_delete_queries_arb, "glDeleteQueries", "glDeleteQueriesARB"); + setGLExtensionFuncPtr(_gl_is_query_arb, "glIsQuery", "glIsQueryARB"); + setGLExtensionFuncPtr(_gl_begin_query_arb, "glBeginQuery", "glBeginQueryARB"); + setGLExtensionFuncPtr(_gl_end_query_arb, "glEndQuery", "glEndQueryARB"); + setGLExtensionFuncPtr(_gl_get_queryiv_arb, "glGetQueryiv", "glGetQueryivARB"); + setGLExtensionFuncPtr(_gl_get_query_objectiv_arb, "glGetQueryObjectiv","glGetQueryObjectivARB"); + setGLExtensionFuncPtr(_gl_get_query_objectuiv_arb, "glGetQueryObjectuiv","glGetQueryObjectuivARB"); + setGLExtensionFuncPtr(_gl_get_query_objectui64v, "glGetQueryObjectui64v","glGetQueryObjectui64vEXT"); } void Drawable::Extensions::glFogCoordfv(const GLfloat* coord) const diff --git a/src/osg/FragmentProgram.cpp b/src/osg/FragmentProgram.cpp index 45c680c10..9a933cc5e 100644 --- a/src/osg/FragmentProgram.cpp +++ b/src/osg/FragmentProgram.cpp @@ -250,19 +250,18 @@ void FragmentProgram::Extensions::setupGLExtensions(unsigned int contextID) { _isFragmentProgramSupported = isGLExtensionSupported(contextID,"GL_ARB_fragment_program"); - _glBindProgram = osg::getGLExtensionFuncPtr("glBindProgramARB"); - _glGenPrograms = osg::getGLExtensionFuncPtr("glGenProgramsARB"); - _glDeletePrograms = osg::getGLExtensionFuncPtr("glDeleteProgramsARB"); - _glProgramString = osg::getGLExtensionFuncPtr("glProgramStringARB"); - _glProgramLocalParameter4fv = osg::getGLExtensionFuncPtr("glProgramLocalParameter4fvARB"); + setGLExtensionFuncPtr(_glBindProgram, "glBindProgramARB"); + setGLExtensionFuncPtr(_glGenPrograms, "glGenProgramsARB"); + setGLExtensionFuncPtr(_glDeletePrograms, "glDeleteProgramsARB"); + setGLExtensionFuncPtr(_glProgramString, "glProgramStringARB"); + setGLExtensionFuncPtr(_glProgramLocalParameter4fv, "glProgramLocalParameter4fvARB"); } void FragmentProgram::Extensions::glBindProgram(GLenum target, GLuint id) const { if (_glBindProgram) { - typedef void (APIENTRY * BindProgramProc) (GLenum target, GLuint id); - ((BindProgramProc)_glBindProgram)(target,id); + _glBindProgram(target,id); } else { @@ -274,8 +273,7 @@ void FragmentProgram::Extensions::glGenPrograms(GLsizei n, GLuint *programs) con { if (_glGenPrograms) { - typedef void (APIENTRY * GenProgramsProc) (GLsizei n, GLuint *programs); - ((GenProgramsProc)_glGenPrograms)(n,programs); + _glGenPrograms(n,programs); } else { @@ -287,8 +285,7 @@ void FragmentProgram::Extensions::glDeletePrograms(GLsizei n, GLuint *programs) { if (_glDeletePrograms) { - typedef void (APIENTRY * DeleteProgramsProc) (GLsizei n, GLuint *programs); - ((DeleteProgramsProc)_glDeletePrograms)(n,programs); + _glDeletePrograms(n,programs); } else { @@ -300,8 +297,7 @@ void FragmentProgram::Extensions::glProgramString(GLenum target, GLenum format, { if (_glProgramString) { - typedef void (APIENTRY * ProgramStringProc) (GLenum target, GLenum format, GLsizei len, const void *string); - ((ProgramStringProc)_glProgramString)(target,format, len, string); + _glProgramString(target,format, len, string); } else { @@ -313,8 +309,7 @@ void FragmentProgram::Extensions::glProgramLocalParameter4fv(GLenum target, GLui { if (_glProgramLocalParameter4fv) { - typedef void (APIENTRY * ProgramLocalParameter4fvProc) (GLenum target, GLuint index, const GLfloat *params); - ((ProgramLocalParameter4fvProc)_glProgramLocalParameter4fv)(target, index, params); + _glProgramLocalParameter4fv(target, index, params); } else { diff --git a/src/osg/FrameBufferObject.cpp b/src/osg/FrameBufferObject.cpp index 780480b9d..8eea141dd 100644 --- a/src/osg/FrameBufferObject.cpp +++ b/src/osg/FrameBufferObject.cpp @@ -38,7 +38,7 @@ FBOExtensions* FBOExtensions::instance(unsigned contextID, bool createIfNotInita /************************************************************************** * FBOExtensions **************************************************************************/ -#define LOAD_FBO_EXT(name) name = (T##name *)getGLExtensionFuncPtr(#name); +#define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name)) FBOExtensions::FBOExtensions(unsigned int contextID) : _supported(false) diff --git a/src/osg/GraphicsContext.cpp b/src/osg/GraphicsContext.cpp index a59450b50..1ccd9bd24 100644 --- a/src/osg/GraphicsContext.cpp +++ b/src/osg/GraphicsContext.cpp @@ -156,7 +156,6 @@ public: { osg::notify(osg::INFO)<<"resetting compileContext "<<_compileContext.get()<<" refCount "<<_compileContext->referenceCount()<(object); if (_preBlockOp==GL_FLUSH) glFlush(); else if (_preBlockOp==GL_FINISH) glFinish(); } diff --git a/src/osg/Multisample.cpp b/src/osg/Multisample.cpp index 23e772cf6..ef4bb6ab9 100644 --- a/src/osg/Multisample.cpp +++ b/src/osg/Multisample.cpp @@ -91,15 +91,14 @@ void Multisample::Extensions::setupGLExtensions(unsigned int contextID) _isMultisampleSupported = isGLExtensionSupported(contextID,"GL_ARB_multisample"); _isMultisampleFilterHintSupported = isGLExtensionSupported(contextID,"GL_NV_multisample_filter_hint"); - _glSampleCoverage = getGLExtensionFuncPtr("glSampleCoverageARB"); + setGLExtensionFuncPtr(_glSampleCoverage, "glSampleCoverageARB"); } void Multisample::Extensions::glSampleCoverage(GLclampf value, GLboolean invert) const { if (_glSampleCoverage) { - typedef void (APIENTRY * GLSampleCoverageProc) (GLclampf value, GLboolean invert); - ((GLSampleCoverageProc)_glSampleCoverage)(value, invert); + _glSampleCoverage(value, invert); } else { diff --git a/src/osg/Point.cpp b/src/osg/Point.cpp index 0404c7962..dd50b5cc1 100644 --- a/src/osg/Point.cpp +++ b/src/osg/Point.cpp @@ -135,22 +135,21 @@ void Point::Extensions::setupGLExtensions(unsigned int contextID) _isPointSpriteCoordOriginSupported = strncmp((const char*)glGetString(GL_VERSION),"2.0",3)>=0; - _glPointParameteri = getGLExtensionFuncPtr("glPointParameteri", "glPointParameteriARB"); - if (!_glPointParameteri) _glPointParameteri = getGLExtensionFuncPtr("glPointParameteriEXT", "glPointParameteriSGIS"); + setGLExtensionFuncPtr(_glPointParameteri, "glPointParameteri", "glPointParameteriARB"); + if (!_glPointParameteri) setGLExtensionFuncPtr(_glPointParameteri, "glPointParameteriEXT", "glPointParameteriSGIS"); - _glPointParameterf = getGLExtensionFuncPtr("glPointParameterf", "glPointParameterfARB"); - if (!_glPointParameterf) _glPointParameterf = getGLExtensionFuncPtr("glPointParameterfEXT", "glPointParameterfSGIS"); + setGLExtensionFuncPtr(_glPointParameterf, "glPointParameterf", "glPointParameterfARB"); + if (!_glPointParameterf) setGLExtensionFuncPtr(_glPointParameterf, "glPointParameterfEXT", "glPointParameterfSGIS"); - _glPointParameterfv = getGLExtensionFuncPtr("glPointParameterfv", "glPointParameterfvARB"); - if (!_glPointParameterfv) _glPointParameterfv = getGLExtensionFuncPtr("glPointParameterfvEXT", "glPointParameterfvSGIS"); + setGLExtensionFuncPtr(_glPointParameterfv, "glPointParameterfv", "glPointParameterfvARB"); + if (!_glPointParameterfv) setGLExtensionFuncPtr(_glPointParameterfv, "glPointParameterfvEXT", "glPointParameterfvSGIS"); } void Point::Extensions::glPointParameteri(GLenum pname, GLint param) const { if (_glPointParameteri) { - typedef void (APIENTRY * GLPointParameteriProc) (GLenum pname, GLint param); - ((GLPointParameteriProc)_glPointParameteri)(pname, param); + _glPointParameteri(pname, param); } else { @@ -162,8 +161,7 @@ void Point::Extensions::glPointParameterf(GLenum pname, GLfloat param) const { if (_glPointParameterf) { - typedef void (APIENTRY * GLPointParameterfProc) (GLenum pname, GLfloat param); - ((GLPointParameterfProc)_glPointParameterf)(pname, param); + _glPointParameterf(pname, param); } else { @@ -175,8 +173,7 @@ void Point::Extensions::glPointParameterfv(GLenum pname, const GLfloat *params) { if (_glPointParameterfv) { - typedef void (APIENTRY * GLPointParameterfvProc) (GLenum pname, const GLfloat *params); - ((GLPointParameterfvProc)_glPointParameterfv)(pname, params); + _glPointParameterfv(pname, params); } else { diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index 4c44fd77b..a508a3e9f 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -1473,17 +1473,16 @@ void Texture::Extensions::setupGLExtensions(unsigned int contextID) _numTextureUnits = 1; } - _glCompressedTexImage2D = getGLExtensionFuncPtr("glCompressedTexImage2D","glCompressedTexImage2DARB"); - _glCompressedTexSubImage2D = getGLExtensionFuncPtr("glCompressedTexSubImage2D","glCompressedTexSubImage2DARB"); - _glGetCompressedTexImage = getGLExtensionFuncPtr("glGetCompressedTexImage","glGetCompressedTexImageARB");; + setGLExtensionFuncPtr(_glCompressedTexImage2D, "glCompressedTexImage2D","glCompressedTexImage2DARB"); + setGLExtensionFuncPtr(_glCompressedTexSubImage2D, "glCompressedTexSubImage2D","glCompressedTexSubImage2DARB"); + setGLExtensionFuncPtr(_glGetCompressedTexImage, "glGetCompressedTexImage","glGetCompressedTexImageARB"); } void Texture::Extensions::glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) const { if (_glCompressedTexImage2D) { - typedef void (APIENTRY * CompressedTexImage2DArbProc) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); - ((CompressedTexImage2DArbProc)_glCompressedTexImage2D)(target, level, internalformat, width, height, border, imageSize, data); + _glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data); } else { @@ -1496,8 +1495,7 @@ void Texture::Extensions::glCompressedTexSubImage2D(GLenum target, GLint level, { if (_glCompressedTexSubImage2D) { - typedef void (APIENTRY * CompressedTexSubImage2DArbProc) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); - ((CompressedTexSubImage2DArbProc)_glCompressedTexSubImage2D)(target, level, xoffset, yoffset, width, height, format, imageSize, data); + _glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data); } else { @@ -1509,8 +1507,7 @@ void Texture::Extensions::glGetCompressedTexImage(GLenum target, GLint level, GL { if (_glGetCompressedTexImage) { - typedef void (APIENTRY * GetCompressedTexImageArbProc) (GLenum target, GLint level, GLvoid *data); - ((GetCompressedTexImageArbProc)_glGetCompressedTexImage)(target, level, data); + _glGetCompressedTexImage(target, level, data); } else { diff --git a/src/osgWrappers/osg/BlendColor.cpp b/src/osgWrappers/osg/BlendColor.cpp index 277867230..93fb0dc97 100644 --- a/src/osgWrappers/osg/BlendColor.cpp +++ b/src/osgWrappers/osg/BlendColor.cpp @@ -149,19 +149,12 @@ BEGIN_OBJECT_REFLECTOR(osg::BlendColor::Extensions) __bool__isBlendColorSupported, "", ""); - I_Method1(void, setBlendColorProc, IN, void *, ptr, - Properties::NON_VIRTUAL, - __void__setBlendColorProc__void_P1, - "", - ""); I_Method4(void, glBlendColor, IN, GLclampf, red, IN, GLclampf, green, IN, GLclampf, blue, IN, GLclampf, alpha, Properties::NON_VIRTUAL, __void__glBlendColor__GLclampf__GLclampf__GLclampf__GLclampf, "", ""); - I_SimpleProperty(void *, BlendColorProc, - 0, - __void__setBlendColorProc__void_P1); + I_SimpleProperty(bool, BlendColorSupported, 0, __void__setBlendColorSupported__bool); diff --git a/src/osgWrappers/osg/BlendEquation.cpp b/src/osgWrappers/osg/BlendEquation.cpp index 776b13eaa..8dd24b681 100644 --- a/src/osgWrappers/osg/BlendEquation.cpp +++ b/src/osgWrappers/osg/BlendEquation.cpp @@ -165,19 +165,12 @@ BEGIN_OBJECT_REFLECTOR(osg::BlendEquation::Extensions) __bool__isLogicOpSupported, "", ""); - I_Method1(void, setBlendEquationProc, IN, void *, ptr, - Properties::NON_VIRTUAL, - __void__setBlendEquationProc__void_P1, - "", - ""); I_Method1(void, glBlendEquation, IN, GLenum, mode, Properties::NON_VIRTUAL, __void__glBlendEquation__GLenum, "", ""); - I_SimpleProperty(void *, BlendEquationProc, - 0, - __void__setBlendEquationProc__void_P1); + I_SimpleProperty(bool, BlendEquationSupported, 0, __void__setBlendEquationSupported__bool); diff --git a/src/osgWrappers/osg/BlendFunc.cpp b/src/osgWrappers/osg/BlendFunc.cpp index 41a3891c7..249b6d450 100644 --- a/src/osgWrappers/osg/BlendFunc.cpp +++ b/src/osgWrappers/osg/BlendFunc.cpp @@ -240,19 +240,12 @@ BEGIN_OBJECT_REFLECTOR(osg::BlendFunc::Extensions) __bool__isBlendFuncSeparateSupported, "", ""); - I_Method1(void, setBlendFuncSeparateProc, IN, void *, ptr, - Properties::NON_VIRTUAL, - __void__setBlendFuncSeparateProc__void_P1, - "", - ""); I_Method4(void, glBlendFuncSeparate, IN, GLenum, sfactorRGB, IN, GLenum, dfactorRGB, IN, GLenum, sfactorAlpha, IN, GLenum, dfactorAlpha, Properties::NON_VIRTUAL, __void__glBlendFuncSeparate__GLenum__GLenum__GLenum__GLenum, "", ""); - I_SimpleProperty(void *, BlendFuncSeparateProc, - 0, - __void__setBlendFuncSeparateProc__void_P1); + I_SimpleProperty(bool, BlendFuncSeparateSupported, 0, __void__setBlendFuncSeparateSupported__bool); diff --git a/src/osgWrappers/osg/ClampColor.cpp b/src/osgWrappers/osg/ClampColor.cpp index 2a6baba35..7b853627b 100644 --- a/src/osgWrappers/osg/ClampColor.cpp +++ b/src/osgWrappers/osg/ClampColor.cpp @@ -163,19 +163,12 @@ BEGIN_OBJECT_REFLECTOR(osg::ClampColor::Extensions) __bool__isClampColorSupported, "", ""); - I_Method1(void, setClampColorProc, IN, void *, ptr, - Properties::NON_VIRTUAL, - __void__setClampColorProc__void_P1, - "", - ""); I_Method2(void, glClampColor, IN, GLenum, target, IN, GLenum, mode, Properties::NON_VIRTUAL, __void__glClampColor__GLenum__GLenum, "", ""); - I_SimpleProperty(void *, ClampColorProc, - 0, - __void__setClampColorProc__void_P1); + I_SimpleProperty(bool, ClampColorSupported, 0, __void__setClampColorSupported__bool); diff --git a/src/osgWrappers/osg/FragmentProgram.cpp b/src/osgWrappers/osg/FragmentProgram.cpp index c9c48173d..4e62ea74a 100644 --- a/src/osgWrappers/osg/FragmentProgram.cpp +++ b/src/osgWrappers/osg/FragmentProgram.cpp @@ -253,6 +253,11 @@ BEGIN_OBJECT_REFLECTOR(osg::FragmentProgram::Extensions) __void__glProgramLocalParameter4fv__GLenum__GLuint__C5_GLfloat_P1, "", ""); + + + + + I_SimpleProperty(bool, FragmentProgramSupported, 0, __void__setFragmentProgramSupported__bool); diff --git a/src/osgWrappers/osg/Multisample.cpp b/src/osgWrappers/osg/Multisample.cpp index 8df583e6e..601a40eeb 100644 --- a/src/osgWrappers/osg/Multisample.cpp +++ b/src/osgWrappers/osg/Multisample.cpp @@ -181,24 +181,17 @@ BEGIN_OBJECT_REFLECTOR(osg::Multisample::Extensions) __bool__isMultisampleFilterHintSupported, "", ""); - I_Method1(void, setSampleCoverageProc, IN, void *, ptr, - Properties::NON_VIRTUAL, - __void__setSampleCoverageProc__void_P1, - "", - ""); I_Method2(void, glSampleCoverage, IN, GLclampf, value, IN, GLboolean, invert, Properties::NON_VIRTUAL, __void__glSampleCoverage__GLclampf__GLboolean, "", ""); + I_SimpleProperty(bool, MultisampleFilterHintSupported, 0, __void__setMultisampleFilterHintSupported__bool); I_SimpleProperty(bool, MultisampleSupported, 0, __void__setMultisampleSupported__bool); - I_SimpleProperty(void *, SampleCoverageProc, - 0, - __void__setSampleCoverageProc__void_P1); END_REFLECTOR diff --git a/src/osgWrappers/osg/Point.cpp b/src/osgWrappers/osg/Point.cpp index c80eb3b38..d286247ab 100644 --- a/src/osgWrappers/osg/Point.cpp +++ b/src/osgWrappers/osg/Point.cpp @@ -216,6 +216,9 @@ BEGIN_OBJECT_REFLECTOR(osg::Point::Extensions) __void__glPointParameterfv__GLenum__C5_GLfloat_P1, "", ""); + + + I_SimpleProperty(bool, PointParametersSupported, 0, __void__setPointParametersSupported__bool); diff --git a/src/osgWrappers/osg/Texture.cpp b/src/osgWrappers/osg/Texture.cpp index 93c4d07ca..506b4d94c 100644 --- a/src/osgWrappers/osg/Texture.cpp +++ b/src/osgWrappers/osg/Texture.cpp @@ -725,9 +725,9 @@ BEGIN_OBJECT_REFLECTOR(osg::Texture::Extensions) __bool__isCompressedTexImage2DSupported, "", ""); - I_Method1(void, setCompressedTexImage2DProc, IN, void *, ptr, + I_Method0(bool, isCompressedTexSubImage2DSupported, Properties::NON_VIRTUAL, - __void__setCompressedTexImage2DProc__void_P1, + __bool__isCompressedTexSubImage2DSupported, "", ""); I_Method8(void, glCompressedTexImage2D, IN, GLenum, target, IN, GLint, level, IN, GLenum, internalformat, IN, GLsizei, width, IN, GLsizei, height, IN, GLint, border, IN, GLsizei, imageSize, IN, const GLvoid *, data, @@ -735,26 +735,11 @@ BEGIN_OBJECT_REFLECTOR(osg::Texture::Extensions) __void__glCompressedTexImage2D__GLenum__GLint__GLenum__GLsizei__GLsizei__GLint__GLsizei__C5_GLvoid_P1, "", ""); - I_Method0(bool, isCompressedTexSubImage2DSupported, - Properties::NON_VIRTUAL, - __bool__isCompressedTexSubImage2DSupported, - "", - ""); - I_Method1(void, setCompressedTexSubImage2DProc, IN, void *, ptr, - Properties::NON_VIRTUAL, - __void__setCompressedTexSubImage2DProc__void_P1, - "", - ""); I_Method9(void, glCompressedTexSubImage2D, IN, GLenum, target, IN, GLint, level, IN, GLint, xoffset, IN, GLint, yoffset, IN, GLsizei, width, IN, GLsizei, height, IN, GLenum, format, IN, GLsizei, type, IN, const GLvoid *, data, Properties::NON_VIRTUAL, __void__glCompressedTexSubImage2D__GLenum__GLint__GLint__GLint__GLsizei__GLsizei__GLenum__GLsizei__C5_GLvoid_P1, "", ""); - I_Method1(void, setGetCompressedTexImageProc, IN, void *, ptr, - Properties::NON_VIRTUAL, - __void__setGetCompressedTexImageProc__void_P1, - "", - ""); I_Method3(void, glGetCompressedTexImage, IN, GLenum, target, IN, GLint, level, IN, GLvoid *, data, Properties::NON_VIRTUAL, __void__glGetCompressedTexImage__GLenum__GLint__GLvoid_P1, @@ -770,18 +755,12 @@ BEGIN_OBJECT_REFLECTOR(osg::Texture::Extensions) __bool__isNonPowerOfTwoTextureSupported__GLenum, "", ""); - I_SimpleProperty(void *, CompressedTexImage2DProc, - 0, - __void__setCompressedTexImage2DProc__void_P1); - I_SimpleProperty(void *, CompressedTexSubImage2DProc, - 0, - __void__setCompressedTexSubImage2DProc__void_P1); + + + I_SimpleProperty(bool, GenerateMipMapSupported, 0, __void__setGenerateMipMapSupported__bool); - I_SimpleProperty(void *, GetCompressedTexImageProc, - 0, - __void__setGetCompressedTexImageProc__void_P1); I_SimpleProperty(GLint, MaxTextureSize, 0, __void__setMaxTextureSize__GLint);