From: Brendan Hansen Date: Sun, 6 Jun 2021 18:16:57 +0000 (-0500) Subject: minor changes with debug mode X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=0c94098adcfb1e10e92ba2bbb971f1b0cfa47482;p=tower.git minor changes with debug mode --- diff --git a/src/build.onyx b/src/build.onyx index 9a96cbd..950a7b8 100644 --- a/src/build.onyx +++ b/src/build.onyx @@ -9,7 +9,6 @@ #load "modules/immediate_mode/module" #load "modules/ui/module" -// #load "src/ui/ui" #load "src/config" #load "src/font/bitmap_font" #load "src/tower" diff --git a/src/config.onyx b/src/config.onyx index 50e515c..7dab26d 100644 --- a/src/config.onyx +++ b/src/config.onyx @@ -1,2 +1,2 @@ -DEBUG :: false +DEBUG :: true diff --git a/src/tower.onyx b/src/tower.onyx index f52a927..76a4f1e 100644 --- a/src/tower.onyx +++ b/src/tower.onyx @@ -56,7 +56,7 @@ poll_events :: () { } } - #if DEBUG { updates_this_frame += 1; } + #if DEBUG { events_this_frame += 1; } } } @@ -93,16 +93,16 @@ draw :: () { } #if DEBUG { - Debug_Info_Font_Size :: 32; - - fps_buffer : [24] u8; - fps_str := conv.str_format("%i %i", ~~ fps_buffer, fps, updates_this_frame); + Debug_Info_Font_Size :: 16; gfx.set_texture(); gfx.rect(.{ 0, 0 }, .{ 160, 36 }, .{0,0,0,.8}); - ui.draw_text(fps_str, 0, 0, ~~Debug_Info_Font_Size, .{0,1,0}); - updates_this_frame = 0; + str_buffer : [32] u8; + conv.str_format("FPS: %i", ~~ str_buffer, fps) |> ui.draw_text(0, 0, ~~Debug_Info_Font_Size, .{0,1,0}); + conv.str_format("Events: %i", ~~ str_buffer, events_this_frame) |> ui.draw_text(0, 20, ~~Debug_Info_Font_Size, .{0,1,0}); + + events_this_frame = 0; } gfx.flush(); @@ -118,6 +118,6 @@ draw :: () { fps_timer := 1.0f frames := 0 - updates_this_frame := 0 + events_this_frame := 0 }