Alexandre Janniaux 3 年之前
父節點
當前提交
5629d31ff3
共有 27 個文件被更改,包括 153 次插入380 次删除
  1. 6 43
      vsyncanalysis.xcodeproj/project.pbxproj
  2. 2 0
      vsyncanalysis/AppDelegate.h
  3. 2 1
      vsyncanalysis/AppDelegate.m
  4. 0 11
      vsyncanalysis/Assets.xcassets/AccentColor.colorset/Contents.json
  5. 0 11
      vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json
  6. 0 6
      vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json
  7. 0 17
      vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json
  8. 0 11
      vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json
  9. 0 6
      vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json
  10. 0 11
      vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json
  11. 0 6
      vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json
  12. 0 16
      vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json
  13. 0 6
      vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json
  14. 0 17
      vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json
  15. 0 16
      vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json
  16. 0 6
      vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json
  17. 0 16
      vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json
  18. 0 6
      vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json
  19. 0 32
      vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json
  20. 0 24
      vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json
  21. 0 24
      vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json
  22. 0 6
      vsyncanalysis/Assets.xcassets/Contents.json
  23. 0 24
      vsyncanalysis/Base.lproj/LaunchScreen.storyboard
  24. 0 28
      vsyncanalysis/Base.lproj/Main.storyboard
  25. 0 14
      vsyncanalysis/ViewController.h
  26. 0 22
      vsyncanalysis/ViewController.m
  27. 143 0
      vsyncanalysis/main.m

+ 6 - 43
vsyncanalysis.xcodeproj/project.pbxproj

@@ -8,10 +8,6 @@
 
 /* Begin PBXBuildFile section */
 		AC9C03FD2728CE9300BCC71E /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AC9C03FC2728CE9300BCC71E /* AppDelegate.m */; };
-		AC9C04002728CE9300BCC71E /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AC9C03FF2728CE9300BCC71E /* ViewController.m */; };
-		AC9C04032728CE9300BCC71E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AC9C04012728CE9300BCC71E /* Main.storyboard */; };
-		AC9C04052728CE9900BCC71E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AC9C04042728CE9900BCC71E /* Assets.xcassets */; };
-		AC9C04082728CE9900BCC71E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AC9C04062728CE9900BCC71E /* LaunchScreen.storyboard */; };
 		AC9C040A2728CE9900BCC71E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AC9C04092728CE9900BCC71E /* main.m */; };
 /* End PBXBuildFile section */
 
@@ -19,11 +15,6 @@
 		AC9C03F82728CE9300BCC71E /* vsyncanalysis.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = vsyncanalysis.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		AC9C03FB2728CE9300BCC71E /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
 		AC9C03FC2728CE9300BCC71E /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
-		AC9C03FE2728CE9300BCC71E /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
-		AC9C03FF2728CE9300BCC71E /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
-		AC9C04022728CE9300BCC71E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
-		AC9C04042728CE9900BCC71E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
-		AC9C04072728CE9900BCC71E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
 		AC9C04092728CE9900BCC71E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
@@ -59,11 +50,6 @@
 			children = (
 				AC9C03FB2728CE9300BCC71E /* AppDelegate.h */,
 				AC9C03FC2728CE9300BCC71E /* AppDelegate.m */,
-				AC9C03FE2728CE9300BCC71E /* ViewController.h */,
-				AC9C03FF2728CE9300BCC71E /* ViewController.m */,
-				AC9C04012728CE9300BCC71E /* Main.storyboard */,
-				AC9C04042728CE9900BCC71E /* Assets.xcassets */,
-				AC9C04062728CE9900BCC71E /* LaunchScreen.storyboard */,
 				AC9C04092728CE9900BCC71E /* main.m */,
 			);
 			path = vsyncanalysis;
@@ -126,9 +112,6 @@
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				AC9C04082728CE9900BCC71E /* LaunchScreen.storyboard in Resources */,
-				AC9C04052728CE9900BCC71E /* Assets.xcassets in Resources */,
-				AC9C04032728CE9300BCC71E /* Main.storyboard in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -139,7 +122,6 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				AC9C04002728CE9300BCC71E /* ViewController.m in Sources */,
 				AC9C040A2728CE9900BCC71E /* main.m in Sources */,
 				AC9C03FD2728CE9300BCC71E /* AppDelegate.m in Sources */,
 			);
@@ -147,25 +129,6 @@
 		};
 /* End PBXSourcesBuildPhase section */
 
-/* Begin PBXVariantGroup section */
-		AC9C04012728CE9300BCC71E /* Main.storyboard */ = {
-			isa = PBXVariantGroup;
-			children = (
-				AC9C04022728CE9300BCC71E /* Base */,
-			);
-			name = Main.storyboard;
-			sourceTree = "<group>";
-		};
-		AC9C04062728CE9900BCC71E /* LaunchScreen.storyboard */ = {
-			isa = PBXVariantGroup;
-			children = (
-				AC9C04072728CE9900BCC71E /* Base */,
-			);
-			name = LaunchScreen.storyboard;
-			sourceTree = "<group>";
-		};
-/* End PBXVariantGroup section */
-
 /* Begin XCBuildConfiguration section */
 		AC9C040B2728CE9900BCC71E /* Debug */ = {
 			isa = XCBuildConfiguration;
@@ -282,14 +245,16 @@
 		AC9C040E2728CE9900BCC71E /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = 93LATVY963;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+					"GLES_SILENCE_DEPRECATION=1",
+				);
 				GENERATE_INFOPLIST_FILE = YES;
-				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
-				INFOPLIST_KEY_UIMainStoryboardFile = Main;
 				INFOPLIST_KEY_UIUserInterfaceStyle = Automatic;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
@@ -306,14 +271,12 @@
 		AC9C040F2728CE9900BCC71E /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = 93LATVY963;
+				GCC_PREPROCESSOR_DEFINITIONS = "GLES_SILENCE_DEPRECATION=1";
 				GENERATE_INFOPLIST_FILE = YES;
-				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
-				INFOPLIST_KEY_UIMainStoryboardFile = Main;
 				INFOPLIST_KEY_UIUserInterfaceStyle = Automatic;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",

+ 2 - 0
vsyncanalysis/AppDelegate.h

@@ -7,6 +7,7 @@
 
 #import <UIKit/UIKit.h>
 
+#if 0
 @interface AppDelegate : UIResponder <UIApplicationDelegate>
 
 @property (strong, nonatomic) UIWindow *window;
@@ -14,3 +15,4 @@
 
 @end
 
+#endif

+ 2 - 1
vsyncanalysis/AppDelegate.m

@@ -6,7 +6,7 @@
 //
 
 #import "AppDelegate.h"
-
+#if 0
 @interface AppDelegate ()
 
 @end
@@ -42,3 +42,4 @@
 
 
 @end
+#endif

+ 0 - 11
vsyncanalysis/Assets.xcassets/AccentColor.colorset/Contents.json

@@ -1,11 +0,0 @@
-{
-  "colors" : [
-    {
-      "idiom" : "universal"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 11
vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json

@@ -1,11 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "tv"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 6
vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json

@@ -1,6 +0,0 @@
-{
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 17
vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json

@@ -1,17 +0,0 @@
-{
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  },
-  "layers" : [
-    {
-      "filename" : "Front.imagestacklayer"
-    },
-    {
-      "filename" : "Middle.imagestacklayer"
-    },
-    {
-      "filename" : "Back.imagestacklayer"
-    }
-  ]
-}

+ 0 - 11
vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json

@@ -1,11 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "tv"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 6
vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json

@@ -1,6 +0,0 @@
-{
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 11
vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json

@@ -1,11 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "tv"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 6
vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json

@@ -1,6 +0,0 @@
-{
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 16
vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json

@@ -1,16 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "tv",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "tv",
-      "scale" : "2x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 6
vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json

@@ -1,6 +0,0 @@
-{
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 17
vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json

@@ -1,17 +0,0 @@
-{
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  },
-  "layers" : [
-    {
-      "filename" : "Front.imagestacklayer"
-    },
-    {
-      "filename" : "Middle.imagestacklayer"
-    },
-    {
-      "filename" : "Back.imagestacklayer"
-    }
-  ]
-}

+ 0 - 16
vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json

@@ -1,16 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "tv",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "tv",
-      "scale" : "2x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 6
vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json

@@ -1,6 +0,0 @@
-{
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 16
vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json

@@ -1,16 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "tv",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "tv",
-      "scale" : "2x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 6
vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json

@@ -1,6 +0,0 @@
-{
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 32
vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json

@@ -1,32 +0,0 @@
-{
-  "assets" : [
-    {
-      "filename" : "App Icon - App Store.imagestack",
-      "idiom" : "tv",
-      "role" : "primary-app-icon",
-      "size" : "1280x768"
-    },
-    {
-      "filename" : "App Icon.imagestack",
-      "idiom" : "tv",
-      "role" : "primary-app-icon",
-      "size" : "400x240"
-    },
-    {
-      "filename" : "Top Shelf Image Wide.imageset",
-      "idiom" : "tv",
-      "role" : "top-shelf-image-wide",
-      "size" : "2320x720"
-    },
-    {
-      "filename" : "Top Shelf Image.imageset",
-      "idiom" : "tv",
-      "role" : "top-shelf-image",
-      "size" : "1920x720"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 24
vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json

@@ -1,24 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "tv",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "tv",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "tv-marketing",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "tv-marketing",
-      "scale" : "2x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 24
vsyncanalysis/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json

@@ -1,24 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "tv",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "tv",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "tv-marketing",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "tv-marketing",
-      "scale" : "2x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 6
vsyncanalysis/Assets.xcassets/Contents.json

@@ -1,6 +0,0 @@
-{
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 24
vsyncanalysis/Base.lproj/LaunchScreen.storyboard

@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder.AppleTV.Storyboard" version="3.0" toolsVersion="13122.16" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
-    <dependencies>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
-        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <scenes>
-        <!--View Controller-->
-        <scene sceneID="tne-QT-ifu">
-            <objects>
-                <viewController id="BYZ-38-t0r" sceneMemberID="viewController">
-                    <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
-                        <rect key="frame" x="0.0" y="0.0" width="1920" height="1080"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
-                        <viewLayoutGuide key="safeArea" id="wu6-TO-1qx"/>
-                    </view>
-                </viewController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
-            </objects>
-        </scene>
-    </scenes>
-</document>

+ 0 - 28
vsyncanalysis/Base.lproj/Main.storyboard

@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder.AppleTV.Storyboard" version="3.0" toolsVersion="13122.16" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
-    <dependencies>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
-        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <scenes>
-        <!--View Controller-->
-        <scene sceneID="tne-QT-ifu">
-            <objects>
-                <viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" 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">
-                        <rect key="frame" x="0.0" y="0.0" width="1920" height="1080"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
-                        <viewLayoutGuide key="safeArea" id="wu6-TO-1qx"/>
-                    </view>
-                </viewController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
-            </objects>
-        </scene>
-    </scenes>
-</document>

+ 0 - 14
vsyncanalysis/ViewController.h

@@ -1,14 +0,0 @@
-//
-//  ViewController.h
-//  vsyncanalysis
-//
-//  Created by Alexandre Janniaux on 27/10/2021.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface ViewController : UIViewController
-
-
-@end
-

+ 0 - 22
vsyncanalysis/ViewController.m

@@ -1,22 +0,0 @@
-//
-//  ViewController.m
-//  vsyncanalysis
-//
-//  Created by Alexandre Janniaux on 27/10/2021.
-//
-
-#import "ViewController.h"
-
-@interface ViewController ()
-
-@end
-
-@implementation ViewController
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view.
-}
-
-
-@end

+ 143 - 0
vsyncanalysis/main.m

@@ -8,6 +8,149 @@
 #import <UIKit/UIKit.h>
 #import "AppDelegate.h"
 
+//
+//  ViewController.m
+//  vsyncanalysis
+//
+//  Created by Alexandre Janniaux on 27/10/2021.
+//
+
+#import <UIKit/UIKit.h>
+#import <OpenGLES/EAGL.h>
+#import <OpenGLES/ES2/gl.h>
+#import <OpenGLES/ES2/glext.h>
+#import <QuartzCore/QuartzCore.h>
+
+@interface GLWindow : UIView {
+    CAEAGLLayer *_layer;
+}
+@end
+
+@implementation GLWindow
++ (Class)layerClass {
+    return [CAEAGLLayer class];
+}
+@end
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate> {
+    UIWindow *_window;
+    GLWindow *_view;
+    EAGLContext *_context;
+    CADisplayLink *_displayLink;
+
+    GLuint _framebuffer;
+    GLuint _renderbuffer;
+
+    CFTimeInterval _lastRender;
+
+    const char *_renderMode, *_dropMode;
+
+    long long unsigned _frameNo;
+}
+- (void)step:(CADisplayLink *)sender;
+@end
+
+@implementation AppDelegate
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
+
+    // Do any additional setup after loading the view.
+
+    _window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
+    _window.rootViewController = [UIViewController alloc];
+    _window.backgroundColor = [UIColor blackColor];
+
+    _view = [[GLWindow alloc] initWithFrame:_window.bounds];
+    _context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
+
+    EAGLContext *previous = [EAGLContext currentContext];
+    [EAGLContext setCurrentContext:_context];
+
+    glGenRenderbuffers(1, &_renderbuffer);
+    glBindRenderbuffer(GL_RENDERBUFFER, _renderbuffer);
+
+    glGenFramebuffers(1, &_framebuffer);
+    glBindFramebuffer(GL_FRAMEBUFFER, _framebuffer);
+    glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+                              GL_RENDERBUFFER, _renderbuffer);
+
+    [_context renderbufferStorage:GL_RENDERBUFFER
+                   fromDrawable:_view.layer];
+    assert(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE);
+    [EAGLContext setCurrentContext:previous];
+
+    [_window addSubview:_view];
+    [_window makeKeyAndVisible];
+
+    _lastRender = CACurrentMediaTime();
+    _frameNo = 0;
+
+    _renderMode = getenv("RENDER_MODE");
+    if (_renderMode == NULL)
+        _renderMode = "vsync";
+
+    _dropMode = getenv("DROP_MODE");
+    if (_dropMode == NULL)
+        _dropMode = "once";
+
+    if (!strcmp(_renderMode, "loop"))
+    {
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [self periodicRender];
+        });
+    }
+    else if (!strcmp(_renderMode, "vsync"))
+    {
+        _displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(onVsync:)];
+        [_displayLink addToRunLoop:[NSRunLoop mainRunLoop]
+                           forMode:NSRunLoopCommonModes];
+    }
+
+    return YES;
+}
+
+- (void)periodicRender {
+    [self render];
+    dispatch_async(dispatch_get_main_queue(), ^{
+        [self periodicRender];
+    });
+}
+
+- (void)onVsync:(CADisplayLink *)sender {
+    [self render];
+}
+
+- (void)render {
+    CFTimeInterval begin_context = CACurrentMediaTime();
+    EAGLContext *previous = [EAGLContext currentContext];
+    [EAGLContext setCurrentContext:_context];
+
+    CFTimeInterval begin_clear = CACurrentMediaTime();
+    glClearColor(cos(begin_context), 0.f, 0.f, 1.f);
+    glClear(GL_COLOR_BUFFER_BIT);
+
+    CFTimeInterval begin_present = CACurrentMediaTime();
+    [_context presentRenderbuffer:GL_RENDERBUFFER];
+
+    CFTimeInterval begin_release = CACurrentMediaTime();
+    [EAGLContext setCurrentContext:previous];
+
+    CFTimeInterval end_render = CACurrentMediaTime();
+
+    if (begin_present - begin_clear > 5. / 1000 || true)
+    {
+        NSLog(@"RENDER: total=%.3lf   makeCurrent=%.3lf   clear=%.3lf   present=%.3lf   release=%.3lf",
+              1000. * (end_render - begin_context),
+              1000. * (begin_clear - begin_context),
+              1000. * (begin_present - begin_clear),
+              1000. * (begin_release - begin_present),
+              1000. * (end_render - begin_release));
+        NSLog(@"RENDER: FPS=%.3lf", 1.f / (begin_context - _lastRender));
+    }
+    _lastRender = begin_context;
+    _frameNo++;
+}
+@end
+
 int main(int argc, char * argv[]) {
     NSString * appDelegateClassName;
     @autoreleasepool {