[PATCH] SDL: enable OpenGL context creation

Jan Henrik Weinstock posted 1 patch 3 years, 7 months ago
Failed in applying to current master (apply log)
ui/sdl2.c | 5 +++++
1 file changed, 5 insertions(+)
[PATCH] SDL: enable OpenGL context creation
Posted by Jan Henrik Weinstock 3 years, 7 months ago
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>
---
  ui/sdl2.c | 5 +++++
  1 file changed, 5 insertions(+)

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,
-- 
2.17.1

Re: [PATCH] SDL: enable OpenGL context creation
Posted by Gerd Hoffmann 3 years, 7 months ago
On Sun, Oct 04, 2020 at 12:42:21PM +0200, Jan Henrik Weinstock wrote:
> 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>

Added to ui patch queue.

thanks,
  Gerd