From 1d75089bf8e6ec77186dafa4cbbfef8c3bfd27af Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 8 Aug 2016 15:08:07 +0100 Subject: [PATCH] Build fixes when compiling wuth CMake options OPENGL_PROFILE set to GLCORE --- include/osg/GLDefines | 8 +++++--- include/osg/Texture | 4 ++-- src/osg/ArrayDispatchers.cpp | 6 +----- src/osg/GLExtensions.cpp | 2 ++ 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/osg/GLDefines b/include/osg/GLDefines index f97dbfa5c..b8b1fc152 100644 --- a/include/osg/GLDefines +++ b/include/osg/GLDefines @@ -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 @@ -615,13 +617,13 @@ namespace osg //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) \ && !defined(GL_ES_VERSION_2_0) && !defined(OPENGLES_1_1_FOUND) - + #if 1 // experimental defination. typedef ptrdiff_t GLsizeiptr; typedef ptrdiff_t GLintptr; #else - + #if defined(_WIN64) typedef __int64 GLintptr; typedef __int64 GLsizeiptr; diff --git a/include/osg/Texture b/include/osg/Texture index d7ffc9086..b34c5aff2 100644 --- a/include/osg/Texture +++ b/include/osg/Texture @@ -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; } diff --git a/src/osg/ArrayDispatchers.cpp b/src/osg/ArrayDispatchers.cpp index 5d61952fa..d65998197 100644 --- a/src/osg/ArrayDispatchers.cpp +++ b/src/osg/ArrayDispatchers.cpp @@ -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(); - #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(Array::FloatArrayType, glTexCoord1fv, 1); texCoordDispatcher.assign(Array::Vec2ArrayType, glTexCoord2fv, 2); texCoordDispatcher.assign(Array::Vec3ArrayType, glTexCoord3fv, 3); texCoordDispatcher.assign(Array::Vec4ArrayType, glTexCoord4fv, 4); - #endif } else { - #if defined(OSG_GL_VERTEX_FUNCS_AVAILABLE) && !defined(OSG_GLES1_AVAILABLE) texCoordDispatcher.targetAssign((GLenum)(GL_TEXTURE0+i), Array::FloatArrayType, extensions->glMultiTexCoord1fv, 1); texCoordDispatcher.targetAssign((GLenum)(GL_TEXTURE0+i), Array::Vec2ArrayType, extensions->glMultiTexCoord2fv, 2); texCoordDispatcher.targetAssign((GLenum)(GL_TEXTURE0+i), Array::Vec3ArrayType, extensions->glMultiTexCoord3fv, 3); texCoordDispatcher.targetAssign((GLenum)(GL_TEXTURE0+i), Array::Vec4ArrayType, extensions->glMultiTexCoord4fv, 4); - #endif } } + #endif } diff --git a/src/osg/GLExtensions.cpp b/src/osg/GLExtensions.cpp index 4f0b442c7..f95530aaa 100644 --- a/src/osg/GLExtensions.cpp +++ b/src/osg/GLExtensions.cpp @@ -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;