├── .DS_Store ├── 03-展示帧数据 ├── .DS_Store ├── 01-HelloOpenGL │ ├── .DS_Store │ ├── tile_floor.png │ ├── OpenGL │ │ ├── VertexSource.glsl │ │ ├── HYOpenGLView.h │ │ ├── VideoCapture.h │ │ ├── FragmentSource.glsl │ │ ├── VideoCapture.m │ │ └── HYOpenGLView.m │ ├── ViewController.h │ ├── AppDelegate.h │ ├── main.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── ViewController.m │ ├── Info.plist │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── AppDelegate.m └── 01-HelloOpenGL.xcodeproj │ ├── project.xcworkspace │ └── contents.xcworkspacedata │ └── project.pbxproj ├── 02-画出一个图片 ├── .DS_Store ├── 01-HelloOpenGL │ ├── .DS_Store │ ├── tile_floor.png │ ├── OpenGL │ │ ├── FragmentSource.glsl │ │ ├── VertexSource.glsl │ │ ├── HYOpenGLView.h │ │ └── HYOpenGLView.m │ ├── ViewController.h │ ├── AppDelegate.h │ ├── main.m │ ├── ViewController.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── AppDelegate.m └── 01-HelloOpenGL.xcodeproj │ ├── project.xcworkspace │ └── contents.xcworkspacedata │ └── project.pbxproj ├── 01-HelloOpenGL ├── 01-HelloOpenGL │ ├── .DS_Store │ ├── OpenGL │ │ ├── HYOpenGLView.h │ │ └── HYOpenGLView.m │ ├── ViewController.h │ ├── AppDelegate.h │ ├── main.m │ ├── ViewController.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── AppDelegate.m └── 01-HelloOpenGL.xcodeproj │ ├── project.xcworkspace │ └── contents.xcworkspacedata │ └── project.pbxproj ├── README.md ├── LICENSE └── .gitignore /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/OpenGL/HEAD/.DS_Store -------------------------------------------------------------------------------- /03-展示帧数据/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/OpenGL/HEAD/03-展示帧数据/.DS_Store -------------------------------------------------------------------------------- /02-画出一个图片/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/OpenGL/HEAD/02-画出一个图片/.DS_Store -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/OpenGL/HEAD/03-展示帧数据/01-HelloOpenGL/.DS_Store -------------------------------------------------------------------------------- /02-画出一个图片/01-HelloOpenGL/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/OpenGL/HEAD/02-画出一个图片/01-HelloOpenGL/.DS_Store -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL/tile_floor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/OpenGL/HEAD/03-展示帧数据/01-HelloOpenGL/tile_floor.png -------------------------------------------------------------------------------- /01-HelloOpenGL/01-HelloOpenGL/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/OpenGL/HEAD/01-HelloOpenGL/01-HelloOpenGL/.DS_Store -------------------------------------------------------------------------------- /02-画出一个图片/01-HelloOpenGL/tile_floor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/OpenGL/HEAD/02-画出一个图片/01-HelloOpenGL/tile_floor.png -------------------------------------------------------------------------------- /02-画出一个图片/01-HelloOpenGL/OpenGL/FragmentSource.glsl: -------------------------------------------------------------------------------- 1 | //varying lowp vec4 DestinationColor; 2 | varying lowp vec2 TexCoordOut; 3 | 4 | uniform sampler2D Texture; 5 | 6 | void main(void) { 7 | gl_FragColor = texture2D(Texture, TexCoordOut); 8 | } 9 | -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL/OpenGL/VertexSource.glsl: -------------------------------------------------------------------------------- 1 | attribute vec4 Position; 2 | attribute vec2 TexCoordIn; 3 | 4 | varying vec2 TexCoordOut; 5 | 6 | void main(void) { 7 | gl_Position = Position; 8 | TexCoordOut = TexCoordIn; 9 | } 10 | -------------------------------------------------------------------------------- /02-画出一个图片/01-HelloOpenGL/OpenGL/VertexSource.glsl: -------------------------------------------------------------------------------- 1 | attribute vec4 Position; 2 | attribute vec2 TexCoordIn; 3 | 4 | varying vec2 TexCoordOut; 5 | 6 | void main(void) { 7 | gl_Position = Position; 8 | TexCoordOut = TexCoordIn; 9 | } 10 | -------------------------------------------------------------------------------- /02-画出一个图片/01-HelloOpenGL.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /01-HelloOpenGL/01-HelloOpenGL.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /02-画出一个图片/01-HelloOpenGL/OpenGL/HYOpenGLView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HYOpenGLView.h 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HYOpenGLView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /01-HelloOpenGL/01-HelloOpenGL/OpenGL/HYOpenGLView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HYOpenGLView.h 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HYOpenGLView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /02-画出一个图片/01-HelloOpenGL/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /01-HelloOpenGL/01-HelloOpenGL/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenGL 2 | OpenGL渐进学习 3 | * 代码中每个步骤有详细注释, 如果还是不理解, 可以查Google了解概念 4 | * 刚接触OpenGL的话概念比较多, 大家可以耐心写一些代码, 就发现其实流程是比较固定的, 只是代码难写 5 | 6 | #### 示例一 7 | * 使用OpengGL将屏幕的渲染成橘色 8 | 9 | #### 示例二 10 | * 将一张图片渲染到屏幕中(较复杂, 涉及到编程管线和纹理等) 11 | 12 | #### 示例三 13 | * 将录制的CMSampleBuffer渲染到屏幕中 14 | * 上面程序的一种转化 15 | * 之前从图片中获取纹理, 现在从帧中获取纹理数据 16 | 17 | -------------------------------------------------------------------------------- /02-画出一个图片/01-HelloOpenGL/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /01-HelloOpenGL/01-HelloOpenGL/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL/OpenGL/HYOpenGLView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HYOpenGLView.h 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface HYOpenGLView : UIView 13 | 14 | - (void)displaySampleBuffer:(CMSampleBufferRef)sampleBuffer; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL/OpenGL/VideoCapture.h: -------------------------------------------------------------------------------- 1 | // 2 | // VideoCapture.h 3 | // 01-视频采集 4 | // 5 | // Created by coderwhy on 2017/2/23. 6 | // Copyright © 2017年 coderwhy. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class HYOpenGLView; 12 | 13 | @interface VideoCapture : NSObject 14 | 15 | - (void)startCapturing:(HYOpenGLView *)openGLView ; 16 | - (void)stopCapturing; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /02-画出一个图片/01-HelloOpenGL/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /01-HelloOpenGL/01-HelloOpenGL/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /02-画出一个图片/01-HelloOpenGL/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "HYOpenGLView.h" 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | 21 | HYOpenGLView *glView = [[HYOpenGLView alloc] initWithFrame:self.view.bounds]; 22 | [self.view addSubview:glView]; 23 | } 24 | 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /01-HelloOpenGL/01-HelloOpenGL/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "HYOpenGLView.h" 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | 21 | HYOpenGLView *glView = [[HYOpenGLView alloc] initWithFrame:self.view.bounds]; 22 | [self.view addSubview:glView]; 23 | } 24 | 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL/OpenGL/FragmentSource.glsl: -------------------------------------------------------------------------------- 1 | //varying lowp vec4 DestinationColor; 2 | varying lowp vec2 TexCoordOut; 3 | 4 | // 设置浮点型的精准度, 默认片段着色器是没有精准度的 5 | precision mediump float; 6 | 7 | uniform sampler2D SamplerY; 8 | uniform sampler2D SamplerUV; 9 | uniform mat3 colorConversionMatrix; 10 | 11 | void main(void) { 12 | 13 | mediump vec3 yuv; 14 | lowp vec3 rgb; 15 | 16 | yuv.x = (texture2D(SamplerY, TexCoordOut).r);// - (16.0/255.0)); 17 | yuv.yz = (texture2D(SamplerUV, TexCoordOut).ra - vec2(0.5, 0.5)); 18 | 19 | rgb = colorConversionMatrix * yuv; 20 | 21 | gl_FragColor = vec4(rgb,1); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /02-画出一个图片/01-HelloOpenGL/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /01-HelloOpenGL/01-HelloOpenGL/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "HYOpenGLView.h" 11 | #import "VideoCapture.h" 12 | 13 | @interface ViewController () 14 | 15 | @property (nonatomic, strong) VideoCapture *videoCapture; 16 | 17 | @end 18 | 19 | @implementation ViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | 24 | 25 | } 26 | 27 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 28 | { 29 | HYOpenGLView *glView = [[HYOpenGLView alloc] initWithFrame:self.view.bounds]; 30 | [self.view addSubview:glView]; 31 | 32 | self.videoCapture = [[VideoCapture alloc] init]; 33 | [self.videoCapture startCapturing:glView]; 34 | } 35 | 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 coderwhy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /02-画出一个图片/01-HelloOpenGL/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /01-HelloOpenGL/01-HelloOpenGL/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /02-画出一个图片/01-HelloOpenGL/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /01-HelloOpenGL/01-HelloOpenGL/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /02-画出一个图片/01-HelloOpenGL/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /01-HelloOpenGL/01-HelloOpenGL/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /01-HelloOpenGL/01-HelloOpenGL/OpenGL/HYOpenGLView.m: -------------------------------------------------------------------------------- 1 | // 2 | // HYOpenGLView.m 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | /* 9 | 1> 将layer改成CAEAGLLayer 10 | 2> 创建EAGLContext上下文 11 | */ 12 | 13 | #import "HYOpenGLView.h" 14 | #import 15 | 16 | @implementation HYOpenGLView 17 | 18 | // 1> 将HYOpenGLView的layer改成CAEAGLlayer 19 | + (Class)layerClass { 20 | return [CAEAGLLayer class]; 21 | } 22 | 23 | // 2> 初始化OpenGL的信息 24 | - (instancetype)initWithFrame:(CGRect)frame 25 | { 26 | if (self = [super initWithFrame:frame]) { 27 | [self setupOpenGL]; 28 | } 29 | return self; 30 | } 31 | 32 | - (void)setupOpenGL { 33 | // 1.创建EAGLContext 34 | EAGLContext *glContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; 35 | [EAGLContext setCurrentContext:glContext]; 36 | CAEAGLLayer *glLayer = (CAEAGLLayer *)self.layer; 37 | 38 | // 在openGL中,即使是画最简单的颜色来添加, 也需要至少两个缓冲区 39 | // renderBuffer(渲染缓冲区, 用来存储一些图像信息)/frameBuffer(帧缓冲区, 渲染缓冲区依附于帧缓冲区才能显示内容的) 40 | // GLuint作为openGL所有对象的引用, 该对象指向GPU中的一块内存地址 41 | 42 | // 2.创建渲染缓存区 43 | GLuint renderbufferUint; 44 | glGenRenderbuffers(1, &renderbufferUint); 45 | glBindRenderbuffer(GL_RENDERBUFFER, renderbufferUint); 46 | [glContext renderbufferStorage:GL_RENDERBUFFER fromDrawable:glLayer]; 47 | 48 | // 3.创建帧缓冲区 49 | GLuint framebufferUint; 50 | glGenFramebuffers(1, &framebufferUint); 51 | glBindFramebuffer(GL_FRAMEBUFFER, framebufferUint); 52 | glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, renderbufferUint); 53 | 54 | // 4.设置缓冲区的填充颜色 55 | glClearColor(1.0, 0.5, 0, 1.0); 56 | glClear(GL_COLOR_BUFFER_BIT); 57 | 58 | // 5.使用上下文, 渲染缓冲区的颜色 59 | [glContext presentRenderbuffer:GL_RENDERBUFFER]; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /02-画出一个图片/01-HelloOpenGL/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /01-HelloOpenGL/01-HelloOpenGL/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL/OpenGL/VideoCapture.m: -------------------------------------------------------------------------------- 1 | // 2 | // VideoCapture.m 3 | // 01-视频采集 4 | // 5 | // Created by coderwhy on 2017/2/23. 6 | // Copyright © 2017年 coderwhy. All rights reserved. 7 | // 8 | 9 | #import "VideoCapture.h" 10 | #import 11 | #import "HYOpenGLView.h" 12 | 13 | @interface VideoCapture () 14 | 15 | @property (nonatomic, strong) AVCaptureSession *session; 16 | @property (nonatomic, weak) AVCaptureVideoPreviewLayer *layer; 17 | @property (nonatomic, strong) dispatch_queue_t videoQueue; 18 | 19 | @property (nonatomic, weak) HYOpenGLView *openGLView; 20 | 21 | @end 22 | 23 | @implementation VideoCapture 24 | 25 | 26 | - (instancetype)init { 27 | if (self = [super init]) { 28 | self.videoQueue = dispatch_queue_create("com.520it.coderwhy", DISPATCH_QUEUE_SERIAL); 29 | } 30 | return self; 31 | } 32 | 33 | #pragma mark - 开始/停止采集 34 | - (void)startCapturing:(HYOpenGLView *)openGLView { 35 | 36 | self.openGLView = openGLView; 37 | 38 | // 1.创建session 39 | AVCaptureSession *session = [[AVCaptureSession alloc] init]; 40 | session.sessionPreset = AVCaptureSessionPreset640x480; 41 | self.session = session; 42 | 43 | // 2.创建输入设备 44 | AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; 45 | AVCaptureDeviceInput *input = [[AVCaptureDeviceInput alloc] initWithDevice:device error:nil]; 46 | [session addInput:input]; 47 | 48 | // 3.创建输出设备 49 | AVCaptureVideoDataOutput *output = [[AVCaptureVideoDataOutput alloc] init]; 50 | [output setSampleBufferDelegate:self queue:self.videoQueue]; 51 | // 设置输出的像素格式(YUV/RGB) 52 | output.videoSettings = @{(NSString *)kCVPixelBufferPixelFormatTypeKey : @(kCVPixelFormatType_420YpCbCr8BiPlanarFullRange)}; 53 | output.alwaysDiscardsLateVideoFrames = YES; 54 | [session addOutput:output]; 55 | 56 | AVCaptureConnection *connection = [output connectionWithMediaType:AVMediaTypeVideo]; 57 | 58 | if ([connection isVideoOrientationSupported]) { 59 | NSLog(@"支持修改"); 60 | } else { 61 | NSLog(@"不知修改"); 62 | } 63 | 64 | [connection setVideoOrientation:AVCaptureVideoOrientationPortrait]; 65 | 66 | // 5.开始采集 67 | [session startRunning]; 68 | } 69 | 70 | - (void)stopCapturing { 71 | [self.layer removeFromSuperlayer]; 72 | [self.session stopRunning]; 73 | } 74 | 75 | 76 | 77 | - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection { 78 | [self.openGLView displaySampleBuffer:sampleBuffer]; 79 | // self.openGLView.pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /02-画出一个图片/01-HelloOpenGL/OpenGL/HYOpenGLView.m: -------------------------------------------------------------------------------- 1 | // 2 | // HYOpenGLView.m 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | /* 9 | 1> 将layer改成CAEAGLLayer 10 | 2> 创建EAGLContext上下文 11 | */ 12 | 13 | #import "HYOpenGLView.h" 14 | #import 15 | 16 | @implementation HYOpenGLView 17 | 18 | // 1> 将HYOpenGLView的layer改成CAEAGLlayer 19 | + (Class)layerClass { 20 | return [CAEAGLLayer class]; 21 | } 22 | 23 | // 2> 初始化OpenGL的信息 24 | - (instancetype)initWithFrame:(CGRect)frame 25 | { 26 | if (self = [super initWithFrame:frame]) { 27 | [self setupOpenGL]; 28 | } 29 | return self; 30 | } 31 | 32 | - (void)setupOpenGL { 33 | // 1.创建EAGLContext 34 | EAGLContext *glContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; 35 | [EAGLContext setCurrentContext:glContext]; 36 | CAEAGLLayer *glLayer = (CAEAGLLayer *)self.layer; 37 | 38 | // 在openGL中,即使是画最简单的颜色来添加, 也需要至少两个缓冲区 39 | // renderBuffer(渲染缓冲区, 用来存储一些图像信息)/frameBuffer(帧缓冲区, 渲染缓冲区依附于帧缓冲区才能显示内容的) 40 | // GLuint作为openGL所有对象的引用, 该对象指向GPU中的一块内存地址 41 | 42 | // 2.创建渲染缓存区 43 | GLuint renderbufferUint; 44 | glGenRenderbuffers(1, &renderbufferUint); 45 | glBindRenderbuffer(GL_RENDERBUFFER, renderbufferUint); 46 | [glContext renderbufferStorage:GL_RENDERBUFFER fromDrawable:glLayer]; 47 | 48 | // 3.创建帧缓冲区 49 | GLuint framebufferUint; 50 | glGenFramebuffers(1, &framebufferUint); 51 | glBindFramebuffer(GL_FRAMEBUFFER, framebufferUint); 52 | glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, renderbufferUint); 53 | 54 | // OpenGL如果要绘制图片 55 | /* 56 | 顶点着色器 和 片段着色器 57 | 共同的特点 58 | 1> 他们都运行在GPU上面的程序, openGL2.0开始被称之为可编程管线, 在OpenGL1.0的时候, 固定管线, 很多顶点着色器都是固定的, 不能任意的修改, 但是从OpenGL2.0开始, 变成可编程管线, 但是难度也突然提升了很多, 相当于我们需要在GPU上面来运行我们的程序 59 | 2> 都是用来为GPU提供绘制图像的内容的 60 | 顶点着色器 61 | 1> 在openGL的世界里, 所有的图像都是以三角形的方式存在的. 为什么是三角形? 比如两个点只能组成一条线, 但是四个点就组成了无线多的面, 不能将4个顶点固定在一个平面上. 但是三角形的三个点确定下来之后, 是一定在同一个平面的. 如果想在其他平面继续画东西, 就给出其他屏幕的三角形即可 62 | 2> 外界提供给我们即将画出的图像的所有顶点, 比如说现在要画一个长方形, 一个长方形是由两个三角形组成的, 那么就需要提供能形成两个三角形的顶点. 而顶点着色器就是接受三角形顶点的. 之后会经过各种变化, 形成新的顶点(因为就3D图像来说, 很多内容是会被上层的内容遮盖的, 那么有些顶点是没有存在的必要) 63 | 3> 接受纹理数据, 并且对纹理数据进行转化 64 | 片段着色器 65 | 1> 接受变化后的顶点, 之后再根据传入的纹理数据, 生成片段, 之后根据片段给屏幕渲染对应的颜色 66 | 如何创建着色器 67 | 1> 需要书写glsl程序, 该程序就是运行了GPU上的程序 68 | 2> 加载源码, 并且编译的程序 69 | */ 70 | // 4.创建和编译着色器程序 71 | GLuint vertexShader = [self compileShader:@"VertexSource" withType:GL_VERTEX_SHADER]; 72 | GLuint fragmentShader = [self compileShader:@"FragmentSource" withType:GL_FRAGMENT_SHADER]; 73 | 74 | // 5.将两个程序链接在一起使用 75 | GLuint programHandle = glCreateProgram(); 76 | glAttachShader(programHandle, vertexShader); 77 | glAttachShader(programHandle, fragmentShader); 78 | glLinkProgram(programHandle); 79 | GLint linkSuccess; 80 | glGetProgramiv(programHandle, GL_LINK_STATUS, &linkSuccess); 81 | if (linkSuccess == GL_FALSE) { 82 | GLchar messages[256]; 83 | glGetProgramInfoLog(programHandle, sizeof(messages), 0, &messages[0]); 84 | NSString *messageString = [NSString stringWithUTF8String:messages]; 85 | NSLog(@"%@", messageString); 86 | } 87 | glUseProgram(programHandle); 88 | 89 | // 6.给顶点着色器传入数据 90 | // 6.1.传入顶点坐标数据 91 | GLfloat quadVertexData [] = { 92 | -1, -1, 93 | 1, -1, 94 | -1, 1, 95 | 1, 1, 96 | }; 97 | glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, quadVertexData); 98 | glEnableVertexAttribArray(0); 99 | 100 | // 6.2.传入纹理的坐标数据 101 | GLfloat quadTextureData[] = { // 正常坐标 102 | 0, 0, 103 | 1, 0, 104 | 0, 1, 105 | 1, 1 106 | }; 107 | glVertexAttribPointer(0, 2, GL_FLOAT, 0, 0, quadTextureData); 108 | glEnableVertexAttribArray(1); 109 | 110 | // 7.设置片段着色器中的纹理数据 111 | // 7.1.获取片段着色器中的纹理属性 112 | GLuint textureUniform = glGetUniformLocation(programHandle, "Texture"); 113 | 114 | // 7.2.绑定纹理数据 115 | GLuint floorTexture = [self setupTexture:@"tile_floor.png"]; 116 | glActiveTexture(GL_TEXTURE0); 117 | glBindTexture(GL_TEXTURE_2D, floorTexture); 118 | 119 | // 7.3.将纹理传入给fragment shader中Uniform属性中 120 | glUniform1i(textureUniform, 0); 121 | 122 | // 8.开始绘制图像 123 | // 8.1.告知系统绘制的大小(绘制的是当前View的大小) 124 | glViewport(0, 0, self.frame.size.width, self.frame.size.height); 125 | 126 | // 8.2. 127 | glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); 128 | 129 | // 8.3.渲染上述的内容 130 | [glContext presentRenderbuffer:GL_RENDERBUFFER]; 131 | } 132 | 133 | - (GLuint)compileShader:(NSString*)shaderName withType:(GLenum)shaderType { 134 | 135 | // 1.获取shader文件的路径 136 | NSString* shaderPath = [[NSBundle mainBundle] pathForResource:shaderName ofType:@"glsl"]; 137 | NSError* error; 138 | NSString* shaderString = [NSString stringWithContentsOfFile:shaderPath encoding:NSUTF8StringEncoding error:&error]; 139 | if (!shaderString) { 140 | NSLog(@"Error loading shader: %@", error.localizedDescription); 141 | } 142 | 143 | // 2.根据类型, 创建对应的着色器对象 144 | GLuint shaderHandle = glCreateShader(shaderType); 145 | 146 | // 3.加载着色器源码 147 | const char* shaderStringUTF8 = [shaderString UTF8String]; 148 | glShaderSource(shaderHandle, 1, &shaderStringUTF8, NULL); 149 | 150 | // 4.编译着色器 151 | glCompileShader(shaderHandle); 152 | 153 | // 5.查看是否编译成功, 如果没有成功, 则打印对应的错误信息 154 | GLint compileSuccess; 155 | glGetShaderiv(shaderHandle, GL_COMPILE_STATUS, &compileSuccess); 156 | if (compileSuccess == GL_FALSE) { 157 | GLchar messages[256]; 158 | glGetShaderInfoLog(shaderHandle, sizeof(messages), 0, &messages[0]); 159 | NSString *messageString = [NSString stringWithUTF8String:messages]; 160 | NSLog(@"%@", messageString); 161 | } 162 | 163 | return shaderHandle; 164 | } 165 | 166 | - (GLuint)setupTexture:(NSString *)fileName { 167 | // 1.根据文件名称, 加载对应的图片 168 | CGImageRef spriteImage = [UIImage imageNamed:fileName].CGImage; 169 | if (!spriteImage) { 170 | NSLog(@"Failed to load image %@", fileName); 171 | exit(1); 172 | } 173 | 174 | // 2.获取Bitmap上下文 175 | // 2.1.获取图片的宽度和高度 176 | size_t width = CGImageGetWidth(spriteImage); 177 | size_t height = CGImageGetHeight(spriteImage); 178 | // 2.2.根据图片的宽度和高度分配内存 179 | // *4 : 图片的每一个像素点都是由RGBA组成, 而一种颜色通道需要一个字节表示 180 | GLubyte * spriteData = (GLubyte *) calloc(width*height*4, sizeof(GLubyte)); 181 | // 2.3.创建BitmapContext 182 | // 最后一个参数是Alpha通道的位置(第一个还是最后一个) 183 | CGContextRef spriteContext = CGBitmapContextCreate(spriteData, width, height, 8, width*4, 184 | CGImageGetColorSpace(spriteImage), kCGImageAlphaPremultipliedLast); 185 | 186 | // 3.将当前的图片绘制到当前位图的上下文中 187 | // 3.1.绘制到当前位图上下文中 188 | CGContextDrawImage(spriteContext, CGRectMake(0, 0, width, height), spriteImage); 189 | // 3.3.释放之前的位图 190 | CGContextRelease(spriteContext); 191 | 192 | // 4.生成纹理 193 | // 4.1.定义纹理的数字标识符(名字) 194 | GLuint texName; 195 | // 4.2.创建纹理对象 196 | glGenTextures(1, &texName); 197 | // 4.3.绑定纹理是2D还是3D 198 | glBindTexture(GL_TEXTURE_2D, texName); 199 | 200 | // https://learnopengl-cn.readthedocs.io/zh/latest/01%20Getting%20started/06%20Textures/ 201 | // 4.4.设置纹理的过滤效果 202 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 203 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 204 | 205 | // 4.5.生成对应的纹理数据 206 | glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (GLsizei)width, (GLsizei)height, 0, GL_RGBA, GL_UNSIGNED_BYTE, spriteData); 207 | free(spriteData); 208 | 209 | return texName; 210 | } 211 | 212 | @end 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL/OpenGL/HYOpenGLView.m: -------------------------------------------------------------------------------- 1 | // 2 | // HYOpenGLView.m 3 | // 01-HelloOpenGL 4 | // 5 | // Created by apple on 17/4/29. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | /* 9 | 1> 将layer改成CAEAGLLayer 10 | 2> 创建EAGLContext上下文 11 | */ 12 | 13 | #import "HYOpenGLView.h" 14 | #import 15 | 16 | // BT.709, which is the standard for HDTV. 17 | static const GLfloat kColorConversion709[] = { 18 | 1.164, 1.164, 1.164, 19 | 0.0, -0.213, 2.112, 20 | 1.793, -0.533, 0.0, 21 | }; 22 | 23 | // BT.601 full range SDTV 24 | const GLfloat kColorConversion601FullRange[] = { 25 | 1.0, 1.0, 1.0, 26 | 0.0, -0.343, 1.765, 27 | 1.4, -0.711, 0.0, 28 | }; 29 | 30 | @interface HYOpenGLView() 31 | { 32 | GLint vertexIndex; 33 | GLint textureIndex; 34 | 35 | GLint samplerYIndex; 36 | GLint samplerUVIndex; 37 | GLint matrixIndex; 38 | 39 | const GLfloat *_preferredConversion; 40 | CVOpenGLESTextureCacheRef _videoTextureCache; 41 | EAGLContext *_glContext; 42 | CVOpenGLESTextureRef _lumaTexture; 43 | CVOpenGLESTextureRef _chromaTexture; 44 | } 45 | 46 | @end 47 | 48 | @implementation HYOpenGLView 49 | 50 | // 1> 将HYOpenGLView的layer改成CAEAGLlayer 51 | + (Class)layerClass { 52 | return [CAEAGLLayer class]; 53 | } 54 | 55 | // 2> 初始化OpenGL的信息 56 | - (instancetype)initWithFrame:(CGRect)frame 57 | { 58 | if (self = [super initWithFrame:frame]) { 59 | [self setupOpenGL]; 60 | } 61 | return self; 62 | } 63 | 64 | - (void)setupOpenGL { 65 | _preferredConversion = kColorConversion709; 66 | 67 | // 1.创建EAGLContext 68 | EAGLContext *glContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; 69 | [EAGLContext setCurrentContext:glContext]; 70 | CAEAGLLayer *glLayer = (CAEAGLLayer *)self.layer; 71 | 72 | // 在openGL中,即使是画最简单的颜色来添加, 也需要至少两个缓冲区 73 | // renderBuffer(渲染缓冲区, 用来存储一些图像信息)/frameBuffer(帧缓冲区, 渲染缓冲区依附于帧缓冲区才能显示内容的) 74 | // GLuint作为openGL所有对象的引用, 该对象指向GPU中的一块内存地址 75 | 76 | // 2.创建渲染缓存区 77 | GLuint renderbufferUint; 78 | glGenRenderbuffers(1, &renderbufferUint); 79 | glBindRenderbuffer(GL_RENDERBUFFER, renderbufferUint); 80 | [glContext renderbufferStorage:GL_RENDERBUFFER fromDrawable:glLayer]; 81 | _glContext = glContext; 82 | 83 | // 3.创建帧缓冲区 84 | GLuint framebufferUint; 85 | glGenFramebuffers(1, &framebufferUint); 86 | glBindFramebuffer(GL_FRAMEBUFFER, framebufferUint); 87 | glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, renderbufferUint); 88 | 89 | // OpenGL如果要绘制图片 90 | /* 91 | 顶点着色器 和 片段着色器 92 | 共同的特点 93 | 1> 他们都运行在GPU上面的程序, openGL2.0开始被称之为可编程管线, 在OpenGL1.0的时候, 固定管线, 很多顶点着色器都是固定的, 不能任意的修改, 但是从OpenGL2.0开始, 变成可编程管线, 但是难度也突然提升了很多, 相当于我们需要在GPU上面来运行我们的程序 94 | 2> 都是用来为GPU提供绘制图像的内容的 95 | 顶点着色器 96 | 1> 在openGL的世界里, 所有的图像都是以三角形的方式存在的. 为什么是三角形? 比如两个点只能组成一条线, 但是四个点就组成了无线多的面, 不能将4个顶点固定在一个平面上. 但是三角形的三个点确定下来之后, 是一定在同一个平面的. 如果想在其他平面继续画东西, 就给出其他屏幕的三角形即可 97 | 2> 外界提供给我们即将画出的图像的所有顶点, 比如说现在要画一个长方形, 一个长方形是由两个三角形组成的, 那么就需要提供能形成两个三角形的顶点. 而顶点着色器就是接受三角形顶点的. 之后会经过各种变化, 形成新的顶点(因为就3D图像来说, 很多内容是会被上层的内容遮盖的, 那么有些顶点是没有存在的必要) 98 | 3> 接受纹理数据, 并且对纹理数据进行转化 99 | 片段着色器 100 | 1> 接受变化后的顶点, 之后再根据传入的纹理数据, 生成片段, 之后根据片段给屏幕渲染对应的颜色 101 | 如何创建着色器 102 | 1> 需要书写glsl程序, 该程序就是运行了GPU上的程序 103 | 2> 加载源码, 并且编译的程序 104 | */ 105 | // 4.创建和编译着色器程序 106 | GLuint vertexShader = [self compileShader:@"VertexSource" withType:GL_VERTEX_SHADER]; 107 | GLuint fragmentShader = [self compileShader:@"FragmentSource" withType:GL_FRAGMENT_SHADER]; 108 | 109 | // 5.将两个程序链接在一起使用 110 | GLuint programHandle = glCreateProgram(); 111 | glAttachShader(programHandle, vertexShader); 112 | glAttachShader(programHandle, fragmentShader); 113 | glLinkProgram(programHandle); 114 | GLint linkSuccess; 115 | glGetProgramiv(programHandle, GL_LINK_STATUS, &linkSuccess); 116 | if (linkSuccess == GL_FALSE) { 117 | GLchar messages[256]; 118 | glGetProgramInfoLog(programHandle, sizeof(messages), 0, &messages[0]); 119 | NSString *messageString = [NSString stringWithUTF8String:messages]; 120 | NSLog(@"%@", messageString); 121 | } 122 | glUseProgram(programHandle); 123 | 124 | // 6.获取顶点着色器的属性index 125 | vertexIndex = glGetAttribLocation(programHandle, "Position"); 126 | glEnableVertexAttribArray(vertexIndex); 127 | textureIndex = glGetAttribLocation(programHandle, "TexCoordIn"); 128 | glEnableVertexAttribArray(textureIndex); 129 | 130 | // 7.获取片段着色器的属性index 131 | samplerYIndex = glGetUniformLocation(programHandle, "SamplerY"); 132 | samplerUVIndex = glGetUniformLocation(programHandle, "SamplerUV"); 133 | matrixIndex = glGetUniformLocation(programHandle, "colorConversionMatrix"); 134 | 135 | // 将纹理和属性结合起来 136 | glUniform1i(samplerYIndex, 0); 137 | glUniform1i(samplerUVIndex, 1); 138 | glUniformMatrix3fv(matrixIndex, 1, GL_FALSE, _preferredConversion); 139 | 140 | // 创建纹理缓存 141 | CVOpenGLESTextureCacheCreate(kCFAllocatorDefault, NULL, glContext, NULL, &_videoTextureCache); 142 | } 143 | 144 | - (GLuint)compileShader:(NSString*)shaderName withType:(GLenum)shaderType { 145 | 146 | // 1.获取shader文件的路径 147 | NSString* shaderPath = [[NSBundle mainBundle] pathForResource:shaderName ofType:@"glsl"]; 148 | NSError* error; 149 | NSString* shaderString = [NSString stringWithContentsOfFile:shaderPath encoding:NSUTF8StringEncoding error:&error]; 150 | if (!shaderString) { 151 | NSLog(@"Error loading shader: %@", error.localizedDescription); 152 | } 153 | 154 | // 2.根据类型, 创建对应的着色器对象 155 | GLuint shaderHandle = glCreateShader(shaderType); 156 | 157 | // 3.加载着色器源码 158 | const char* shaderStringUTF8 = [shaderString UTF8String]; 159 | glShaderSource(shaderHandle, 1, &shaderStringUTF8, NULL); 160 | 161 | // 4.编译着色器 162 | glCompileShader(shaderHandle); 163 | 164 | // 5.查看是否编译成功, 如果没有成功, 则打印对应的错误信息 165 | GLint compileSuccess; 166 | glGetShaderiv(shaderHandle, GL_COMPILE_STATUS, &compileSuccess); 167 | if (compileSuccess == GL_FALSE) { 168 | GLchar messages[256]; 169 | glGetShaderInfoLog(shaderHandle, sizeof(messages), 0, &messages[0]); 170 | NSString *messageString = [NSString stringWithUTF8String:messages]; 171 | NSLog(@"%@", messageString); 172 | } 173 | 174 | return shaderHandle; 175 | } 176 | 177 | - (void)displaySampleBuffer:(CMSampleBufferRef)sampleBuffer 178 | { 179 | // 1.获取CVPixelBuffer 180 | CVPixelBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); 181 | 182 | // 2.获取图片的宽度和高度 183 | int frameWidth = (int)CVPixelBufferGetWidth(pixelBuffer); 184 | int frameHeight = (int)CVPixelBufferGetHeight(pixelBuffer); 185 | 186 | // 3.设置当前的上下文是之前创建的上下文 187 | if ([EAGLContext currentContext] != _glContext) { 188 | [EAGLContext setCurrentContext:_glContext]; // 非常重要的一行代码 189 | } 190 | 191 | // 4.清楚之前的纹理数据, 获取新的纹理数据 192 | [self cleanUpTextures]; 193 | 194 | // 5.判断纹理的类型 195 | CFTypeRef colorAttachments = CVBufferGetAttachment(pixelBuffer, kCVImageBufferYCbCrMatrixKey, NULL); 196 | if (colorAttachments == kCVImageBufferYCbCrMatrix_ITU_R_601_4) { 197 | _preferredConversion = kColorConversion601FullRange; 198 | } else { 199 | _preferredConversion = kColorConversion709; 200 | } 201 | 202 | // 6.获取Y的纹理 203 | glActiveTexture(GL_TEXTURE0); 204 | CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, 205 | _videoTextureCache, 206 | pixelBuffer, 207 | NULL, 208 | GL_TEXTURE_2D, 209 | GL_LUMINANCE, 210 | frameWidth, 211 | frameHeight, 212 | GL_LUMINANCE, 213 | GL_UNSIGNED_BYTE, 214 | 0, 215 | &_lumaTexture); 216 | 217 | glBindTexture(CVOpenGLESTextureGetTarget(_lumaTexture), CVOpenGLESTextureGetName(_lumaTexture)); 218 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 219 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 220 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 221 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 222 | 223 | // 7.获取UV纹理 224 | glActiveTexture(GL_TEXTURE1); 225 | CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, 226 | _videoTextureCache, 227 | pixelBuffer, 228 | NULL, 229 | GL_TEXTURE_2D, 230 | GL_LUMINANCE_ALPHA, 231 | frameWidth / 2, 232 | frameHeight / 2, 233 | GL_LUMINANCE_ALPHA, 234 | GL_UNSIGNED_BYTE, 235 | 1, 236 | &_chromaTexture); 237 | 238 | glBindTexture(CVOpenGLESTextureGetTarget(_chromaTexture), CVOpenGLESTextureGetName(_chromaTexture)); 239 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 240 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 241 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 242 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 243 | 244 | 245 | // 9.设置创建的大小 246 | glViewport(0, 0, frameWidth, frameHeight); 247 | 248 | // 10.使用新的颜色, 清空缓冲 249 | glClearColor(0.0f, 0.0f, 0.0f, 1.0f); 250 | glClear(GL_COLOR_BUFFER_BIT); 251 | 252 | // 11.获取顶点坐标 253 | GLfloat quadVertexData [] = { 254 | -1, -1, 255 | 1, -1, 256 | -1, 1, 257 | 1, 1, 258 | }; 259 | 260 | // 更新顶点数据 261 | glVertexAttribPointer(vertexIndex, 2, GL_FLOAT, 0, 0, quadVertexData); 262 | 263 | // 1.2.纹理坐标 264 | GLfloat quadTextureData[] = { // 正常坐标 265 | 0, 1, 266 | 1, 1, 267 | 0, 0, 268 | 1, 0 269 | }; 270 | 271 | glVertexAttribPointer(textureIndex, 2, GL_FLOAT, 0, 0, quadTextureData); 272 | glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); 273 | 274 | if ([EAGLContext currentContext] == _glContext) { 275 | [_glContext presentRenderbuffer:GL_RENDERBUFFER]; 276 | } 277 | 278 | } 279 | 280 | - (void)cleanUpTextures 281 | { 282 | if (_lumaTexture) { 283 | CFRelease(_lumaTexture); 284 | _lumaTexture = NULL; 285 | } 286 | 287 | if (_chromaTexture) { 288 | CFRelease(_chromaTexture); 289 | _chromaTexture = NULL; 290 | } 291 | 292 | // Periodic texture cache flush every frame 293 | CVOpenGLESTextureCacheFlush(_videoTextureCache, 0); 294 | } 295 | 296 | 297 | @end 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | -------------------------------------------------------------------------------- /01-HelloOpenGL/01-HelloOpenGL.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 180FA1541EB4BC8F00EF5567 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 180FA1531EB4BC8F00EF5567 /* main.m */; }; 11 | 180FA1571EB4BC8F00EF5567 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 180FA1561EB4BC8F00EF5567 /* AppDelegate.m */; }; 12 | 180FA15A1EB4BC8F00EF5567 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 180FA1591EB4BC8F00EF5567 /* ViewController.m */; }; 13 | 180FA15D1EB4BC8F00EF5567 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 180FA15B1EB4BC8F00EF5567 /* Main.storyboard */; }; 14 | 180FA15F1EB4BC8F00EF5567 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 180FA15E1EB4BC8F00EF5567 /* Assets.xcassets */; }; 15 | 180FA1621EB4BC8F00EF5567 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 180FA1601EB4BC8F00EF5567 /* LaunchScreen.storyboard */; }; 16 | 180FA16C1EB4BCAE00EF5567 /* HYOpenGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = 180FA16B1EB4BCAE00EF5567 /* HYOpenGLView.m */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 180FA14F1EB4BC8F00EF5567 /* 01-HelloOpenGL.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "01-HelloOpenGL.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 180FA1531EB4BC8F00EF5567 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 22 | 180FA1551EB4BC8F00EF5567 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 23 | 180FA1561EB4BC8F00EF5567 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 24 | 180FA1581EB4BC8F00EF5567 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 25 | 180FA1591EB4BC8F00EF5567 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 26 | 180FA15C1EB4BC8F00EF5567 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 27 | 180FA15E1EB4BC8F00EF5567 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 28 | 180FA1611EB4BC8F00EF5567 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 29 | 180FA1631EB4BC8F00EF5567 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 30 | 180FA16A1EB4BCAE00EF5567 /* HYOpenGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HYOpenGLView.h; sourceTree = ""; }; 31 | 180FA16B1EB4BCAE00EF5567 /* HYOpenGLView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HYOpenGLView.m; sourceTree = ""; }; 32 | /* End PBXFileReference section */ 33 | 34 | /* Begin PBXFrameworksBuildPhase section */ 35 | 180FA14C1EB4BC8F00EF5567 /* Frameworks */ = { 36 | isa = PBXFrameworksBuildPhase; 37 | buildActionMask = 2147483647; 38 | files = ( 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXFrameworksBuildPhase section */ 43 | 44 | /* Begin PBXGroup section */ 45 | 180FA1461EB4BC8E00EF5567 = { 46 | isa = PBXGroup; 47 | children = ( 48 | 180FA1511EB4BC8F00EF5567 /* 01-HelloOpenGL */, 49 | 180FA1501EB4BC8F00EF5567 /* Products */, 50 | ); 51 | sourceTree = ""; 52 | }; 53 | 180FA1501EB4BC8F00EF5567 /* Products */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | 180FA14F1EB4BC8F00EF5567 /* 01-HelloOpenGL.app */, 57 | ); 58 | name = Products; 59 | sourceTree = ""; 60 | }; 61 | 180FA1511EB4BC8F00EF5567 /* 01-HelloOpenGL */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | 180FA1691EB4BCA100EF5567 /* OpenGL */, 65 | 180FA1551EB4BC8F00EF5567 /* AppDelegate.h */, 66 | 180FA1561EB4BC8F00EF5567 /* AppDelegate.m */, 67 | 180FA1581EB4BC8F00EF5567 /* ViewController.h */, 68 | 180FA1591EB4BC8F00EF5567 /* ViewController.m */, 69 | 180FA15B1EB4BC8F00EF5567 /* Main.storyboard */, 70 | 180FA15E1EB4BC8F00EF5567 /* Assets.xcassets */, 71 | 180FA1601EB4BC8F00EF5567 /* LaunchScreen.storyboard */, 72 | 180FA1631EB4BC8F00EF5567 /* Info.plist */, 73 | 180FA1521EB4BC8F00EF5567 /* Supporting Files */, 74 | ); 75 | path = "01-HelloOpenGL"; 76 | sourceTree = ""; 77 | }; 78 | 180FA1521EB4BC8F00EF5567 /* Supporting Files */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 180FA1531EB4BC8F00EF5567 /* main.m */, 82 | ); 83 | name = "Supporting Files"; 84 | sourceTree = ""; 85 | }; 86 | 180FA1691EB4BCA100EF5567 /* OpenGL */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 180FA16A1EB4BCAE00EF5567 /* HYOpenGLView.h */, 90 | 180FA16B1EB4BCAE00EF5567 /* HYOpenGLView.m */, 91 | ); 92 | path = OpenGL; 93 | sourceTree = ""; 94 | }; 95 | /* End PBXGroup section */ 96 | 97 | /* Begin PBXNativeTarget section */ 98 | 180FA14E1EB4BC8F00EF5567 /* 01-HelloOpenGL */ = { 99 | isa = PBXNativeTarget; 100 | buildConfigurationList = 180FA1661EB4BC8F00EF5567 /* Build configuration list for PBXNativeTarget "01-HelloOpenGL" */; 101 | buildPhases = ( 102 | 180FA14B1EB4BC8F00EF5567 /* Sources */, 103 | 180FA14C1EB4BC8F00EF5567 /* Frameworks */, 104 | 180FA14D1EB4BC8F00EF5567 /* Resources */, 105 | ); 106 | buildRules = ( 107 | ); 108 | dependencies = ( 109 | ); 110 | name = "01-HelloOpenGL"; 111 | productName = "01-HelloOpenGL"; 112 | productReference = 180FA14F1EB4BC8F00EF5567 /* 01-HelloOpenGL.app */; 113 | productType = "com.apple.product-type.application"; 114 | }; 115 | /* End PBXNativeTarget section */ 116 | 117 | /* Begin PBXProject section */ 118 | 180FA1471EB4BC8E00EF5567 /* Project object */ = { 119 | isa = PBXProject; 120 | attributes = { 121 | LastUpgradeCheck = 0820; 122 | ORGANIZATIONNAME = apple; 123 | TargetAttributes = { 124 | 180FA14E1EB4BC8F00EF5567 = { 125 | CreatedOnToolsVersion = 8.2.1; 126 | ProvisioningStyle = Automatic; 127 | }; 128 | }; 129 | }; 130 | buildConfigurationList = 180FA14A1EB4BC8E00EF5567 /* Build configuration list for PBXProject "01-HelloOpenGL" */; 131 | compatibilityVersion = "Xcode 3.2"; 132 | developmentRegion = English; 133 | hasScannedForEncodings = 0; 134 | knownRegions = ( 135 | en, 136 | Base, 137 | ); 138 | mainGroup = 180FA1461EB4BC8E00EF5567; 139 | productRefGroup = 180FA1501EB4BC8F00EF5567 /* Products */; 140 | projectDirPath = ""; 141 | projectRoot = ""; 142 | targets = ( 143 | 180FA14E1EB4BC8F00EF5567 /* 01-HelloOpenGL */, 144 | ); 145 | }; 146 | /* End PBXProject section */ 147 | 148 | /* Begin PBXResourcesBuildPhase section */ 149 | 180FA14D1EB4BC8F00EF5567 /* Resources */ = { 150 | isa = PBXResourcesBuildPhase; 151 | buildActionMask = 2147483647; 152 | files = ( 153 | 180FA1621EB4BC8F00EF5567 /* LaunchScreen.storyboard in Resources */, 154 | 180FA15F1EB4BC8F00EF5567 /* Assets.xcassets in Resources */, 155 | 180FA15D1EB4BC8F00EF5567 /* Main.storyboard in Resources */, 156 | ); 157 | runOnlyForDeploymentPostprocessing = 0; 158 | }; 159 | /* End PBXResourcesBuildPhase section */ 160 | 161 | /* Begin PBXSourcesBuildPhase section */ 162 | 180FA14B1EB4BC8F00EF5567 /* Sources */ = { 163 | isa = PBXSourcesBuildPhase; 164 | buildActionMask = 2147483647; 165 | files = ( 166 | 180FA15A1EB4BC8F00EF5567 /* ViewController.m in Sources */, 167 | 180FA1571EB4BC8F00EF5567 /* AppDelegate.m in Sources */, 168 | 180FA16C1EB4BCAE00EF5567 /* HYOpenGLView.m in Sources */, 169 | 180FA1541EB4BC8F00EF5567 /* main.m in Sources */, 170 | ); 171 | runOnlyForDeploymentPostprocessing = 0; 172 | }; 173 | /* End PBXSourcesBuildPhase section */ 174 | 175 | /* Begin PBXVariantGroup section */ 176 | 180FA15B1EB4BC8F00EF5567 /* Main.storyboard */ = { 177 | isa = PBXVariantGroup; 178 | children = ( 179 | 180FA15C1EB4BC8F00EF5567 /* Base */, 180 | ); 181 | name = Main.storyboard; 182 | sourceTree = ""; 183 | }; 184 | 180FA1601EB4BC8F00EF5567 /* LaunchScreen.storyboard */ = { 185 | isa = PBXVariantGroup; 186 | children = ( 187 | 180FA1611EB4BC8F00EF5567 /* Base */, 188 | ); 189 | name = LaunchScreen.storyboard; 190 | sourceTree = ""; 191 | }; 192 | /* End PBXVariantGroup section */ 193 | 194 | /* Begin XCBuildConfiguration section */ 195 | 180FA1641EB4BC8F00EF5567 /* Debug */ = { 196 | isa = XCBuildConfiguration; 197 | buildSettings = { 198 | ALWAYS_SEARCH_USER_PATHS = NO; 199 | CLANG_ANALYZER_NONNULL = YES; 200 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 201 | CLANG_CXX_LIBRARY = "libc++"; 202 | CLANG_ENABLE_MODULES = YES; 203 | CLANG_ENABLE_OBJC_ARC = YES; 204 | CLANG_WARN_BOOL_CONVERSION = YES; 205 | CLANG_WARN_CONSTANT_CONVERSION = YES; 206 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 207 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 208 | CLANG_WARN_EMPTY_BODY = YES; 209 | CLANG_WARN_ENUM_CONVERSION = YES; 210 | CLANG_WARN_INFINITE_RECURSION = YES; 211 | CLANG_WARN_INT_CONVERSION = YES; 212 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 213 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 214 | CLANG_WARN_UNREACHABLE_CODE = YES; 215 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 216 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 217 | COPY_PHASE_STRIP = NO; 218 | DEBUG_INFORMATION_FORMAT = dwarf; 219 | ENABLE_STRICT_OBJC_MSGSEND = YES; 220 | ENABLE_TESTABILITY = YES; 221 | GCC_C_LANGUAGE_STANDARD = gnu99; 222 | GCC_DYNAMIC_NO_PIC = NO; 223 | GCC_NO_COMMON_BLOCKS = YES; 224 | GCC_OPTIMIZATION_LEVEL = 0; 225 | GCC_PREPROCESSOR_DEFINITIONS = ( 226 | "DEBUG=1", 227 | "$(inherited)", 228 | ); 229 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 230 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 231 | GCC_WARN_UNDECLARED_SELECTOR = YES; 232 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 233 | GCC_WARN_UNUSED_FUNCTION = YES; 234 | GCC_WARN_UNUSED_VARIABLE = YES; 235 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 236 | MTL_ENABLE_DEBUG_INFO = YES; 237 | ONLY_ACTIVE_ARCH = YES; 238 | SDKROOT = iphoneos; 239 | }; 240 | name = Debug; 241 | }; 242 | 180FA1651EB4BC8F00EF5567 /* Release */ = { 243 | isa = XCBuildConfiguration; 244 | buildSettings = { 245 | ALWAYS_SEARCH_USER_PATHS = NO; 246 | CLANG_ANALYZER_NONNULL = YES; 247 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 248 | CLANG_CXX_LIBRARY = "libc++"; 249 | CLANG_ENABLE_MODULES = YES; 250 | CLANG_ENABLE_OBJC_ARC = YES; 251 | CLANG_WARN_BOOL_CONVERSION = YES; 252 | CLANG_WARN_CONSTANT_CONVERSION = YES; 253 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 254 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 255 | CLANG_WARN_EMPTY_BODY = YES; 256 | CLANG_WARN_ENUM_CONVERSION = YES; 257 | CLANG_WARN_INFINITE_RECURSION = YES; 258 | CLANG_WARN_INT_CONVERSION = YES; 259 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 260 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 261 | CLANG_WARN_UNREACHABLE_CODE = YES; 262 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 263 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 264 | COPY_PHASE_STRIP = NO; 265 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 266 | ENABLE_NS_ASSERTIONS = NO; 267 | ENABLE_STRICT_OBJC_MSGSEND = YES; 268 | GCC_C_LANGUAGE_STANDARD = gnu99; 269 | GCC_NO_COMMON_BLOCKS = YES; 270 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 271 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 272 | GCC_WARN_UNDECLARED_SELECTOR = YES; 273 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 274 | GCC_WARN_UNUSED_FUNCTION = YES; 275 | GCC_WARN_UNUSED_VARIABLE = YES; 276 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 277 | MTL_ENABLE_DEBUG_INFO = NO; 278 | SDKROOT = iphoneos; 279 | VALIDATE_PRODUCT = YES; 280 | }; 281 | name = Release; 282 | }; 283 | 180FA1671EB4BC8F00EF5567 /* Debug */ = { 284 | isa = XCBuildConfiguration; 285 | buildSettings = { 286 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 287 | INFOPLIST_FILE = "01-HelloOpenGL/Info.plist"; 288 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 289 | PRODUCT_BUNDLE_IDENTIFIER = "com.coderwhy.-1-HelloOpenGL"; 290 | PRODUCT_NAME = "$(TARGET_NAME)"; 291 | }; 292 | name = Debug; 293 | }; 294 | 180FA1681EB4BC8F00EF5567 /* Release */ = { 295 | isa = XCBuildConfiguration; 296 | buildSettings = { 297 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 298 | INFOPLIST_FILE = "01-HelloOpenGL/Info.plist"; 299 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 300 | PRODUCT_BUNDLE_IDENTIFIER = "com.coderwhy.-1-HelloOpenGL"; 301 | PRODUCT_NAME = "$(TARGET_NAME)"; 302 | }; 303 | name = Release; 304 | }; 305 | /* End XCBuildConfiguration section */ 306 | 307 | /* Begin XCConfigurationList section */ 308 | 180FA14A1EB4BC8E00EF5567 /* Build configuration list for PBXProject "01-HelloOpenGL" */ = { 309 | isa = XCConfigurationList; 310 | buildConfigurations = ( 311 | 180FA1641EB4BC8F00EF5567 /* Debug */, 312 | 180FA1651EB4BC8F00EF5567 /* Release */, 313 | ); 314 | defaultConfigurationIsVisible = 0; 315 | defaultConfigurationName = Release; 316 | }; 317 | 180FA1661EB4BC8F00EF5567 /* Build configuration list for PBXNativeTarget "01-HelloOpenGL" */ = { 318 | isa = XCConfigurationList; 319 | buildConfigurations = ( 320 | 180FA1671EB4BC8F00EF5567 /* Debug */, 321 | 180FA1681EB4BC8F00EF5567 /* Release */, 322 | ); 323 | defaultConfigurationIsVisible = 0; 324 | }; 325 | /* End XCConfigurationList section */ 326 | }; 327 | rootObject = 180FA1471EB4BC8E00EF5567 /* Project object */; 328 | } 329 | -------------------------------------------------------------------------------- /02-画出一个图片/01-HelloOpenGL.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 180FA1541EB4BC8F00EF5567 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 180FA1531EB4BC8F00EF5567 /* main.m */; }; 11 | 180FA1571EB4BC8F00EF5567 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 180FA1561EB4BC8F00EF5567 /* AppDelegate.m */; }; 12 | 180FA15A1EB4BC8F00EF5567 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 180FA1591EB4BC8F00EF5567 /* ViewController.m */; }; 13 | 180FA15D1EB4BC8F00EF5567 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 180FA15B1EB4BC8F00EF5567 /* Main.storyboard */; }; 14 | 180FA15F1EB4BC8F00EF5567 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 180FA15E1EB4BC8F00EF5567 /* Assets.xcassets */; }; 15 | 180FA1621EB4BC8F00EF5567 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 180FA1601EB4BC8F00EF5567 /* LaunchScreen.storyboard */; }; 16 | 180FA16C1EB4BCAE00EF5567 /* HYOpenGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = 180FA16B1EB4BCAE00EF5567 /* HYOpenGLView.m */; }; 17 | 180FA16F1EB4CD7200EF5567 /* FragmentSource.glsl in Resources */ = {isa = PBXBuildFile; fileRef = 180FA16D1EB4CD7200EF5567 /* FragmentSource.glsl */; }; 18 | 180FA1701EB4CD7200EF5567 /* VertexSource.glsl in Resources */ = {isa = PBXBuildFile; fileRef = 180FA16E1EB4CD7200EF5567 /* VertexSource.glsl */; }; 19 | 180FA1721EB4D4BE00EF5567 /* tile_floor.png in Resources */ = {isa = PBXBuildFile; fileRef = 180FA1711EB4D4BE00EF5567 /* tile_floor.png */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 180FA14F1EB4BC8F00EF5567 /* 01-HelloOpenGL.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "01-HelloOpenGL.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | 180FA1531EB4BC8F00EF5567 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 25 | 180FA1551EB4BC8F00EF5567 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 26 | 180FA1561EB4BC8F00EF5567 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 27 | 180FA1581EB4BC8F00EF5567 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 28 | 180FA1591EB4BC8F00EF5567 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 29 | 180FA15C1EB4BC8F00EF5567 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 30 | 180FA15E1EB4BC8F00EF5567 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 31 | 180FA1611EB4BC8F00EF5567 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 32 | 180FA1631EB4BC8F00EF5567 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | 180FA16A1EB4BCAE00EF5567 /* HYOpenGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HYOpenGLView.h; sourceTree = ""; }; 34 | 180FA16B1EB4BCAE00EF5567 /* HYOpenGLView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HYOpenGLView.m; sourceTree = ""; }; 35 | 180FA16D1EB4CD7200EF5567 /* FragmentSource.glsl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FragmentSource.glsl; sourceTree = ""; }; 36 | 180FA16E1EB4CD7200EF5567 /* VertexSource.glsl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VertexSource.glsl; sourceTree = ""; }; 37 | 180FA1711EB4D4BE00EF5567 /* tile_floor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tile_floor.png; sourceTree = ""; }; 38 | /* End PBXFileReference section */ 39 | 40 | /* Begin PBXFrameworksBuildPhase section */ 41 | 180FA14C1EB4BC8F00EF5567 /* Frameworks */ = { 42 | isa = PBXFrameworksBuildPhase; 43 | buildActionMask = 2147483647; 44 | files = ( 45 | ); 46 | runOnlyForDeploymentPostprocessing = 0; 47 | }; 48 | /* End PBXFrameworksBuildPhase section */ 49 | 50 | /* Begin PBXGroup section */ 51 | 180FA1461EB4BC8E00EF5567 = { 52 | isa = PBXGroup; 53 | children = ( 54 | 180FA1511EB4BC8F00EF5567 /* 01-HelloOpenGL */, 55 | 180FA1501EB4BC8F00EF5567 /* Products */, 56 | ); 57 | sourceTree = ""; 58 | }; 59 | 180FA1501EB4BC8F00EF5567 /* Products */ = { 60 | isa = PBXGroup; 61 | children = ( 62 | 180FA14F1EB4BC8F00EF5567 /* 01-HelloOpenGL.app */, 63 | ); 64 | name = Products; 65 | sourceTree = ""; 66 | }; 67 | 180FA1511EB4BC8F00EF5567 /* 01-HelloOpenGL */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | 180FA1691EB4BCA100EF5567 /* OpenGL */, 71 | 180FA1551EB4BC8F00EF5567 /* AppDelegate.h */, 72 | 180FA1561EB4BC8F00EF5567 /* AppDelegate.m */, 73 | 180FA1581EB4BC8F00EF5567 /* ViewController.h */, 74 | 180FA1591EB4BC8F00EF5567 /* ViewController.m */, 75 | 180FA15B1EB4BC8F00EF5567 /* Main.storyboard */, 76 | 180FA15E1EB4BC8F00EF5567 /* Assets.xcassets */, 77 | 180FA1601EB4BC8F00EF5567 /* LaunchScreen.storyboard */, 78 | 180FA1631EB4BC8F00EF5567 /* Info.plist */, 79 | 180FA1521EB4BC8F00EF5567 /* Supporting Files */, 80 | ); 81 | path = "01-HelloOpenGL"; 82 | sourceTree = ""; 83 | }; 84 | 180FA1521EB4BC8F00EF5567 /* Supporting Files */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 180FA1711EB4D4BE00EF5567 /* tile_floor.png */, 88 | 180FA1531EB4BC8F00EF5567 /* main.m */, 89 | ); 90 | name = "Supporting Files"; 91 | sourceTree = ""; 92 | }; 93 | 180FA1691EB4BCA100EF5567 /* OpenGL */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 180FA16A1EB4BCAE00EF5567 /* HYOpenGLView.h */, 97 | 180FA16B1EB4BCAE00EF5567 /* HYOpenGLView.m */, 98 | 180FA16E1EB4CD7200EF5567 /* VertexSource.glsl */, 99 | 180FA16D1EB4CD7200EF5567 /* FragmentSource.glsl */, 100 | ); 101 | path = OpenGL; 102 | sourceTree = ""; 103 | }; 104 | /* End PBXGroup section */ 105 | 106 | /* Begin PBXNativeTarget section */ 107 | 180FA14E1EB4BC8F00EF5567 /* 01-HelloOpenGL */ = { 108 | isa = PBXNativeTarget; 109 | buildConfigurationList = 180FA1661EB4BC8F00EF5567 /* Build configuration list for PBXNativeTarget "01-HelloOpenGL" */; 110 | buildPhases = ( 111 | 180FA14B1EB4BC8F00EF5567 /* Sources */, 112 | 180FA14C1EB4BC8F00EF5567 /* Frameworks */, 113 | 180FA14D1EB4BC8F00EF5567 /* Resources */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = "01-HelloOpenGL"; 120 | productName = "01-HelloOpenGL"; 121 | productReference = 180FA14F1EB4BC8F00EF5567 /* 01-HelloOpenGL.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 180FA1471EB4BC8E00EF5567 /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 0820; 131 | ORGANIZATIONNAME = apple; 132 | TargetAttributes = { 133 | 180FA14E1EB4BC8F00EF5567 = { 134 | CreatedOnToolsVersion = 8.2.1; 135 | ProvisioningStyle = Automatic; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 180FA14A1EB4BC8E00EF5567 /* Build configuration list for PBXProject "01-HelloOpenGL" */; 140 | compatibilityVersion = "Xcode 3.2"; 141 | developmentRegion = English; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 180FA1461EB4BC8E00EF5567; 148 | productRefGroup = 180FA1501EB4BC8F00EF5567 /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 180FA14E1EB4BC8F00EF5567 /* 01-HelloOpenGL */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 180FA14D1EB4BC8F00EF5567 /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 180FA16F1EB4CD7200EF5567 /* FragmentSource.glsl in Resources */, 163 | 180FA1621EB4BC8F00EF5567 /* LaunchScreen.storyboard in Resources */, 164 | 180FA15F1EB4BC8F00EF5567 /* Assets.xcassets in Resources */, 165 | 180FA1701EB4CD7200EF5567 /* VertexSource.glsl in Resources */, 166 | 180FA1721EB4D4BE00EF5567 /* tile_floor.png in Resources */, 167 | 180FA15D1EB4BC8F00EF5567 /* Main.storyboard in Resources */, 168 | ); 169 | runOnlyForDeploymentPostprocessing = 0; 170 | }; 171 | /* End PBXResourcesBuildPhase section */ 172 | 173 | /* Begin PBXSourcesBuildPhase section */ 174 | 180FA14B1EB4BC8F00EF5567 /* Sources */ = { 175 | isa = PBXSourcesBuildPhase; 176 | buildActionMask = 2147483647; 177 | files = ( 178 | 180FA15A1EB4BC8F00EF5567 /* ViewController.m in Sources */, 179 | 180FA1571EB4BC8F00EF5567 /* AppDelegate.m in Sources */, 180 | 180FA16C1EB4BCAE00EF5567 /* HYOpenGLView.m in Sources */, 181 | 180FA1541EB4BC8F00EF5567 /* main.m in Sources */, 182 | ); 183 | runOnlyForDeploymentPostprocessing = 0; 184 | }; 185 | /* End PBXSourcesBuildPhase section */ 186 | 187 | /* Begin PBXVariantGroup section */ 188 | 180FA15B1EB4BC8F00EF5567 /* Main.storyboard */ = { 189 | isa = PBXVariantGroup; 190 | children = ( 191 | 180FA15C1EB4BC8F00EF5567 /* Base */, 192 | ); 193 | name = Main.storyboard; 194 | sourceTree = ""; 195 | }; 196 | 180FA1601EB4BC8F00EF5567 /* LaunchScreen.storyboard */ = { 197 | isa = PBXVariantGroup; 198 | children = ( 199 | 180FA1611EB4BC8F00EF5567 /* Base */, 200 | ); 201 | name = LaunchScreen.storyboard; 202 | sourceTree = ""; 203 | }; 204 | /* End PBXVariantGroup section */ 205 | 206 | /* Begin XCBuildConfiguration section */ 207 | 180FA1641EB4BC8F00EF5567 /* Debug */ = { 208 | isa = XCBuildConfiguration; 209 | buildSettings = { 210 | ALWAYS_SEARCH_USER_PATHS = NO; 211 | CLANG_ANALYZER_NONNULL = YES; 212 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 213 | CLANG_CXX_LIBRARY = "libc++"; 214 | CLANG_ENABLE_MODULES = YES; 215 | CLANG_ENABLE_OBJC_ARC = YES; 216 | CLANG_WARN_BOOL_CONVERSION = YES; 217 | CLANG_WARN_CONSTANT_CONVERSION = YES; 218 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 219 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 220 | CLANG_WARN_EMPTY_BODY = YES; 221 | CLANG_WARN_ENUM_CONVERSION = YES; 222 | CLANG_WARN_INFINITE_RECURSION = YES; 223 | CLANG_WARN_INT_CONVERSION = YES; 224 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 225 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 226 | CLANG_WARN_UNREACHABLE_CODE = YES; 227 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 228 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 229 | COPY_PHASE_STRIP = NO; 230 | DEBUG_INFORMATION_FORMAT = dwarf; 231 | ENABLE_STRICT_OBJC_MSGSEND = YES; 232 | ENABLE_TESTABILITY = YES; 233 | GCC_C_LANGUAGE_STANDARD = gnu99; 234 | GCC_DYNAMIC_NO_PIC = NO; 235 | GCC_NO_COMMON_BLOCKS = YES; 236 | GCC_OPTIMIZATION_LEVEL = 0; 237 | GCC_PREPROCESSOR_DEFINITIONS = ( 238 | "DEBUG=1", 239 | "$(inherited)", 240 | ); 241 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 242 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 243 | GCC_WARN_UNDECLARED_SELECTOR = YES; 244 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 245 | GCC_WARN_UNUSED_FUNCTION = YES; 246 | GCC_WARN_UNUSED_VARIABLE = YES; 247 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 248 | MTL_ENABLE_DEBUG_INFO = YES; 249 | ONLY_ACTIVE_ARCH = YES; 250 | SDKROOT = iphoneos; 251 | }; 252 | name = Debug; 253 | }; 254 | 180FA1651EB4BC8F00EF5567 /* Release */ = { 255 | isa = XCBuildConfiguration; 256 | buildSettings = { 257 | ALWAYS_SEARCH_USER_PATHS = NO; 258 | CLANG_ANALYZER_NONNULL = YES; 259 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 260 | CLANG_CXX_LIBRARY = "libc++"; 261 | CLANG_ENABLE_MODULES = YES; 262 | CLANG_ENABLE_OBJC_ARC = YES; 263 | CLANG_WARN_BOOL_CONVERSION = YES; 264 | CLANG_WARN_CONSTANT_CONVERSION = YES; 265 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 266 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 267 | CLANG_WARN_EMPTY_BODY = YES; 268 | CLANG_WARN_ENUM_CONVERSION = YES; 269 | CLANG_WARN_INFINITE_RECURSION = YES; 270 | CLANG_WARN_INT_CONVERSION = YES; 271 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 272 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 273 | CLANG_WARN_UNREACHABLE_CODE = YES; 274 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 275 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 276 | COPY_PHASE_STRIP = NO; 277 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 278 | ENABLE_NS_ASSERTIONS = NO; 279 | ENABLE_STRICT_OBJC_MSGSEND = YES; 280 | GCC_C_LANGUAGE_STANDARD = gnu99; 281 | GCC_NO_COMMON_BLOCKS = YES; 282 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 283 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 284 | GCC_WARN_UNDECLARED_SELECTOR = YES; 285 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 286 | GCC_WARN_UNUSED_FUNCTION = YES; 287 | GCC_WARN_UNUSED_VARIABLE = YES; 288 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 289 | MTL_ENABLE_DEBUG_INFO = NO; 290 | SDKROOT = iphoneos; 291 | VALIDATE_PRODUCT = YES; 292 | }; 293 | name = Release; 294 | }; 295 | 180FA1671EB4BC8F00EF5567 /* Debug */ = { 296 | isa = XCBuildConfiguration; 297 | buildSettings = { 298 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 299 | INFOPLIST_FILE = "01-HelloOpenGL/Info.plist"; 300 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 301 | PRODUCT_BUNDLE_IDENTIFIER = "com.coderwhy.-1-HelloOpenGL"; 302 | PRODUCT_NAME = "$(TARGET_NAME)"; 303 | }; 304 | name = Debug; 305 | }; 306 | 180FA1681EB4BC8F00EF5567 /* Release */ = { 307 | isa = XCBuildConfiguration; 308 | buildSettings = { 309 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 310 | INFOPLIST_FILE = "01-HelloOpenGL/Info.plist"; 311 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 312 | PRODUCT_BUNDLE_IDENTIFIER = "com.coderwhy.-1-HelloOpenGL"; 313 | PRODUCT_NAME = "$(TARGET_NAME)"; 314 | }; 315 | name = Release; 316 | }; 317 | /* End XCBuildConfiguration section */ 318 | 319 | /* Begin XCConfigurationList section */ 320 | 180FA14A1EB4BC8E00EF5567 /* Build configuration list for PBXProject "01-HelloOpenGL" */ = { 321 | isa = XCConfigurationList; 322 | buildConfigurations = ( 323 | 180FA1641EB4BC8F00EF5567 /* Debug */, 324 | 180FA1651EB4BC8F00EF5567 /* Release */, 325 | ); 326 | defaultConfigurationIsVisible = 0; 327 | defaultConfigurationName = Release; 328 | }; 329 | 180FA1661EB4BC8F00EF5567 /* Build configuration list for PBXNativeTarget "01-HelloOpenGL" */ = { 330 | isa = XCConfigurationList; 331 | buildConfigurations = ( 332 | 180FA1671EB4BC8F00EF5567 /* Debug */, 333 | 180FA1681EB4BC8F00EF5567 /* Release */, 334 | ); 335 | defaultConfigurationIsVisible = 0; 336 | defaultConfigurationName = Release; 337 | }; 338 | /* End XCConfigurationList section */ 339 | }; 340 | rootObject = 180FA1471EB4BC8E00EF5567 /* Project object */; 341 | } 342 | -------------------------------------------------------------------------------- /03-展示帧数据/01-HelloOpenGL.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 180FA1541EB4BC8F00EF5567 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 180FA1531EB4BC8F00EF5567 /* main.m */; }; 11 | 180FA1571EB4BC8F00EF5567 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 180FA1561EB4BC8F00EF5567 /* AppDelegate.m */; }; 12 | 180FA15A1EB4BC8F00EF5567 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 180FA1591EB4BC8F00EF5567 /* ViewController.m */; }; 13 | 180FA15D1EB4BC8F00EF5567 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 180FA15B1EB4BC8F00EF5567 /* Main.storyboard */; }; 14 | 180FA15F1EB4BC8F00EF5567 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 180FA15E1EB4BC8F00EF5567 /* Assets.xcassets */; }; 15 | 180FA1621EB4BC8F00EF5567 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 180FA1601EB4BC8F00EF5567 /* LaunchScreen.storyboard */; }; 16 | 180FA16C1EB4BCAE00EF5567 /* HYOpenGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = 180FA16B1EB4BCAE00EF5567 /* HYOpenGLView.m */; }; 17 | 180FA16F1EB4CD7200EF5567 /* FragmentSource.glsl in Resources */ = {isa = PBXBuildFile; fileRef = 180FA16D1EB4CD7200EF5567 /* FragmentSource.glsl */; }; 18 | 180FA1701EB4CD7200EF5567 /* VertexSource.glsl in Resources */ = {isa = PBXBuildFile; fileRef = 180FA16E1EB4CD7200EF5567 /* VertexSource.glsl */; }; 19 | 180FA1721EB4D4BE00EF5567 /* tile_floor.png in Resources */ = {isa = PBXBuildFile; fileRef = 180FA1711EB4D4BE00EF5567 /* tile_floor.png */; }; 20 | 180FA1751EB4E87400EF5567 /* VideoCapture.m in Sources */ = {isa = PBXBuildFile; fileRef = 180FA1741EB4E87400EF5567 /* VideoCapture.m */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXFileReference section */ 24 | 180FA14F1EB4BC8F00EF5567 /* 01-HelloOpenGL.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "01-HelloOpenGL.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | 180FA1531EB4BC8F00EF5567 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 26 | 180FA1551EB4BC8F00EF5567 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 27 | 180FA1561EB4BC8F00EF5567 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 28 | 180FA1581EB4BC8F00EF5567 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 29 | 180FA1591EB4BC8F00EF5567 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 30 | 180FA15C1EB4BC8F00EF5567 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 31 | 180FA15E1EB4BC8F00EF5567 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 32 | 180FA1611EB4BC8F00EF5567 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 33 | 180FA1631EB4BC8F00EF5567 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 34 | 180FA16A1EB4BCAE00EF5567 /* HYOpenGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HYOpenGLView.h; sourceTree = ""; }; 35 | 180FA16B1EB4BCAE00EF5567 /* HYOpenGLView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HYOpenGLView.m; sourceTree = ""; }; 36 | 180FA16D1EB4CD7200EF5567 /* FragmentSource.glsl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FragmentSource.glsl; sourceTree = ""; }; 37 | 180FA16E1EB4CD7200EF5567 /* VertexSource.glsl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VertexSource.glsl; sourceTree = ""; }; 38 | 180FA1711EB4D4BE00EF5567 /* tile_floor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tile_floor.png; sourceTree = ""; }; 39 | 180FA1731EB4E87400EF5567 /* VideoCapture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoCapture.h; sourceTree = ""; }; 40 | 180FA1741EB4E87400EF5567 /* VideoCapture.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoCapture.m; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | 180FA14C1EB4BC8F00EF5567 /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | ); 49 | runOnlyForDeploymentPostprocessing = 0; 50 | }; 51 | /* End PBXFrameworksBuildPhase section */ 52 | 53 | /* Begin PBXGroup section */ 54 | 180FA1461EB4BC8E00EF5567 = { 55 | isa = PBXGroup; 56 | children = ( 57 | 180FA1511EB4BC8F00EF5567 /* 01-HelloOpenGL */, 58 | 180FA1501EB4BC8F00EF5567 /* Products */, 59 | ); 60 | sourceTree = ""; 61 | }; 62 | 180FA1501EB4BC8F00EF5567 /* Products */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | 180FA14F1EB4BC8F00EF5567 /* 01-HelloOpenGL.app */, 66 | ); 67 | name = Products; 68 | sourceTree = ""; 69 | }; 70 | 180FA1511EB4BC8F00EF5567 /* 01-HelloOpenGL */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | 180FA1691EB4BCA100EF5567 /* OpenGL */, 74 | 180FA1551EB4BC8F00EF5567 /* AppDelegate.h */, 75 | 180FA1561EB4BC8F00EF5567 /* AppDelegate.m */, 76 | 180FA1581EB4BC8F00EF5567 /* ViewController.h */, 77 | 180FA1591EB4BC8F00EF5567 /* ViewController.m */, 78 | 180FA15B1EB4BC8F00EF5567 /* Main.storyboard */, 79 | 180FA15E1EB4BC8F00EF5567 /* Assets.xcassets */, 80 | 180FA1601EB4BC8F00EF5567 /* LaunchScreen.storyboard */, 81 | 180FA1631EB4BC8F00EF5567 /* Info.plist */, 82 | 180FA1521EB4BC8F00EF5567 /* Supporting Files */, 83 | ); 84 | path = "01-HelloOpenGL"; 85 | sourceTree = ""; 86 | }; 87 | 180FA1521EB4BC8F00EF5567 /* Supporting Files */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 180FA1711EB4D4BE00EF5567 /* tile_floor.png */, 91 | 180FA1531EB4BC8F00EF5567 /* main.m */, 92 | ); 93 | name = "Supporting Files"; 94 | sourceTree = ""; 95 | }; 96 | 180FA1691EB4BCA100EF5567 /* OpenGL */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 180FA1731EB4E87400EF5567 /* VideoCapture.h */, 100 | 180FA1741EB4E87400EF5567 /* VideoCapture.m */, 101 | 180FA16A1EB4BCAE00EF5567 /* HYOpenGLView.h */, 102 | 180FA16B1EB4BCAE00EF5567 /* HYOpenGLView.m */, 103 | 180FA16E1EB4CD7200EF5567 /* VertexSource.glsl */, 104 | 180FA16D1EB4CD7200EF5567 /* FragmentSource.glsl */, 105 | ); 106 | path = OpenGL; 107 | sourceTree = ""; 108 | }; 109 | /* End PBXGroup section */ 110 | 111 | /* Begin PBXNativeTarget section */ 112 | 180FA14E1EB4BC8F00EF5567 /* 01-HelloOpenGL */ = { 113 | isa = PBXNativeTarget; 114 | buildConfigurationList = 180FA1661EB4BC8F00EF5567 /* Build configuration list for PBXNativeTarget "01-HelloOpenGL" */; 115 | buildPhases = ( 116 | 180FA14B1EB4BC8F00EF5567 /* Sources */, 117 | 180FA14C1EB4BC8F00EF5567 /* Frameworks */, 118 | 180FA14D1EB4BC8F00EF5567 /* Resources */, 119 | ); 120 | buildRules = ( 121 | ); 122 | dependencies = ( 123 | ); 124 | name = "01-HelloOpenGL"; 125 | productName = "01-HelloOpenGL"; 126 | productReference = 180FA14F1EB4BC8F00EF5567 /* 01-HelloOpenGL.app */; 127 | productType = "com.apple.product-type.application"; 128 | }; 129 | /* End PBXNativeTarget section */ 130 | 131 | /* Begin PBXProject section */ 132 | 180FA1471EB4BC8E00EF5567 /* Project object */ = { 133 | isa = PBXProject; 134 | attributes = { 135 | LastUpgradeCheck = 0820; 136 | ORGANIZATIONNAME = apple; 137 | TargetAttributes = { 138 | 180FA14E1EB4BC8F00EF5567 = { 139 | CreatedOnToolsVersion = 8.2.1; 140 | ProvisioningStyle = Automatic; 141 | }; 142 | }; 143 | }; 144 | buildConfigurationList = 180FA14A1EB4BC8E00EF5567 /* Build configuration list for PBXProject "01-HelloOpenGL" */; 145 | compatibilityVersion = "Xcode 3.2"; 146 | developmentRegion = English; 147 | hasScannedForEncodings = 0; 148 | knownRegions = ( 149 | en, 150 | Base, 151 | ); 152 | mainGroup = 180FA1461EB4BC8E00EF5567; 153 | productRefGroup = 180FA1501EB4BC8F00EF5567 /* Products */; 154 | projectDirPath = ""; 155 | projectRoot = ""; 156 | targets = ( 157 | 180FA14E1EB4BC8F00EF5567 /* 01-HelloOpenGL */, 158 | ); 159 | }; 160 | /* End PBXProject section */ 161 | 162 | /* Begin PBXResourcesBuildPhase section */ 163 | 180FA14D1EB4BC8F00EF5567 /* Resources */ = { 164 | isa = PBXResourcesBuildPhase; 165 | buildActionMask = 2147483647; 166 | files = ( 167 | 180FA16F1EB4CD7200EF5567 /* FragmentSource.glsl in Resources */, 168 | 180FA1621EB4BC8F00EF5567 /* LaunchScreen.storyboard in Resources */, 169 | 180FA15F1EB4BC8F00EF5567 /* Assets.xcassets in Resources */, 170 | 180FA1701EB4CD7200EF5567 /* VertexSource.glsl in Resources */, 171 | 180FA1721EB4D4BE00EF5567 /* tile_floor.png in Resources */, 172 | 180FA15D1EB4BC8F00EF5567 /* Main.storyboard in Resources */, 173 | ); 174 | runOnlyForDeploymentPostprocessing = 0; 175 | }; 176 | /* End PBXResourcesBuildPhase section */ 177 | 178 | /* Begin PBXSourcesBuildPhase section */ 179 | 180FA14B1EB4BC8F00EF5567 /* Sources */ = { 180 | isa = PBXSourcesBuildPhase; 181 | buildActionMask = 2147483647; 182 | files = ( 183 | 180FA1751EB4E87400EF5567 /* VideoCapture.m in Sources */, 184 | 180FA15A1EB4BC8F00EF5567 /* ViewController.m in Sources */, 185 | 180FA1571EB4BC8F00EF5567 /* AppDelegate.m in Sources */, 186 | 180FA16C1EB4BCAE00EF5567 /* HYOpenGLView.m in Sources */, 187 | 180FA1541EB4BC8F00EF5567 /* main.m in Sources */, 188 | ); 189 | runOnlyForDeploymentPostprocessing = 0; 190 | }; 191 | /* End PBXSourcesBuildPhase section */ 192 | 193 | /* Begin PBXVariantGroup section */ 194 | 180FA15B1EB4BC8F00EF5567 /* Main.storyboard */ = { 195 | isa = PBXVariantGroup; 196 | children = ( 197 | 180FA15C1EB4BC8F00EF5567 /* Base */, 198 | ); 199 | name = Main.storyboard; 200 | sourceTree = ""; 201 | }; 202 | 180FA1601EB4BC8F00EF5567 /* LaunchScreen.storyboard */ = { 203 | isa = PBXVariantGroup; 204 | children = ( 205 | 180FA1611EB4BC8F00EF5567 /* Base */, 206 | ); 207 | name = LaunchScreen.storyboard; 208 | sourceTree = ""; 209 | }; 210 | /* End PBXVariantGroup section */ 211 | 212 | /* Begin XCBuildConfiguration section */ 213 | 180FA1641EB4BC8F00EF5567 /* Debug */ = { 214 | isa = XCBuildConfiguration; 215 | buildSettings = { 216 | ALWAYS_SEARCH_USER_PATHS = NO; 217 | CLANG_ANALYZER_NONNULL = YES; 218 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 219 | CLANG_CXX_LIBRARY = "libc++"; 220 | CLANG_ENABLE_MODULES = YES; 221 | CLANG_ENABLE_OBJC_ARC = YES; 222 | CLANG_WARN_BOOL_CONVERSION = YES; 223 | CLANG_WARN_CONSTANT_CONVERSION = YES; 224 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 225 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 226 | CLANG_WARN_EMPTY_BODY = YES; 227 | CLANG_WARN_ENUM_CONVERSION = YES; 228 | CLANG_WARN_INFINITE_RECURSION = YES; 229 | CLANG_WARN_INT_CONVERSION = YES; 230 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 231 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 232 | CLANG_WARN_UNREACHABLE_CODE = YES; 233 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 234 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 235 | COPY_PHASE_STRIP = NO; 236 | DEBUG_INFORMATION_FORMAT = dwarf; 237 | ENABLE_STRICT_OBJC_MSGSEND = YES; 238 | ENABLE_TESTABILITY = YES; 239 | GCC_C_LANGUAGE_STANDARD = gnu99; 240 | GCC_DYNAMIC_NO_PIC = NO; 241 | GCC_NO_COMMON_BLOCKS = YES; 242 | GCC_OPTIMIZATION_LEVEL = 0; 243 | GCC_PREPROCESSOR_DEFINITIONS = ( 244 | "DEBUG=1", 245 | "$(inherited)", 246 | ); 247 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 248 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 249 | GCC_WARN_UNDECLARED_SELECTOR = YES; 250 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 251 | GCC_WARN_UNUSED_FUNCTION = YES; 252 | GCC_WARN_UNUSED_VARIABLE = YES; 253 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 254 | MTL_ENABLE_DEBUG_INFO = YES; 255 | ONLY_ACTIVE_ARCH = YES; 256 | SDKROOT = iphoneos; 257 | }; 258 | name = Debug; 259 | }; 260 | 180FA1651EB4BC8F00EF5567 /* Release */ = { 261 | isa = XCBuildConfiguration; 262 | buildSettings = { 263 | ALWAYS_SEARCH_USER_PATHS = NO; 264 | CLANG_ANALYZER_NONNULL = YES; 265 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 266 | CLANG_CXX_LIBRARY = "libc++"; 267 | CLANG_ENABLE_MODULES = YES; 268 | CLANG_ENABLE_OBJC_ARC = YES; 269 | CLANG_WARN_BOOL_CONVERSION = YES; 270 | CLANG_WARN_CONSTANT_CONVERSION = YES; 271 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 272 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 273 | CLANG_WARN_EMPTY_BODY = YES; 274 | CLANG_WARN_ENUM_CONVERSION = YES; 275 | CLANG_WARN_INFINITE_RECURSION = YES; 276 | CLANG_WARN_INT_CONVERSION = YES; 277 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 278 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 279 | CLANG_WARN_UNREACHABLE_CODE = YES; 280 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 281 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 282 | COPY_PHASE_STRIP = NO; 283 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 284 | ENABLE_NS_ASSERTIONS = NO; 285 | ENABLE_STRICT_OBJC_MSGSEND = YES; 286 | GCC_C_LANGUAGE_STANDARD = gnu99; 287 | GCC_NO_COMMON_BLOCKS = YES; 288 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 289 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 290 | GCC_WARN_UNDECLARED_SELECTOR = YES; 291 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 292 | GCC_WARN_UNUSED_FUNCTION = YES; 293 | GCC_WARN_UNUSED_VARIABLE = YES; 294 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 295 | MTL_ENABLE_DEBUG_INFO = NO; 296 | SDKROOT = iphoneos; 297 | VALIDATE_PRODUCT = YES; 298 | }; 299 | name = Release; 300 | }; 301 | 180FA1671EB4BC8F00EF5567 /* Debug */ = { 302 | isa = XCBuildConfiguration; 303 | buildSettings = { 304 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 305 | INFOPLIST_FILE = "01-HelloOpenGL/Info.plist"; 306 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 307 | PRODUCT_BUNDLE_IDENTIFIER = "com.coderwhy.-1-HelloOpenGL"; 308 | PRODUCT_NAME = "$(TARGET_NAME)"; 309 | }; 310 | name = Debug; 311 | }; 312 | 180FA1681EB4BC8F00EF5567 /* Release */ = { 313 | isa = XCBuildConfiguration; 314 | buildSettings = { 315 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 316 | INFOPLIST_FILE = "01-HelloOpenGL/Info.plist"; 317 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 318 | PRODUCT_BUNDLE_IDENTIFIER = "com.coderwhy.-1-HelloOpenGL"; 319 | PRODUCT_NAME = "$(TARGET_NAME)"; 320 | }; 321 | name = Release; 322 | }; 323 | /* End XCBuildConfiguration section */ 324 | 325 | /* Begin XCConfigurationList section */ 326 | 180FA14A1EB4BC8E00EF5567 /* Build configuration list for PBXProject "01-HelloOpenGL" */ = { 327 | isa = XCConfigurationList; 328 | buildConfigurations = ( 329 | 180FA1641EB4BC8F00EF5567 /* Debug */, 330 | 180FA1651EB4BC8F00EF5567 /* Release */, 331 | ); 332 | defaultConfigurationIsVisible = 0; 333 | defaultConfigurationName = Release; 334 | }; 335 | 180FA1661EB4BC8F00EF5567 /* Build configuration list for PBXNativeTarget "01-HelloOpenGL" */ = { 336 | isa = XCConfigurationList; 337 | buildConfigurations = ( 338 | 180FA1671EB4BC8F00EF5567 /* Debug */, 339 | 180FA1681EB4BC8F00EF5567 /* Release */, 340 | ); 341 | defaultConfigurationIsVisible = 0; 342 | defaultConfigurationName = Release; 343 | }; 344 | /* End XCConfigurationList section */ 345 | }; 346 | rootObject = 180FA1471EB4BC8E00EF5567 /* Project object */; 347 | } 348 | --------------------------------------------------------------------------------