From d117cd3b8b0b179f47e763466b18172f4fadb61e Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Fri, 1 May 2026 19:49:54 +0200 Subject: [PATCH] - [FIX] Canvi de tipus del timer --- source/backends/SDL3/base.cpp | 4 ---- source/backends/SDL3/video.cpp | 1 + source/backends/backend.cpp | 12 ++++++------ source/backends/backend.h | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/source/backends/SDL3/base.cpp b/source/backends/SDL3/base.cpp index eea2efe..d8b0683 100644 --- a/source/backends/SDL3/base.cpp +++ b/source/backends/SDL3/base.cpp @@ -91,10 +91,6 @@ namespace backend SDL_SetClipboardText(value); } - uint64_t get_time_ms() { - return SDL_GetTicks(); - } - } #endif \ No newline at end of file diff --git a/source/backends/SDL3/video.cpp b/source/backends/SDL3/video.cpp index 189ddaa..cfde82a 100644 --- a/source/backends/SDL3/video.cpp +++ b/source/backends/SDL3/video.cpp @@ -31,6 +31,7 @@ namespace backend window = SDL_CreateWindow(title, width*zoom, height*zoom, SDL_WINDOW_OPENGL|(mini::win::state.fullscreen?SDL_WINDOW_FULLSCREEN:0)); SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl"); renderer = SDL_CreateRenderer(window, NULL); + SDL_SetRenderVSync(renderer, SDL_RENDERER_VSYNC_DISABLED); // Mostrar o ocultar el cursor if (mini::win::state.cursor) SDL_ShowCursor(); else SDL_HideCursor(); diff --git a/source/backends/backend.cpp b/source/backends/backend.cpp index 1782e6b..0660ad7 100644 --- a/source/backends/backend.cpp +++ b/source/backends/backend.cpp @@ -3,12 +3,12 @@ namespace backend { -// uint64_t get_time_ms() { -// using namespace std::chrono; -// return duration_cast( -// steady_clock::now().time_since_epoch() -// ).count(); -// } + uint32_t get_time_ms() { + using namespace std::chrono; + return duration_cast( + steady_clock::now().time_since_epoch() + ).count(); + } void exit() { current_state = quitting; diff --git a/source/backends/backend.h b/source/backends/backend.h index 76a30f0..ccf1a2b 100644 --- a/source/backends/backend.h +++ b/source/backends/backend.h @@ -20,7 +20,7 @@ namespace backend void poll_events(); const state_t& state(); void exit(); - uint64_t get_time_ms(); + uint32_t get_time_ms(); char* clipboard(); void clipboard(const char* value);