diff --git a/.gitignore b/.gitignore index 84a2fea78..d0ef9cd12 100644 --- a/.gitignore +++ b/.gitignore @@ -78,3 +78,9 @@ PlatformSpecifics/Windows/*.rc # Visual Studio - Browsing Database File *.sdf *.opensdf + +#osx xcode +DerivedData/ +*.DS_Store +*.build +*.xcodeproj diff --git a/CMakeLists.txt b/CMakeLists.txt index 338d3d43f..232f0ba6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -568,11 +568,17 @@ ELSEIF(OSG_GLES2_AVAILABLE) IF (APPLE AND NOT ANDROID) SET(OPENGL_HEADER1 "#include \"TargetConditionals.h\"" CACHE STRING "#include<> line for OpenGL Header") SET(OPENGL_HEADER2 "#include " CACHE STRING "#include<> line for additional OpenGL Headers if required") - # TODO: GLES3 ELSE() SET(OPENGL_HEADER1 "#include " CACHE STRING "#include<> line for OpenGL Header") SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required") - # TODO: GLES3 + ENDIF() +ELSEIF(OSG_GLES3_AVAILABLE) + IF (APPLE AND NOT ANDROID) + SET(OPENGL_HEADER1 "#include \"TargetConditionals.h\"" CACHE STRING "#include<> line for OpenGL Header") + SET(OPENGL_HEADER2 "#include " CACHE STRING "#include<> line for additional OpenGL Headers if required") + ELSE() + SET(OPENGL_HEADER1 "#include " CACHE STRING "#include<> line for OpenGL Header") + SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required") ENDIF() ELSE() IF (APPLE) diff --git a/include/osg/Camera b/include/osg/Camera index 376029201..a48b9d0eb 100644 --- a/include/osg/Camera +++ b/include/osg/Camera @@ -26,7 +26,7 @@ #include -#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) +#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) || defined(OSG_GLES3_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) #define GL_FRONT_LEFT 0x0400 #define GL_FRONT_RIGHT 0x0401 #define GL_BACK_LEFT 0x0402 diff --git a/include/osg/Image b/include/osg/Image index b1e467caa..3a90175ea 100644 --- a/include/osg/Image +++ b/include/osg/Image @@ -61,10 +61,13 @@ #define GL_GREEN 0x1904 #define GL_BLUE 0x1905 #define GL_DEPTH_COMPONENT 0x1902 +#endif + +#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) || defined(OSG_GLES3_AVAILABLE) #define GL_STENCIL_INDEX 0x1901 #endif -#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) || defined(OSG_GL3_AVAILABLE) +#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) || defined(OSG_GLES3_AVAILABLE) || defined(OSG_GL3_AVAILABLE) #define GL_BITMAP 0x1A00 #define GL_COLOR_INDEX 0x1900 #define GL_INTENSITY12 0x804C diff --git a/include/osg/PolygonMode b/include/osg/PolygonMode index daa326788..230d6716e 100644 --- a/include/osg/PolygonMode +++ b/include/osg/PolygonMode @@ -17,7 +17,7 @@ #include #include -#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) +#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) || defined(OSG_GLES3_AVAILABLE) #define GL_POINT 0x1B00 #define GL_LINE 0x1B01 #define GL_FILL 0x1B02 diff --git a/include/osg/TexGen b/include/osg/TexGen index cb7200687..ed153d6f6 100644 --- a/include/osg/TexGen +++ b/include/osg/TexGen @@ -17,7 +17,7 @@ #include #include -#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) || defined(OSG_GL3_AVAILABLE) +#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) || defined(OSG_GLES3_AVAILABLE) || defined(OSG_GL3_AVAILABLE) #define GL_OBJECT_LINEAR 0x2401 #define GL_EYE_LINEAR 0x2400 #define GL_SPHERE_MAP 0x2402 diff --git a/src/osg/Depth.cpp b/src/osg/Depth.cpp index 32b09cdad..bf1877287 100644 --- a/src/osg/Depth.cpp +++ b/src/osg/Depth.cpp @@ -30,7 +30,7 @@ void Depth::apply(State&) const { glDepthFunc((GLenum)_func); glDepthMask((GLboolean)_depthWriteMask); -#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) +#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) || defined(OSG_GLES3_AVAILABLE) glDepthRangef(_zNear,_zFar); #else glDepthRange(_zNear,_zFar); diff --git a/src/osg/GL.in b/src/osg/GL.in index 2cacb8142..89c6bace4 100644 --- a/src/osg/GL.in +++ b/src/osg/GL.in @@ -172,13 +172,13 @@ #define GL_NONE 0x0 #endif -#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) +#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) || defined(OSG_GLES3_AVAILABLE) //GLES defines (OES) #define GL_RGB8_OES 0x8051 #define GL_RGBA8_OES 0x8058 #endif -#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) || defined(OSG_GL3_AVAILABLE) +#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) || defined(OSG_GLES3_AVAILABLE) || defined(OSG_GL3_AVAILABLE) #define GL_POLYGON 0x0009 #define GL_QUADS 0x0007 #define GL_QUAD_STRIP 0x0008 diff --git a/src/osg/Image.cpp b/src/osg/Image.cpp index b126048ee..1149acdc4 100644 --- a/src/osg/Image.cpp +++ b/src/osg/Image.cpp @@ -1061,7 +1061,7 @@ void Image::readPixels(int x,int y,int width,int height, void Image::readImageFromCurrentTexture(unsigned int contextID, bool copyMipMapsIfAvailable, GLenum type, unsigned int face) { -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) // OSG_NOTICE<<"Image::readImageFromCurrentTexture()"<data()) return; @@ -378,7 +378,7 @@ void Texture1D::applyTexImage1D(GLenum target, Image* image, State& state, GLsiz void Texture1D::copyTexImage1D(State& state, int x, int y, int width) { -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) const unsigned int contextID = state.getContextID(); // get the texture object for the current contextID. @@ -435,7 +435,7 @@ void Texture1D::copyTexImage1D(State& state, int x, int y, int width) void Texture1D::copyTexSubImage1D(State& state, int xoffset, int x, int y, int width) { -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) const unsigned int contextID = state.getContextID(); // get the texture object for the current contextID. @@ -467,7 +467,7 @@ void Texture1D::copyTexSubImage1D(State& state, int xoffset, int x, int y, int w void Texture1D::allocateMipmap(State& state) const { -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) const unsigned int contextID = state.getContextID(); // get the texture object for the current contextID. diff --git a/src/osg/TextureRectangle.cpp b/src/osg/TextureRectangle.cpp index e6e741e1c..87dbf6f9c 100644 --- a/src/osg/TextureRectangle.cpp +++ b/src/osg/TextureRectangle.cpp @@ -321,7 +321,7 @@ void TextureRectangle::applyTexImage_load(GLenum target, Image* image, State& st { glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE,GL_TRUE); - #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) + #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_PRIORITY,0.0f); #endif diff --git a/src/osg/glu/libutil/mipmap.cpp b/src/osg/glu/libutil/mipmap.cpp index af66c39e6..96c958bd6 100644 --- a/src/osg/glu/libutil/mipmap.cpp +++ b/src/osg/glu/libutil/mipmap.cpp @@ -267,7 +267,7 @@ void PixelStorageModes::retrieveStoreModes() { glGetIntegerv(GL_UNPACK_ALIGNMENT, &unpack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glGetIntegerv(GL_UNPACK_ROW_LENGTH, &unpack_row_length); glGetIntegerv(GL_UNPACK_SKIP_ROWS, &unpack_skip_rows); glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &unpack_skip_pixels); @@ -276,7 +276,7 @@ void PixelStorageModes::retrieveStoreModes() #endif glGetIntegerv(GL_PACK_ALIGNMENT, &pack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glGetIntegerv(GL_PACK_ROW_LENGTH, &pack_row_length); glGetIntegerv(GL_PACK_SKIP_ROWS, &pack_skip_rows); glGetIntegerv(GL_PACK_SKIP_PIXELS, &pack_skip_pixels); @@ -288,7 +288,7 @@ void PixelStorageModes::retrieveStoreModes() void PixelStorageModes::retrieveStoreModes3D() { glGetIntegerv(GL_UNPACK_ALIGNMENT, &unpack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glGetIntegerv(GL_UNPACK_ROW_LENGTH, &unpack_row_length); glGetIntegerv(GL_UNPACK_SKIP_ROWS, &unpack_skip_rows); glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &unpack_skip_pixels); @@ -299,7 +299,7 @@ void PixelStorageModes::retrieveStoreModes3D() #endif glGetIntegerv(GL_PACK_ALIGNMENT, &pack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glGetIntegerv(GL_PACK_ROW_LENGTH, &pack_row_length); glGetIntegerv(GL_PACK_SKIP_ROWS, &pack_skip_rows); glGetIntegerv(GL_PACK_SKIP_PIXELS, &pack_skip_pixels); @@ -3437,7 +3437,7 @@ static void closestFit(GLenum target, GLint width, GLint height, GLint internalFormat, GLenum format, GLenum type, GLint *newWidth, GLint *newHeight) { -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) /* Use proxy textures if OpenGL version is >= 1.1 */ if ( (strtod((const char *)glGetString(GL_VERSION),NULL) >= 1.1) ) { @@ -3592,7 +3592,7 @@ int gluBuild1DMipmapLevelsCore(GLenum target, GLint internalFormat, GLint userLevel, GLint baseLevel,GLint maxLevel, const void *data) { -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) GLint newwidth; GLint level, levels; GLushort *newImage; @@ -3786,7 +3786,7 @@ static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat, cmpts = elements_per_group(format,type); glPixelStorei(GL_UNPACK_ALIGNMENT, 2); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); @@ -3808,7 +3808,7 @@ static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat, otherImage = (GLushort *) malloc(memreq); if (otherImage == NULL) { glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); @@ -3836,7 +3836,7 @@ static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat, } glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); @@ -3913,7 +3913,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, usersImage = (const GLubyte *) data + psm.unpack_skip_rows * rowsize + psm.unpack_skip_pixels * group_size; -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); @@ -3925,20 +3925,20 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, if (width == newwidth && height == newheight) { /* Use usersImage for level userLevel */ if (baseLevel <= level && level <= maxLevel) { -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); #endif glTexImage2D(target, level, internalFormat, width, height, 0, format, type, usersImage); } -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); #endif if(levels == 0) { /* we're done. clean up and return */ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); @@ -4001,7 +4001,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, } if (dstImage == NULL) { glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); @@ -4168,7 +4168,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, } if (dstImage == NULL) { glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); @@ -4227,7 +4227,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, if (dstImage == NULL) { glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); @@ -4415,7 +4415,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, } if (dstImage == NULL) { glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); @@ -4429,7 +4429,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, level = userLevel; } -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); #endif @@ -4579,7 +4579,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, if (newMipmapImage == NULL) { /* out of memory so return */ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); @@ -4615,7 +4615,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, } /* for level */ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); @@ -7428,7 +7428,7 @@ static void closestFit3D(GLTexImage3DProc gluTexImage3D, GLint internalFormat, GLenum format, GLenum type, GLint *newWidth, GLint *newHeight, GLint *newDepth) { -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) GLint widthPowerOf2= nearestPower(width); GLint heightPowerOf2= nearestPower(height); GLint depthPowerOf2= nearestPower(depth); @@ -7837,7 +7837,7 @@ static int gluBuild3DMipmapLevelsCore(GLTexImage3DProc gluTexImage3D, } if(levels == 0) { /* we're done. clean up and return */ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); @@ -7903,7 +7903,7 @@ static int gluBuild3DMipmapLevelsCore(GLTexImage3DProc gluTexImage3D, } if (dstImage == NULL) { glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); @@ -8124,7 +8124,7 @@ static int gluBuild3DMipmapLevelsCore(GLTexImage3DProc gluTexImage3D, } if (dstImage == NULL) { glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); @@ -8185,7 +8185,7 @@ static int gluBuild3DMipmapLevelsCore(GLTexImage3DProc gluTexImage3D, if (dstImage == NULL) { glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); @@ -8263,7 +8263,7 @@ static int gluBuild3DMipmapLevelsCore(GLTexImage3DProc gluTexImage3D, } if (dstImage == NULL) { glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); @@ -8279,7 +8279,7 @@ static int gluBuild3DMipmapLevelsCore(GLTexImage3DProc gluTexImage3D, level = userLevel; } -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); #endif @@ -8466,7 +8466,7 @@ static int gluBuild3DMipmapLevelsCore(GLTexImage3DProc gluTexImage3D, } /* for level */ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) + #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); diff --git a/src/osgDB/ObjectWrapper.cpp b/src/osgDB/ObjectWrapper.cpp index bab389342..ef0d8eab0 100644 --- a/src/osgDB/ObjectWrapper.cpp +++ b/src/osgDB/ObjectWrapper.cpp @@ -53,7 +53,7 @@ #define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 #endif -#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) +#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) || defined(OSG_GLES3_AVAILABLE) #define GL_POLYGON_SMOOTH_HINT 0x0C53 #define GL_LINE_SMOOTH_HINT 0x0C52 #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B diff --git a/src/osgGA/StateSetManipulator.cpp b/src/osgGA/StateSetManipulator.cpp index cd75cb06a..2f5b61e05 100644 --- a/src/osgGA/StateSetManipulator.cpp +++ b/src/osgGA/StateSetManipulator.cpp @@ -96,7 +96,7 @@ bool StateSetManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& aa) (_stateset->getTextureMode(0,GL_TEXTURE_RECTANGLE)&mode)!=0 || (_stateset->getTextureMode(0,GL_TEXTURE_CUBE_MAP)&mode)!=0; - #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) + #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) _texture |= ((_stateset->getTextureMode(0,GL_TEXTURE_1D)&mode)!=0); #endif } @@ -181,7 +181,7 @@ void StateSetManipulator::setTextureEnabled(bool newtexture) if ( _texture ) mode = osg::StateAttribute::INHERIT|osg::StateAttribute::ON; for( unsigned int ii=0; ii<_maxNumOfTextureUnits; ii++ ) { - #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) + #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) _stateset->setTextureMode( ii, GL_TEXTURE_1D, mode ); #endif _stateset->setTextureMode( ii, GL_TEXTURE_2D, mode ); diff --git a/src/osgParticle/ParticleSystem.cpp b/src/osgParticle/ParticleSystem.cpp index 7d95b3516..c20bef1d5 100644 --- a/src/osgParticle/ParticleSystem.cpp +++ b/src/osgParticle/ParticleSystem.cpp @@ -460,7 +460,7 @@ void osgParticle::ParticleSystem::drawImplementation(osg::RenderInfo& renderInfo } // set up depth mask for first rendering pass -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) glPushAttrib(GL_DEPTH_BUFFER_BIT); #endif @@ -469,7 +469,7 @@ void osgParticle::ParticleSystem::drawImplementation(osg::RenderInfo& renderInfo ad.dispatchArrays(state); ad.dispatchPrimitives(); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) // restore depth mask settings glPopAttrib(); #endif @@ -478,14 +478,14 @@ void osgParticle::ParticleSystem::drawImplementation(osg::RenderInfo& renderInfo if (_doublepass) { // set up color mask for second rendering pass -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) glPushAttrib(GL_COLOR_BUFFER_BIT); #endif glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); ad.dispatchPrimitives(); -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) // restore color mask settings glPopAttrib(); #endif diff --git a/src/osgPlugins/logo/ReaderWriterLOGO.cpp b/src/osgPlugins/logo/ReaderWriterLOGO.cpp index 7f3655456..0af8a20a7 100644 --- a/src/osgPlugins/logo/ReaderWriterLOGO.cpp +++ b/src/osgPlugins/logo/ReaderWriterLOGO.cpp @@ -98,7 +98,7 @@ class Logos: public osg::Drawable virtual void drawImplementation(osg::RenderInfo& renderInfo) const { - #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) + #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) if( renderInfo.getContextID() != _contextID ) return; diff --git a/src/osgShadow/ShadowMap.cpp b/src/osgShadow/ShadowMap.cpp index 724ff9fe6..3391523b7 100644 --- a/src/osgShadow/ShadowMap.cpp +++ b/src/osgShadow/ShadowMap.cpp @@ -341,7 +341,7 @@ void ShadowMap::init() _stateset->setTextureAttribute(_baseTextureUnit,fakeTex,osg::StateAttribute::ON); _stateset->setTextureMode(_baseTextureUnit,GL_TEXTURE_2D,osg::StateAttribute::ON); _stateset->setTextureMode(_baseTextureUnit,GL_TEXTURE_3D,osg::StateAttribute::OFF); - #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) + #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) _stateset->setTextureMode(_baseTextureUnit,GL_TEXTURE_1D,osg::StateAttribute::OFF); #endif } diff --git a/src/osgShadow/StandardShadowMap.cpp b/src/osgShadow/StandardShadowMap.cpp index ae87c55ea..564aff078 100644 --- a/src/osgShadow/StandardShadowMap.cpp +++ b/src/osgShadow/StandardShadowMap.cpp @@ -560,7 +560,7 @@ void StandardShadowMap::ViewData::init( ThisClass *st, osgUtil::CullVisitor *cv _stateset->setTextureAttribute(st->_baseTextureUnit,fakeTex,osg::StateAttribute::ON); _stateset->setTextureMode(st->_baseTextureUnit,GL_TEXTURE_2D,osg::StateAttribute::ON); _stateset->setTextureMode(st->_baseTextureUnit,GL_TEXTURE_3D,osg::StateAttribute::OFF); - #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) + #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) _stateset->setTextureMode(st->_baseTextureUnit,GL_TEXTURE_1D,osg::StateAttribute::OFF); #endif } @@ -664,7 +664,7 @@ void StandardShadowMap::ViewData::init( ThisClass *st, osgUtil::CullVisitor *cv for( unsigned stage = 1; stage < 4; stage ++ ) { - #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) + #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) stateset->setTextureMode( stage, GL_TEXTURE_1D, osg::StateAttribute::OVERRIDE | osg::StateAttribute::OFF ); #endif stateset->setTextureMode( stage, GL_TEXTURE_2D, osg::StateAttribute::OVERRIDE | osg::StateAttribute::OFF ); diff --git a/src/osgSim/LightPointDrawable.cpp b/src/osgSim/LightPointDrawable.cpp index 4f5b4f115..1a6b9f7bc 100644 --- a/src/osgSim/LightPointDrawable.cpp +++ b/src/osgSim/LightPointDrawable.cpp @@ -85,7 +85,7 @@ void LightPointDrawable::reset() void LightPointDrawable::drawImplementation(osg::RenderInfo& renderInfo) const { -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) osg::State& state = *renderInfo.getState(); state.applyMode(GL_POINT_SMOOTH,true); diff --git a/src/osgSim/LightPointSpriteDrawable.cpp b/src/osgSim/LightPointSpriteDrawable.cpp index 607f97e20..530725613 100644 --- a/src/osgSim/LightPointSpriteDrawable.cpp +++ b/src/osgSim/LightPointSpriteDrawable.cpp @@ -30,7 +30,7 @@ LightPointSpriteDrawable::LightPointSpriteDrawable(const LightPointSpriteDrawabl void LightPointSpriteDrawable::drawImplementation(osg::RenderInfo& renderInfo) const { -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) osg::State& state = *renderInfo.getState(); if (!state.getModeValidity(GL_POINT_SPRITE_ARB)) diff --git a/src/osgUtil/RenderStage.cpp b/src/osgUtil/RenderStage.cpp index a08bf3a67..2b707e57d 100644 --- a/src/osgUtil/RenderStage.cpp +++ b/src/osgUtil/RenderStage.cpp @@ -519,7 +519,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo) { setDrawBuffer( GL_NONE, true ); setReadBuffer( GL_NONE, true ); - #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) + #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glDrawBuffer( GL_NONE ); glReadBuffer( GL_NONE ); #endif @@ -911,7 +911,7 @@ void RenderStage::drawInner(osg::RenderInfo& renderInfo,RenderLeaf*& previous, b if (!using_multiple_render_targets) { - #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) + #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) if( getDrawBufferApplyMask() ) glDrawBuffer(_drawBuffer); @@ -997,7 +997,7 @@ void RenderStage::drawInner(osg::RenderInfo& renderInfo,RenderLeaf*& previous, b blitMask, GL_NEAREST); } -#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) if (needToBlitColorBuffers) { for (FrameBufferObject::AttachmentMap::const_iterator @@ -1349,7 +1349,7 @@ void RenderStage::drawImplementation(osg::RenderInfo& renderInfo,RenderLeaf*& pr if (_clearMask & GL_DEPTH_BUFFER_BIT) { - #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) + #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) glClearDepth( _clearDepth); #else glClearDepthf( _clearDepth); @@ -1366,7 +1366,7 @@ void RenderStage::drawImplementation(osg::RenderInfo& renderInfo,RenderLeaf*& pr state.haveAppliedAttribute( osg::StateAttribute::STENCIL ); } - #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) + #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) if (_clearMask & GL_ACCUM_BUFFER_BIT) { glClearAccum( _clearAccum[0], _clearAccum[1], _clearAccum[2], _clearAccum[3]); diff --git a/src/osgUtil/SceneView.cpp b/src/osgUtil/SceneView.cpp index 89296b3c1..b4fd18a89 100644 --- a/src/osgUtil/SceneView.cpp +++ b/src/osgUtil/SceneView.cpp @@ -1232,7 +1232,7 @@ void SceneView::draw() case(osg::DisplaySettings::HORIZONTAL_INTERLACE): case(osg::DisplaySettings::CHECKERBOARD): { - #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) + #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) && !defined(OSG_GLES3_AVAILABLE) && !defined(OSG_GL3_AVAILABLE) if( 0 == ( _camera->getInheritanceMask() & DRAW_BUFFER) ) { _renderStageLeft->setDrawBuffer(_camera->getDrawBuffer());