feat: on frame listener
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#define H_WINDOW_
|
||||
|
||||
#include <cstddef>
|
||||
#include <functional>
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
@@ -10,6 +11,8 @@
|
||||
|
||||
#define UNUSED(x) (void)(x)
|
||||
|
||||
typedef std::function<void()> IFrameListener;
|
||||
|
||||
class WindowImpl {
|
||||
public:
|
||||
WindowImpl() = default;
|
||||
@@ -19,6 +22,7 @@ public:
|
||||
WindowImpl(WindowImpl&&) = delete;
|
||||
protected:
|
||||
virtual bool Dispatch() = 0;
|
||||
virtual void OnFrame(IFrameListener fn) = 0;
|
||||
|
||||
virtual size_t GetWidth() const = 0;
|
||||
virtual size_t GetHeight() const = 0;
|
||||
@@ -39,6 +43,10 @@ public:
|
||||
size_t GetWidth() const;
|
||||
size_t GetHeight() const;
|
||||
|
||||
public:
|
||||
void Run();
|
||||
void OnFrame(IFrameListener fn);
|
||||
|
||||
private:
|
||||
WindowImpl* m_impl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user