 import OpenGLES
 import GLKit
 
-// FIXME: very drawcall-heavy. Can be done in one drawcall with fatter vertices.
-
 func BUFFER_OFFSET(_ i: UInt32) -> UnsafeRawPointer? {
 	return UnsafeRawPointer(bitPattern: Int(i))
 }

	}
	
	func placesRenderPlane() -> RenderPrimitive {
		let vertices = places.reduce([]) { (accumulator: [Vertex], place: GeoPlace) in
			let size = 0.4 / 2.0
			let v0 = Vertex(0.0, size)
			let v1 = Vertex(size, 0.0)
			let v2 = Vertex(0.0, -size)
			let v3 = Vertex(-size, 0.0)
			let verts = [v0, v1, v2, v3].map { $0 + place.location }
			return accumulator + verts
		}
		
		let triangleRange = 0..<UInt32(places.count * 2)
		let indices = triangleRange.reduce([]) { (accumulator: [UInt32], triIndex: UInt32) in
			let quadIndices: [UInt32] = [0, 2, 1, 0, 3, 2]	// Build two triangles from the four quad vertices
			let vertexOffset = triIndex * 4
			let offsetIndices = quadIndices.map { $0 + vertexOffset }
			return accumulator + offsetIndices
		}
		
		return RenderPrimitive(vertices: vertices,
													 indices: indices,
													 color: (r: 0.8, g: 0.3, b: 0.0, a: 1.0),
													 debugName: name)
	}
}


	}
	
	func placesRenderPlane() -> RenderPrimitive {
		let (vertices, indices) = buildPlaceMarkers(places: places, markerSize: 1.0)
		return RenderPrimitive(vertices: vertices,
													 indices: indices,
													 color: (r: 1.0, g: 0.5, b: 0.5, a: 1.0),
													 debugName: "Continent: \(name) - poi plane")
	}
}

