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; typedef char GLchar;
#endif #endif
#if !defined(GL_VERSION_2_0) #if !defined(GL_VERTEX_PROGRAM_POINT_SIZE)
#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 #define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
#endif
#if !defined(GL_VERTEX_PROGRAM_TWO_SIDE)
#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 #define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
#endif #endif
@ -615,13 +617,13 @@ namespace osg
//all ES versions except GL_OES_VERSION_1_0 provide these types for OpenGL ES //all ES versions except GL_OES_VERSION_1_0 provide these types for OpenGL ES
#if !defined(GL_VERSION_1_5) && !defined(GL_ARB_vertex_buffer_object) \ #if !defined(GL_VERSION_1_5) && !defined(GL_ARB_vertex_buffer_object) \
&& !defined(GL_ES_VERSION_2_0) && !defined(OPENGLES_1_1_FOUND) && !defined(GL_ES_VERSION_2_0) && !defined(OPENGLES_1_1_FOUND)
#if 1 #if 1
// experimental defination. // experimental defination.
typedef ptrdiff_t GLsizeiptr; typedef ptrdiff_t GLsizeiptr;
typedef ptrdiff_t GLintptr; typedef ptrdiff_t GLintptr;
#else #else
#if defined(_WIN64) #if defined(_WIN64)
typedef __int64 GLintptr; typedef __int64 GLintptr;
typedef __int64 GLsizeiptr; typedef __int64 GLsizeiptr;

View File

@ -446,13 +446,13 @@ class OSG_EXPORT Texture : public osg::StateAttribute
virtual GLenum getTextureTarget() const = 0; virtual GLenum getTextureTarget() const = 0;
#ifdef OSG_GL_FIXED_FUNCTION_AVAILABLE
virtual bool getModeUsage(StateAttribute::ModeUsage& usage) const virtual bool getModeUsage(StateAttribute::ModeUsage& usage) const
{ {
#ifdef OSG_GL_FIXED_FUNCTION_AVAILABLE
usage.usesTextureMode(getTextureTarget()); usage.usesTextureMode(getTextureTarget());
#endif
return true; return true;
} }
#endif
virtual int getTextureWidth() const { return 0; } virtual int getTextureWidth() const { return 0; }
virtual int getTextureHeight() 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) #if defined(OSG_GL_VERTEX_FUNCS_AVAILABLE) && !defined(OSG_GLES1_AVAILABLE)
GLExtensions* extensions = _state->get<GLExtensions>(); GLExtensions* extensions = _state->get<GLExtensions>();
#endif
for(unsigned int i=_texCoordDispatchers.size(); i<=unit; ++i) for(unsigned int i=_texCoordDispatchers.size(); i<=unit; ++i)
{ {
@ -290,23 +289,20 @@ void ArrayDispatchers::assignTexCoordDispatchers(unsigned int unit)
AttributeDispatchMap& texCoordDispatcher = *_texCoordDispatchers[i]; AttributeDispatchMap& texCoordDispatcher = *_texCoordDispatchers[i];
if (i==0) 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::FloatArrayType, glTexCoord1fv, 1);
texCoordDispatcher.assign<GLfloat>(Array::Vec2ArrayType, glTexCoord2fv, 2); texCoordDispatcher.assign<GLfloat>(Array::Vec2ArrayType, glTexCoord2fv, 2);
texCoordDispatcher.assign<GLfloat>(Array::Vec3ArrayType, glTexCoord3fv, 3); texCoordDispatcher.assign<GLfloat>(Array::Vec3ArrayType, glTexCoord3fv, 3);
texCoordDispatcher.assign<GLfloat>(Array::Vec4ArrayType, glTexCoord4fv, 4); texCoordDispatcher.assign<GLfloat>(Array::Vec4ArrayType, glTexCoord4fv, 4);
#endif
} }
else 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::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::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::Vec3ArrayType, extensions->glMultiTexCoord3fv, 3);
texCoordDispatcher.targetAssign<GLenum, GLfloat>((GLenum)(GL_TEXTURE0+i), Array::Vec4ArrayType, extensions->glMultiTexCoord4fv, 4); texCoordDispatcher.targetAssign<GLenum, GLfloat>((GLenum)(GL_TEXTURE0+i), Array::Vec4ArrayType, extensions->glMultiTexCoord4fv, 4);
#endif
} }
} }
#endif
} }

View File

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