feat: separate wayland implementation

This commit is contained in:
2026-02-13 13:27:06 +01:00
parent 696d55db02
commit ae9de0a22e
11 changed files with 635 additions and 470 deletions

52
include/window.h Normal file
View File

@@ -0,0 +1,52 @@
#pragma once
#ifndef H_WINDOW_
#define H_WINDOW_
#include <cstddef>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES2/gl2.h>
#define UNUSED(x) (void)(x)
class WindowImpl {
public:
WindowImpl() = default;
virtual ~WindowImpl() = default;
WindowImpl(const WindowImpl&) = delete;
WindowImpl(WindowImpl&&) = delete;
protected:
virtual bool Dispatch() = 0;
virtual size_t GetWidth() const = 0;
virtual size_t GetHeight() const = 0;
friend class Window;
};
class Window {
public:
Window(size_t width, size_t height);
virtual ~Window();
Window(const Window &) = delete;
Window(Window &&) = delete;
public:
bool Running() const;
size_t GetWidth() const;
size_t GetHeight() const;
private:
WindowImpl* m_impl;
private: // app logic
uint32_t m_last_time;
size_t m_width;
size_t m_height;
bool m_running;
};
#endif // H_WINDOW_