Split Linux FPS title reporting
This commit is contained in:
@@ -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
|
||||
|
||||
35
src/platform_linux/linux_platform_services.cpp
Normal file
35
src/platform_linux/linux_platform_services.cpp
Normal 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
|
||||
7
src/platform_linux/linux_platform_services.h
Normal file
7
src/platform_linux/linux_platform_services.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
namespace pp::platform::linux {
|
||||
|
||||
void report_rendered_frames(int frames);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user