diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2014-11-19 14:56:46 +0100 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:28:22 -0600 |
commit | b6ba9ac8baf2ac7c59dfdf66fdb332f9c4300581 (patch) | |
tree | b67f4b9b059492b0e95c49989927ea2cb99d196c /include/ui | |
parent | 9286a3039ae84d5ca1ba5de83e1ed5f24f8e72c6 (diff) | |
download | hqemu-b6ba9ac8baf2ac7c59dfdf66fdb332f9c4300581.zip hqemu-b6ba9ac8baf2ac7c59dfdf66fdb332f9c4300581.tar.gz |
sdl2/opengl: add opengl context and scanout support
This allows virtio-gpu to render in 3d mode.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'include/ui')
-rw-r--r-- | include/ui/sdl2.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h index 2fdad8f..b7ac38f 100644 --- a/include/ui/sdl2.h +++ b/include/ui/sdl2.h @@ -15,12 +15,18 @@ struct sdl2_console { SDL_Renderer *real_renderer; int idx; int last_vm_running; /* per console for caption reasons */ - int x, y; + int x, y, w, h; int hidden; int opengl; int updates; SDL_GLContext winctx; +#ifdef CONFIG_OPENGL ConsoleGLState *gls; + GLuint tex_id; + GLuint fbo_id; + bool y0_top; + bool scanout_mode; +#endif }; void sdl2_window_create(struct sdl2_console *scon); @@ -48,4 +54,18 @@ void sdl2_gl_switch(DisplayChangeListener *dcl, void sdl2_gl_refresh(DisplayChangeListener *dcl); void sdl2_gl_redraw(struct sdl2_console *scon); +QEMUGLContext sdl2_gl_create_context(DisplayChangeListener *dcl, + QEMUGLParams *params); +void sdl2_gl_destroy_context(DisplayChangeListener *dcl, QEMUGLContext ctx); +int sdl2_gl_make_context_current(DisplayChangeListener *dcl, + QEMUGLContext ctx); +QEMUGLContext sdl2_gl_get_current_context(DisplayChangeListener *dcl); + +void sdl2_gl_scanout(DisplayChangeListener *dcl, + uint32_t backing_id, bool backing_y_0_top, + uint32_t x, uint32_t y, + uint32_t w, uint32_t h); +void sdl2_gl_scanout_flush(DisplayChangeListener *dcl, + uint32_t x, uint32_t y, uint32_t w, uint32_t h); + #endif /* SDL2_H */ |