diff --git a/ch01/chapter01.xcodeproj/project.pbxproj b/ch01/chapter01.xcodeproj/project.pbxproj index 6cbc653..2d19679 100644 --- a/ch01/chapter01.xcodeproj/project.pbxproj +++ b/ch01/chapter01.xcodeproj/project.pbxproj @@ -51,11 +51,19 @@ isa = PBXGroup; children = ( 29400C7E1C3AEE1300345568 /* ViewController.swift */, + 297F43031DE8C78100638FC8 /* Supporting files */, + ); + path = chapter01; + sourceTree = ""; + }; + 297F43031DE8C78100638FC8 /* Supporting files */ = { + isa = PBXGroup; + children = ( 29400C821C3AEE1300345568 /* Main.storyboard */, 29400C851C3AEE1300345568 /* Info.plist */, 29400C7C1C3AEE1300345568 /* AppDelegate.swift */, ); - path = chapter01; + name = "Supporting files"; sourceTree = ""; }; /* End PBXGroup section */ @@ -85,7 +93,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0810; ORGANIZATIONNAME = "Marius Horga"; TargetAttributes = { 29400C781C3AEE1300345568 = { @@ -160,8 +168,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; @@ -204,8 +214,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; diff --git a/ch01/chapter01.xcodeproj/project.xcworkspace/xcuserdata/marius.xcuserdatad/UserInterfaceState.xcuserstate b/ch01/chapter01.xcodeproj/project.xcworkspace/xcuserdata/marius.xcuserdatad/UserInterfaceState.xcuserstate index ba92cab..457e0b6 100644 Binary files a/ch01/chapter01.xcodeproj/project.xcworkspace/xcuserdata/marius.xcuserdatad/UserInterfaceState.xcuserstate and b/ch01/chapter01.xcodeproj/project.xcworkspace/xcuserdata/marius.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ch01/chapter01.xcodeproj/xcuserdata/marius.xcuserdatad/xcschemes/chapter01.xcscheme b/ch01/chapter01.xcodeproj/xcuserdata/marius.xcuserdatad/xcschemes/chapter01.xcscheme index 2adec09..eca02c6 100644 --- a/ch01/chapter01.xcodeproj/xcuserdata/marius.xcuserdatad/xcschemes/chapter01.xcscheme +++ b/ch01/chapter01.xcodeproj/xcuserdata/marius.xcuserdatad/xcschemes/chapter01.xcscheme @@ -1,6 +1,6 @@ .size + vertexBuffer = device!.makeBuffer(bytes: vertexData!, length: dataSize, options: []) let library = device!.newDefaultLibrary()! - let vertex_func = library.newFunction(withName: "vertex_func") - let frag_func = library.newFunction(withName: "fragment_func") + let vertex_func = library.makeFunction(name: "vertex_func") + let frag_func = library.makeFunction(name: "fragment_func") let rpld = MTLRenderPipelineDescriptor() rpld.vertexFunction = vertex_func rpld.fragmentFunction = frag_func rpld.colorAttachments[0].pixelFormat = .bgra8Unorm do { - try rps = device!.newRenderPipelineState(with: rpld) + try rps = device!.makeRenderPipelineState(descriptor: rpld) } catch let error { self.print("\(error)") } @@ -45,11 +45,11 @@ class MetalView: MTKView { override func draw(_ dirtyRect: NSRect) { if let drawable = currentDrawable, let rpd = currentRenderPassDescriptor { rpd.colorAttachments[0].clearColor = MTLClearColorMake(0, 0.5, 0.5, 1.0) - let commandBuffer = commandQueue!.commandBuffer() - let commandEncoder = commandBuffer.renderCommandEncoder(with: rpd) + let commandBuffer = commandQueue!.makeCommandBuffer() + let commandEncoder = commandBuffer.makeRenderCommandEncoder(descriptor: rpd) commandEncoder.setRenderPipelineState(rps!) commandEncoder.setVertexBuffer(vertexBuffer, offset: 0, at: 0) - commandEncoder.drawPrimitives(.triangle, vertexStart: 0, vertexCount: 3, instanceCount: 1) + commandEncoder.drawPrimitives(type: .triangle, vertexStart: 0, vertexCount: 3, instanceCount: 1) commandEncoder.endEncoding() commandBuffer.present(drawable) commandBuffer.commit() diff --git a/ch04/chapter04.xcodeproj/project.pbxproj b/ch04/chapter04.xcodeproj/project.pbxproj index 428e017..758c724 100644 --- a/ch04/chapter04.xcodeproj/project.pbxproj +++ b/ch04/chapter04.xcodeproj/project.pbxproj @@ -96,7 +96,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0810; ORGANIZATIONNAME = "Marius Horga"; TargetAttributes = { 29C87D3C1C56E93A005F4615 = { @@ -172,8 +172,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; @@ -216,8 +218,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; diff --git a/ch04/chapter04.xcodeproj/project.xcworkspace/xcuserdata/marius.xcuserdatad/UserInterfaceState.xcuserstate b/ch04/chapter04.xcodeproj/project.xcworkspace/xcuserdata/marius.xcuserdatad/UserInterfaceState.xcuserstate index 43b3357..591b497 100644 Binary files a/ch04/chapter04.xcodeproj/project.xcworkspace/xcuserdata/marius.xcuserdatad/UserInterfaceState.xcuserstate and b/ch04/chapter04.xcodeproj/project.xcworkspace/xcuserdata/marius.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ch04/chapter04.xcodeproj/xcuserdata/marius.xcuserdatad/xcschemes/chapter04.xcscheme b/ch04/chapter04.xcodeproj/xcuserdata/marius.xcuserdatad/xcschemes/chapter04.xcscheme index 56204a9..dbdb0d2 100644 --- a/ch04/chapter04.xcodeproj/xcuserdata/marius.xcuserdatad/xcschemes/chapter04.xcscheme +++ b/ch04/chapter04.xcodeproj/xcuserdata/marius.xcuserdatad/xcschemes/chapter04.xcscheme @@ -1,6 +1,6 @@