Introduce chkgfx #3
@@ -42,13 +42,6 @@ final class RenderGLView: NSOpenGLView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func loadModel() {
|
private func loadModel() {
|
||||||
for path in modelCandidates() where FileManager.default.fileExists(atPath: path) {
|
|
||||||
sr_load_model(path)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private func modelCandidates() -> [String] {
|
|
||||||
var paths: [String] = []
|
var paths: [String] = []
|
||||||
|
|
||||||
if let resources = Bundle.main.resourceURL {
|
if let resources = Bundle.main.resourceURL {
|
||||||
@@ -63,7 +56,10 @@ final class RenderGLView: NSOpenGLView {
|
|||||||
paths.append(dir.appendingPathComponent("assets/cube.gltf").path)
|
paths.append(dir.appendingPathComponent("assets/cube.gltf").path)
|
||||||
}
|
}
|
||||||
|
|
||||||
return paths
|
for path in paths where FileManager.default.fileExists(atPath: path) {
|
||||||
|
sr_load_model(path)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override func reshape() {
|
override func reshape() {
|
||||||
|
|||||||
Reference in new issue
Block a user