diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-02-11 21:40:54 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-02-11 21:40:54 +0000 |
| commit | 9ed548ea23cf8b53ef276852d49e803241ec8627 (patch) | |
| tree | 1d49f3b8324839b260b73f11f048c0c0dc18e9e9 /unityplugin/UnityEmulator | |
| parent | Fixed MacOS build (diff) | |
| download | DiligentEngine-9ed548ea23cf8b53ef276852d49e803241ec8627.tar.gz DiligentEngine-9ed548ea23cf8b53ef276852d49e803241ec8627.zip | |
Removed unused Apple source from Unity emulator
Diffstat (limited to 'unityplugin/UnityEmulator')
23 files changed, 0 insertions, 1444 deletions
diff --git a/unityplugin/UnityEmulator/Apple/Data/OSX/Base.lproj/Main.storyboard b/unityplugin/UnityEmulator/Apple/Data/OSX/Base.lproj/Main.storyboard deleted file mode 100644 index 5890ca3..0000000 --- a/unityplugin/UnityEmulator/Apple/Data/OSX/Base.lproj/Main.storyboard +++ /dev/null @@ -1,161 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS"> - <dependencies> - <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/> - <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> - </dependencies> - <scenes> - <!--Application--> - <scene sceneID="JPo-4y-FX3"> - <objects> - <application id="hnw-xV-0zn" sceneMemberID="viewController"> - <menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6"> - <items> - <menuItem title="Application" id="1Xt-HY-uBw"> - <modifierMask key="keyEquivalentModifierMask"/> - <menu key="submenu" title="Application" systemMenu="apple" id="uQy-DD-JDr"> - <items> - <menuItem title="About" id="5kV-Vb-QxS" userLabel="About"> - <modifierMask key="keyEquivalentModifierMask"/> - <connections> - <action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/> - </connections> - </menuItem> - <menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/> - <menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/> - <menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/> - <menuItem title="Services" id="NMo-om-nkz"> - <modifierMask key="keyEquivalentModifierMask"/> - <menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/> - </menuItem> - <menuItem isSeparatorItem="YES" id="4je-JR-u6R"/> - <menuItem title="Hide" keyEquivalent="h" id="Olw-nP-bQN" userLabel="Hide"> - <connections> - <action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/> - </connections> - </menuItem> - <menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO"> - <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> - <connections> - <action selector="hideOtherApplications:" target="Ady-hI-5gd" id="VT4-aY-XCT"/> - </connections> - </menuItem> - <menuItem title="Show All" id="Kd2-mp-pUS"> - <modifierMask key="keyEquivalentModifierMask"/> - <connections> - <action selector="unhideAllApplications:" target="Ady-hI-5gd" id="Dhg-Le-xox"/> - </connections> - </menuItem> - <menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/> - <menuItem title="Quit" keyEquivalent="q" id="4sb-4s-VLi" userLabel="Quit"> - <connections> - <action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/> - </connections> - </menuItem> - </items> - </menu> - </menuItem> - <menuItem title="View" id="H8h-7b-M4v"> - <modifierMask key="keyEquivalentModifierMask"/> - <menu key="submenu" title="View" id="HyV-fh-RgO"> - <items> - <menuItem title="Show Toolbar" keyEquivalent="t" id="snW-S8-Cw5"> - <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> - <connections> - <action selector="toggleToolbarShown:" target="Ady-hI-5gd" id="BXY-wc-z0C"/> - </connections> - </menuItem> - <menuItem title="Customize Toolbar…" id="1UK-8n-QPP"> - <modifierMask key="keyEquivalentModifierMask"/> - <connections> - <action selector="runToolbarCustomizationPalette:" target="Ady-hI-5gd" id="pQI-g3-MTW"/> - </connections> - </menuItem> - </items> - </menu> - </menuItem> - <menuItem title="Window" id="aUF-d1-5bR"> - <modifierMask key="keyEquivalentModifierMask"/> - <menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo"> - <items> - <menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV"> - <connections> - <action selector="performMiniaturize:" target="Ady-hI-5gd" id="VwT-WD-YPe"/> - </connections> - </menuItem> - <menuItem title="Zoom" id="R4o-n2-Eq4"> - <modifierMask key="keyEquivalentModifierMask"/> - <connections> - <action selector="performZoom:" target="Ady-hI-5gd" id="DIl-cC-cCs"/> - </connections> - </menuItem> - <menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/> - <menuItem title="Bring All to Front" id="LE2-aR-0XJ"> - <modifierMask key="keyEquivalentModifierMask"/> - <connections> - <action selector="arrangeInFront:" target="Ady-hI-5gd" id="DRN-fu-gQh"/> - </connections> - </menuItem> - </items> - </menu> - </menuItem> - <menuItem title="Help" id="wpr-3q-Mcd"> - <modifierMask key="keyEquivalentModifierMask"/> - <menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ"> - <items> - <menuItem title="Help" keyEquivalent="?" id="FKE-Sm-Kum" userLabel="Sample Help"> - <connections> - <action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/> - </connections> - </menuItem> - </items> - </menu> - </menuItem> - </items> - </menu> - <connections> - <outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/> - </connections> - </application> - <customObject id="Voe-Tx-rLC" customClass="AppDelegate"/> - <customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/> - </objects> - <point key="canvasLocation" x="75" y="0.0"/> - </scene> - <!--Window Controller--> - <scene sceneID="R2V-B0-nI4"> - <objects> - <windowController id="B8D-0N-5wS" customClass="WindowController" sceneMemberID="viewController"> - <window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA"> - <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/> - <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/> - <rect key="contentRect" x="196" y="240" width="480" height="270"/> - <rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/> - <value key="minSize" type="size" width="10" height="20"/> - <connections> - <outlet property="delegate" destination="B8D-0N-5wS" id="owC-aB-m7U"/> - </connections> - </window> - <connections> - <segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/> - </connections> - </windowController> - <customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/> - </objects> - <point key="canvasLocation" x="75" y="250"/> - </scene> - <!--View Controller--> - <scene sceneID="hIz-AP-VOD"> - <objects> - <viewController id="XfG-lQ-9wD" sceneMemberID="viewController"> - <view key="view" id="m2S-Jp-Qdl" userLabel="GL View" customClass="GLView"> - <rect key="frame" x="0.0" y="0.0" width="800" height="600"/> - <autoresizingMask key="autoresizingMask"/> - </view> - </viewController> - <customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/> - </objects> - <point key="canvasLocation" x="75" y="655"/> - </scene> - </scenes> -</document> diff --git a/unityplugin/UnityEmulator/Apple/Data/OSX/Images.xcassets/AppIcon.appiconset/dg.icns b/unityplugin/UnityEmulator/Apple/Data/OSX/Images.xcassets/AppIcon.appiconset/dg.icns Binary files differdeleted file mode 100644 index fddfdff..0000000 --- a/unityplugin/UnityEmulator/Apple/Data/OSX/Images.xcassets/AppIcon.appiconset/dg.icns +++ /dev/null diff --git a/unityplugin/UnityEmulator/Apple/Data/OSX/Info.plist b/unityplugin/UnityEmulator/Apple/Data/OSX/Info.plist deleted file mode 100644 index 463bc11..0000000 --- a/unityplugin/UnityEmulator/Apple/Data/OSX/Info.plist +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>en</string> - <key>CFBundleExecutable</key> - <string>$(EXECUTABLE_NAME)</string> - <key>CFBundleIconFile</key> - <string>dg.icns</string> - <key>CFBundleIdentifier</key> - <string></string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>$(PRODUCT_NAME)</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleShortVersionString</key> - <string>2.3</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>1</string> - <key>LSMinimumSystemVersion</key> - <string>$(MACOSX_DEPLOYMENT_TARGET)</string> - <key>NSMainStoryboardFile</key> - <string>Main</string> - <key>NSPrincipalClass</key> - <string>NSApplication</string> -</dict> -</plist> diff --git a/unityplugin/UnityEmulator/Apple/Data/iOS/Base.lproj/LaunchScreen.xib b/unityplugin/UnityEmulator/Apple/Data/iOS/Base.lproj/LaunchScreen.xib deleted file mode 100644 index 0d1a62b..0000000 --- a/unityplugin/UnityEmulator/Apple/Data/iOS/Base.lproj/LaunchScreen.xib +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="8121.20" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES"> - <dependencies> - <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8101.16"/> - <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/> - </dependencies> - <objects> - <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> - <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> - <view contentMode="scaleToFill" id="iN0-l3-epB"> - <rect key="frame" x="0.0" y="0.0" width="480" height="480"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <subviews> - <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright © 2015 Apple, Inc. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye"> - <rect key="frame" x="20" y="439" width="441" height="21"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> - <nil key="highlightedColor"/> - </label> - <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="GLEssentials" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX"> - <rect key="frame" x="20" y="140" width="441" height="43"/> - <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> - <nil key="highlightedColor"/> - </label> - </subviews> - <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> - <constraints> - <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/> - <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/> - <constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/> - <constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/> - <constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/> - <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/> - </constraints> - <nil key="simulatedStatusBarMetrics"/> - <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> - <point key="canvasLocation" x="548" y="455"/> - </view> - </objects> -</document> diff --git a/unityplugin/UnityEmulator/Apple/Data/iOS/Base.lproj/Main.storyboard b/unityplugin/UnityEmulator/Apple/Data/iOS/Base.lproj/Main.storyboard deleted file mode 100644 index 0dc87c1..0000000 --- a/unityplugin/UnityEmulator/Apple/Data/iOS/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8121.20" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> - <dependencies> - <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8101.16"/> - </dependencies> - <scenes> - <!--View Controller--> - <scene sceneID="tne-QT-ifu"> - <objects> - <viewController id="BYZ-38-t0r" sceneMemberID="viewController"> - <layoutGuides> - <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> - <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> - </layoutGuides> - <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC" customClass="EAGLView"> - <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> - </view> - </viewController> - <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> - </objects> - </scene> - </scenes> -</document> diff --git a/unityplugin/UnityEmulator/Apple/Data/iOS/Images.xcassets/AppIcon.appiconset/Contents.json b/unityplugin/UnityEmulator/Apple/Data/iOS/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 36d2c80..0000000 --- a/unityplugin/UnityEmulator/Apple/Data/iOS/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -}
\ No newline at end of file diff --git a/unityplugin/UnityEmulator/Apple/Data/iOS/info.plist b/unityplugin/UnityEmulator/Apple/Data/iOS/info.plist deleted file mode 100644 index d54bdf3..0000000 --- a/unityplugin/UnityEmulator/Apple/Data/iOS/info.plist +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>en</string> - <key>CFBundleExecutable</key> - <string>$(EXECUTABLE_NAME)</string> - <key>CFBundleIdentifier</key> - <string>com.example.apple-samplecode.GLEssentials</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>$(PRODUCT_NAME)</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleShortVersionString</key> - <string>1.8</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>1</string> - <key>LSRequiresIPhoneOS</key> - <true/> - <key>UILaunchStoryboardName</key> - <string>LaunchScreen</string> - <key>UIMainStoryboardFile</key> - <string>Main</string> - <key>UIRequiredDeviceCapabilities</key> - <array> - <string>armv7</string> - </array> - <key>UISupportedInterfaceOrientations</key> - <array> - <string>UIInterfaceOrientationPortrait</string> - <string>UIInterfaceOrientationLandscapeLeft</string> - <string>UIInterfaceOrientationLandscapeRight</string> - </array> - <key>UISupportedInterfaceOrientations~ipad</key> - <array> - <string>UIInterfaceOrientationPortrait</string> - <string>UIInterfaceOrientationPortraitUpsideDown</string> - <string>UIInterfaceOrientationLandscapeLeft</string> - <string>UIInterfaceOrientationLandscapeRight</string> - </array> -</dict> -</plist> diff --git a/unityplugin/UnityEmulator/Apple/LICENSE.txt b/unityplugin/UnityEmulator/Apple/LICENSE.txt deleted file mode 100644 index 73f0303..0000000 --- a/unityplugin/UnityEmulator/Apple/LICENSE.txt +++ /dev/null @@ -1,42 +0,0 @@ -Sample code project: GLEssentials -Version: 3.0 - -IMPORTANT: This Apple software is supplied to you by Apple -Inc. ("Apple") in consideration of your agreement to the following -terms, and your use, installation, modification or redistribution of -this Apple software constitutes acceptance of these terms. If you do -not agree with these terms, please do not use, install, modify or -redistribute this Apple software. - -In consideration of your agreement to abide by the following terms, and -subject to these terms, Apple grants you a personal, non-exclusive -license, under Apple's copyrights in this original Apple software (the -"Apple Software"), to use, reproduce, modify and redistribute the Apple -Software, with or without modifications, in source and/or binary forms; -provided that if you redistribute the Apple Software in its entirety and -without modifications, you must retain this notice and the following -text and disclaimers in all such redistributions of the Apple Software. -Neither the name, trademarks, service marks or logos of Apple Inc. may -be used to endorse or promote products derived from the Apple Software -without specific prior written permission from Apple. Except as -expressly stated in this notice, no other rights or licenses, express or -implied, are granted by Apple herein, including but not limited to any -patent rights that may be infringed by your derivative works or by other -works in which the Apple Software may be incorporated. - -The Apple Software is provided by Apple on an "AS IS" basis. APPLE -MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION -THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND -OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - -IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, -MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED -AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), -STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -Copyright (C) 2015 Apple Inc. All Rights Reserved. diff --git a/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/AppDelegate.h b/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/AppDelegate.h deleted file mode 100644 index d38403c..0000000 --- a/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/AppDelegate.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - Copyright (C) 2015 Apple Inc. All Rights Reserved. - See LICENSE.txt for this sample’s licensing information - - Abstract: - The Application Delegate. - */ - -#import <Cocoa/Cocoa.h> - -@interface AppDelegate : NSObject <NSApplicationDelegate> - - -@end - diff --git a/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/AppDelegate.m b/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/AppDelegate.m deleted file mode 100644 index 9c8918f..0000000 --- a/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/AppDelegate.m +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright (C) 2015 Apple Inc. All Rights Reserved. - See LICENSE.txt for this sample’s licensing information - - Abstract: - The Application Delegate. - */ - -#import "AppDelegate.h" -#import "GLView.h" - -@interface AppDelegate () - -@end - -@implementation AppDelegate - -- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { - // Insert code here to initialize your application - NSWindow* mainWindow = [[NSApplication sharedApplication]mainWindow]; - [mainWindow setAcceptsMouseMovedEvents:YES]; - NSString *sceneName = [[mainWindow contentView] getSceneName]; - [mainWindow setTitle:sceneName]; -} - -- (void)applicationWillTerminate:(NSNotification *)aNotification { - // Insert code here to tear down your application -} - -- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication { - return YES; -} - -@end diff --git a/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/FullscreenWindow.h b/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/FullscreenWindow.h deleted file mode 100644 index 2a61a51..0000000 --- a/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/FullscreenWindow.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - Copyright (C) 2015 Apple Inc. All Rights Reserved. - See LICENSE.txt for this sample’s licensing information - - Abstract: - Fullscreen window class. - All logic here could have been done in the window controller except that, by default, borderless windows cannot be made key and input cannot go to them. - Therefore, this class exists to override canBecomeKeyWindow allowing this borderless window to accept inputs. - This class is not part of the NIB and entirely managed in code by the window controller. - */ -#import <Cocoa/Cocoa.h> - -@interface FullscreenWindow : NSWindow - -@end diff --git a/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/FullscreenWindow.m b/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/FullscreenWindow.m deleted file mode 100644 index 69c9063..0000000 --- a/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/FullscreenWindow.m +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (C) 2015 Apple Inc. All Rights Reserved. - See LICENSE.txt for this sample’s licensing information - - Abstract: - Fullscreen window class. - All logic here could have been done in the window controller except that, by default, borderless windows cannot be made key and input cannot go to them. - Therefore, this class exists to override canBecomeKeyWindow allowing this borderless window to accept inputs. - This class is not part of the NIB and entirely managed in code by the window controller. - */ - -#import "FullscreenWindow.h" - -@implementation FullscreenWindow - --(instancetype)init -{ - // Create a screen-sized window on the display you want to take over - NSRect screenRect = [[NSScreen mainScreen] frame]; - - // Initialize the window making it size of the screen and borderless - self = [super initWithContentRect:screenRect - styleMask:NSWindowStyleMaskBorderless - backing:NSBackingStoreBuffered - defer:YES]; - - // Set the window level to be above the menu bar to cover everything else - [self setLevel:NSMainMenuWindowLevel+1]; - - // Set opaque - [self setOpaque:YES]; - - // Hide this when user switches to another window (or app) - [self setHidesOnDeactivate:YES]; - - return self; -} - --(BOOL)canBecomeKeyWindow -{ - // Return yes so that this borderless window can receive input - return YES; -} - -- (void)keyDown:(NSEvent *)event -{ - // Implement keyDown since controller will not get [ESC] key event which - // the controller uses to kill fullscreen - [[self windowController] keyDown:event]; -} - -@end diff --git a/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/GLView.h b/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/GLView.h deleted file mode 100644 index 10f16ba..0000000 --- a/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/GLView.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - Copyright (C) 2015 Apple Inc. All Rights Reserved. - See LICENSE.txt for this sample’s licensing information - - Abstract: - OpenGL view subclass. - */ - - -#import <Cocoa/Cocoa.h> -#import <QuartzCore/CVDisplayLink.h> - -@interface GLView : NSOpenGLView { - CVDisplayLinkRef displayLink; -} - --(void)stopDisplayLink; --(void)startDisplayLink; --(NSString*)getSceneName; - -@end diff --git a/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/GLView.m b/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/GLView.m deleted file mode 100644 index 1887364..0000000 --- a/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/GLView.m +++ /dev/null @@ -1,267 +0,0 @@ -/* - Copyright (C) 2015 Apple Inc. All Rights Reserved. - See LICENSE.txt for this sample’s licensing information - - Abstract: - OpenGL view subclass. - */ - -#import "GLView.h" -#include "Renderer.h" -#include <memory> - -#define SUPPORT_RETINA_RESOLUTION 1 - -@interface GLView () -{ - std::unique_ptr<Renderer> _renderer; - NSRect _viewRectPixels; -} -@end - -@implementation GLView - - -- (CVReturn) getFrameForTime:(const CVTimeStamp*)outputTime -{ - // There is no autorelease pool when this method is called - // because it will be called from a background thread. - // It's important to create one or app can leak objects. - @autoreleasepool { - [self drawView]; - } - return kCVReturnSuccess; -} - -// This is the renderer output callback function -static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, - const CVTimeStamp* now, - const CVTimeStamp* outputTime, - CVOptionFlags flagsIn, - CVOptionFlags* flagsOut, - void* displayLinkContext) -{ - CVReturn result = [(__bridge GLView*)displayLinkContext getFrameForTime:outputTime]; - return result; -} - -// Prepares the receiver for service after it has been loaded -// from an Interface Builder archive, or nib file. -- (void) awakeFromNib -{ - [super awakeFromNib]; - - NSOpenGLPixelFormatAttribute attrs[] = - { - NSOpenGLPFADoubleBuffer, - NSOpenGLPFADepthSize, 24, - NSOpenGLPFAOpenGLProfile, - NSOpenGLProfileVersion4_1Core, - 0 - }; - - NSOpenGLPixelFormat *pf = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs]; - - if (!pf) - { - NSLog(@"No OpenGL pixel format"); - } - - NSOpenGLContext* context = [[NSOpenGLContext alloc] initWithFormat:pf shareContext:nil]; - -#if defined(DEBUG) - // When we're using a CoreProfile context, crash if we call a legacy OpenGL function - // This will make it much more obvious where and when such a function call is made so - // that we can remove such calls. - // Without this we'd simply get GL_INVALID_OPERATION error for calling legacy functions - // but it would be more difficult to see where that function was called. - CGLEnable([context CGLContextObj], kCGLCECrashOnRemovedFunctions); -#endif - - [self setPixelFormat:pf]; - - [self setOpenGLContext:context]; - -#if SUPPORT_RETINA_RESOLUTION - // Opt-In to Retina resolution - [self setWantsBestResolutionOpenGLSurface:YES]; -#endif // SUPPORT_RETINA_RESOLUTION - - _renderer.reset(new Renderer()); -} - -- (void) prepareOpenGL -{ - [super prepareOpenGL]; - - // Make all the OpenGL calls to setup rendering - // and build the necessary rendering objects - [self initGL]; - - // Create a display link capable of being used with all active displays - CVDisplayLinkCreateWithActiveCGDisplays(&displayLink); - - // Set the renderer output callback function - CVDisplayLinkSetOutputCallback(displayLink, &MyDisplayLinkCallback, (__bridge void*)self); - - // Set the display link for the current renderer - CGLContextObj cglContext = [[self openGLContext] CGLContextObj]; - CGLPixelFormatObj cglPixelFormat = [[self pixelFormat] CGLPixelFormatObj]; - CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext(displayLink, cglContext, cglPixelFormat); - - // Activate the display link - CVDisplayLinkStart(displayLink); - - // Register to be notified when the window closes so we can stop the displaylink - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(windowWillClose:) - name:NSWindowWillCloseNotification - object:[self window]]; -} - -- (void) windowWillClose:(NSNotification*)notification -{ - // Stop the display link when the window is closing because default - // OpenGL render buffers will be destroyed. If display link continues to - // fire without renderbuffers, OpenGL draw calls will set errors. - - CVDisplayLinkStop(displayLink); - // Stop the display link BEFORE releasing anything in the view - // otherwise the display link thread may call into the view and crash - // when it encounters something that has been released - - _renderer.reset(); -} - -- (void) initGL -{ - // The reshape function may have changed the thread to which our OpenGL - // context is attached before prepareOpenGL and initGL are called. So call - // makeCurrentContext to ensure that our OpenGL context current to this - // thread (i.e. makeCurrentContext directs all OpenGL calls on this thread - // to [self openGLContext]) - [[self openGLContext] makeCurrentContext]; - - // Synchronize buffer swaps with vertical refresh rate - GLint swapInt = 1; - [[self openGLContext] setValues:&swapInt forParameter:NSOpenGLCPSwapInterval]; - - // Init our renderer. - _renderer->Init(); -} - -- (void)reshape -{ - [super reshape]; - - // We draw on a secondary thread through the display link. However, when - // resizing the view, -drawRect is called on the main thread. - // Add a mutex around to avoid the threads accessing the context - // simultaneously when resizing. - CGLLockContext([[self openGLContext] CGLContextObj]); - - // Get the view size in Points - NSRect viewRectPoints = [self bounds]; - -#if SUPPORT_RETINA_RESOLUTION - - // Rendering at retina resolutions will reduce aliasing, but at the potential - // cost of framerate and battery life due to the GPU needing to render more - // pixels. - - // Any calculations the renderer does which use pixel dimentions, must be - // in "retina" space. [NSView convertRectToBacking] converts point sizes - // to pixel sizes. Thus the renderer gets the size in pixels, not points, - // so that it can set it's viewport and perform and other pixel based - // calculations appropriately. - // viewRectPixels will be larger than viewRectPoints for retina displays. - // viewRectPixels will be the same as viewRectPoints for non-retina displays - _viewRectPixels = [self convertRectToBacking:viewRectPoints]; - -#else //if !SUPPORT_RETINA_RESOLUTION - - // App will typically render faster and use less power rendering at - // non-retina resolutions since the GPU needs to render less pixels. - // There is the cost of more aliasing, but it will be no-worse than - // on a Mac without a retina display. - - // Points:Pixels is always 1:1 when not supporting retina resolutions - _viewRectPixels = viewRectPoints; - -#endif // !SUPPORT_RETINA_RESOLUTION - - // Set the new dimensions in our renderer - _renderer->WindowResize(_viewRectPixels.size.width, _viewRectPixels.size.height); - - CGLUnlockContext([[self openGLContext] CGLContextObj]); -} - - -- (void)renewGState -{ - // Called whenever graphics state updated (such as window resize) - - // OpenGL rendering is not synchronous with other rendering on the OSX. - // Therefore, call disableScreenUpdatesUntilFlush so the window server - // doesn't render non-OpenGL content in the window asynchronously from - // OpenGL content, which could cause flickering. (non-OpenGL content - // includes the title bar and drawing done by the app with other APIs) - [[self window] disableScreenUpdatesUntilFlush]; - - [super renewGState]; -} - -- (void) drawRect: (NSRect) theRect -{ - // Called during resize operations - - // Avoid flickering during resize by drawiing - [self drawView]; -} - -- (void) drawView -{ - [[self openGLContext] makeCurrentContext]; - - // We draw on a secondary thread through the display link - // When resizing the view, -reshape is called automatically on the main - // thread. Add a mutex around to avoid the threads accessing the context - // simultaneously when resizing - CGLLockContext([[self openGLContext] CGLContextObj]); - - _renderer->Render(); - - CGLFlushDrawable([[self openGLContext] CGLContextObj]); - CGLUnlockContext([[self openGLContext] CGLContextObj]); -} - -- (void) dealloc -{ - // Stop the display link BEFORE releasing anything in the view - // otherwise the display link thread may call into the view and crash - // when it encounters something that has been released - CVDisplayLinkStop(displayLink); - - CVDisplayLinkRelease(displayLink); - - _renderer.reset(); - - [super dealloc]; -} - -- (void)stopDisplayLink -{ - CVDisplayLinkStop(displayLink); -} - -- (void)startDisplayLink -{ - CVDisplayLinkStart(displayLink); -} - -- (NSString*)getSceneName -{ - return [NSString stringWithFormat:@"%s", _renderer->GetSceneName()]; -} - -@end diff --git a/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/WindowController.h b/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/WindowController.h deleted file mode 100644 index bfa3e5a..0000000 --- a/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/WindowController.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - Copyright (C) 2015 Apple Inc. All Rights Reserved. - See LICENSE.txt for this sample’s licensing information - - Abstract: - Window controller subclass. - */ - - -#import <Cocoa/Cocoa.h> -#import "GLView.h" - -@interface WindowController : NSWindowController - -@end diff --git a/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/WindowController.m b/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/WindowController.m deleted file mode 100644 index e85684b..0000000 --- a/unityplugin/UnityEmulator/Apple/Source/Classes/OSX/WindowController.m +++ /dev/null @@ -1,154 +0,0 @@ -/* - Copyright (C) 2015 Apple Inc. All Rights Reserved. - See LICENSE.txt for this sample’s licensing information - - Abstract: - Window controller subclass. - */ - -#import "WindowController.h" -#import "FullscreenWindow.h" - -@interface WindowController () - -// Fullscreen window -@property(strong) FullscreenWindow *fullscreenWindow; - -// Non-Fullscreen window (also the initial window) -@property(strong) NSWindow* standardWindow; - -@end - -@implementation WindowController - -- (instancetype)initWithWindow:(NSWindow *)window -{ - self = [super initWithWindow:window]; - - if (self) - { - // Initialize to nil since it indicates app is not fullscreen - _fullscreenWindow = nil; - } - - return self; -} - -- (void) goFullscreen -{ - // If app is already fullscreen... - if([self fullscreenWindow]) - { - //...don't do anything - return; - } - // We must stop the display link while - // switching the windows to make sure - // that render commands are not issued - // from another thread - [self.window.contentView stopDisplayLink]; - - // Allocate a new fullscreen window - [self setFullscreenWindow: [[FullscreenWindow alloc] init]]; - - [[self fullscreenWindow] setAcceptsMouseMovedEvents:YES]; - - // Resize the view to screensize - NSRect viewRect = [[self fullscreenWindow] frame]; - - // Set the view to the size of the fullscreen window - [self.window.contentView setFrameSize: viewRect.size]; - - // Set the view in the fullscreen window - [[self fullscreenWindow] setContentView:self.window.contentView]; - - [self setStandardWindow:[self window]]; - - // Hide non-fullscreen window so it doesn't show up when switching out - // of this app (i.e. with CMD-TAB) - [[self standardWindow] orderOut:self]; - - // Set controller to the fullscreen window so that all input will go to - // this controller (self) - [self setWindow:[self fullscreenWindow]]; - - // Show the window and make it the key window for input - [[self fullscreenWindow] makeKeyAndOrderFront:self]; - - // Restore display link - [self.window.contentView startDisplayLink]; -} - -- (void) goWindow -{ - // If controller doesn't have a full screen window... - if([self fullscreenWindow] == nil) - { - //...app is already windowed so don't do anything - return; - } - // We must stop the display link while - // switching the windows to make sure - // that render commands are not issued - // from another thread - [self.window.contentView stopDisplayLink]; - - // Get the rectangle of the original window - NSRect viewRect = [[self standardWindow] frame]; - - // Set the view rect to the new size - [self.window.contentView setFrame:viewRect]; - - // Hide fullscreen window - [[self fullscreenWindow] orderOut:self]; - - // Set controller to the standard window so that all input will go to - // this controller (self) - [self setWindow:[self standardWindow]]; - - // Set the content of the orginal window to the view - [[self window] setContentView: [self fullscreenWindow].contentView]; - - // Show the window and make it the key window for input - [[self window] makeKeyAndOrderFront:self]; - - // Ensure we set fullscreen Window to nil so our checks for - // windowed vs. fullscreen mode elsewhere are correct - [self setFullscreenWindow: nil]; - - // Restore display link - [self.window.contentView startDisplayLink]; -} - - -- (void) keyDown:(NSEvent *)event -{ - unichar c = [[event charactersIgnoringModifiers] characterAtIndex:0]; - - switch (c) - { - // Handle [ESC] key - case 27: - if([self fullscreenWindow] != nil) - { - [self goWindow]; - } - return; - // Have f key toggle fullscreen - case 'f': - if([self fullscreenWindow] == nil) - { - [self goFullscreen]; - } - else - { - [self goWindow]; - } - return; - } - - // Allow other character to be handled (or not and beep) - [super keyDown:event]; -} - -@end diff --git a/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/AppDelegate.h b/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/AppDelegate.h deleted file mode 100644 index bbb1f04..0000000 --- a/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/AppDelegate.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - Copyright (C) 2015 Apple Inc. All Rights Reserved. - See LICENSE.txt for this sample’s licensing information - - Abstract: - The application delegate - */ - - -#import <UIKit/UIKit.h> - -@class EAGLView; -@class MainViewController; - -@interface AppDelegate : NSObject <UIApplicationDelegate> { -} - -@property (nonatomic, retain) UIWindow *window; - -@end - diff --git a/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/AppDelegate.m b/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/AppDelegate.m deleted file mode 100644 index a8a379f..0000000 --- a/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/AppDelegate.m +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright (C) 2015 Apple Inc. All Rights Reserved. - See LICENSE.txt for this sample’s licensing information - - Abstract: - The application delegate -*/ - -#import "AppDelegate.h" -#import "EAGLView.h" - -@implementation AppDelegate - -#pragma mark - -#pragma mark Application lifecycle - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - // Override point for customization after application launch. - - [self.window makeKeyAndVisible]; - - [(EAGLView*)self.window.rootViewController.view startAnimation]; - - return YES; -} - - -- (void)applicationWillResignActive:(UIApplication *)application -{ - /* - Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - */ - - [(EAGLView*)self.window.rootViewController.view stopAnimation]; -} - - -- (void)applicationDidEnterBackground:(UIApplication *)application { - /* - Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - If your application supports background execution, called instead of applicationWillTerminate: when the user quits. - */ - - [(EAGLView*)self.window.rootViewController.view stopAnimation]; -} - - -- (void)applicationWillEnterForeground:(UIApplication *)application { - /* - Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. - */ - - [(EAGLView*)self.window.rootViewController.view startAnimation]; -} - - -- (void)applicationDidBecomeActive:(UIApplication *)application -{ - /* - Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - */ - - [(EAGLView*)self.window.rootViewController.view startAnimation]; -} - - -- (void)applicationWillTerminate:(UIApplication *)application { - /* - Called when the application is about to terminate. - See also applicationDidEnterBackground:. - */ - - [(EAGLView*)self.window.rootViewController.view stopAnimation]; -} - - -#pragma mark - -#pragma mark Memory management - -- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - /* - Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. - */ -} - -@end diff --git a/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/EAGLView.h b/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/EAGLView.h deleted file mode 100644 index 73d18c8..0000000 --- a/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/EAGLView.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2015 Apple Inc. All Rights Reserved. - See LICENSE.txt for this sample’s licensing information - - Abstract: - The EAGLView class is a UIView subclass that renders OpenGL scene. -*/ - -#import <UIKit/UIKit.h> - -#import "ES2Renderer.h" - -// This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. -// The view content is basically an EAGL surface you render your OpenGL scene into. -// Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. -@interface EAGLView : UIView - -@property (readonly, nonatomic, getter=isAnimating) BOOL animating; -@property (nonatomic) NSInteger animationFrameInterval; - -- (void) startAnimation; -- (void) stopAnimation; -- (void) drawView:(id)sender; - -@end diff --git a/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/EAGLView.m b/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/EAGLView.m deleted file mode 100644 index 07a7787..0000000 --- a/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/EAGLView.m +++ /dev/null @@ -1,135 +0,0 @@ -/* - Copyright (C) 2015 Apple Inc. All Rights Reserved. - See LICENSE.txt for this sample’s licensing information - - Abstract: - The EAGLView class is a UIView subclass that renders OpenGL scene. -*/ - -#import "EAGLView.h" - -#import "ES2Renderer.h" -@interface EAGLView () -{ - ES2Renderer* _renderer; - EAGLContext* _context; - NSInteger _animationFrameInterval; - CADisplayLink* _displayLink; -} -@end - -@implementation EAGLView - -// Must return the CAEAGLLayer class so that CA allocates an EAGLLayer backing for this view -+ (Class) layerClass -{ - return [CAEAGLLayer class]; -} - -// The GL view is stored in the storyboard file. When it's unarchived it's sent -initWithCoder: -- (instancetype) initWithCoder:(NSCoder*)coder -{ - if ((self = [super initWithCoder:coder])) - { - // Get the layer - CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer; - - eaglLayer.opaque = TRUE; - eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:FALSE], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil]; - - - _context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; - - if (!_context || ![EAGLContext setCurrentContext:_context]) - { - return nil; - } - - _renderer = [[ES2Renderer alloc] initWithContext:_context AndDrawable:(id<EAGLDrawable>)self.layer]; - - if (!_renderer) - { - return nil; - } - - _animating = FALSE; - _animationFrameInterval = 1; - _displayLink = nil; - } - - return self; -} - -- (void) drawView:(id)sender -{ - [EAGLContext setCurrentContext:_context]; - [_renderer render]; -} - -- (void) layoutSubviews -{ - [_renderer resizeFromLayer:(CAEAGLLayer*)self.layer]; - [self drawView:nil]; -} - -- (NSInteger) animationFrameInterval -{ - return _animationFrameInterval; -} - -- (void) setAnimationFrameInterval:(NSInteger)frameInterval -{ - // Frame interval defines how many display frames must pass between each time the - // display link fires. The display link will only fire 30 times a second when the - // frame internal is two on a display that refreshes 60 times a second. The default - // frame interval setting of one will fire 60 times a second when the display refreshes - // at 60 times a second. A frame interval setting of less than one results in undefined - // behavior. - if (frameInterval >= 1) - { - _animationFrameInterval = frameInterval; - - if (_animating) - { - [self stopAnimation]; - [self startAnimation]; - } - } -} - -- (void) startAnimation -{ - if (!_animating) - { - // Create the display link and set the callback to our drawView method - _displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(drawView:)]; - - // Set it to our _animationFrameInterval - [_displayLink setFrameInterval:_animationFrameInterval]; - - // Have the display link run on the default runn loop (and the main thread) - [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; - - _animating = TRUE; - } -} - -- (void)stopAnimation -{ - if (_animating) - { - [_displayLink invalidate]; - _displayLink = nil; - _animating = FALSE; - } -} - -- (void) dealloc -{ - // tear down context - if ([EAGLContext currentContext] == _context) - [EAGLContext setCurrentContext:nil]; -} - -@end diff --git a/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/ES2Renderer.h b/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/ES2Renderer.h deleted file mode 100644 index 7b63b00..0000000 --- a/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/ES2Renderer.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2015 Apple Inc. All Rights Reserved. - See LICENSE.txt for this sample’s licensing information - - Abstract: - The main rendering code. - */ - -#import <QuartzCore/QuartzCore.h> - -#import <OpenGLES/EAGL.h> -#import <OpenGLES/EAGLDrawable.h> -#import "OpenGLRenderer.h" - -@interface ES2Renderer : OpenGLRenderer -{ - -} - -- (instancetype)initWithContext:(EAGLContext*)context AndDrawable:(id<EAGLDrawable>)drawable; -- (void)render; -- (BOOL)resizeFromLayer:(CAEAGLLayer*)layer; - -@end - diff --git a/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/ES2Renderer.m b/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/ES2Renderer.m deleted file mode 100644 index 962aefe..0000000 --- a/unityplugin/UnityEmulator/Apple/Source/Classes/iOS/ES2Renderer.m +++ /dev/null @@ -1,134 +0,0 @@ -/* - Copyright (C) 2015 Apple Inc. All Rights Reserved. - See LICENSE.txt for this sample’s licensing information - - Abstract: - The main rendering code. - */ - -#import "ES2Renderer.h" - -#import <OpenGLES/ES2/gl.h> -#import <OpenGLES/ES2/glext.h> - -@interface ES2Renderer () -{ - EAGLContext* _context; - - // The OpenGL names for the framebuffer and renderbuffer used to render to this view - GLuint _colorRenderbuffer; - GLuint _depthRenderbuffer; -} -@end - -@implementation ES2Renderer - -// Create an ES 2.0 context -- (instancetype)initWithContext:(EAGLContext*)context AndDrawable:(id<EAGLDrawable>)drawable -{ - // Create default framebuffer object. The backing will be allocated for the - // current layer in -resizeFromLayer - GLuint defaultFBOName; - glGenFramebuffers(1, &defaultFBOName); - - glGenRenderbuffers(1, &_colorRenderbuffer); - glBindFramebuffer(GL_FRAMEBUFFER, defaultFBOName); - glBindRenderbuffer(GL_RENDERBUFFER, _colorRenderbuffer); - _context = context; - - // This call associates the storage for the current render buffer with the - // EAGLDrawable (our CAEAGLLayer) allowing us to draw into a buffer that - // will later be rendered to the screen wherever the layer is (which - // corresponds with our view). - [_context renderbufferStorage:GL_RENDERBUFFER fromDrawable:drawable]; - - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, _colorRenderbuffer); - - // Get the drawable buffer's width and height so we can create a depth buffer for the FBO - GLint backingWidth; - GLint backingHeight; - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &backingWidth); - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &backingHeight); - - // Create a depth buffer to use with our drawable FBO - glGenRenderbuffers(1, &_depthRenderbuffer); - glBindRenderbuffer(GL_RENDERBUFFER, _depthRenderbuffer); - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, backingWidth, backingHeight); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, _depthRenderbuffer); - - if(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) - { - NSLog(@"failed to make complete framebuffer object %x", glCheckFramebufferStatus(GL_FRAMEBUFFER)); - return nil; - } - - self = [super initWithDefaultFBO:defaultFBOName]; - - if (nil == self) - { - glDeleteFramebuffers(1, &defaultFBOName); - glDeleteRenderbuffers(1, &_colorRenderbuffer); - glDeleteRenderbuffers(1, &_depthRenderbuffer); - } - - return self; -} - -- (void)render -{ - // Replace the implementation of this method to do your own custom drawing - - glBindFramebuffer(GL_FRAMEBUFFER, super.defaultFBOName); - - [super render]; - - glBindRenderbuffer(GL_RENDERBUFFER, _colorRenderbuffer); - [_context presentRenderbuffer:GL_RENDERBUFFER]; -} - -- (BOOL)resizeFromLayer:(CAEAGLLayer*)layer -{ - // The pixel dimensions of the CAEAGLLayer - GLint backingWidth; - GLint backingHeight; - - // Allocate color buffer backing based on the current layer size - glBindRenderbuffer(GL_RENDERBUFFER, _colorRenderbuffer); - [_context renderbufferStorage:GL_RENDERBUFFER fromDrawable:layer]; - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &backingWidth); - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &backingHeight); - - glGenRenderbuffers(1, &_depthRenderbuffer); - glBindRenderbuffer(GL_RENDERBUFFER, _depthRenderbuffer); - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, backingWidth, backingHeight); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, _depthRenderbuffer); - - [super resizeWithWidth:backingWidth AndHeight:backingHeight]; - - if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) - { - NSLog(@"Failed to make complete framebuffer object %x", glCheckFramebufferStatus(GL_FRAMEBUFFER)); - return NO; - } - - return YES; -} - -- (void)dealloc -{ - // tear down GL - if (super.defaultFBOName) - { - GLuint defaultFBOName = super.defaultFBOName; - glDeleteFramebuffers(1, &defaultFBOName); - super.defaultFBOName = 0; - } - - if (_colorRenderbuffer) - { - glDeleteRenderbuffers(1, &_colorRenderbuffer); - _colorRenderbuffer = 0; - } -} - -@end diff --git a/unityplugin/UnityEmulator/Apple/Source/main.m b/unityplugin/UnityEmulator/Apple/Source/main.m deleted file mode 100644 index f6fdd5b..0000000 --- a/unityplugin/UnityEmulator/Apple/Source/main.m +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2015 Apple Inc. All Rights Reserved. - See LICENSE.txt for this sample’s licensing information - - Abstract: - Standard AppKit entry point. - */ - -#ifdef TARGET_IOS -#import <UIKit/UIKit.h> -#import "AppDelegate.h" -#else // OS X -#import <Cocoa/Cocoa.h> -#endif - -int main(int argc, char * argv[]) { - -#ifdef TARGET_IOS - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -#else - return NSApplicationMain(argc, (const char**)argv); -#endif -} |
