- Implemented EGL Context
This commit is contained in:
@@ -25,8 +25,7 @@ namespace fennec
|
||||
{
|
||||
|
||||
STATIC_CONSTRUCTOR(_init_linux) {
|
||||
static linux_platform* platform = new linux_platform();
|
||||
file::cout().write(platform, sizeof(platform), 1);
|
||||
static linux_platform platform;
|
||||
}
|
||||
|
||||
void linux_platform::initialize() {
|
||||
@@ -34,7 +33,7 @@ void linux_platform::initialize() {
|
||||
}
|
||||
|
||||
void linux_platform::shutdown() {
|
||||
|
||||
platform::shutdown();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user