wlroots-hyprland/include/wlr/render/egl.h

82 lines
2.1 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 07:04:41 +02: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 07:04:41 +02:00
#include <EGL/egl.h>
2017-08-09 21:25:34 +02:00
#include <EGL/eglext.h>
2018-02-09 22:54:14 +01:00
#include <pixman.h>
2018-02-12 21:29:23 +01:00
#include <stdbool.h>
#include <wayland-server-core.h>
#include <wlr/render/dmabuf.h>
#include <wlr/render/drm_format_set.h>
2017-05-03 07:04:41 +02:00
struct wlr_egl {
EGLDisplay display;
EGLContext context;
EGLDeviceEXT device; // may be EGL_NO_DEVICE_EXT
struct gbm_device *gbm_device;
2017-08-09 21:25:34 +02:00
struct {
// Display extensions
bool bind_wayland_display_wl;
bool image_base_khr;
bool image_dmabuf_import_ext;
bool image_dmabuf_import_modifiers_ext;
// Device extensions
bool device_drm_ext;
} exts;
2017-08-09 21:25:34 +02:00
struct {
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT;
PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR;
PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR;
PFNEGLQUERYWAYLANDBUFFERWL eglQueryWaylandBufferWL;
PFNEGLBINDWAYLANDDISPLAYWL eglBindWaylandDisplayWL;
PFNEGLUNBINDWAYLANDDISPLAYWL eglUnbindWaylandDisplayWL;
PFNEGLQUERYDMABUFFORMATSEXTPROC eglQueryDmaBufFormatsEXT;
PFNEGLQUERYDMABUFMODIFIERSEXTPROC eglQueryDmaBufModifiersEXT;
PFNEGLDEBUGMESSAGECONTROLKHRPROC eglDebugMessageControlKHR;
PFNEGLQUERYDISPLAYATTRIBEXTPROC eglQueryDisplayAttribEXT;
PFNEGLQUERYDEVICESTRINGEXTPROC eglQueryDeviceStringEXT;
} procs;
2017-08-09 21:25:34 +02:00
struct wl_display *wl_display;
struct wlr_drm_format_set dmabuf_texture_formats;
struct wlr_drm_format_set dmabuf_render_formats;
2017-05-03 07:04:41 +02:00
};
/**
* 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_make_current(struct wlr_egl *egl);
bool wlr_egl_unset_current(struct wlr_egl *egl);
bool wlr_egl_is_current(struct wlr_egl *egl);
2017-05-03 07:04:41 +02:00
#endif