diff --git a/include/osg/GLExtensions b/include/osg/GLExtensions index a5df2de42..721e747a2 100644 --- a/include/osg/GLExtensions +++ b/include/osg/GLExtensions @@ -626,7 +626,25 @@ class OSG_EXPORT GLExtensions : public osg::Referenced // MultiDrawArrays void (GL_APIENTRY * glMultiDrawArrays) (GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount); + // ViewportArray + bool isViewportArraySupported; + void (GL_APIENTRY * glViewportArrayv) (GLuint first, GLsizei count, const GLfloat * v); + void (GL_APIENTRY * glViewportIndexedf) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); + void (GL_APIENTRY * glViewportIndexedfv) (GLuint index, const GLfloat * v); + void (GL_APIENTRY * glScissorArrayv) (GLuint first, GLsizei count, const GLint * v); + void (GL_APIENTRY * glScissorIndexed) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); + void (GL_APIENTRY * glScissorIndexedv) (GLuint index, const GLint * v); + void (GL_APIENTRY * glDepthRangeArrayv) (GLuint first, GLsizei count, const GLclampd * v); + void (GL_APIENTRY * glDepthRangeIndexed) (GLuint index, GLclampd n, GLclampd f); + void (GL_APIENTRY * glGetFloati_v) (GLenum target, GLuint index, GLfloat *data); + void (GL_APIENTRY * glGetDoublei_v) (GLenum target, GLuint index, GLdouble *data); + + //introduced by other OpenGL extensions such as EXT_draw_buffers2 + void (GL_APIENTRY * glGetIntegerIndexedvEXT) (GLenum target, GLuint index, int * v); + void (GL_APIENTRY * glEnableIndexedEXT) (GLenum target, GLuint index); + void (GL_APIENTRY * glDisableIndexedEXT) (GLenum target, GLuint index); + GLboolean (GL_APIENTRY * glIsEnabledIndexedEXT) (GLenum target, GLuint index); }; diff --git a/src/osg/GLExtensions.cpp b/src/osg/GLExtensions.cpp index 274376362..da6899328 100644 --- a/src/osg/GLExtensions.cpp +++ b/src/osg/GLExtensions.cpp @@ -1103,6 +1103,25 @@ GLExtensions::GLExtensions(unsigned int contextID) // MultiDrawArrays setGLExtensionFuncPtr(glMultiDrawArrays, "glMultiDrawArrays", "glMultiDrawArraysEXT", validContext); + + // ViewportArray + isViewportArraySupported = validContext && (isGLExtensionOrVersionSupported(contextID, "GL_ARB_viewport_array", 4.1f)); + + osg::setGLExtensionFuncPtr(glViewportArrayv, "glViewportArrayv", validContext); + osg::setGLExtensionFuncPtr(glViewportIndexedf, "glViewportIndexedf", validContext); + osg::setGLExtensionFuncPtr(glViewportIndexedfv, "glViewportIndexedfv", validContext); + osg::setGLExtensionFuncPtr(glScissorArrayv, "glScissorArrayv", validContext); + osg::setGLExtensionFuncPtr(glScissorIndexed, "glScissorIndexed", validContext); + osg::setGLExtensionFuncPtr(glScissorIndexedv, "glScissorIndexedv", validContext); + osg::setGLExtensionFuncPtr(glDepthRangeArrayv, "glDepthRangeArrayv", validContext); + osg::setGLExtensionFuncPtr(glDepthRangeIndexed, "glDepthRangeIndexed", validContext); + osg::setGLExtensionFuncPtr(glGetFloati_v, "glGetFloati_v", validContext); + osg::setGLExtensionFuncPtr(glGetDoublei_v, "glGetDoublei_v", validContext); + osg::setGLExtensionFuncPtr(glGetIntegerIndexedvEXT, "glGetIntegerIndexedvEXT", validContext); + osg::setGLExtensionFuncPtr(glEnableIndexedEXT, "glEnableIndexedEXT", validContext); + osg::setGLExtensionFuncPtr(glDisableIndexedEXT, "glDisableIndexedEXT", validContext); + osg::setGLExtensionFuncPtr(glIsEnabledIndexedEXT, "glIsEnabledIndexedEXT", validContext); + }