Build fixes when compiling wuth CMake options OPENGL_PROFILE set to GLCORE
This commit is contained in:
parent
46c86f53ac
commit
1d75089bf8
@ -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
|
||||
|
||||
|
@ -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; }
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user