diff --git a/compositor/compositor-drm.c b/compositor/compositor-drm.c index 806afc60..6f1ce708 100644 --- a/compositor/compositor-drm.c +++ b/compositor/compositor-drm.c @@ -352,6 +352,9 @@ drm_compositor_create(struct wl_display *display, int connector) ec->base.create_buffer = wlsc_drm_buffer_create; ec->base.focus = 1; + glGenFramebuffers(1, &ec->base.fbo); + glBindFramebuffer(GL_FRAMEBUFFER, ec->base.fbo); + /* Can't init base class until we have a current egl context */ if (wlsc_compositor_init(&ec->base, display) < 0) return NULL; diff --git a/compositor/compositor-wayland.c b/compositor/compositor-wayland.c index 17930899..fea189b1 100644 --- a/compositor/compositor-wayland.c +++ b/compositor/compositor-wayland.c @@ -519,6 +519,9 @@ wayland_compositor_create(struct wl_display *display, int width, int height) c->base.present = wayland_compositor_present; c->base.create_buffer = wlsc_drm_buffer_create; + glGenFramebuffers(1, &c->base.fbo); + glBindFramebuffer(GL_FRAMEBUFFER, c->base.fbo); + /* Can't init base class until we have a current egl context */ if (wlsc_compositor_init(&c->base, display) < 0) return NULL; diff --git a/compositor/compositor-x11.c b/compositor/compositor-x11.c index 27b7cd9e..afe7adc2 100644 --- a/compositor/compositor-x11.c +++ b/compositor/compositor-x11.c @@ -731,6 +731,9 @@ x11_compositor_create(struct wl_display *display, int width, int height) c->base.present = x11_compositor_present; c->base.create_buffer = wlsc_drm_buffer_create; + glGenFramebuffers(1, &c->base.fbo); + glBindFramebuffer(GL_FRAMEBUFFER, c->base.fbo); + /* Can't init base class until we have a current egl context */ if (wlsc_compositor_init(&c->base, display) < 0) return NULL; diff --git a/compositor/compositor.c b/compositor/compositor.c index e3989d5a..6b754477 100644 --- a/compositor/compositor.c +++ b/compositor/compositor.c @@ -1353,8 +1353,6 @@ wlsc_compositor_init(struct wlsc_compositor *ec, struct wl_display *display) return -1; } - glGenFramebuffers(1, &ec->fbo); - glBindFramebuffer(GL_FRAMEBUFFER, ec->fbo); glActiveTexture(GL_TEXTURE0); if (init_shaders(ec) < 0) return -1;