From a875e0155ec7757c7b487bee0b4a8fbfa8574888 Mon Sep 17 00:00:00 2001 From: iamcheeseman Date: Wed, 27 May 2026 16:34:31 -0400 Subject: build for w*ndows --- teensy/teensy_context.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'teensy/teensy_context.c') diff --git a/teensy/teensy_context.c b/teensy/teensy_context.c index ad7c79e..2eb1df3 100644 --- a/teensy/teensy_context.c +++ b/teensy/teensy_context.c @@ -2,7 +2,11 @@ #include #include +#ifdef _WIN32 +#include +#else #include +#endif #include "teensy_platform.h" #include "teensy_renderer.h" @@ -81,7 +85,7 @@ int ty_tick(void) double current_time = ty_get_time(); double time_since_tic = current_time - ctx.prev_tic_ts; - int tics = time_since_tic / ctx.ticrate; + int tics = (int)(time_since_tic / ctx.ticrate); if (tics > 0) { update_buttons(); ctx.prev_tic_ts = current_time; @@ -95,10 +99,14 @@ void ty_sleep(uint64_t ms) { assert(is_init()); +#ifdef _WIN32 + Sleep((DWORD)ms); +#else struct timespec ts; ts.tv_sec = ms / 1000; ts.tv_nsec = (ms % 1000) * 1000000; nanosleep(&ts, NULL); +#endif } char *ty_format_args(const char *fmt, va_list list) -- cgit v1.3-2-g0d8e