Skip to content

Commit

Permalink
Merge pull request #2 from quephird/add_new_app_protocol
Browse files Browse the repository at this point in the history
First try at adding new protocol for creating an app.
  • Loading branch information
quephird committed Sep 25, 2022
2 parents 2a5381b + 9a6a832 commit cc633ec
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Sources/ScintillaLib/ScintillaApp.swift
@@ -0,0 +1,23 @@
//
// File.swift
//
//
// Created by Danielle Kefford on 9/24/22.
//

import Foundation

public protocol ScintillaApp {
var filename: String { get set }
@WorldBuilder var body: (Light, Camera, [Shape]) { get }

init()
}

extension ScintillaApp {
public static func main() {
let instance = Self()
let canvas = World { return instance.body }.render()
canvas.save(to: instance.filename)
}
}

0 comments on commit cc633ec

Please sign in to comment.