final, but buuugs

This commit is contained in:
Stepanov Igor 2025-10-05 19:09:24 +03:00
parent 82562300ff
commit 5e19c6807c
5 changed files with 13 additions and 27 deletions

View file

@ -89,6 +89,7 @@ void input_sdl::pollEvents() {
cursor = {event.motion.x, event.motion.y};
break;
case SDL_EVENT_WINDOW_RESIZED:
window.setSize({event.window.data1, event.window.data2});
break;
case SDL_EVENT_TEXT_INPUT:
std::vector<char> vec(

View file

@ -344,12 +344,12 @@ void window_sdl::resetScissor() {
}
double window_sdl::time() {
return static_cast<double>(SDL_GetTicks()) / 1000;
return static_cast<double>(SDL_GetTicksNS()) / 1'000'000'000;
}
void window_sdl::setFramerate(int framerate) {
/*todo*/
if (!SDL_GL_SetSwapInterval(1)) {
if (!SDL_GL_SetSwapInterval(framerate)) {
logger.error() << "Failed to set framerate: " << SDL_GetError();
}
}