wlroots/include/wlr/render/egl.h

64 lines
1.4 KiB
C
Raw Normal View History

/*
* 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
2018-02-12 21:29:23 +01:00
#ifndef WLR_RENDER_EGL_H
#define WLR_RENDER_EGL_H
2017-05-03 17:04:41 +12:00
#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>
2017-05-03 17:04:41 +12:00
#include <EGL/egl.h>
2017-08-09 21:25:34 +02:00
#include <EGL/eglext.h>
2018-02-12 21:29:23 +01:00
#include <stdbool.h>
#include <wlr/render/drm_format_set.h>
2017-05-03 17:04:41 +12:00
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);
2017-05-03 17:04:41 +12:00
#endif