Moved osg::Drawable::Extensions into osg::GL2Extensions
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14575 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
@@ -627,729 +627,3 @@ void Drawable::setBound(const BoundingBox& bb) const
|
||||
_boundingBox = bb;
|
||||
_boundingBoxComputed = true;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Extension support
|
||||
//
|
||||
|
||||
typedef buffered_value< ref_ptr<Drawable::Extensions> > BufferedExtensions;
|
||||
static BufferedExtensions s_extensions;
|
||||
|
||||
Drawable::Extensions* Drawable::getExtensions(unsigned int contextID,bool createIfNotInitalized)
|
||||
{
|
||||
if (!s_extensions[contextID] && createIfNotInitalized) s_extensions[contextID] = new Drawable::Extensions(contextID);
|
||||
return s_extensions[contextID].get();
|
||||
}
|
||||
|
||||
void Drawable::setExtensions(unsigned int contextID,Extensions* extensions)
|
||||
{
|
||||
s_extensions[contextID] = extensions;
|
||||
}
|
||||
|
||||
Drawable::Extensions::Extensions(unsigned int contextID)
|
||||
{
|
||||
setupGLExtensions(contextID);
|
||||
}
|
||||
|
||||
Drawable::Extensions::Extensions(const Extensions& rhs):
|
||||
Referenced()
|
||||
{
|
||||
_isVertexProgramSupported = rhs._isVertexProgramSupported;
|
||||
_isSecondaryColorSupported = rhs._isSecondaryColorSupported;
|
||||
_isFogCoordSupported = rhs._isFogCoordSupported;
|
||||
_isMultiTexSupported = rhs._isMultiTexSupported;
|
||||
_isOcclusionQuerySupported = rhs._isOcclusionQuerySupported;
|
||||
_isARBOcclusionQuerySupported = rhs._isARBOcclusionQuerySupported;
|
||||
_isTimerQuerySupported = rhs._isTimerQuerySupported;
|
||||
_isARBTimerQuerySupported = rhs._isARBTimerQuerySupported;
|
||||
|
||||
_glFogCoordfv = rhs._glFogCoordfv;
|
||||
_glSecondaryColor3ubv = rhs._glSecondaryColor3ubv;
|
||||
_glSecondaryColor3fv = rhs._glSecondaryColor3fv;
|
||||
_glMultiTexCoord1f = rhs._glMultiTexCoord1f;
|
||||
_glMultiTexCoord2fv = rhs._glMultiTexCoord2fv;
|
||||
_glMultiTexCoord3fv = rhs._glMultiTexCoord3fv;
|
||||
_glMultiTexCoord4fv = rhs._glMultiTexCoord4fv;
|
||||
_glVertexAttrib1s = rhs._glVertexAttrib1s;
|
||||
_glVertexAttrib1f = rhs._glVertexAttrib1f;
|
||||
_glVertexAttrib2fv = rhs._glVertexAttrib2fv;
|
||||
_glVertexAttrib3fv = rhs._glVertexAttrib3fv;
|
||||
_glVertexAttrib4fv = rhs._glVertexAttrib4fv;
|
||||
_glVertexAttrib4ubv = rhs._glVertexAttrib4ubv;
|
||||
_glVertexAttrib4Nubv = rhs._glVertexAttrib4Nubv;
|
||||
_glGenBuffers = rhs._glGenBuffers;
|
||||
_glBindBuffer = rhs._glBindBuffer;
|
||||
_glBufferData = rhs._glBufferData;
|
||||
_glBufferSubData = rhs._glBufferSubData;
|
||||
_glDeleteBuffers = rhs._glDeleteBuffers;
|
||||
_glGenOcclusionQueries = rhs._glGenOcclusionQueries;
|
||||
_glDeleteOcclusionQueries = rhs._glDeleteOcclusionQueries;
|
||||
_glIsOcclusionQuery = rhs._glIsOcclusionQuery;
|
||||
_glBeginOcclusionQuery = rhs._glBeginOcclusionQuery;
|
||||
_glEndOcclusionQuery = rhs._glEndOcclusionQuery;
|
||||
_glGetOcclusionQueryiv = rhs._glGetOcclusionQueryiv;
|
||||
_glGetOcclusionQueryuiv = rhs._glGetOcclusionQueryuiv;
|
||||
_gl_gen_queries_arb = rhs._gl_gen_queries_arb;
|
||||
_gl_delete_queries_arb = rhs._gl_delete_queries_arb;
|
||||
_gl_is_query_arb = rhs._gl_is_query_arb;
|
||||
_gl_begin_query_arb = rhs._gl_begin_query_arb;
|
||||
_gl_end_query_arb = rhs._gl_end_query_arb;
|
||||
_gl_get_queryiv_arb = rhs._gl_get_queryiv_arb;
|
||||
_gl_get_query_objectiv_arb = rhs._gl_get_query_objectiv_arb;
|
||||
_gl_get_query_objectuiv_arb = rhs._gl_get_query_objectuiv_arb;
|
||||
_gl_get_query_objectui64v = rhs._gl_get_query_objectui64v;
|
||||
_glGetInteger64v = rhs._glGetInteger64v;
|
||||
}
|
||||
|
||||
|
||||
void Drawable::Extensions::lowestCommonDenominator(const Extensions& rhs)
|
||||
{
|
||||
if (!rhs._isVertexProgramSupported) _isVertexProgramSupported = false;
|
||||
if (!rhs._isSecondaryColorSupported) _isSecondaryColorSupported = false;
|
||||
if (!rhs._isFogCoordSupported) _isFogCoordSupported = false;
|
||||
if (!rhs._isMultiTexSupported) _isMultiTexSupported = false;
|
||||
if (!rhs._isOcclusionQuerySupported) _isOcclusionQuerySupported = false;
|
||||
if (!rhs._isARBOcclusionQuerySupported) _isARBOcclusionQuerySupported = false;
|
||||
|
||||
if (!rhs._isTimerQuerySupported) _isTimerQuerySupported = false;
|
||||
if (!rhs._isARBTimerQuerySupported) _isARBTimerQuerySupported = false;
|
||||
|
||||
if (!rhs._glFogCoordfv) _glFogCoordfv = 0;
|
||||
if (!rhs._glSecondaryColor3ubv) _glSecondaryColor3ubv = 0;
|
||||
if (!rhs._glSecondaryColor3fv) _glSecondaryColor3fv = 0;
|
||||
if (!rhs._glMultiTexCoord1f) _glMultiTexCoord1f = 0;
|
||||
if (!rhs._glMultiTexCoord2fv) _glMultiTexCoord2fv = 0;
|
||||
if (!rhs._glMultiTexCoord3fv) _glMultiTexCoord3fv = 0;
|
||||
if (!rhs._glMultiTexCoord4fv) _glMultiTexCoord4fv = 0;
|
||||
|
||||
if (!rhs._glVertexAttrib1s) _glVertexAttrib1s = 0;
|
||||
if (!rhs._glVertexAttrib1f) _glVertexAttrib1f = 0;
|
||||
if (!rhs._glVertexAttrib2fv) _glVertexAttrib2fv = 0;
|
||||
if (!rhs._glVertexAttrib3fv) _glVertexAttrib3fv = 0;
|
||||
if (!rhs._glVertexAttrib4fv) _glVertexAttrib4fv = 0;
|
||||
if (!rhs._glVertexAttrib4ubv) _glVertexAttrib4ubv = 0;
|
||||
if (!rhs._glVertexAttrib4Nubv) _glVertexAttrib4Nubv = 0;
|
||||
|
||||
if (!rhs._glGenBuffers) _glGenBuffers = 0;
|
||||
if (!rhs._glBindBuffer) _glBindBuffer = 0;
|
||||
if (!rhs._glBufferData) _glBufferData = 0;
|
||||
if (!rhs._glBufferSubData) _glBufferSubData = 0;
|
||||
if (!rhs._glDeleteBuffers) _glDeleteBuffers = 0;
|
||||
if (!rhs._glIsBuffer) _glIsBuffer = 0;
|
||||
if (!rhs._glGetBufferSubData) _glGetBufferSubData = 0;
|
||||
if (!rhs._glMapBuffer) _glMapBuffer = 0;
|
||||
if (!rhs._glUnmapBuffer) _glUnmapBuffer = 0;
|
||||
if (!rhs._glGetBufferParameteriv) _glGetBufferParameteriv = 0;
|
||||
if (!rhs._glGetBufferPointerv) _glGetBufferPointerv = 0;
|
||||
|
||||
if (!rhs._glGenOcclusionQueries) _glGenOcclusionQueries = 0;
|
||||
if (!rhs._glDeleteOcclusionQueries) _glDeleteOcclusionQueries = 0;
|
||||
if (!rhs._glIsOcclusionQuery) _glIsOcclusionQuery = 0;
|
||||
if (!rhs._glBeginOcclusionQuery) _glBeginOcclusionQuery = 0;
|
||||
if (!rhs._glEndOcclusionQuery) _glEndOcclusionQuery = 0;
|
||||
if (!rhs._glGetOcclusionQueryiv) _glGetOcclusionQueryiv = 0;
|
||||
if (!rhs._glGetOcclusionQueryuiv) _glGetOcclusionQueryuiv = 0;
|
||||
|
||||
if (!rhs._gl_gen_queries_arb) _gl_gen_queries_arb = 0;
|
||||
if (!rhs._gl_delete_queries_arb) _gl_delete_queries_arb = 0;
|
||||
if (!rhs._gl_is_query_arb) _gl_is_query_arb = 0;
|
||||
if (!rhs._gl_begin_query_arb) _gl_begin_query_arb = 0;
|
||||
if (!rhs._gl_end_query_arb) _gl_end_query_arb = 0;
|
||||
if (!rhs._gl_get_queryiv_arb) _gl_get_queryiv_arb = 0;
|
||||
if (!rhs._gl_get_query_objectiv_arb) _gl_get_query_objectiv_arb = 0;
|
||||
if (!rhs._gl_get_query_objectuiv_arb) _gl_get_query_objectuiv_arb = 0;
|
||||
if (!rhs._gl_get_query_objectui64v) _gl_get_query_objectui64v = 0;
|
||||
if (!rhs._glGetInteger64v) _glGetInteger64v = 0;
|
||||
}
|
||||
|
||||
void Drawable::Extensions::setupGLExtensions(unsigned int contextID)
|
||||
{
|
||||
_isVertexProgramSupported = isGLExtensionSupported(contextID,"GL_ARB_vertex_program");
|
||||
_isSecondaryColorSupported = isGLExtensionSupported(contextID,"GL_EXT_secondary_color");
|
||||
_isFogCoordSupported = isGLExtensionSupported(contextID,"GL_EXT_fog_coord");
|
||||
_isMultiTexSupported = isGLExtensionSupported(contextID,"GL_ARB_multitexture");
|
||||
_isOcclusionQuerySupported = osg::isGLExtensionSupported(contextID, "GL_NV_occlusion_query" );
|
||||
_isARBOcclusionQuerySupported = OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID, "GL_ARB_occlusion_query" );
|
||||
|
||||
_isTimerQuerySupported = osg::isGLExtensionSupported(contextID, "GL_EXT_timer_query" );
|
||||
_isARBTimerQuerySupported = osg::isGLExtensionSupported(contextID, "GL_ARB_timer_query");
|
||||
|
||||
|
||||
setGLExtensionFuncPtr(_glFogCoordfv, "glFogCoordfv","glFogCoordfvEXT");
|
||||
setGLExtensionFuncPtr(_glSecondaryColor3ubv, "glSecondaryColor3ubv","glSecondaryColor3ubvEXT");
|
||||
setGLExtensionFuncPtr(_glSecondaryColor3fv, "glSecondaryColor3fv","glSecondaryColor3fvEXT");
|
||||
setGLExtensionFuncPtr(_glMultiTexCoord1f, "glMultiTexCoord1f","glMultiTexCoord1fARB");
|
||||
setGLExtensionFuncPtr(_glMultiTexCoord1fv, "glMultiTexCoord1fv","glMultiTexCoord1fvARB");
|
||||
setGLExtensionFuncPtr(_glMultiTexCoord2fv, "glMultiTexCoord2fv","glMultiTexCoord2fvARB");
|
||||
setGLExtensionFuncPtr(_glMultiTexCoord3fv, "glMultiTexCoord3fv","glMultiTexCoord3fvARB");
|
||||
setGLExtensionFuncPtr(_glMultiTexCoord4fv, "glMultiTexCoord4fv","glMultiTexCoord4fvARB");
|
||||
setGLExtensionFuncPtr(_glMultiTexCoord1d, "glMultiTexCoord1d","glMultiTexCoorddfARB");
|
||||
setGLExtensionFuncPtr(_glMultiTexCoord2dv, "glMultiTexCoord2dv","glMultiTexCoord2dvARB");
|
||||
setGLExtensionFuncPtr(_glMultiTexCoord3dv, "glMultiTexCoord3dv","glMultiTexCoord3dvARB");
|
||||
setGLExtensionFuncPtr(_glMultiTexCoord4dv, "glMultiTexCoord4dv","glMultiTexCoord4dvARB");
|
||||
|
||||
setGLExtensionFuncPtr(_glVertexAttrib1s, "glVertexAttrib1s","glVertexAttrib1sARB");
|
||||
setGLExtensionFuncPtr(_glVertexAttrib1f, "glVertexAttrib1f","glVertexAttrib1fARB");
|
||||
setGLExtensionFuncPtr(_glVertexAttrib1d, "glVertexAttrib1d","glVertexAttrib1dARB");
|
||||
setGLExtensionFuncPtr(_glVertexAttrib1fv, "glVertexAttrib1fv","glVertexAttrib1fvARB");
|
||||
setGLExtensionFuncPtr(_glVertexAttrib2fv, "glVertexAttrib2fv","glVertexAttrib2fvARB");
|
||||
setGLExtensionFuncPtr(_glVertexAttrib3fv, "glVertexAttrib3fv","glVertexAttrib3fvARB");
|
||||
setGLExtensionFuncPtr(_glVertexAttrib4fv, "glVertexAttrib4fv","glVertexAttrib4fvARB");
|
||||
setGLExtensionFuncPtr(_glVertexAttrib2dv, "glVertexAttrib2dv","glVertexAttrib2dvARB");
|
||||
setGLExtensionFuncPtr(_glVertexAttrib3dv, "glVertexAttrib3dv","glVertexAttrib3dvARB");
|
||||
setGLExtensionFuncPtr(_glVertexAttrib4dv, "glVertexAttrib4dv","glVertexAttrib4dvARB");
|
||||
setGLExtensionFuncPtr(_glVertexAttrib4ubv, "glVertexAttrib4ubv","glVertexAttrib4ubvARB");
|
||||
setGLExtensionFuncPtr(_glVertexAttrib4Nubv, "glVertexAttrib4Nubv","glVertexAttrib4NubvARB");
|
||||
|
||||
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");
|
||||
|
||||
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");
|
||||
|
||||
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");
|
||||
setGLExtensionFuncPtr(_glQueryCounter, "glQueryCounter");
|
||||
setGLExtensionFuncPtr(_glGetInteger64v, "glGetInteger64v");
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glFogCoordfv(const GLfloat* coord) const
|
||||
{
|
||||
if (_glFogCoordfv)
|
||||
{
|
||||
_glFogCoordfv(coord);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glFogCoordfv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glSecondaryColor3ubv(const GLubyte* coord) const
|
||||
{
|
||||
if (_glSecondaryColor3ubv)
|
||||
{
|
||||
_glSecondaryColor3ubv(coord);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glSecondaryColor3ubv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glSecondaryColor3fv(const GLfloat* coord) const
|
||||
{
|
||||
if (_glSecondaryColor3fv)
|
||||
{
|
||||
_glSecondaryColor3fv(coord);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glSecondaryColor3fv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glMultiTexCoord1f(GLenum target,GLfloat coord) const
|
||||
{
|
||||
if (_glMultiTexCoord1f)
|
||||
{
|
||||
_glMultiTexCoord1f(target,coord);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glMultiTexCoord1f not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glMultiTexCoord2fv(GLenum target,const GLfloat* coord) const
|
||||
{
|
||||
if (_glMultiTexCoord2fv)
|
||||
{
|
||||
_glMultiTexCoord2fv(target,coord);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glMultiTexCoord2fv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glMultiTexCoord3fv(GLenum target,const GLfloat* coord) const
|
||||
{
|
||||
if (_glMultiTexCoord3fv)
|
||||
{
|
||||
_glMultiTexCoord3fv(target,coord);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: _glMultiTexCoord3fv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glMultiTexCoord4fv(GLenum target,const GLfloat* coord) const
|
||||
{
|
||||
if (_glMultiTexCoord4fv)
|
||||
{
|
||||
_glMultiTexCoord4fv(target,coord);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glMultiTexCoord4fv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glMultiTexCoord1d(GLenum target,GLdouble coord) const
|
||||
{
|
||||
if (_glMultiTexCoord1d)
|
||||
{
|
||||
_glMultiTexCoord1d(target,coord);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glMultiTexCoord1d not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glMultiTexCoord2dv(GLenum target,const GLdouble* coord) const
|
||||
{
|
||||
if (_glMultiTexCoord2dv)
|
||||
{
|
||||
_glMultiTexCoord2dv(target,coord);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glMultiTexCoord2dv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glMultiTexCoord3dv(GLenum target,const GLdouble* coord) const
|
||||
{
|
||||
if (_glMultiTexCoord3dv)
|
||||
{
|
||||
_glMultiTexCoord3dv(target,coord);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: _glMultiTexCoord3dv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glMultiTexCoord4dv(GLenum target,const GLdouble* coord) const
|
||||
{
|
||||
if (_glMultiTexCoord4dv)
|
||||
{
|
||||
_glMultiTexCoord4dv(target,coord);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glMultiTexCoord4dv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glVertexAttrib1s(unsigned int index, GLshort s) const
|
||||
{
|
||||
if (_glVertexAttrib1s)
|
||||
{
|
||||
_glVertexAttrib1s(index,s);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glVertexAttrib1s not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glVertexAttrib1f(unsigned int index, GLfloat f) const
|
||||
{
|
||||
if (_glVertexAttrib1f)
|
||||
{
|
||||
_glVertexAttrib1f(index,f);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glVertexAttrib1f not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glVertexAttrib1d(unsigned int index, GLdouble f) const
|
||||
{
|
||||
if (_glVertexAttrib1d)
|
||||
{
|
||||
_glVertexAttrib1d(index,f);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glVertexAttrib1d not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glVertexAttrib2fv(unsigned int index, const GLfloat * v) const
|
||||
{
|
||||
if (_glVertexAttrib2fv)
|
||||
{
|
||||
_glVertexAttrib2fv(index,v);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glVertexAttrib2fv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glVertexAttrib3fv(unsigned int index, const GLfloat * v) const
|
||||
{
|
||||
if (_glVertexAttrib3fv)
|
||||
{
|
||||
_glVertexAttrib3fv(index,v);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glVertexAttrib3fv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glVertexAttrib4fv(unsigned int index, const GLfloat * v) const
|
||||
{
|
||||
if (_glVertexAttrib4fv)
|
||||
{
|
||||
_glVertexAttrib4fv(index,v);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glVertexAttrib4fv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glVertexAttrib2dv(unsigned int index, const GLdouble * v) const
|
||||
{
|
||||
if (_glVertexAttrib2dv)
|
||||
{
|
||||
_glVertexAttrib2dv(index,v);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glVertexAttrib2dv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glVertexAttrib3dv(unsigned int index, const GLdouble * v) const
|
||||
{
|
||||
if (_glVertexAttrib3dv)
|
||||
{
|
||||
_glVertexAttrib3dv(index,v);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glVertexAttrib3dv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glVertexAttrib4dv(unsigned int index, const GLdouble * v) const
|
||||
{
|
||||
if (_glVertexAttrib4dv)
|
||||
{
|
||||
_glVertexAttrib4dv(index,v);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glVertexAttrib4dv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glVertexAttrib4ubv(unsigned int index, const GLubyte * v) const
|
||||
{
|
||||
if (_glVertexAttrib4ubv)
|
||||
{
|
||||
_glVertexAttrib4ubv(index,v);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glVertexAttrib4ubv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glVertexAttrib4Nubv(unsigned int index, const GLubyte * v) const
|
||||
{
|
||||
if (_glVertexAttrib4Nubv)
|
||||
{
|
||||
_glVertexAttrib4Nubv(index,v);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glVertexAttrib4Nubv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glGenBuffers(GLsizei n, GLuint *buffers) const
|
||||
{
|
||||
if (_glGenBuffers) _glGenBuffers(n, buffers);
|
||||
else OSG_WARN<<"Error: glGenBuffers not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glBindBuffer(GLenum target, GLuint buffer) const
|
||||
{
|
||||
if (_glBindBuffer) _glBindBuffer(target, buffer);
|
||||
else OSG_WARN<<"Error: glBindBuffer not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glBufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage) const
|
||||
{
|
||||
if (_glBufferData) _glBufferData(target, size, data, usage);
|
||||
else OSG_WARN<<"Error: glBufferData not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data) const
|
||||
{
|
||||
if (_glBufferSubData) _glBufferSubData(target, offset, size, data);
|
||||
else OSG_WARN<<"Error: glBufferData not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glDeleteBuffers(GLsizei n, const GLuint *buffers) const
|
||||
{
|
||||
if (_glDeleteBuffers) _glDeleteBuffers(n, buffers);
|
||||
else OSG_WARN<<"Error: glBufferData not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
GLboolean Drawable::Extensions::glIsBuffer (GLuint buffer) const
|
||||
{
|
||||
if (_glIsBuffer) return _glIsBuffer(buffer);
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glIsBuffer not supported by OpenGL driver"<<std::endl;
|
||||
return GL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data) const
|
||||
{
|
||||
if (_glGetBufferSubData) _glGetBufferSubData(target,offset,size,data);
|
||||
else OSG_WARN<<"Error: glGetBufferSubData not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
GLvoid* Drawable::Extensions::glMapBuffer (GLenum target, GLenum access) const
|
||||
{
|
||||
if (_glMapBuffer) return _glMapBuffer(target,access);
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glMapBuffer not supported by OpenGL driver"<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
GLboolean Drawable::Extensions::glUnmapBuffer (GLenum target) const
|
||||
{
|
||||
if (_glUnmapBuffer) return _glUnmapBuffer(target);
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glUnmapBuffer not supported by OpenGL driver"<<std::endl;
|
||||
return GL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params) const
|
||||
{
|
||||
if (_glGetBufferParameteriv) _glGetBufferParameteriv(target,pname,params);
|
||||
else OSG_WARN<<"Error: glGetBufferParameteriv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params) const
|
||||
{
|
||||
if (_glGetBufferPointerv) _glGetBufferPointerv(target,pname,params);
|
||||
else OSG_WARN<<"Error: glGetBufferPointerv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
void Drawable::Extensions::glGenOcclusionQueries( GLsizei n, GLuint *ids ) const
|
||||
{
|
||||
if (_glGenOcclusionQueries)
|
||||
{
|
||||
_glGenOcclusionQueries( n, ids );
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glGenOcclusionQueries not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glDeleteOcclusionQueries( GLsizei n, const GLuint *ids ) const
|
||||
{
|
||||
if (_glDeleteOcclusionQueries)
|
||||
{
|
||||
_glDeleteOcclusionQueries( n, ids );
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glDeleteOcclusionQueries not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
GLboolean Drawable::Extensions::glIsOcclusionQuery( GLuint id ) const
|
||||
{
|
||||
if (_glIsOcclusionQuery)
|
||||
{
|
||||
return _glIsOcclusionQuery( id );
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glIsOcclusionQuery not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
return GLboolean( 0 );
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glBeginOcclusionQuery( GLuint id ) const
|
||||
{
|
||||
if (_glBeginOcclusionQuery)
|
||||
{
|
||||
_glBeginOcclusionQuery( id );
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glBeginOcclusionQuery not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glEndOcclusionQuery() const
|
||||
{
|
||||
if (_glEndOcclusionQuery)
|
||||
{
|
||||
_glEndOcclusionQuery();
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glEndOcclusionQuery not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glGetOcclusionQueryiv( GLuint id, GLenum pname, GLint *params ) const
|
||||
{
|
||||
if (_glGetOcclusionQueryiv)
|
||||
{
|
||||
_glGetOcclusionQueryiv( id, pname, params );
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glGetOcclusionQueryiv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glGetOcclusionQueryuiv( GLuint id, GLenum pname, GLuint *params ) const
|
||||
{
|
||||
if (_glGetOcclusionQueryuiv)
|
||||
{
|
||||
_glGetOcclusionQueryuiv( id, pname, params );
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN<<"Error: glGetOcclusionQueryuiv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glGetQueryiv(GLenum target, GLenum pname, GLint *params) const
|
||||
{
|
||||
if (_gl_get_queryiv_arb)
|
||||
_gl_get_queryiv_arb(target, pname, params);
|
||||
else
|
||||
OSG_WARN << "Error: glGetQueryiv not supported by OpenGL driver" << std::endl;
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glGenQueries(GLsizei n, GLuint *ids) const
|
||||
{
|
||||
if (_gl_gen_queries_arb)
|
||||
_gl_gen_queries_arb(n, ids);
|
||||
else
|
||||
OSG_WARN << "Error: glGenQueries not supported by OpenGL driver" << std::endl;
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glBeginQuery(GLenum target, GLuint id) const
|
||||
{
|
||||
if (_gl_begin_query_arb)
|
||||
_gl_begin_query_arb(target, id);
|
||||
else
|
||||
OSG_WARN << "Error: glBeginQuery not supported by OpenGL driver" << std::endl;
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glEndQuery(GLenum target) const
|
||||
{
|
||||
if (_gl_end_query_arb)
|
||||
_gl_end_query_arb(target);
|
||||
else
|
||||
OSG_WARN << "Error: glEndQuery not supported by OpenGL driver" << std::endl;
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glQueryCounter(GLuint id, GLenum target) const
|
||||
{
|
||||
if (_glQueryCounter)
|
||||
_glQueryCounter(id, target);
|
||||
else
|
||||
OSG_WARN << "Error: glQueryCounter not supported by OpenGL driver\n";
|
||||
}
|
||||
|
||||
GLboolean Drawable::Extensions::glIsQuery(GLuint id) const
|
||||
{
|
||||
if (_gl_is_query_arb) return _gl_is_query_arb(id);
|
||||
|
||||
OSG_WARN << "Error: glIsQuery not supported by OpenGL driver" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glDeleteQueries(GLsizei n, const GLuint *ids) const
|
||||
{
|
||||
if (_gl_delete_queries_arb)
|
||||
_gl_delete_queries_arb(n, ids);
|
||||
else
|
||||
OSG_WARN << "Error: glIsQuery not supported by OpenGL driver" << std::endl;
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glGetQueryObjectiv(GLuint id, GLenum pname, GLint *params) const
|
||||
{
|
||||
if (_gl_get_query_objectiv_arb)
|
||||
_gl_get_query_objectiv_arb(id, pname, params);
|
||||
else
|
||||
OSG_WARN << "Error: glGetQueryObjectiv not supported by OpenGL driver" << std::endl;
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params) const
|
||||
{
|
||||
if (_gl_get_query_objectuiv_arb)
|
||||
_gl_get_query_objectuiv_arb(id, pname, params);
|
||||
else
|
||||
OSG_WARN << "Error: glGetQueryObjectuiv not supported by OpenGL driver" << std::endl;
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glGetQueryObjectui64v(GLuint id, GLenum pname, GLuint64 *params) const
|
||||
{
|
||||
if (_gl_get_query_objectui64v)
|
||||
_gl_get_query_objectui64v(id, pname, params);
|
||||
else
|
||||
OSG_WARN << "Error: glGetQueryObjectui64v not supported by OpenGL driver" << std::endl;
|
||||
}
|
||||
|
||||
void Drawable::Extensions::glGetInteger64v(GLenum pname, GLint64 *params)
|
||||
const
|
||||
{
|
||||
if (_glGetInteger64v)
|
||||
_glGetInteger64v(pname, params);
|
||||
else
|
||||
OSG_WARN << "Error: glGetInteger64v not supported by OpenGL driver\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user