#include "platform_linux/linux_platform_services.h"

#ifdef __LINUX__
#include <string>
#include <utility>

namespace pp::platform::linux_desktop {
namespace {

std::function<void(std::string)> g_fps_title_callback;

void linux_update_fps(int frames)
{
    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);
}

}
#else
namespace pp::platform::linux_desktop {

void set_fps_title_callback(std::function<void(std::string)> callback)
{
    (void)callback;
}

void report_rendered_frames(int frames)
{
    (void)frames;
}

}
#endif
