Own brush workers and thin preview/platform seams
This commit is contained in:
@@ -2,21 +2,28 @@
|
||||
|
||||
#ifdef __LINUX__
|
||||
#include <string>
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include "app.h"
|
||||
#include <utility>
|
||||
|
||||
namespace pp::platform::linux {
|
||||
namespace {
|
||||
|
||||
std::function<void(std::string)> g_fps_title_callback;
|
||||
|
||||
void linux_update_fps(int frames)
|
||||
{
|
||||
App::I->title("PanoPainter - " + std::to_string(frames) + " FPS");
|
||||
if (!g_fps_title_callback)
|
||||
return;
|
||||
|
||||
g_fps_title_callback("PanoPainter - " + std::to_string(frames) + " FPS");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void set_fps_title_callback(std::function<void(std::string)> callback)
|
||||
{
|
||||
g_fps_title_callback = std::move(callback);
|
||||
}
|
||||
|
||||
void report_rendered_frames(int frames)
|
||||
{
|
||||
linux_update_fps(frames);
|
||||
@@ -26,6 +33,11 @@ void report_rendered_frames(int frames)
|
||||
#else
|
||||
namespace pp::platform::linux {
|
||||
|
||||
void set_fps_title_callback(std::function<void(std::string)> callback)
|
||||
{
|
||||
(void)callback;
|
||||
}
|
||||
|
||||
void report_rendered_frames(int frames)
|
||||
{
|
||||
(void)frames;
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
namespace pp::platform::linux {
|
||||
|
||||
void set_fps_title_callback(std::function<void(std::string)> callback);
|
||||
void report_rendered_frames(int frames);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user