summaryrefslogtreecommitdiffstats
path: root/include/ui/egl-helpers.h
diff options
context:
space:
mode:
authorGerd Hoffmann2017-06-14 10:41:46 +0200
committerGerd Hoffmann2017-06-21 14:23:16 +0200
commit6fafc2601412327189734ee883153d504f57f9b8 (patch)
treefae3290ccbac814cca307fa1e4999e4c7926ae1c /include/ui/egl-helpers.h
parenttcg/tci: fix tcg-interpreter build (diff)
downloadqemu-6fafc2601412327189734ee883153d504f57f9b8.tar.gz
qemu-6fafc2601412327189734ee883153d504f57f9b8.tar.xz
qemu-6fafc2601412327189734ee883153d504f57f9b8.zip
egl-helpers: add helpers to handle opengl framebuffers
Add a collection of egl_fb_*() helper functions to manage and use opengl framebuffers, which is a common pattern in UI code with opengl support. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170614084149.31314-2-kraxel@redhat.com
Diffstat (limited to 'include/ui/egl-helpers.h')
-rw-r--r--include/ui/egl-helpers.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/ui/egl-helpers.h b/include/ui/egl-helpers.h
index c785d60e91..be8908737c 100644
--- a/include/ui/egl-helpers.h
+++ b/include/ui/egl-helpers.h
@@ -8,6 +8,21 @@
extern EGLDisplay *qemu_egl_display;
extern EGLConfig qemu_egl_config;
+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_create_for_tex(egl_fb *fb, int width, int height, GLuint texture);
+void egl_fb_create_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);
+
#ifdef CONFIG_OPENGL_DMABUF
extern int qemu_egl_rn_fd;