wayland: give up on cairo and switch to OpenGL

This commit is contained in:
IoIxD 2025-12-03 18:17:27 -07:00
commit 0adc98a2a2
6 changed files with 310 additions and 119 deletions

View file

@ -12,11 +12,14 @@
#include <Mw/TypeDefs.h>
#include <Mw/LowLevel.h>
#include <wayland-egl.h>
#include <EGL/egl.h>
#include <GL/gl.h>
#include <GL/glext.h>
#include <wayland-client.h>
#include <xkbcommon/xkbcommon.h>
#include <cairo/cairo.h>
MWDECL int MwLLWaylandCallInit(void);
#ifndef WL_PROTOCOLS_DEFINED
@ -58,21 +61,6 @@ struct _MwLLWayland {
MWLL_WAYLAND_SUBSURFACE = 1,
} type;
struct wl_display* display;
struct wl_registry* registry;
struct wl_compositor* compositor;
struct wl_subcompositor* subcompositor;
struct wl_surface* surface;
struct wl_shm* shm;
struct wl_registry_listener registry_listener;
int mapped_buffer_size;
cairo_surface_t* cairo_surface;
// cairo_t* cairo;
MwU8* mapped_buffer;
struct {
const char* key;
wl_setup_func* value;
@ -83,9 +71,32 @@ struct _MwLLWayland {
wayland_protocol_t* value;
}* wl_protocol_map;
/*MwLL* subsurfaces;*/
struct wl_display* display;
struct wl_registry* registry;
struct wl_compositor* compositor;
struct wl_subcompositor* subcompositor;
struct wl_surface* surface;
struct wl_shm* shm;
struct wl_registry_listener registry_listener;
// cairo_surface_t* cairo_surface;
MwBool configured;
MwBool force_redraw;
MwBool do_clear;
MwU32 x, y, ww, wh;
MwLL parent;
GLuint fbo;
unsigned int fbo_texture;
unsigned int rbo;
MwBool egl_setup;
EGLNativeWindowType egl_window_native;
EGLDisplay egl_display;
EGLContext egl_context;
EGLSurface egl_surface;
};
struct _MwLLWaylandColor {