- Implemented EGL Context

This commit is contained in:
2025-07-28 13:00:20 -04:00
parent 8124ea2ae5
commit 7aafa4c9aa
19 changed files with 385 additions and 49 deletions

View File

@@ -38,7 +38,7 @@ STATIC_CONSTRUCTOR(_wayland_init) {
}
wayland_display::wayland_display(platform* platform)
: display(platform)
: display(platform, "wayland", this)
, _handle(nullptr)
, _registry(nullptr)
, _compositor(nullptr)
@@ -56,22 +56,23 @@ wayland_display::wayland_display(platform* platform)
// Get handles
_handle = wl_display_connect(nullptr);
if (not _handle) {
cleanup();
return;
}
// Get the wayland registry
_registry = wl_display_get_registry(_handle);
if (not _registry) {
cleanup();
return;
}
// Add listener for interfaces
wl_registry_add_listener(_registry, &listener, this);
wl_display_roundtrip(_handle);
// Check for fifo v1, wayland's builtin fifo only allows one frame to be in flight at a time
if (not _fifo) {
assert(_fifo, "Compositor does not support fifo-v1 protocol, falling back to other display protocols.");
cleanup();
@@ -111,7 +112,7 @@ void wayland_display::cleanup() {
libwayland::unload_symbols(_platform);
}
void wayland_display::listen_global(void* data, wl_registry* registry, uint32_t name, const char* itfc, uint32_t version) {
void wayland_display::listen_global(void* data, wl_registry* registry, uint32_t name, const char* itfc, uint32_t version) {
static constexpr wl_seat_listener seat_listener = {
listen_seat, nullptr
};
@@ -132,10 +133,10 @@ void wayland_display::cleanup() {
}
void wayland_display::listen_global_remove(void*, wl_registry*, uint32_t) {
void wayland_display::listen_global_remove(void*, wl_registry*, uint32_t) {
}
void wayland_display::listen_seat(void*, wl_seat*, uint32_t) {
void wayland_display::listen_seat(void*, wl_seat*, uint32_t) {
}