// =====================================================================================================================
// fennec, a free and open source game engine
// Copyright © 2025 Medusa Slockbower
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
// =====================================================================================================================
#include
#include
#include
namespace fennec
{
wayland_eglsurface::wayland_eglsurface(wayland_window* win, eglcontext* ctx)
: eglsurface(win, ctx,
reinterpret_cast(
wl_egl_window_create(
static_cast(win->get_native_handle()), win->get_size().x, win->get_size().y
)
)
) {
}
wayland_eglsurface::~wayland_eglsurface() {
wl_egl_window_destroy(reinterpret_cast(_eglwindow));
}
void wayland_eglsurface::resize(const ivec2& size) {
wl_egl_window_resize(reinterpret_cast(_eglwindow), size.x, size.y, 0, 0);
}
}