/* * This an unstable interface of wlroots. No guarantees are made regarding the * future consistency of this API. */ #ifndef WLR_USE_UNSTABLE #error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features" #endif #ifndef WLR_RENDER_EGL_H #define WLR_RENDER_EGL_H #ifndef MESA_EGL_NO_X11_HEADERS #define MESA_EGL_NO_X11_HEADERS #endif #ifndef EGL_NO_X11 #define EGL_NO_X11 #endif #ifndef EGL_NO_PLATFORM_SPECIFIC_TYPES #define EGL_NO_PLATFORM_SPECIFIC_TYPES #endif #include #include #include #include #include struct wlr_egl_context { EGLDisplay display; EGLContext context; EGLSurface draw_surface; EGLSurface read_surface; }; /** * Make the EGL context current. * * Callers are expected to clear the current context when they are done by * calling wlr_egl_unset_current. */ bool wlr_egl_context_set_current(struct wlr_egl_context *ctx); /** * Clear the EGL context */ bool wlr_egl_context_unset_current(struct wlr_egl_context *ctx); bool wlr_egl_context_is_current(struct wlr_egl_context *ctx); /** * Save the current EGL context to the structure provided in the argument. * * This includes display, context, draw surface and read surface. */ void wlr_egl_context_save(struct wlr_egl_context *context); /** * Restore EGL context that was previously saved using wlr_egl_context_save(). */ bool wlr_egl_context_restore(struct wlr_egl_context *context); #endif