Ivan Safrin 10 лет назад
Родитель
Сommit
55be3ce400

+ 0 - 6
build/ios/PolycodeCore/PolycodeCore.xcodeproj/project.pbxproj

@@ -43,7 +43,6 @@
 		8A0F81681BF541F900E24F9B /* PolyParticleEmitter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F811A1BF541F800E24F9B /* PolyParticleEmitter.cpp */; };
 		8A0F81691BF541F900E24F9B /* PolyPeer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F811B1BF541F800E24F9B /* PolyPeer.cpp */; };
 		8A0F816A1BF541F900E24F9B /* PolyPerlin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F811C1BF541F800E24F9B /* PolyPerlin.cpp */; };
-		8A0F816B1BF541F900E24F9B /* PolyPhysFSFileProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F811D1BF541F800E24F9B /* PolyPhysFSFileProvider.cpp */; };
 		8A0F816C1BF541F900E24F9B /* PolyQuaternion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F811E1BF541F800E24F9B /* PolyQuaternion.cpp */; };
 		8A0F816D1BF541F900E24F9B /* PolyQuaternionCurve.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F811F1BF541F800E24F9B /* PolyQuaternionCurve.cpp */; };
 		8A0F816E1BF541F900E24F9B /* PolyRay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F81201BF541F800E24F9B /* PolyRay.cpp */; };
@@ -138,7 +137,6 @@
 		8A0F80D01BF5417E00E24F9B /* PolyParticleEmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyParticleEmitter.h; path = ../../../include/polycode/core/PolyParticleEmitter.h; sourceTree = "<group>"; };
 		8A0F80D11BF5417E00E24F9B /* PolyPeer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyPeer.h; path = ../../../include/polycode/core/PolyPeer.h; sourceTree = "<group>"; };
 		8A0F80D21BF5417E00E24F9B /* PolyPerlin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyPerlin.h; path = ../../../include/polycode/core/PolyPerlin.h; sourceTree = "<group>"; };
-		8A0F80D31BF5417E00E24F9B /* PolyPhysFSFileProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyPhysFSFileProvider.h; path = ../../../include/polycode/core/PolyPhysFSFileProvider.h; sourceTree = "<group>"; };
 		8A0F80D41BF5417E00E24F9B /* PolyQuaternion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyQuaternion.h; path = ../../../include/polycode/core/PolyQuaternion.h; sourceTree = "<group>"; };
 		8A0F80D51BF5417E00E24F9B /* PolyQuaternionCurve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyQuaternionCurve.h; path = ../../../include/polycode/core/PolyQuaternionCurve.h; sourceTree = "<group>"; };
 		8A0F80D61BF5417E00E24F9B /* PolyRay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyRay.h; path = ../../../include/polycode/core/PolyRay.h; sourceTree = "<group>"; };
@@ -212,7 +210,6 @@
 		8A0F811A1BF541F800E24F9B /* PolyParticleEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyParticleEmitter.cpp; path = ../../../src/core/PolyParticleEmitter.cpp; sourceTree = "<group>"; };
 		8A0F811B1BF541F800E24F9B /* PolyPeer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyPeer.cpp; path = ../../../src/core/PolyPeer.cpp; sourceTree = "<group>"; };
 		8A0F811C1BF541F800E24F9B /* PolyPerlin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyPerlin.cpp; path = ../../../src/core/PolyPerlin.cpp; sourceTree = "<group>"; };
-		8A0F811D1BF541F800E24F9B /* PolyPhysFSFileProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyPhysFSFileProvider.cpp; path = ../../../src/core/PolyPhysFSFileProvider.cpp; sourceTree = "<group>"; };
 		8A0F811E1BF541F800E24F9B /* PolyQuaternion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyQuaternion.cpp; path = ../../../src/core/PolyQuaternion.cpp; sourceTree = "<group>"; };
 		8A0F811F1BF541F800E24F9B /* PolyQuaternionCurve.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyQuaternionCurve.cpp; path = ../../../src/core/PolyQuaternionCurve.cpp; sourceTree = "<group>"; };
 		8A0F81201BF541F800E24F9B /* PolyRay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyRay.cpp; path = ../../../src/core/PolyRay.cpp; sourceTree = "<group>"; };
@@ -324,7 +321,6 @@
 				8A0F80D01BF5417E00E24F9B /* PolyParticleEmitter.h */,
 				8A0F80D11BF5417E00E24F9B /* PolyPeer.h */,
 				8A0F80D21BF5417E00E24F9B /* PolyPerlin.h */,
-				8A0F80D31BF5417E00E24F9B /* PolyPhysFSFileProvider.h */,
 				8A0F80D41BF5417E00E24F9B /* PolyQuaternion.h */,
 				8A0F80D51BF5417E00E24F9B /* PolyQuaternionCurve.h */,
 				8A0F80D61BF5417E00E24F9B /* PolyRay.h */,
@@ -405,7 +401,6 @@
 				8A0F811A1BF541F800E24F9B /* PolyParticleEmitter.cpp */,
 				8A0F811B1BF541F800E24F9B /* PolyPeer.cpp */,
 				8A0F811C1BF541F800E24F9B /* PolyPerlin.cpp */,
-				8A0F811D1BF541F800E24F9B /* PolyPhysFSFileProvider.cpp */,
 				8A0F811E1BF541F800E24F9B /* PolyQuaternion.cpp */,
 				8A0F811F1BF541F800E24F9B /* PolyQuaternionCurve.cpp */,
 				8A0F81201BF541F800E24F9B /* PolyRay.cpp */,
@@ -592,7 +587,6 @@
 				8A0F81691BF541F900E24F9B /* PolyPeer.cpp in Sources */,
 				8A0F81531BF541F900E24F9B /* PolyCubemap.cpp in Sources */,
 				8A0F817E1BF541F900E24F9B /* PolySceneSound.cpp in Sources */,
-				8A0F816B1BF541F900E24F9B /* PolyPhysFSFileProvider.cpp in Sources */,
 				8A0F81791BF541F900E24F9B /* PolySceneLine.cpp in Sources */,
 				8A0F81661BF541F900E24F9B /* PolyObject.cpp in Sources */,
 				8A0F81841BF541F900E24F9B /* PolySound.cpp in Sources */,

+ 16 - 6
build/ios/TemplateApp/TemplateApp.xcodeproj/project.pbxproj

@@ -14,8 +14,9 @@
 		8A0F806F1BF536C800E24F9B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8A0F806D1BF536C800E24F9B /* LaunchScreen.storyboard */; };
 		8A0F807B1BF53DD200E24F9B /* PolycodeTemplateApp.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F807A1BF53DD200E24F9B /* PolycodeTemplateApp.mm */; };
 		8A0F81991BF56A2D00E24F9B /* PolycodeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F81981BF56A2D00E24F9B /* PolycodeView.m */; };
+		8A35E14B1C877A8B00BF9EEA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A35E14A1C877A8B00BF9EEA /* main.m */; };
+		8A35E14F1C877DDB00BF9EEA /* libFreetype2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8A35E14E1C877DDB00BF9EEA /* libFreetype2.a */; };
 		8AD300AB1BF68290004D243B /* libPolycodeCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8AD300AA1BF68290004D243B /* libPolycodeCore.a */; };
-		8AFAD6CC1C28A95500AD31ED /* libFreetype2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8AFAD6CB1C28A95500AD31ED /* libFreetype2.a */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
@@ -23,7 +24,7 @@
 		8A0F80621BF536C800E24F9B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
 		8A0F80631BF536C800E24F9B /* AppDelegate.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp.preprocessed; path = AppDelegate.m; sourceTree = "<group>"; };
 		8A0F80651BF536C800E24F9B /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
-		8A0F80661BF536C800E24F9B /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
+		8A0F80661BF536C800E24F9B /* ViewController.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp.preprocessed; path = ViewController.m; sourceTree = "<group>"; };
 		8A0F80691BF536C800E24F9B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
 		8A0F806B1BF536C800E24F9B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
 		8A0F806E1BF536C800E24F9B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
@@ -31,8 +32,10 @@
 		8A0F80791BF53DD200E24F9B /* PolycodeTemplateApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeTemplateApp.h; sourceTree = "<group>"; };
 		8A0F807A1BF53DD200E24F9B /* PolycodeTemplateApp.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PolycodeTemplateApp.mm; sourceTree = "<group>"; };
 		8A0F81981BF56A2D00E24F9B /* PolycodeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PolycodeView.m; path = ../../../../src/view/ios/PolycodeView.m; sourceTree = "<group>"; };
+		8A35E14A1C877A8B00BF9EEA /* main.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp.preprocessed; fileEncoding = 4; path = main.m; sourceTree = "<group>"; };
+		8A35E14E1C877DDB00BF9EEA /* libFreetype2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libFreetype2.a; path = ../../../../lib/ios/iphonesimulator/libFreetype2.a; sourceTree = "<group>"; };
+		8A35E19E1C87A54A00BF9EEA /* PolycodeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolycodeView.h; path = ../../../../include/polycode/view/ios/PolycodeView.h; sourceTree = "<group>"; };
 		8AD300AA1BF68290004D243B /* libPolycodeCore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPolycodeCore.a; path = ../../../../lib/ios/iphonesimulator/libPolycodeCore.a; sourceTree = "<group>"; };
-		8AFAD6CB1C28A95500AD31ED /* libFreetype2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libFreetype2.a; path = ../../../../lib/ios/iphonesimulator/libFreetype2.a; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -40,7 +43,7 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				8AFAD6CC1C28A95500AD31ED /* libFreetype2.a in Frameworks */,
+				8A35E14F1C877DDB00BF9EEA /* libFreetype2.a in Frameworks */,
 				8AD300AB1BF68290004D243B /* libPolycodeCore.a in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -67,7 +70,7 @@
 		8A0F805E1BF536C800E24F9B /* TemplateApp */ = {
 			isa = PBXGroup;
 			children = (
-				8AFAD6CB1C28A95500AD31ED /* libFreetype2.a */,
+				8A35E14E1C877DDB00BF9EEA /* libFreetype2.a */,
 				8AD300AA1BF68290004D243B /* libPolycodeCore.a */,
 				8A0F80621BF536C800E24F9B /* AppDelegate.h */,
 				8A0F80631BF536C800E24F9B /* AppDelegate.m */,
@@ -76,9 +79,11 @@
 				8A0F80791BF53DD200E24F9B /* PolycodeTemplateApp.h */,
 				8A0F807A1BF53DD200E24F9B /* PolycodeTemplateApp.mm */,
 				8A0F80681BF536C800E24F9B /* Main.storyboard */,
-				8A0F806B1BF536C800E24F9B /* Assets.xcassets */,
+				8A35E19E1C87A54A00BF9EEA /* PolycodeView.h */,
 				8A0F81981BF56A2D00E24F9B /* PolycodeView.m */,
+				8A0F806B1BF536C800E24F9B /* Assets.xcassets */,
 				8A0F806D1BF536C800E24F9B /* LaunchScreen.storyboard */,
+				8A35E14A1C877A8B00BF9EEA /* main.m */,
 				8A0F80701BF536C800E24F9B /* Info.plist */,
 			);
 			path = TemplateApp;
@@ -154,6 +159,7 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				8A35E14B1C877A8B00BF9EEA /* main.m in Sources */,
 				8A0F80671BF536C800E24F9B /* ViewController.m in Sources */,
 				8A0F807B1BF53DD200E24F9B /* PolycodeTemplateApp.mm in Sources */,
 				8A0F80641BF536C800E24F9B /* AppDelegate.m in Sources */,
@@ -269,10 +275,12 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				GCC_NO_COMMON_BLOCKS = YES;
 				HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../../include\"";
 				INFOPLIST_FILE = TemplateApp/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../lib/ios/iphonesimulator\"";
+				OTHER_LDFLAGS = "";
 				PRODUCT_BUNDLE_IDENTIFIER = org.polycode.TemplateApp;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
@@ -282,10 +290,12 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				GCC_NO_COMMON_BLOCKS = YES;
 				HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../../include\"";
 				INFOPLIST_FILE = TemplateApp/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../lib/ios/iphonesimulator\"";
+				OTHER_LDFLAGS = "";
 				PRODUCT_BUNDLE_IDENTIFIER = org.polycode.TemplateApp;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};

+ 1 - 10
build/ios/TemplateApp/TemplateApp/AppDelegate.h

@@ -1,19 +1,10 @@
 
 
 #import <UIKit/UIKit.h>
-#import "polycode/view/ios/PolycodeView.h"
-#include "PolycodeTemplateApp.h"
 
-@interface AppDelegate : UIResponder <UIApplicationDelegate> {
-    @private
-    UIWindow *window;
-    PolycodeView *mainView;
-    PolycodeTemplateApp *app;
-    NSTimer *timer;
-}
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
 
 @property (strong, nonatomic) UIWindow *window;
-@property (strong, nonatomic) PolycodeView *mainView;
 
 
 @end

+ 7 - 1
build/ios/TemplateApp/TemplateApp/AppDelegate.m

@@ -1,4 +1,10 @@
-
+//
+//  AppDelegate.m
+//  Testing222
+//
+//  Created by Ivan Safrin on 3/2/16.
+//  Copyright © 2016 Polycode. All rights reserved.
+//
 
 #import "AppDelegate.h"
 

+ 5 - 0
build/ios/TemplateApp/TemplateApp/Assets.xcassets/AppIcon.appiconset/Contents.json

@@ -59,6 +59,11 @@
       "idiom" : "ipad",
       "size" : "76x76",
       "scale" : "2x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "83.5x83.5",
+      "scale" : "2x"
     }
   ],
   "info" : {

+ 2 - 3
build/ios/TemplateApp/TemplateApp/Base.lproj/LaunchScreen.storyboard

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
     </dependencies>
     <scenes>
         <!--View Controller-->
@@ -16,7 +16,6 @@
                     <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
                         <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <animations/>
                         <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
                     </view>
                 </viewController>

+ 12 - 9
build/ios/TemplateApp/TemplateApp/Base.lproj/Main.storyboard

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
     </dependencies>
     <scenes>
         <!--View Controller-->
@@ -10,18 +10,21 @@
             <objects>
                 <viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
                     <layoutGuides>
-                        <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
-                        <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
+                        <viewControllerLayoutGuide type="top" id="CcZ-Kq-cqd"/>
+                        <viewControllerLayoutGuide type="bottom" id="cfD-uc-FeA"/>
                     </layoutGuides>
-                    <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC" customClass="PolycodeView">
+                    <glkView key="view" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" enableSetNeedsDisplay="NO" id="2t5-1N-wWB" customClass="PolycodeView">
                         <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <animations/>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
-                    </view>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                        <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                    </glkView>
+                    <connections>
+                        <outlet property="mainView" destination="2t5-1N-wWB" id="N2W-rf-Rkf"/>
+                    </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
             </objects>
+            <point key="canvasLocation" x="246" y="486"/>
         </scene>
     </scenes>
 </document>

+ 4 - 4
build/ios/TemplateApp/TemplateApp/PolycodeTemplateApp.mm

@@ -12,11 +12,11 @@ PolycodeTemplateApp::PolycodeTemplateApp(PolycodeView *view) {
     ResourcePool *globalPool = Services()->getResourceManager()->getGlobalPool();
     globalPool->loadResourcesFromFolder("default", true);
     
-	// Write your code here!
+    // Write your code here!
     
     Scene *scene = new Scene(Scene::SCENE_2D);
     scene->useClearColor = true;
-   
+    scene->clearColor.setColor(0.2, 0.0, 0.0, 1.0);
     
     ScenePrimitive *test = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10.0, 10.0);
     test->setMaterialByName("UnlitUntextured");
@@ -25,8 +25,8 @@ PolycodeTemplateApp::PolycodeTemplateApp(PolycodeView *view) {
     test->scissorBox.setRect(100, 50, 100, 30);
     scene->addChild(test);
     
-    Sound *music = new Sound("BUGSHUFFLE.ogg");
-    music->Play();
+//    Sound *music = new Sound("BUGSHUFFLE.ogg");
+//    music->Play();
     
     Services()->getInput()->addEventListener(this, InputEvent::EVENT_KEYDOWN);
 }

+ 9 - 1
build/ios/TemplateApp/TemplateApp/ViewController.h

@@ -7,9 +7,17 @@
 //
 
 #import <UIKit/UIKit.h>
+#import "polycode/view/ios/PolycodeView.h"
+#include "PolycodeTemplateApp.h"
 
-@interface ViewController : UIViewController
+@interface ViewController : UIViewController {
+@private
+    PolycodeView *_mainView;
+    PolycodeTemplateApp *app;
+    NSTimer *timer;
+}
 
+@property (strong, nonatomic) IBOutlet PolycodeView *mainView;
 
 @end
 

+ 15 - 0
build/ios/TemplateApp/TemplateApp/ViewController.m

@@ -17,6 +17,21 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view, typically from a nib.
+    
+    app = new PolycodeTemplateApp(_mainView);
+    timer = [NSTimer timerWithTimeInterval:(1.0f/60.0f)
+                                    target:self
+                                  selector:@selector(animationTimer:)
+                                  userInfo:nil
+                                   repeats:YES];
+    [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSDefaultRunLoopMode];
+}
+
+- (void)animationTimer:(NSTimer *)timer
+{
+    if(!app->Update()) {
+        //       [[NSApplication sharedApplication] stop:self];
+    }
 }
 
 - (void)didReceiveMemoryWarning {

+ 2 - 4
build/osx/TemplateApp/TemplateApp/Base.lproj/MainMenu.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8191" systemVersion="15A284" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9532" systemVersion="15C50" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8191"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9532"/>
     </dependencies>
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
@@ -79,7 +79,6 @@
                 <subviews>
                     <openGLView useAuxiliaryDepthBufferStencil="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tWU-Qa-Oa0" customClass="PolycodeView">
                         <rect key="frame" x="0.0" y="0.0" width="480" height="360"/>
-                        <animations/>
                     </openGLView>
                 </subviews>
                 <constraints>
@@ -88,7 +87,6 @@
                     <constraint firstAttribute="trailing" secondItem="tWU-Qa-Oa0" secondAttribute="trailing" id="pHk-gH-OUj"/>
                     <constraint firstAttribute="bottom" secondItem="tWU-Qa-Oa0" secondAttribute="bottom" id="ymg-dO-AoI"/>
                 </constraints>
-                <animations/>
             </view>
         </window>
     </objects>

+ 1 - 1
build/osx/TemplateApp/TemplateApp/PolycodeTemplateApp.mm

@@ -24,7 +24,7 @@ PolycodeTemplateApp::PolycodeTemplateApp(PolycodeView *view) {
     test->scissorBox.setRect(100, 50, 100, 30);
     scene->addChild(test);
     
-    scene->getDefaultCamera()->setPostFilterByName("Invert");
+  //  scene->getDefaultCamera()->setPostFilterByName("Invert");
 //    Sound *music = new Sound("BUGSHUFFLE.ogg");
   //  music->Play();
     

+ 16 - 1
include/polycode/core/PolyIOSCore.h

@@ -24,9 +24,24 @@ THE SOFTWARE.
 
 #include "polycode/core/PolyCore.h"
 #import "polycode/view/ios/PolycodeView.h"
+#include "polycode/core/PolyOpenGLGraphicsInterface.h"
+#include <pthread.h>
+
+@class PolycodeView;
+
+using namespace Polycode;
 
 #define POLYCODE_CORE IOSCore
 
+class _PolyExport PosixMutex : public CoreMutex {
+public:
+    void lock();
+    void unlock();
+    pthread_mutex_t pMutex;
+};
+
+
+
 namespace Polycode {
 
 	class _PolyExport IOSCore : public Core {
@@ -64,7 +79,7 @@ namespace Polycode {
 
 	private:
         
-        
+        PolycodeView *glView;
 
 	};
 }

+ 1 - 1
lib

@@ -1 +1 @@
-Subproject commit 1f45a39574ddda0b22c951c86b01612efda30a43
+Subproject commit f2dfaa4c3f353e211028f0440a8bb48ce0b3b582

+ 49 - 7
src/core/PolyIOSCore.mm

@@ -25,9 +25,26 @@ THE SOFTWARE.
 
 using namespace Polycode;
 
+void PosixMutex::lock() {
+    pthread_mutex_lock(&pMutex);
+}
+
+void PosixMutex::unlock() {
+    pthread_mutex_unlock(&pMutex);
+}
 
 IOSCore::IOSCore(PolycodeView *view, int xRes, int yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel, int frameRate, int monitorIndex, bool retinaSupport)
 	: Core(xRes, yRes, fullScreen, vSync, aaLevel, anisotropyLevel, frameRate, monitorIndex) {
+        
+        glView = view;
+        
+        renderer = new Renderer();
+                
+        OpenGLGraphicsInterface *interface = new OpenGLGraphicsInterface();
+        renderer->setGraphicsInterface(this, interface);
+        services->setRenderer(renderer);
+        
+        setVideoMode(xRes, yRes, fullScreen, vSync, aaLevel, anisotropyLevel, retinaSupport);
 
 }
 
@@ -36,7 +53,10 @@ IOSCore::~IOSCore() {
 }
 
 void IOSCore::Render() {
-
+    renderer->beginFrame();
+    services->Render(Polycode::Rectangle(0, 0, 800, 600));
+    renderer->endFrame();
+    [glView display];
 }
 
 
@@ -65,13 +85,23 @@ void launchThread(Threaded *target) {
 	target->scheduledForRemoval = true;
 }
 
-void IOSCore::createThread(Threaded * target) {
+void *ManagedThreadFunc(void *data) {
+    Threaded *target = static_cast<Threaded*>(data);
+    target->runThread();
+    target->scheduledForRemoval = true;
+    return NULL;
+}
 
-	 
+void IOSCore::createThread(Threaded *target) {
+    Core::createThread(target);
+    pthread_t thread;
+    pthread_create( &thread, NULL, ManagedThreadFunc, (void*)target);
 }
 
 CoreMutex *IOSCore::createMutex() {
-    return NULL;
+    PosixMutex *mutex = new PosixMutex();
+    pthread_mutex_init(&mutex->pMutex, NULL);
+    return mutex;
 }
 
 void IOSCore::copyStringToClipboard(const String& str) {
@@ -112,7 +142,19 @@ String IOSCore::saveFilePicker(std::vector<CoreFileExtension> extensions) {
 }
 
 void IOSCore::handleVideoModeChange(VideoModeChangeInfo *modeInfo) {
-
+    
+    EAGLContext *context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
+    
+    if (!context) {
+        printf("Failed to create ES context...\n");
+    }
+    
+    glView.context = context;
+    glView.drawableDepthFormat = GLKViewDrawableDepthFormat24;
+    
+    [EAGLContext setCurrentContext:context];
+    
+    
 }
 
 void IOSCore::flushRenderContext() {
@@ -148,9 +190,9 @@ void IOSCore::setDeviceSize(Number x, Number y) {
 }
 
 Number IOSCore::getBackingXRes() {
-	return 1.0;
+	return getXRes();
 }
 
 Number IOSCore::getBackingYRes() {
-	return 1.0;
+	return getYRes();
 }