switch 'quad' to 'rect'. windows build.bat
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Sun, 9 May 2021 17:17:58 +0000 (12:17 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Sun, 9 May 2021 17:17:58 +0000 (12:17 -0500)
build.bat [new file with mode: 0644]
site/sand_toy.wasm
src/sand_toy.onyx

diff --git a/build.bat b/build.bat
new file mode 100644 (file)
index 0000000..ce6c778
--- /dev/null
+++ b/build.bat
@@ -0,0 +1,10 @@
+@echo off
+
+set TARGET=site\sand_toy.wasm
+set ONYX_INSTALLATION_FOLDER=\dev\onyx
+
+copy "%ONYX_INSTALLATION_FOLDER%\bin\onyx-loader.js" .\site\js\onyx-loader.js  >NUL
+copy "%ONYX_INSTALLATION_FOLDER%\modules\webgl2\webgl2.js" .\site\js\webgl2.js >NUL
+copy "%ONYX_INSTALLATION_FOLDER%\modules\js_events\js_events.js" .\site\js\js_events.js >NUL
+
+\dev\onyx\onyx -r js --use-post-mvp-features -V -o %TARGET% src\build.onyx -I %ONYX_INSTALLATION_FOLDER%
index 802890f470ee5701c6974cbf94f3321399b1b306..7f687fa774da28392268b1ce6af3df59e022786c 100644 (file)
Binary files a/site/sand_toy.wasm and b/site/sand_toy.wasm differ
index 7fdd8c8119b8543b1187751a227b9ae00596ecfc..aebc1c42ebdeee6432711cfe36d743e91a33d064 100644 (file)
@@ -161,7 +161,7 @@ draw :: () {
 
     gfx.set_texture(0);
     gfx.use_ortho_projection(0, ~~window_width, 0, ~~window_height);
-    gfx.textured_quad(.{ 0, BAR_HEIGHT }, .{ ~~window_width, ~~window_height - BAR_HEIGHT }, .{ 0, 0 }, .{ 1, 1 });
+    gfx.textured_rect(.{ 0, BAR_HEIGHT }, .{ ~~window_width, ~~window_height - BAR_HEIGHT }, .{ 0, 0 }, .{ 1, 1 });
 
     gfx.flush();
 
@@ -169,16 +169,16 @@ draw :: () {
 
 
     draw_selection_bar :: () {
-        gfx.quad(.{ 0, 0 }, .{ ~~window_width, BAR_HEIGHT }, color=.{.2,.2,.2});
+        gfx.rect(.{ 0, 0 }, .{ ~~window_width, BAR_HEIGHT }, color=.{.2,.2,.2});
 
         x_off := 4.0f;
         for type: Particle.types {
             if type == selected_particle {
-                gfx.quad(.{ x_off - 4, 0 }, .{ BAR_HEIGHT, BAR_HEIGHT }, color=.{1,1,0});
+                gfx.rect(.{ x_off - 4, 0 }, .{ BAR_HEIGHT, BAR_HEIGHT }, color=.{1,1,0});
             }
 
             color := particle_type_to_color(type) |> convert_color();
-            gfx.quad(.{ x_off, 4 }, .{ BAR_HEIGHT - 8,  BAR_HEIGHT - 8 }, color=color);
+            gfx.rect(.{ x_off, 4 }, .{ BAR_HEIGHT - 8,  BAR_HEIGHT - 8 }, color=color);
 
             x_off += BAR_HEIGHT;
         }