diff mbox series

[PULL,7/9] SDL: enable OpenGL context creation

Message ID 20201014082149.26853-8-kraxel@redhat.com
State New
Headers show
Series Ui 20201014 patches | expand

Commit Message

Gerd Hoffmann Oct. 14, 2020, 8:21 a.m. UTC
From: Jan Henrik Weinstock <jan.weinstock@rwth-aachen.de>

We need to specify SDL_WINDOW_OPENGL if we want to create an OpenGL context on it, i.e. when using '-device virtio-gpu-pci,virgl=on'

Signed-off-by: Jan Henrik Weinstock <jan.weinstock@rwth-aachen.de>
Message-id: b2ba98b3-2975-0d4d-1c56-f659923c714d@rwth-aachen.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/sdl2.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/ui/sdl2.c b/ui/sdl2.c
index abad7f981e50..189d26e2a951 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -84,6 +84,11 @@  void sdl2_window_create(struct sdl2_console *scon)
     if (scon->hidden) {
         flags |= SDL_WINDOW_HIDDEN;
     }
+#ifdef CONFIG_OPENGL
+    if (scon->opengl) {
+        flags |= SDL_WINDOW_OPENGL;
+    }
+#endif
 
     scon->real_window = SDL_CreateWindow("", SDL_WINDOWPOS_UNDEFINED,
                                          SDL_WINDOWPOS_UNDEFINED,