Removed the GLclampd declaration and replaced its usage with GLdouble to standardize the OSG extension setup with current GL/GLES headers.

Added a float fallback from osg::DepthDangeIndex to suppprt GLES.
This commit is contained in:
Robert Osfield
2017-08-16 14:20:00 +01:00
parent bfbaecaf49
commit f3adcda6b7
4 changed files with 11 additions and 9 deletions

View File

@@ -41,7 +41,11 @@ void DepthRangeIndexed::apply(State& state) const
const GLExtensions* extensions = state.get<GLExtensions>();
if (extensions->glDepthRangeIndexed)
{
extensions->glDepthRangeIndexed(static_cast<GLuint>(_index), static_cast<GLclampd>(_zNear), static_cast<GLclampd>(_zFar));
extensions->glDepthRangeIndexed(static_cast<GLuint>(_index), static_cast<GLdouble>(_zNear), static_cast<GLdouble>(_zFar));
}
else if (extensions->glDepthRangeIndexedf)
{
extensions->glDepthRangeIndexedf(static_cast<GLuint>(_index), static_cast<GLfloat>(_zNear), static_cast<GLfloat>(_zFar));
}
else
{

View File

@@ -1171,6 +1171,7 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
osg::setGLExtensionFuncPtr(glScissorIndexedv, "glScissorIndexedv", validContext);
osg::setGLExtensionFuncPtr(glDepthRangeArrayv, "glDepthRangeArrayv", validContext);
osg::setGLExtensionFuncPtr(glDepthRangeIndexed, "glDepthRangeIndexed", validContext);
osg::setGLExtensionFuncPtr(glDepthRangeIndexedf, "glDepthRangeIndexedfOES", "glDepthRangeIndexedfNV", validContext);
osg::setGLExtensionFuncPtr(glGetFloati_v, "glGetFloati_v", validContext);
osg::setGLExtensionFuncPtr(glGetDoublei_v, "glGetDoublei_v", validContext);
osg::setGLExtensionFuncPtr(glGetIntegerIndexedvEXT, "glGetIntegerIndexedvEXT", validContext);