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

40
include/renderer.h Normal file
View File

@@ -0,0 +1,40 @@
#pragma once
#ifndef H_RENDERER_
#define H_RENDERER_
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <wayland-egl.h>
class Renderer {
public:
static Renderer *GetInstance();
public:
const EGLConfig &GetConfig() const;
public:
void DestroyWindow(const EGLSurface& surface, struct wl_egl_window* window);
void DestroyContext(const EGLContext& context);
EGLContext CreateContext();
EGLSurface CreateSurface(struct wl_egl_window *window);
void SurfaceSetContext(const EGLSurface &surface, const EGLContext &context);
void SwapBuffers(const EGLSurface &surface);
private:
Renderer();
~Renderer();
private:
static Renderer *s_instance;
EGLDisplay m_egl_display;
EGLConfig m_config;
};
#endif // H_RENDERER_