diff options
Diffstat (limited to 'include/ui')
-rw-r--r-- | include/ui/egl-helpers.h | 15 | ||||
-rw-r--r-- | include/ui/gtk.h | 4 | ||||
-rw-r--r-- | include/ui/sdl2.h | 8 |
3 files changed, 23 insertions, 4 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; diff --git a/include/ui/gtk.h b/include/ui/gtk.h index ca9a2268de..2f7b720358 100644 --- a/include/ui/gtk.h +++ b/include/ui/gtk.h @@ -52,8 +52,8 @@ typedef struct VirtualGfxConsole { EGLSurface esurface; int glupdates; int x, y, w, h; - GLuint tex_id; - GLuint fbo_id; + egl_fb guest_fb; + egl_fb win_fb; bool y0_top; bool scanout_mode; #endif diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h index aaf226c2c0..454367ac84 100644 --- a/include/ui/sdl2.h +++ b/include/ui/sdl2.h @@ -7,6 +7,10 @@ #include <SDL.h> #include <SDL_syswm.h> +#ifdef CONFIG_OPENGL +# include "ui/egl-helpers.h" +#endif + struct sdl2_console { DisplayChangeListener dcl; DisplaySurface *surface; @@ -23,8 +27,8 @@ struct sdl2_console { SDL_GLContext winctx; #ifdef CONFIG_OPENGL ConsoleGLState *gls; - GLuint tex_id; - GLuint fbo_id; + egl_fb guest_fb; + egl_fb win_fb; bool y0_top; bool scanout_mode; #endif |