[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/11] ui/sdl: get the GL context from the window
From: |
marcandre . lureau |
Subject: |
[PATCH 11/11] ui/sdl: get the GL context from the window |
Date: |
Mon, 30 Jan 2023 15:24:31 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
There is no guarantee to have a current GL context here. The current
code seems to rely on the renderer using a GL backend, and to set a
current GL context. But this is not always the case, for example if the
renderer backend is DirectX.
This change is enough to fix using virgl with sdl2 on win32, on my setup.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
ui/sdl2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 8cb77416af..f259e4c4d1 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -101,7 +101,7 @@ void sdl2_window_create(struct sdl2_console *scon)
flags);
scon->real_renderer = SDL_CreateRenderer(scon->real_window, -1, 0);
if (scon->opengl) {
- scon->winctx = SDL_GL_GetCurrentContext();
+ scon->winctx = SDL_GL_CreateContext(scon->real_window);
}
sdl_update_caption(scon);
}
--
2.39.1
- [PATCH 01/11] ui/dbus: unregister clipboard on connection close, (continued)
- [PATCH 01/11] ui/dbus: unregister clipboard on connection close, marcandre . lureau, 2023/01/30
- [PATCH 02/11] audio/dbus: there are no sender for p2p mode, marcandre . lureau, 2023/01/30
- [PATCH 03/11] ui/dbus: set mouse is-absolute during console creation, marcandre . lureau, 2023/01/30
- [PATCH 04/11] ui/dbus: update the display when switching surface, marcandre . lureau, 2023/01/30
- [PATCH 05/11] meson: ensure dbus-display generated code is built before other units, marcandre . lureau, 2023/01/30
- [PATCH 06/11] ui: rename cursor_{put->unref}, marcandre . lureau, 2023/01/30
- [PATCH 08/11] ui: keep current cursor with QemuConsole, marcandre . lureau, 2023/01/30
- [PATCH 10/11] ui: set cursor position upon listener registration, marcandre . lureau, 2023/01/30
- [PATCH 09/11] ui: set cursor upon listener registration, marcandre . lureau, 2023/01/30
- [PATCH 07/11] ui: rename cursor_{get->ref}, return it, marcandre . lureau, 2023/01/30
- [PATCH 11/11] ui/sdl: get the GL context from the window,
marcandre . lureau <=