mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 20:19:44 +00:00
54d208ffda
Add support for OpenGL ES to egl-helpers. Wire up the new option for egl-headless and gtk UIs. egl-headless actually works fine. gtk hits a not-yet implemented code path in libEGL when trying to use gles mode: libEGL warning: FIXME: egl/x11 doesn't support front buffer rendering. (This is mesa 17.2.3). Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Message-id: 20180618112141.23398-1-kraxel@redhat.com
53 lines
1.6 KiB
C
53 lines
1.6 KiB
C
#ifndef EGL_HELPERS_H
|
|
#define EGL_HELPERS_H
|
|
|
|
#include <epoxy/gl.h>
|
|
#include <epoxy/egl.h>
|
|
#include <gbm.h>
|
|
|
|
extern EGLDisplay *qemu_egl_display;
|
|
extern EGLConfig qemu_egl_config;
|
|
extern DisplayGLMode qemu_egl_mode;
|
|
|
|
typedef struct egl_fb {
|
|
int width;
|
|
int height;
|
|
GLuint texture;
|
|
GLuint framebuffer;
|
|
bool delete_texture;
|
|
} egl_fb;
|
|
|
|
void egl_fb_destroy(egl_fb *fb);
|
|
void egl_fb_setup_default(egl_fb *fb, int width, int height);
|
|
void egl_fb_setup_for_tex(egl_fb *fb, int width, int height,
|
|
GLuint texture, bool delete);
|
|
void egl_fb_setup_new_tex(egl_fb *fb, int width, int height);
|
|
void egl_fb_blit(egl_fb *dst, egl_fb *src, bool flip);
|
|
void egl_fb_read(void *dst, egl_fb *src);
|
|
|
|
void egl_texture_blit(QemuGLShader *gls, egl_fb *dst, egl_fb *src, bool flip);
|
|
void egl_texture_blend(QemuGLShader *gls, egl_fb *dst, egl_fb *src, bool flip,
|
|
int x, int y);
|
|
|
|
#ifdef CONFIG_OPENGL_DMABUF
|
|
|
|
extern int qemu_egl_rn_fd;
|
|
extern struct gbm_device *qemu_egl_rn_gbm_dev;
|
|
extern EGLContext qemu_egl_rn_ctx;
|
|
|
|
int egl_rendernode_init(const char *rendernode, DisplayGLMode mode);
|
|
int egl_get_fd_for_texture(uint32_t tex_id, EGLint *stride, EGLint *fourcc);
|
|
|
|
void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf);
|
|
void egl_dmabuf_release_texture(QemuDmaBuf *dmabuf);
|
|
|
|
#endif
|
|
|
|
EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, Window win);
|
|
|
|
int qemu_egl_init_dpy_x11(EGLNativeDisplayType dpy, DisplayGLMode mode);
|
|
int qemu_egl_init_dpy_mesa(EGLNativeDisplayType dpy, DisplayGLMode mode);
|
|
EGLContext qemu_egl_init_ctx(void);
|
|
|
|
#endif /* EGL_HELPERS_H */
|