Skip to content

Commit aa4d781

Browse files
authored
Add webgl2 IDL spec and generated code (#18)
I've added WebGL 2 example code to `DOMKitDemo` ported from https://webgl2fundamentals.org/webgl/lessons/webgl-fundamentals.html, which is under MIT/BSD3-like license (added inline to the file), looks like this in action after you press the button. Just a pink triangle, but it finally works!
1 parent ce7f227 commit aa4d781

File tree

6 files changed

+2007
-141
lines changed

6 files changed

+2007
-141
lines changed

Package.swift

+16-8
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,43 @@ let package = Package(
88
products: [
99
.executable(
1010
name: "DOMKitDemo",
11-
targets: ["DOMKitDemo"]),
11+
targets: ["DOMKitDemo"]
12+
),
1213
.library(
1314
name: "DOMKit",
14-
targets: ["DOMKit"]),
15+
targets: ["DOMKit"]
16+
),
1517
.library(name: "WebIDL", targets: ["WebIDL"]),
1618
.executable(name: "WebIDLToSwift", targets: ["WebIDLToSwift"]),
1719
],
1820
dependencies: [
1921
.package(
2022
url: "https://github.com/swiftwasm/JavaScriptKit.git",
21-
.branch("main")),
23+
.revision("95d0c4cd78b48ffc7e19c618d57c3244917be09a")
24+
),
2225
],
2326
targets: [
2427
.target(
2528
name: "DOMKitDemo",
26-
dependencies: ["DOMKit"]),
29+
dependencies: ["DOMKit"]
30+
),
2731
.target(
2832
name: "DOMKit",
29-
dependencies: ["ECMAScript", "JavaScriptKit", .product(name: "JavaScriptEventLoop", package: "JavaScriptKit")]),
33+
dependencies: ["ECMAScript", "JavaScriptKit", .product(name: "JavaScriptEventLoop", package: "JavaScriptKit")]
34+
),
3035
// This support library should be moved to JavaScriptKit
3136
.target(name: "ECMAScript", dependencies: [
3237
"JavaScriptKit",
33-
.product(name: "JavaScriptEventLoop", package: "JavaScriptKit")]),
38+
.product(name: "JavaScriptEventLoop", package: "JavaScriptKit"),
39+
]),
3440
.target(name: "WebIDL"),
3541
.target(
3642
name: "WebIDLToSwift",
37-
dependencies: ["WebIDL"]),
43+
dependencies: ["WebIDL"]
44+
),
3845
.testTarget(
3946
name: "DOMKitTests",
40-
dependencies: ["DOMKit"]),
47+
dependencies: ["DOMKit"]
48+
),
4149
]
4250
)

0 commit comments

Comments
 (0)