changes with unary field access in Onyx
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 22 Apr 2021 17:43:20 +0000 (12:43 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 22 Apr 2021 17:43:20 +0000 (12:43 -0500)
lib/immediate_renderer.onyx
site/sand_toy.wasm
src/sand_toy.onyx
src/simulation.onyx [new file with mode: 0644]

index 470a16cfd989393ed97772589e571df87b373ce4..5a7c31568274f39b17101d18ad84a5fabb6a41f3 100644 (file)
@@ -100,6 +100,7 @@ Immediate_Renderer :: struct {
         gl.useProgram(shader.program);
         gl.bindVertexArray(vertex_array);
         gl.drawArrays(gl.TRIANGLES, 0, vertex_count);
+        gl.bindVertexArray(-1);
 
         vertex_count = 0;
     }
index ad6c39bad00b1cfb75777e5912e18f5a93c6d4c0..4ed4bab993d6c320cefda0deef62fe3e79bb30f6 100644 (file)
Binary files a/site/sand_toy.wasm and b/site/sand_toy.wasm differ
index aa75920dde1f480be4f31a3ab9ff8801fc2fafeb..6d78cfbbc0cd5b7e6ebdf57a68a37702de5288a9 100644 (file)
@@ -32,10 +32,8 @@ window_width  := 0
 window_height := 0
 
 poll_events :: () {
-    use events.DomEventKind;
-
     for event: events.consume() do switch event.kind {
-        case Resize {
+        case .Resize {
             println("The window was resized!");
 
             window_width  = event.resize.width;
@@ -45,8 +43,8 @@ poll_events :: () {
             gl.viewport(0, 0, window_width, window_height);
         }
 
-        case MouseDown {
-            if event.mouse.button == ~~0 {
+        case .MouseDown {
+            if event.mouse.button == .Left {
                 println("Left button click!");
             }
         }
diff --git a/src/simulation.onyx b/src/simulation.onyx
new file mode 100644 (file)
index 0000000..fab4f69
--- /dev/null
@@ -0,0 +1,10 @@
+
+
+Particle :: struct {
+    Type :: enum {
+        Empty;
+        Sand;
+    }
+
+    type := Type.Empty;
+}