aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorJan Henrik Weinstock <jan.weinstock@rwth-aachen.de>2020-10-04 12:42:21 +0200
committerGerd Hoffmann <kraxel@redhat.com>2020-10-14 06:05:56 +0200
commit67c6f1dbb708f4cf0edc18d427f694654999b4b2 (patch)
treec40879a705864bce2f00a0032c11796c2b2d87f0 /ui
parentdb88404a4e0f1cc1d2f26ed8187690088ba38a2b (diff)
SDL: enable OpenGL context creation
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>
Diffstat (limited to 'ui')
-rw-r--r--ui/sdl2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/sdl2.c b/ui/sdl2.c
index abad7f981e..189d26e2a9 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,