Split Linux FPS title reporting

This commit is contained in:
2026-06-13 19:28:09 +02:00
parent ca7ea820ba
commit 1d50bcc741
7 changed files with 90 additions and 3 deletions

View File

@@ -37,9 +37,9 @@ void save_image_library(const std::string& path);
#elif __LINUX__
#include <GLFW/glfw3.h>
#include <tinyfiledialogs.h>
#include "platform_linux/linux_platform_services.h"
std::string linux_home_path();
int mkpath(const std::string& dir, mode_t mode = DEFFILEMODE);
void linux_update_fps(int frames);
#elif __WEB__
#include <GLFW/glfw3.h>
void webgl_pick_file(std::function<void(std::string)> callback);
@@ -474,7 +474,7 @@ public:
void report_rendered_frames(int frames) override
{
#ifdef __LINUX__
linux_update_fps(frames);
pp::platform::linux::report_rendered_frames(frames);
#else
(void)frames;
#endif

View File

@@ -0,0 +1,35 @@
#include "platform_linux/linux_platform_services.h"
#ifdef __LINUX__
#include <string>
#include <GLFW/glfw3.h>
#include "app.h"
namespace pp::platform::linux {
namespace {
void linux_update_fps(int frames)
{
App::I->title("PanoPainter - " + std::to_string(frames) + " FPS");
}
}
void report_rendered_frames(int frames)
{
linux_update_fps(frames);
}
}
#else
namespace pp::platform::linux {
void report_rendered_frames(int frames)
{
(void)frames;
}
}
#endif

View File

@@ -0,0 +1,7 @@
#pragma once
namespace pp::platform::linux {
void report_rendered_frames(int frames);
}