[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 14/18] ui/sdl: add optional logging when _SDL_DEBUG is set
From: |
marcandre . lureau |
Subject: |
[PATCH v2 14/18] ui/sdl: add optional logging when _SDL_DEBUG is set |
Date: |
Tue, 7 Mar 2023 15:56:33 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Apparently, there is no environment variable you can set for libsdl to
enable logging.
(similar to _VNC_DEBUG)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
include/ui/sdl2.h | 2 ++
ui/sdl2.c | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h
index 8fb7e08262..6fea36db82 100644
--- a/include/ui/sdl2.h
+++ b/include/ui/sdl2.h
@@ -6,6 +6,8 @@
#include <SDL.h>
+/* #define _SDL_DEBUG 1 */
+
/* with Alpine / muslc SDL headers pull in directfb headers
* which in turn trigger warning about redundant decls for
* direct_waitqueue_deinit.
diff --git a/ui/sdl2.c b/ui/sdl2.c
index f259e4c4d1..592eca3e1c 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -841,6 +841,10 @@ static void sdl2_display_init(DisplayState *ds,
DisplayOptions *o)
}
#endif
+#ifdef _SDL_DEBUG
+ SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE);
+#endif
+
if (SDL_Init(SDL_INIT_VIDEO)) {
fprintf(stderr, "Could not initialize SDL(%s) - exiting\n",
SDL_GetError());
--
2.39.2
- [PATCH v2 08/18] ui: keep current cursor with QemuConsole, (continued)
- [PATCH v2 08/18] ui: keep current cursor with QemuConsole, marcandre . lureau, 2023/03/07
- [PATCH v2 09/18] ui: set cursor upon listener registration, marcandre . lureau, 2023/03/07
- [PATCH v2 10/18] ui: set cursor position upon listener registration, marcandre . lureau, 2023/03/07
- [PATCH v2 11/18] ui/sdl: get the GL context from the window, marcandre . lureau, 2023/03/07
- [PATCH v2 13/18] ui/egl: print EGL error, helping debugging, marcandre . lureau, 2023/03/07
- [PATCH v2 14/18] ui/sdl: add optional logging when _SDL_DEBUG is set,
marcandre . lureau <=
- [PATCH v2 12/18] ui/shader: fix #version directive must occur on first line, marcandre . lureau, 2023/03/07
- [PATCH v2 15/18] ui/sdl: try to instantiate the matching opengl renderer, marcandre . lureau, 2023/03/07
- [PATCH v2 16/18] ui: introduce egl_init(), marcandre . lureau, 2023/03/07