Skip to content

Commit

Permalink
[iOS] iOS 7 support and a number of GL ES 3 fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjrogers committed Sep 28, 2013
1 parent b022144 commit 5bc34a3
Show file tree
Hide file tree
Showing 88 changed files with 2,109 additions and 519 deletions.
5 changes: 4 additions & 1 deletion CMake/Templates/SDK_CMakeLists.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,14 @@ if (APPLE AND OGRE_BUILD_PLATFORM_APPLE_IOS)

set(CMAKE_OSX_DEPLOYMENT_TARGET "")
set(CMAKE_EXE_LINKER_FLAGS "-framework Foundation -framework CoreGraphics -framework QuartzCore -framework UIKit")
set(XCODE_ATTRIBUTE_GCC_UNROLL_LOOPS "YES")
set(XCODE_ATTRIBUTE_LLVM_VECTORIZE_LOOPS "YES")
set(XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES")
set(OGRE_BUILD_RENDERSYSTEM_GLES TRUE CACHE BOOL "Forcing OpenGL ES RenderSystem for iOS" FORCE)
set(OGRE_BUILD_RENDERSYSTEM_GLES2 TRUE CACHE BOOL "Forcing OpenGL ES 2 RenderSystem for iOS" FORCE)
set(OGRE_STATIC TRUE CACHE BOOL "Forcing static build for iOS" FORCE)
set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.yourcompany.\${PRODUCT_NAME:rfc1034identifier}")
set(CMAKE_OSX_ARCHITECTURES $(ARCHS_STANDARD_32_BIT))
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_INCLUDING_64_BIT)")

remove_definitions(-msse)
endif ()
Expand Down
10 changes: 5 additions & 5 deletions CMake/Utils/OgreConfigTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ if(APPLE)
set_property( TARGET ${targ} PROPERTY XCODE_ATTRIBUTE_${xc_prop_name} ${xc_prop_val} )
endmacro(set_xcode_property)

if(OGRE_CONFIG_ENABLE_LIBCPP_SUPPORT)
set(MIN_IOS_VERSION "5.0")
else()
set(MIN_IOS_VERSION "4.3")
endif()
set(MIN_IOS_VERSION "6.0")

if(NOT OGRE_BUILD_PLATFORM_ANDROID AND NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
set(PLATFORM_NAME "macosx")
Expand Down Expand Up @@ -177,6 +173,7 @@ function(ogre_config_common TARGETNAME)
)
if(OGRE_BUILD_PLATFORM_APPLE_IOS)
set_xcode_property( ${TARGETNAME} IPHONEOS_DEPLOYMENT_TARGET ${MIN_IOS_VERSION} )
set_property( TARGET ${TARGETNAME} PROPERTY XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET[arch=arm64] "7.0" )
set_target_properties(${TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_GCC_THUMB_SUPPORT "NO")
set_target_properties(${TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_GCC_UNROLL_LOOPS "YES")
set_target_properties(${TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer")
Expand Down Expand Up @@ -222,6 +219,7 @@ function(ogre_config_lib LIBNAME EXPORT)

if(OGRE_BUILD_PLATFORM_APPLE_IOS)
set_xcode_property( ${LIBNAME} IPHONEOS_DEPLOYMENT_TARGET ${MIN_IOS_VERSION} )
set_property( TARGET ${LIBNAME} PROPERTY XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET[arch=arm64] "7.0" )
endif()

if (OGRE_INSTALL_PDB)
Expand Down Expand Up @@ -281,6 +279,7 @@ function(ogre_config_plugin PLUGINNAME)

if(OGRE_BUILD_PLATFORM_APPLE_IOS)
set_xcode_property( ${PLUGINNAME} IPHONEOS_DEPLOYMENT_TARGET ${MIN_IOS_VERSION} )
set_property( TARGET ${PLUGINNAME} PROPERTY XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET[arch=arm64] "7.0" )
set_target_properties(${PLUGINNAME} PROPERTIES XCODE_ATTRIBUTE_GCC_THUMB_SUPPORT "NO")
set_target_properties(${PLUGINNAME} PROPERTIES XCODE_ATTRIBUTE_GCC_UNROLL_LOOPS "YES")
set_target_properties(${PLUGINNAME} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES")
Expand Down Expand Up @@ -342,6 +341,7 @@ function(ogre_config_sample_common SAMPLENAME)
endif()
else()
set_xcode_property( ${SAMPLENAME} IPHONEOS_DEPLOYMENT_TARGET ${MIN_IOS_VERSION} )
set_property( TARGET ${SAMPLENAME} PROPERTY XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET[arch=arm64] "7.0" )
endif()
endif (APPLE)
if (NOT OGRE_STATIC)
Expand Down
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,7 @@ if (OGRE_BUILD_PLATFORM_APPLE_IOS)
set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.yourcompany.\${PRODUCT_NAME:rfc1034identifier}")
add_definitions(-mno-thumb)

if(CMAKE_GENERATOR STREQUAL "Unix Makefiles")
set(CMAKE_OSX_ARCHITECTURES "${ARCHS_STANDARD_32_BIT}")
else()
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_BIT)")
endif()
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_INCLUDING_64_BIT)")
string (REPLACE "-msse" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
elseif (ANDROID)
set(TargetPlatform "Android")
Expand Down
2 changes: 1 addition & 1 deletion Components/Terrain/src/OgreTerrain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ namespace Ogre
// vertex data goes at this level, at bakedresolution
// applies to all lower levels (except those with a closer vertex data)
// determine physical size (as opposed to resolution)
size_t sz = ((bakedresolution-1) / splits) + 1;
uint sz = ((bakedresolution-1) / splits) + 1;
mQuadTree->assignVertexData(depth, prevdepth, bakedresolution, sz);

// next set to look for
Expand Down
12 changes: 6 additions & 6 deletions Components/Terrain/src/OgreTerrainMaterialGeneratorA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,10 @@ namespace Ogre
--freeTextureUnits;
if (isShadowingEnabled(HIGH_LOD, terrain))
{
uint numShadowTextures = 1;
uint8 numShadowTextures = 1;
if (getReceiveDynamicShadowsPSSM())
{
numShadowTextures = getReceiveDynamicShadowsPSSM()->getSplitCount();
numShadowTextures = (uint8)getReceiveDynamicShadowsPSSM()->getSplitCount();
}
freeTextureUnits -= numShadowTextures;
}
Expand Down Expand Up @@ -432,7 +432,7 @@ namespace Ogre
uint numTextures = 1;
if (getReceiveDynamicShadowsPSSM())
{
numTextures = getReceiveDynamicShadowsPSSM()->getSplitCount();
numTextures = (uint)getReceiveDynamicShadowsPSSM()->getSplitCount();
}
for (uint i = 0; i < numTextures; ++i)
{
Expand Down Expand Up @@ -556,7 +556,7 @@ namespace Ogre
uint numTextures = 1;
if (prof->getReceiveDynamicShadowsPSSM())
{
numTextures = prof->getReceiveDynamicShadowsPSSM()->getSplitCount();
numTextures = (uint)prof->getReceiveDynamicShadowsPSSM()->getSplitCount();
}
for (uint i = 0; i < numTextures; ++i)
{
Expand Down Expand Up @@ -600,7 +600,7 @@ namespace Ogre
if (prof->getReceiveDynamicShadowsPSSM())
{
PSSMShadowCameraSetup* pssm = prof->getReceiveDynamicShadowsPSSM();
numTextures = pssm->getSplitCount();
numTextures = (uint)pssm->getSplitCount();
Vector4 splitPoints;
const PSSMShadowCameraSetup::SplitPointList& splitPointList = pssm->getSplitPoints();
// Populate from split point 1, not 0, since split 0 isn't useful (usually 0)
Expand Down Expand Up @@ -661,7 +661,7 @@ namespace Ogre

uint numShadowTextures = 1;
if (prof->getReceiveDynamicShadowsPSSM())
numShadowTextures = prof->getReceiveDynamicShadowsPSSM()->getSplitCount();
numShadowTextures = (uint)prof->getReceiveDynamicShadowsPSSM()->getSplitCount();

for (uint i = 0; i < numShadowTextures; ++i)
{
Expand Down
6 changes: 3 additions & 3 deletions OgreMain/include/OgreShadowCameraSetupPSSM.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace Ogre
typedef vector<Real>::type OptimalAdjustFactorList;

protected:
size_t mSplitCount;
uint mSplitCount;
SplitPointList mSplitPoints;
OptimalAdjustFactorList mOptimalAdjustFactors;
Real mSplitPadding;
Expand All @@ -78,7 +78,7 @@ namespace Ogre
@param farDist The far plane to use for the last split
@param lambda Factor to use to reduce the split size
*/
void calculateSplitPoints(size_t splitCount, Real nearDist, Real farDist, Real lambda = 0.95);
void calculateSplitPoints(uint splitCount, Real nearDist, Real farDist, Real lambda = 0.95);

/** Manually configure a new splitting scheme.
@param newSplitPoints A list which is splitCount + 1 entries long, containing the
Expand All @@ -103,7 +103,7 @@ namespace Ogre
*/
Real getSplitPadding() const { return mSplitPadding; }
/// Get the number of splits.
size_t getSplitCount() const { return mSplitCount; }
uint getSplitCount() const { return mSplitCount; }

/// Returns a LiSPSM shadow camera with PSSM splits base on iteration.
virtual void getShadowCamera(const Ogre::SceneManager *sm, const Ogre::Camera *cam,
Expand Down
1 change: 1 addition & 0 deletions OgreMain/include/Threading/OgreThreadHeadersBoost.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ THE SOFTWARE
# pragma GCC diagnostic ignored "-Wpadded"
# pragma GCC diagnostic ignored "-Wweak-vtables"
# pragma GCC diagnostic ignored "-Wall"
# pragma GCC diagnostic ignored "-Wshorten-64-to-32"
#endif

#include <boost/thread/tss.hpp>
Expand Down
6 changes: 6 additions & 0 deletions OgreMain/src/OgrePlatformInformation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,15 @@ namespace Ogre {
case CPU_SUBTYPE_ARM_V7F:
cpuID = "ARM Cortex-A9";
break;
case CPU_SUBTYPE_ARM_V7S:
cpuID = "ARM Swift";
break;
case CPU_SUBTYPE_ARM_V8:
cpuID = "ARMv8";
break;
case CPU_SUBTYPE_ARM64_V8:
cpuID = "ARM64v8";
break;
default:
cpuID = "Unknown ARM";
break;
Expand Down
2 changes: 1 addition & 1 deletion OgreMain/src/OgreShadowCameraSetupPSSM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace Ogre
{
}
//---------------------------------------------------------------------
void PSSMShadowCameraSetup::calculateSplitPoints(size_t splitCount, Real nearDist, Real farDist, Real lambda)
void PSSMShadowCameraSetup::calculateSplitPoints(uint splitCount, Real nearDist, Real farDist, Real lambda)
{
if (splitCount < 2)
OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Cannot specify less than 2 splits",
Expand Down
2 changes: 1 addition & 1 deletion RenderSystems/GL3Plus/src/GLSL/src/OgreGLSLProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ namespace Ogre {
{
// is the name valid and already loaded?
// check with the high level program manager to see if it was loaded
HighLevelGpuProgramPtr hlProgram = HighLevelGpuProgramManager::getSingleton().getByName(name).staticCast<HighLevelGpuProgram>();
HighLevelGpuProgramPtr hlProgram = HighLevelGpuProgramManager::getSingleton().getByName(name);
if (!hlProgram.isNull())
{
if (hlProgram->getSyntaxCode() == "glsl")
Expand Down
3 changes: 1 addition & 2 deletions RenderSystems/GLES2/include/EAGL/OgreEAGL2View.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ using namespace Ogre;

#ifdef __OBJC__

#import <UIKit/UIKit.h>

#import <UIKit/UIView.h>

@interface EAGL2View : UIView {
String mWindowName;
Expand Down
2 changes: 1 addition & 1 deletion RenderSystems/GLES2/include/EAGL/OgreEAGL2ViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ THE SOFTWARE.
#ifndef __EAGL2ViewController_H__
#define __EAGL2ViewController_H__

#import <UIKit/UIKit.h>
#import <UIKit/UIViewController.h>
#import "OgreRoot.h"
#import "OgreEAGL2Support.h"

Expand Down
1 change: 0 additions & 1 deletion RenderSystems/GLES2/include/EAGL/OgreEAGL2Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ THE SOFTWARE.
#include "OgreRenderWindow.h"

#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import "OgreEAGL2View.h"
#import "OgreEAGL2ViewController.h"

Expand Down
Loading

0 comments on commit 5bc34a3

Please sign in to comment.