mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-08 13:29:45 -05:00
63 lines
1.4 KiB
C
63 lines
1.4 KiB
C
/*
|
|
* 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 <wlr/config.h>
|
|
|
|
#include <EGL/egl.h>
|
|
#include <EGL/eglext.h>
|
|
#include <stdbool.h>
|
|
#include <wlr/render/drm_format_set.h>
|
|
|
|
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
|