From db6cdfbeba791a2e5047a44f61d068cefa0b7c91 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 21 Feb 2017 10:37:20 +0100 Subject: sdl2: add scanout_disable support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 1487669841-13668-6-git-send-email-kraxel@redhat.com --- ui/sdl2-gl.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'ui/sdl2-gl.c') diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c index e25aa3bf76..1cd77e2c16 100644 --- a/ui/sdl2-gl.c +++ b/ui/sdl2-gl.c @@ -184,6 +184,17 @@ QEMUGLContext sdl2_gl_get_current_context(DisplayChangeListener *dcl) return (QEMUGLContext)sdlctx; } +void sdl2_gl_scanout_disable(DisplayChangeListener *dcl) +{ + struct sdl2_console *scon = container_of(dcl, struct sdl2_console, dcl); + + assert(scon->opengl); + scon->w = 0; + scon->h = 0; + scon->tex_id = 0; + sdl2_set_scanout_mode(scon, false); +} + void sdl2_gl_scanout_texture(DisplayChangeListener *dcl, uint32_t backing_id, bool backing_y_0_top, @@ -204,11 +215,6 @@ void sdl2_gl_scanout_texture(DisplayChangeListener *dcl, SDL_GL_MakeCurrent(scon->real_window, scon->winctx); - if (scon->tex_id == 0 || scon->w == 0 || scon->h == 0) { - sdl2_set_scanout_mode(scon, false); - return; - } - sdl2_set_scanout_mode(scon, true); if (!scon->fbo_id) { glGenFramebuffers(1, &scon->fbo_id); -- cgit v1.2.1