Build fixes when compiling wuth CMake options OPENGL_PROFILE set to GLCORE

This commit is contained in:
Robert Osfield 2016-08-08 15:08:07 +01:00
parent 46c86f53ac
commit 1d75089bf8
4 changed files with 10 additions and 10 deletions

View File

@ -45,8 +45,10 @@
typedef char GLchar;
#endif
#if !defined(GL_VERSION_2_0)
#if !defined(GL_VERTEX_PROGRAM_POINT_SIZE)
#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
#endif
#if !defined(GL_VERTEX_PROGRAM_TWO_SIDE)
#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
#endif

View File

@ -446,13 +446,13 @@ class OSG_EXPORT Texture : public osg::StateAttribute
virtual GLenum getTextureTarget() const = 0;
#ifdef OSG_GL_FIXED_FUNCTION_AVAILABLE
virtual bool getModeUsage(StateAttribute::ModeUsage& usage) const
{
#ifdef OSG_GL_FIXED_FUNCTION_AVAILABLE
usage.usesTextureMode(getTextureTarget());
#endif
return true;
}
#endif
virtual int getTextureWidth() const { return 0; }
virtual int getTextureHeight() const { return 0; }

View File

@ -282,7 +282,6 @@ void ArrayDispatchers::assignTexCoordDispatchers(unsigned int unit)
{
#if defined(OSG_GL_VERTEX_FUNCS_AVAILABLE) && !defined(OSG_GLES1_AVAILABLE)
GLExtensions* extensions = _state->get<GLExtensions>();
#endif
for(unsigned int i=_texCoordDispatchers.size(); i<=unit; ++i)
{
@ -290,23 +289,20 @@ void ArrayDispatchers::assignTexCoordDispatchers(unsigned int unit)
AttributeDispatchMap& texCoordDispatcher = *_texCoordDispatchers[i];
if (i==0)
{
#if defined(OSG_GL_VERTEX_FUNCS_AVAILABLE) && !defined(OSG_GLES1_AVAILABLE)
texCoordDispatcher.assign<GLfloat>(Array::FloatArrayType, glTexCoord1fv, 1);
texCoordDispatcher.assign<GLfloat>(Array::Vec2ArrayType, glTexCoord2fv, 2);
texCoordDispatcher.assign<GLfloat>(Array::Vec3ArrayType, glTexCoord3fv, 3);
texCoordDispatcher.assign<GLfloat>(Array::Vec4ArrayType, glTexCoord4fv, 4);
#endif
}
else
{
#if defined(OSG_GL_VERTEX_FUNCS_AVAILABLE) && !defined(OSG_GLES1_AVAILABLE)
texCoordDispatcher.targetAssign<GLenum, GLfloat>((GLenum)(GL_TEXTURE0+i), Array::FloatArrayType, extensions->glMultiTexCoord1fv, 1);
texCoordDispatcher.targetAssign<GLenum, GLfloat>((GLenum)(GL_TEXTURE0+i), Array::Vec2ArrayType, extensions->glMultiTexCoord2fv, 2);
texCoordDispatcher.targetAssign<GLenum, GLfloat>((GLenum)(GL_TEXTURE0+i), Array::Vec3ArrayType, extensions->glMultiTexCoord3fv, 3);
texCoordDispatcher.targetAssign<GLenum, GLfloat>((GLenum)(GL_TEXTURE0+i), Array::Vec4ArrayType, extensions->glMultiTexCoord4fv, 4);
}
}
#endif
}
}
}

View File

@ -1159,6 +1159,7 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
glMaxTextureCoords = glMaxTextureUnits;
#endif
}
#ifdef GL_MAX_TEXTURE_UNITS
else if ( osg::getGLVersionNumber() >= 1.3 ||
osg::isGLExtensionSupported(contextID,"GL_ARB_multitexture") ||
osg::isGLExtensionSupported(contextID,"GL_EXT_multitexture") ||
@ -1169,6 +1170,7 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
glMaxTextureUnits = maxTextureUnits;
glMaxTextureCoords = maxTextureUnits;
}
#endif
else
{
glMaxTextureUnits = 1;