From 2ce5238cf7fe78a64af18a62e036fe9e0e29d721 Mon Sep 17 00:00:00 2001 From: Thomas Hogarth Date: Thu, 4 May 2017 18:17:30 +0100 Subject: [PATCH] Added more plugins to iOS example, Textures now working on GLES3 (missed so if defineds) --- examples/osgviewerIPhone/CMakeLists.txt | 2 +- examples/osgviewerIPhone/osgPlugins.h | 24 +++++++++++++++++++++--- src/osg/Texture.cpp | 10 +++++----- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/examples/osgviewerIPhone/CMakeLists.txt b/examples/osgviewerIPhone/CMakeLists.txt index c47097405..b0a48f00d 100644 --- a/examples/osgviewerIPhone/CMakeLists.txt +++ b/examples/osgviewerIPhone/CMakeLists.txt @@ -7,7 +7,7 @@ SET(TARGET_SRC osgIPhoneViewer-Info.plist ) -SET(TARGET_ADDED_LIBRARIES osgdb_osg osgdb_imageio osgdb_avfoundation) +SET(TARGET_ADDED_LIBRARIES osgdb_osg osgdb_rgb osgdb_imageio osgdb_avfoundation) SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES} osgdb_deprecated_osg osgdb_deprecated_osgparticle osgdb_deprecated_osganimation diff --git a/examples/osgviewerIPhone/osgPlugins.h b/examples/osgviewerIPhone/osgPlugins.h index 02eb9f285..8dbc34d71 100644 --- a/examples/osgviewerIPhone/osgPlugins.h +++ b/examples/osgviewerIPhone/osgPlugins.h @@ -9,17 +9,35 @@ USE_GRAPICSWINDOW_IMPLEMENTATION(IOS) //plugins -//USE_OSGPLUGIN(obj) -//USE_OSGPLUGIN(ive) - USE_OSGPLUGIN(osg) USE_DOTOSGWRAPPER_LIBRARY(osg) +USE_DOTOSGWRAPPER_LIBRARY(osgFX) +USE_DOTOSGWRAPPER_LIBRARY(osgParticle) +USE_DOTOSGWRAPPER_LIBRARY(osgShadow) +USE_DOTOSGWRAPPER_LIBRARY(osgSim) +USE_DOTOSGWRAPPER_LIBRARY(osgTerrain) +USE_DOTOSGWRAPPER_LIBRARY(osgText) +USE_DOTOSGWRAPPER_LIBRARY(osgViewer) +USE_DOTOSGWRAPPER_LIBRARY(osgVolume) USE_OSGPLUGIN(osg2) USE_SERIALIZER_WRAPPER_LIBRARY(osg) +USE_SERIALIZER_WRAPPER_LIBRARY(osgAnimation) +USE_SERIALIZER_WRAPPER_LIBRARY(osgFX) +USE_SERIALIZER_WRAPPER_LIBRARY(osgManipulator) +USE_SERIALIZER_WRAPPER_LIBRARY(osgParticle) +USE_SERIALIZER_WRAPPER_LIBRARY(osgShadow) +USE_SERIALIZER_WRAPPER_LIBRARY(osgSim) +USE_SERIALIZER_WRAPPER_LIBRARY(osgTerrain) +USE_SERIALIZER_WRAPPER_LIBRARY(osgText) +USE_SERIALIZER_WRAPPER_LIBRARY(osgVolume) + +//USE_OSGPLUGIN(obj) +//USE_OSGPLUGIN(ive) USE_OSGPLUGIN(imageio) USE_OSGPLUGIN(rgb) +//USE_OSGPLUGIN(pvr) //USE_OSGPLUGIN(avfoundation) //USE_OSGPLUGIN(freetype) diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index 536f5b5f7..e033ccdc3 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -1616,7 +1616,7 @@ void Texture::computeInternalFormatWithImage(const osg::Image& image) const } } -#if defined (OSG_GLES1_AVAILABLE) || defined (OSG_GLES2_AVAILABLE) +#if defined (OSG_GLES1_AVAILABLE) || defined (OSG_GLES2_AVAILABLE) || defined (OSG_GLES3_AVAILABLE) // GLES doesn't cope with internal formats of 1,2,3 and 4 and glTexImage doesn't // handle the _OES pixel formats so map them to the appropriate equivilants. switch(internalFormat) @@ -1905,7 +1905,7 @@ void Texture::applyTexParameters(GLenum target, State& state) const wr = CLAMP; } - #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 (ws == CLAMP) ws = CLAMP_TO_EDGE; if (wt == CLAMP) wt = CLAMP_TO_EDGE; if (wr == CLAMP) wr = CLAMP_TO_EDGE; @@ -2206,7 +2206,7 @@ void Texture::applyTexImage2D_load(State& state, GLenum target, const Image* ima { pbo = 0; } -#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,rowLength); #endif if( !mipmappingRequired || useHardwareMipMapGeneration) @@ -2552,7 +2552,7 @@ void Texture::applyTexImage2D_subload(State& state, GLenum target, const Image* { pbo = 0; } -#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,rowLength); #endif if( !mipmappingRequired || useHardwareMipMapGeneration) @@ -2689,7 +2689,7 @@ Texture::GenerateMipmapMode Texture::mipmapBeforeTexImage(const State& state, bo { if (hardwareMipmapOn) { -#if defined( OSG_GLES2_AVAILABLE ) || defined( OSG_GL3_AVAILABLE ) +#if defined( OSG_GLES2_AVAILABLE ) || defined( OSG_GLES3_AVAILABLE ) || defined( OSG_GL3_AVAILABLE ) return GENERATE_MIPMAP; #else