From 7798c1a61c792f1b73841e6aedd77a9c8ce33e80 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Wed, 7 Jul 2021 08:50:52 -0500 Subject: [PATCH] getting rid of the old testing canvas --- build.sh | 4 ++-- src/main.onyx | 37 ++----------------------------------- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/build.sh b/build.sh index 132e368..dd1f364 100755 --- a/build.sh +++ b/build.sh @@ -9,12 +9,12 @@ cp "$ONYX_MODULE_DIRECTORY/modules/webgl2/webgl2.js" ./site/js/webgl2.js cp "$ONYX_MODULE_DIRECTORY/modules/js_events/js_events.js" ./site/js/js_events.js FLAGS= -[ ! -z "$DEBUG" ] && FLAGS=--print-function-mappings +[ ! -z "$DEBUG" ] && FLAGS="--print-function-mappings -VVV" RUNTIME=js [ ! -z "$CONSOLE" ] && RUNTIME=wasi -onyx --no-colors $FLAGS -r $RUNTIME \ +onyx --no-colors $FLAGS -r $RUNTIME -V \ --use-post-mvp-features \ -I $ONYX_MODULE_DIRECTORY \ --doc doc/source_reference \ diff --git a/src/main.onyx b/src/main.onyx index 1ce5393..3bb5e62 100644 --- a/src/main.onyx +++ b/src/main.onyx @@ -14,8 +14,6 @@ main :: (args: [] cstr) { start_loop(); } -test_canvas : gfx.Canvas; - init :: () { gl.init("main_canvas"); events.init(); @@ -27,33 +25,6 @@ init :: () { gl.enable(gl.BLEND); gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - test_canvas = gfx.create_canvas(1000, 1000); - { - time_now :: () -> i32 #foreign "decompiler" "time_now" --- - random.set_seed(time_now() / 1000); - - gfx.use_canvas(^test_canvas); - defer gfx.use_canvas(null); - - gl.clearColor(0, 0, 0, 0.6); - gl.clear(gl.COLOR_BUFFER_BIT); - - gfx.set_mode(.Lines); - gfx.set_texture(); - gl.lineWidth(10); - - pv := gfx.Vector2.{ 0, 0 }; - for i: 11 { - pv = .{ ~~random.between(0, 1000), ~~random.between(0, 1000) }; - gfx.vertex(pv, config.Colors.primary); - - pv = .{ ~~random.between(0, 1000), ~~random.between(0, 1000) }; - gfx.vertex(pv, config.Colors.primary); - } - - gfx.set_mode(.Triangles); - } - load_colors :: () { json :: package json @@ -97,7 +68,7 @@ init :: () { last_time := 0; #export "loop" () { - time_now :: () -> i32 #foreign "decompiler" "time_now" --- + time_now :: () -> i32 #foreign "decompiler" "time_now" --- ; if last_time == 0 do last_time = time_now(); @@ -185,10 +156,6 @@ draw :: () { draw_background_lines(~~window_width, ~~window_height, 0, 0, line_color=config.Colors.dark_background); draw_menu_bar(window_rectangle); - gfx.set_texture(^test_canvas.color_texture); - gfx.textured_rect(.{ 300, 100 }, .{ 800, 400 }, .{ 0, 0 }, .{ 1, 1 }); - gfx.set_texture(); - gfx.flush(); ui.clear_buttons(); } @@ -197,7 +164,7 @@ draw :: () { draw_menu_bar :: (window_rectangle: ui.Rectangle) { menu_bar, _ := ui.Flow.split_horizontal(window_rectangle, top_height=32); - ui.draw_rect(menu_bar, color=.{ 0.2, 0.2, 0.2 }); + ui.draw_rect(menu_bar, color=config.Colors.background); menu_button_theme := ui.default_button_theme; menu_button_theme.border_width = 2; -- 2.25.1