From cd5a7dd7d355d7e680bc88d6866d93a9ff0271e0 Mon Sep 17 00:00:00 2001 From: Niellune Date: Sat, 28 Mar 2026 02:07:18 +0200 Subject: [PATCH] More info --- src/application.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/application.cpp b/src/application.cpp index 7076d45..49ad8ad 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -436,12 +436,12 @@ void Application::loop() interface.debug(debugBuffer); } + std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now(); + frameTime = (int32_t)std::chrono::duration_cast(now - frameStart).count(); + frameStart = now; if (_active && !Settings::vsync && !_state.dirty) { - std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now(); - frameTime = (int32_t)std::chrono::duration_cast(now - frameStart).count(); frameDelay = (frameTarget - frameTime) * ((decoder.buffer.latestId() == frameId) ? 1.0 : 0.9); - frameStart = now; if (frameDelay > 0) { std::this_thread::sleep_for(std::chrono::microseconds(frameDelay)); @@ -470,6 +470,7 @@ const std::string Application::status() const << SDL_GetCurrentVideoDriver(); SDL_Window *window = SDL_GetKeyboardFocus(); + SDL_RendererInfo cr{}; if (window) { int width = 0; @@ -479,23 +480,25 @@ const std::string Application::status() const SDL_Renderer *renderer = SDL_GetRenderer(window); if (renderer) { - SDL_RendererInfo info{}; - if (SDL_GetRendererInfo(renderer, &info) == 0) + if (SDL_GetRendererInfo(renderer, &cr) == 0) { - out << " " << info.name - << ((info.flags & SDL_RENDERER_ACCELERATED) != 0 ? " accelerated" : "") - << ((info.flags & SDL_RENDERER_PRESENTVSYNC) != 0 ? " vsync" : ""); + out << ((cr.flags & SDL_RENDERER_ACCELERATED) != 0 ? " accelerated" : "") + << ((cr.flags & SDL_RENDERER_PRESENTVSYNC) != 0 ? " vsync" : ""); } } } - out << " " << SDL_GetCurrentAudioDriver(); + out << " audio: " << SDL_GetCurrentAudioDriver(); out << "\nBACKENDS:"; for (int i = 0; i < SDL_GetNumRenderDrivers(); ++i) { SDL_RendererInfo info; SDL_GetRenderDriverInfo(i, &info); - out << " " << info.name; + out << " "; + if(cr.name == info.name) + out << "[" << info.name << "]"; + else + out << info.name; } int displayIndex = SDL_GetWindowDisplayIndex(window);