diff -rupN original/Components/Terrain/src/OgreTerrain.cpp new/Components/Terrain/src/OgreTerrain.cpp --- original/Components/Terrain/src/OgreTerrain.cpp 2014-10-28 08:05:45.000000000 +0200 +++ new/Components/Terrain/src/OgreTerrain.cpp 2014-11-24 23:27:30.000000000 +0200 @@ -287,7 +287,7 @@ namespace Ogre load(0,true); #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS - DataStreamPtr stream = Root::getSingleton().createFileStream(macBundlePath() + "/../Documents/" + filename, + DataStreamPtr stream = Root::getSingleton().createFileStream(iOSDocumentsDirectory() + "/" + filename, _getDerivedResourceGroup(), true); #else DataStreamPtr stream = Root::getSingleton().createFileStream(filename, diff -rupN original/OgreMain/src/OgreRoot.cpp new/OgreMain/src/OgreRoot.cpp --- original/OgreMain/src/OgreRoot.cpp 2014-10-28 08:05:45.000000000 +0200 +++ new/OgreMain/src/OgreRoot.cpp 2014-11-24 23:27:30.000000000 +0200 @@ -378,7 +378,7 @@ namespace Ogre { // Check the Documents directory within the application sandbox Ogre::String outBaseName, extension, configFileName; Ogre::StringUtil::splitFilename(mConfigFileName, outBaseName, extension); - configFileName = macBundlePath() + "/../Documents/" + outBaseName; + configFileName = iOSDocumentsDirectory() + "/" + outBaseName; std::ofstream of(configFileName.c_str()); if (of.is_open()) mConfigFileName = configFileName; @@ -432,7 +432,7 @@ namespace Ogre { Ogre::String outBaseName, extension, configFileName; Ogre::StringUtil::splitFilename(mConfigFileName, outBaseName, extension); - configFileName = macBundlePath() + "/../Documents/" + outBaseName; + configFileName = iOSDocumentsDirectory() + "/" + outBaseName; std::ifstream fp; fp.open(configFileName.c_str(), std::ios::in); diff -rupN original/OgreMain/src/iOS/OgreFileSystemLayer.mm new/OgreMain/src/iOS/OgreFileSystemLayer.mm --- original/OgreMain/src/iOS/OgreFileSystemLayer.mm 2014-10-28 08:05:45.000000000 +0200 +++ new/OgreMain/src/iOS/OgreFileSystemLayer.mm 2014-11-24 23:27:22.000000000 +0200 @@ -34,7 +34,7 @@ namespace Ogre { void FileSystemLayer::getConfigPaths() { - mConfigPaths.push_back(Ogre::macBundlePath() + "/../Documents/"); + mConfigPaths.push_back(Ogre::iOSDocumentsDirectory() + "/"); mConfigPaths.push_back(Ogre::macBundlePath() + "/"); } //--------------------------------------------------------------------- diff -rupN original/RenderSystems/GLES/CMakeLists.txt new/RenderSystems/GLES/CMakeLists.txt --- original/RenderSystems/GLES/CMakeLists.txt 2014-10-28 08:05:45.000000000 +0200 +++ new/RenderSystems/GLES/CMakeLists.txt 2014-11-20 01:52:40.000000000 +0200 @@ -40,7 +40,7 @@ if (WIN32) # Add system specific settings elseif (APPLE) file(GLOB PLATFORM_HEADERS "include/EAGL/*.h") - file(GLOB PLATFORM_SOURCES "include/EAGL/*.mm") + file(GLOB PLATFORM_SOURCES "src/EAGL/*.mm") include_directories(src/EAGL include/EAGL) link_directories(${OPENGLES_LIBRARY_PATH}) diff -rupN original/RenderSystems/GLES/src/EAGL/OgreEAGLWindow.mm new/RenderSystems/GLES/src/EAGL/OgreEAGLWindow.mm --- original/RenderSystems/GLES/src/EAGL/OgreEAGLWindow.mm 2014-10-28 08:05:45.000000000 +0200 +++ new/RenderSystems/GLES/src/EAGL/OgreEAGLWindow.mm 2014-11-27 00:00:51.000000000 +0200 @@ -116,19 +116,8 @@ namespace Ogre { { if(!mWindow) return; - Real w = mContentScalingFactor, h = mContentScalingFactor; - - // Check the orientation of the view controller and adjust dimensions - if (UIInterfaceOrientationIsPortrait(mViewController.interfaceOrientation)) - { - h *= std::max(width, height); - w *= std::min(width, height); - } - else - { - w *= std::max(width, height); - h *= std::min(width, height); - } + Real w = width * mContentScalingFactor; + Real h = height * mContentScalingFactor; // Check if the window size really changed if(mWidth == w && mHeight == h) @@ -151,10 +140,10 @@ namespace Ogre { void EAGLWindow::windowMovedOrResized() { CGRect frame = [mView frame]; - mWidth = (unsigned int)frame.size.width; - mHeight = (unsigned int)frame.size.height; - mLeft = (int)frame.origin.x; - mTop = (int)frame.origin.y+(int)frame.size.height; + mWidth = (unsigned int)frame.size.width * mContentScalingFactor; + mHeight = (unsigned int)frame.size.height * mContentScalingFactor; + mLeft = (int)frame.origin.x * mContentScalingFactor; + mTop = ((int)frame.origin.y + (int)frame.size.height) * mContentScalingFactor; for (ViewportList::iterator it = mViewportList.begin(); it != mViewportList.end(); ++it) { @@ -264,7 +253,8 @@ namespace Ogre { OgreAssert(mContext != nil, "EAGLWindow: Failed to create OpenGL ES context"); - [mWindow addSubview:mViewController.view]; + if(!mUsingExternalViewController) + [mWindow addSubview:mViewController.view]; mViewController.mGLSupport = mGLSupport; @@ -274,7 +264,8 @@ namespace Ogre { if(!mUsingExternalView) [mView release]; - [mWindow makeKeyAndVisible]; + if(!mUsingExternalViewController) + [mWindow makeKeyAndVisible]; mContext->createFramebuffer(); diff -rupN original/RenderSystems/GLES2/src/EAGL/OgreEAGL2Window.mm new/RenderSystems/GLES2/src/EAGL/OgreEAGL2Window.mm --- original/RenderSystems/GLES2/src/EAGL/OgreEAGL2Window.mm 2014-10-28 08:05:45.000000000 +0200 +++ new/RenderSystems/GLES2/src/EAGL/OgreEAGL2Window.mm 2014-11-26 23:59:48.000000000 +0200 @@ -113,19 +113,8 @@ namespace Ogre { { if(!mWindow) return; - Real w = mContentScalingFactor, h = mContentScalingFactor; - - // Check the orientation of the view controller and adjust dimensions - if (UIInterfaceOrientationIsPortrait(mViewController.interfaceOrientation)) - { - h *= std::max(width, height); - w *= std::min(width, height); - } - else - { - w *= std::max(width, height); - h *= std::min(width, height); - } + Real w = width * mContentScalingFactor; + Real h = height * mContentScalingFactor; // Check if the window size really changed if(mWidth == w && mHeight == h) @@ -148,10 +137,10 @@ namespace Ogre { void EAGL2Window::windowMovedOrResized() { CGRect frame = [mView frame]; - mWidth = (unsigned int)frame.size.width; - mHeight = (unsigned int)frame.size.height; - mLeft = (int)frame.origin.x; - mTop = (int)frame.origin.y+(int)frame.size.height; + mWidth = (unsigned int)frame.size.width * mContentScalingFactor; + mHeight = (unsigned int)frame.size.height * mContentScalingFactor; + mLeft = (int)frame.origin.x * mContentScalingFactor; + mTop = ((int)frame.origin.y + (int)frame.size.height) * mContentScalingFactor; for (ViewportList::iterator it = mViewportList.begin(); it != mViewportList.end(); ++it) { diff -rupN original/RenderSystems/GLES2/src/GLSLES/src/OgreGLSLESCgProgram.cpp new/RenderSystems/GLES2/src/GLSLES/src/OgreGLSLESCgProgram.cpp --- original/RenderSystems/GLES2/src/GLSLES/src/OgreGLSLESCgProgram.cpp 2014-10-28 08:05:45.000000000 +0200 +++ new/RenderSystems/GLES2/src/GLSLES/src/OgreGLSLESCgProgram.cpp 2014-11-21 02:22:09.000000000 +0200 @@ -374,14 +374,14 @@ namespace Ogre { Hlsl2Glsl_SetUserAttributeNames (parser, gAttribSemantic, gAttribString, gNumberOfAttribSemantic); // we want user varyings in this case (and not opengl's) - Hlsl2Glsl_UseUserVaryings(parser, true); +// Hlsl2Glsl_UseUserVaryings(parser, true); int res = 0; // parse the file - res = Hlsl2Glsl_Parse (parser, sourceToUse.c_str(), options); + res = Hlsl2Glsl_Parse(parser, sourceToUse.c_str(), ETargetGLSL_ES_100, nullptr, options); // convert from cg to glsl - res = res && Hlsl2Glsl_Translate( parser, mEntryPoint.c_str(), options); + res = res && Hlsl2Glsl_Translate(parser, mEntryPoint.c_str(), ETargetGLSL_ES_100, options); // check for error if (res == 0) diff -rupN original/RenderSystems/GLES2/src/GLSLES/src/OgreGLSLESCgProgramFactory.cpp new/RenderSystems/GLES2/src/GLSLES/src/OgreGLSLESCgProgramFactory.cpp --- original/RenderSystems/GLES2/src/GLSLES/src/OgreGLSLESCgProgramFactory.cpp 2014-10-28 08:05:45.000000000 +0200 +++ new/RenderSystems/GLES2/src/GLSLES/src/OgreGLSLESCgProgramFactory.cpp 2014-11-20 21:59:07.000000000 +0200 @@ -41,7 +41,8 @@ namespace Ogre { //----------------------------------------------------------------------- GLSLESCgProgramFactory::~GLSLESCgProgramFactory() { - Hlsl2Glsl_Finalize(); +// Hlsl2Glsl_Finalize(); + Hlsl2Glsl_Shutdown(); } //----------------------------------------------------------------------- const String& GLSLESCgProgramFactory::getLanguage(void) const diff -rupN original/RenderSystems/GLES2/src/gles2w.cpp new/RenderSystems/GLES2/src/gles2w.cpp --- original/RenderSystems/GLES2/src/gles2w.cpp 2014-10-28 08:05:45.000000000 +0200 +++ new/RenderSystems/GLES2/src/gles2w.cpp 2014-11-24 23:42:02.000000000 +0200 @@ -61,7 +61,7 @@ static void open_libgl(void) if(isSimulator) { // Ask where Xcode is installed - std::string xcodePath = exec("/usr/bin/xcode-select -print-path"); + std::string xcodePath = "/Applications/Xcode.app/Contents/Developer\n"; // The result contains an end line character. Remove it. size_t pos = xcodePath.find("\n"); diff -rupN original/RenderSystems/GLES2/src/gles3w.cpp new/RenderSystems/GLES2/src/gles3w.cpp --- original/RenderSystems/GLES2/src/gles3w.cpp 2014-10-28 08:05:45.000000000 +0200 +++ new/RenderSystems/GLES2/src/gles3w.cpp 2014-11-24 23:42:35.000000000 +0200 @@ -61,7 +61,7 @@ static void open_libgl(void) if(isSimulator) { // Ask where Xcode is installed - std::string xcodePath = exec("/usr/bin/xcode-select -print-path"); + std::string xcodePath = "/Applications/Xcode.app/Contents/Developer\n"; // The result contains an end line character. Remove it. size_t pos = xcodePath.find("\n");