Render triangles as wireframes, instead of rendering lines

This commit is contained in:
Eryn Wells 2018-10-11 16:54:57 -07:00
parent cb8afac46f
commit 6dc175c39d

View file

@ -191,7 +191,8 @@ public class Renderer: NSObject, MTKViewDelegate {
encoder.label = "Marching Squares Render"
encoder.setRenderPipelineState(pipeline)
encoder.setVertexBytes(points, length: points.count * MemoryLayout<Vertex>.stride, index: 0)
encoder.drawPrimitives(type: .line, vertexStart: 0, vertexCount: 6)
encoder.setTriangleFillMode(.lines)
encoder.drawPrimitives(type: .triangle, vertexStart: 0, vertexCount: 6)
encoder.endEncoding()
didEncode = true
}