mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
render/egl: replace init/finish with create/destroy
This ensures wlr_gles2_renderer can properly take ownership of the wlr_egl. Closes: https://github.com/swaywm/wlroots/issues/2612
This commit is contained in:
parent
50b120927d
commit
1d461687d2
12 changed files with 62 additions and 68 deletions
|
|
@ -18,12 +18,12 @@ static struct xdg_wm_base *wm_base = NULL;
|
|||
static struct zwlr_input_inhibit_manager_v1 *input_inhibit_manager = NULL;
|
||||
static struct zwlr_input_inhibitor_v1 *input_inhibitor = NULL;
|
||||
|
||||
struct wlr_egl egl;
|
||||
struct wlr_egl *egl;
|
||||
struct wl_egl_window *egl_window;
|
||||
struct wlr_egl_surface *egl_surface;
|
||||
|
||||
static void render_frame(void) {
|
||||
eglMakeCurrent(egl.display, egl_surface, egl_surface, egl.context);
|
||||
eglMakeCurrent(egl->display, egl_surface, egl_surface, egl->context);
|
||||
|
||||
glViewport(0, 0, width, height);
|
||||
if (keys) {
|
||||
|
|
@ -33,7 +33,7 @@ static void render_frame(void) {
|
|||
}
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
eglSwapBuffers(egl.display, egl_surface);
|
||||
eglSwapBuffers(egl->display, egl_surface);
|
||||
}
|
||||
|
||||
static void xdg_surface_handle_configure(void *data,
|
||||
|
|
@ -158,7 +158,7 @@ int main(int argc, char **argv) {
|
|||
assert(input_inhibitor);
|
||||
|
||||
EGLint attribs[] = { EGL_NONE };
|
||||
wlr_egl_init(&egl, EGL_PLATFORM_WAYLAND_EXT, display, attribs);
|
||||
egl = wlr_egl_create(EGL_PLATFORM_WAYLAND_EXT, display, attribs);
|
||||
|
||||
struct wl_surface *surface = wl_compositor_create_surface(compositor);
|
||||
assert(surface);
|
||||
|
|
@ -174,7 +174,7 @@ int main(int argc, char **argv) {
|
|||
wl_surface_commit(surface);
|
||||
|
||||
egl_window = wl_egl_window_create(surface, width, height);
|
||||
egl_surface = wlr_egl_create_surface(&egl, egl_window);
|
||||
egl_surface = wlr_egl_create_surface(egl, egl_window);
|
||||
|
||||
wl_display_roundtrip(display);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue