diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2014-11-19 14:56:46 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2016-01-08 12:20:15 +0100 |
commit | cb47dc9ab9f55083017291b2b8fbae639c576ec2 (patch) | |
tree | 471fa94f134c554cd757926948e5d47297806adb /include/ui | |
parent | 4083733db5e4120939acee57019ff52db1f45b9d (diff) |
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 2fdad8f300..b7ac38f198 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 */ |