2022-11-12 19:03:42 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "pacer.h"
|
|
|
|
|
|
|
|
#include <wayland-client-core.h>
|
|
|
|
#include <wayland-client-protocol.h>
|
|
|
|
|
|
|
|
class WaylandVsyncSource : public IVsyncSource
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
WaylandVsyncSource(Pacer* pacer);
|
|
|
|
|
|
|
|
virtual ~WaylandVsyncSource();
|
|
|
|
|
2022-11-12 21:08:50 +00:00
|
|
|
virtual bool initialize(SDL_Window* window, int displayFps) override;
|
|
|
|
|
|
|
|
virtual bool isAsync() override;
|
2022-11-12 19:03:42 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
static void frameDone(void* data, struct wl_callback* oldCb, uint32_t time);
|
|
|
|
|
|
|
|
static const struct wl_callback_listener s_FrameListener;
|
|
|
|
|
|
|
|
Pacer* m_Pacer;
|
|
|
|
wl_display* m_Display;
|
|
|
|
wl_surface* m_Surface;
|
|
|
|
wl_callback* m_Callback;
|
|
|
|
};
|
|
|
|
|