From Aurelien Albert, "This submission is made against trunk version and add the loading of "glVertexAttribDivisor" extension."

This commit is contained in:
Robert Osfield 2013-06-03 09:19:46 +00:00
parent 56dc8fee01
commit efe52842fa
2 changed files with 18 additions and 0 deletions

View File

@ -637,6 +637,7 @@ class OSG_EXPORT GL2Extensions : public osg::Referenced
void glVertexAttrib4uiv(GLuint index, const GLuint *v) const;
void glVertexAttrib4usv(GLuint index, const GLushort *v) const;
void glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer) const;
void glVertexAttribDivisor(GLuint index, GLuint divisor) const;
// C++-friendly convenience wrapper methods
GLuint getCurrentProgram() const;
@ -828,6 +829,7 @@ class OSG_EXPORT GL2Extensions : public osg::Referenced
typedef void (GL_APIENTRY * VertexAttrib4uivProc)(GLuint index, const GLuint *v);
typedef void (GL_APIENTRY * VertexAttrib4usvProc)(GLuint index, const GLushort *v);
typedef void (GL_APIENTRY * VertexAttribPointerProc)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
typedef void (GL_APIENTRY * VertexAttribDivisorProc)(GLuint index, GLuint divisor);
typedef void (GL_APIENTRY * UniformMatrix2x3fvProc)( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value );
typedef void (GL_APIENTRY * UniformMatrix3x2fvProc)( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value );
typedef void (GL_APIENTRY * UniformMatrix2x4fvProc)( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value );
@ -974,6 +976,7 @@ class OSG_EXPORT GL2Extensions : public osg::Referenced
VertexAttrib4uivProc _glVertexAttrib4uiv;
VertexAttrib4usvProc _glVertexAttrib4usv;
VertexAttribPointerProc _glVertexAttribPointer;
VertexAttribDivisorProc _glVertexAttribDivisor;
GetInfoLogARBProc _glGetInfoLogARB;
GetObjectParameterivARBProc _glGetObjectParameterivARB;

View File

@ -147,6 +147,7 @@ GL2Extensions::GL2Extensions(const GL2Extensions& rhs) : osg::Referenced()
_glVertexAttrib4uiv = rhs._glVertexAttrib4uiv;
_glVertexAttrib4usv = rhs._glVertexAttrib4usv;
_glVertexAttribPointer = rhs._glVertexAttribPointer;
_glVertexAttribDivisor = rhs._glVertexAttribDivisor;
_glGetInfoLogARB = rhs._glGetInfoLogARB;
_glGetObjectParameterivARB = rhs._glGetObjectParameterivARB;
@ -331,6 +332,7 @@ void GL2Extensions::lowestCommonDenominator(const GL2Extensions& rhs)
if (!rhs._glVertexAttrib4uiv) _glVertexAttrib4uiv = 0;
if (!rhs._glVertexAttrib4usv) _glVertexAttrib4usv = 0;
if (!rhs._glVertexAttribPointer) _glVertexAttribPointer = 0;
if (!rhs._glVertexAttribDivisor) _glVertexAttribDivisor = 0;
if (!rhs._glGetInfoLogARB) _glGetInfoLogARB = 0;
if (!rhs._glGetObjectParameterivARB) _glGetObjectParameterivARB = 0;
@ -523,6 +525,7 @@ void GL2Extensions::setupGL2Extensions(unsigned int contextID)
_glVertexAttrib4uiv= 0;
_glVertexAttrib4usv= 0;
_glVertexAttribPointer= 0;
_glVertexAttribDivisor= 0;
_glGetInfoLogARB= 0;
_glGetObjectParameterivARB= 0;
@ -732,6 +735,7 @@ void GL2Extensions::setupGL2Extensions(unsigned int contextID)
setGLExtensionFuncPtr(_glVertexAttrib4uiv, "glVertexAttrib4uiv");
setGLExtensionFuncPtr(_glVertexAttrib4usv, "glVertexAttrib4usv");
setGLExtensionFuncPtr(_glVertexAttribPointer, "glVertexAttribPointer");
setGLExtensionFuncPtr(_glVertexAttribDivisor, "glVertexAttribDivisor");
// v1.5-only ARB entry points, in case they're needed for fallback
setGLExtensionFuncPtr(_glGetInfoLogARB, "glGetInfoLogARB");
@ -2165,6 +2169,17 @@ void GL2Extensions::glVertexAttribPointer(GLuint index, GLint size, GLenum type,
}
}
void GL2Extensions::glVertexAttribDivisor(GLuint index, GLuint divisor) const
{
if (_glVertexAttribDivisor)
{
_glVertexAttribDivisor(index, divisor);
}
else
{
NotSupported( "glVertexAttribDivisor" );
}
}
void GL2Extensions::glUniformMatrix2x3fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) const
{