From d4f820e37bbb6571af4587adb2a3b3519d76849a Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Sat, 5 Oct 2024 08:28:22 +0200 Subject: Draw triangles and lines --- examples/gravity.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'examples/gravity.c') diff --git a/examples/gravity.c b/examples/gravity.c index 8bc45e0..246aab1 100755 --- a/examples/gravity.c +++ b/examples/gravity.c @@ -40,13 +40,6 @@ typedef struct { Entity entities[10 * 1024 * 1024]; } World; -i64 time_milliseconds() { - struct timespec t; - timespec_get(&t, TIME_UTC); - - return (i64) t.tv_sec * 1000ll + (i64) t.tv_nsec / 1000000ll; -} - i32 main(i32 argc, c8 **argv) { (void) argc; (void) argv; @@ -64,12 +57,12 @@ i32 main(i32 argc, c8 **argv) { srand(time(0)); static World world = {0}; - i64 time_0 = time_milliseconds(); + i64 time_0 = p_time(); while (!platform.done) { p_handle_events(); - i64 time_elapsed = time_milliseconds() - time_0; + i64 time_elapsed = p_time() - time_0; time_0 += time_elapsed; if (platform.key_pressed[BUTTON_LEFT]) { -- cgit v1.2.3