diff --git a/ch08/chapter08.playground/playground.xcworkspace/xcuserdata/marius.xcuserdatad/UserInterfaceState.xcuserstate b/ch08/chapter08.playground/playground.xcworkspace/xcuserdata/marius.xcuserdatad/UserInterfaceState.xcuserstate index ee9d100..2b92eb4 100644 Binary files a/ch08/chapter08.playground/playground.xcworkspace/xcuserdata/marius.xcuserdatad/UserInterfaceState.xcuserstate and b/ch08/chapter08.playground/playground.xcworkspace/xcuserdata/marius.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ch09/chapter09.playground/Resources/Shaders.metal b/ch09/chapter09.playground/Resources/Shaders.metal index e98195c..f2464b2 100755 --- a/ch09/chapter09.playground/Resources/Shaders.metal +++ b/ch09/chapter09.playground/Resources/Shaders.metal @@ -22,5 +22,4 @@ vertex Vertex vertex_func(constant Vertex *vertices [[buffer(0)]], constant Unif fragment half4 fragment_func(Vertex vert [[stage_in]]) { return half4(vert.color); -// return half4(0.0, 1.0, 0.0, 1.0); } diff --git a/ch09/chapter09.playground/Sources/MetalView.swift b/ch09/chapter09.playground/Sources/MetalView.swift index 921a3e6..795b1ae 100755 --- a/ch09/chapter09.playground/Sources/MetalView.swift +++ b/ch09/chapter09.playground/Sources/MetalView.swift @@ -71,8 +71,6 @@ public class MetalView: NSObject, MTKViewDelegate { let modelMatrix = matrix_multiply(matrix_multiply(rotatedX, rotatedY), scaled) let cameraPosition = vector_float3(0, 0, -3) let viewMatrix = translationMatrix(position: cameraPosition) -// let aspect = Float(view.drawableSize.width / view.drawableSize.height) -// let projMatrix = projectionMatrix(0, far: 10, aspect: aspect, fovy: 1) let projMatrix = projectionMatrix(near: 0, far: 10, aspect: 1, fovy: 1) let modelViewProjectionMatrix = matrix_multiply(projMatrix, matrix_multiply(viewMatrix, modelMatrix)) let bufferPointer = uniformBuffer.contents() @@ -93,7 +91,6 @@ public class MetalView: NSObject, MTKViewDelegate { commandEncoder.setCullMode(.back) commandEncoder.setVertexBuffer(vertexBuffer, offset: 0, at: 0) commandEncoder.setVertexBuffer(uniformBuffer, offset: 0, at: 1) -// commandEncoder.setTriangleFillMode(.lines) commandEncoder.drawIndexedPrimitives(type: .triangle, indexCount: indexBuffer.length / MemoryLayout.size, indexType: MTLIndexType.uint16, indexBuffer: indexBuffer, indexBufferOffset: 0) commandEncoder.endEncoding() commandBuffer.present(drawable) diff --git a/ch09/chapter09.playground/contents.xcplayground b/ch09/chapter09.playground/contents.xcplayground index 06828af..9f9eecc 100644 --- a/ch09/chapter09.playground/contents.xcplayground +++ b/ch09/chapter09.playground/contents.xcplayground @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/ch09/chapter09.playground/playground.xcworkspace/xcuserdata/marius.xcuserdatad/UserInterfaceState.xcuserstate b/ch09/chapter09.playground/playground.xcworkspace/xcuserdata/marius.xcuserdatad/UserInterfaceState.xcuserstate index 2061fba..9c3f516 100755 Binary files a/ch09/chapter09.playground/playground.xcworkspace/xcuserdata/marius.xcuserdatad/UserInterfaceState.xcuserstate and b/ch09/chapter09.playground/playground.xcworkspace/xcuserdata/marius.xcuserdatad/UserInterfaceState.xcuserstate differ