From eab1fb958335b6293e346c1a4eeb944f35463266 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 26 Nov 2020 19:43:36 +0100 Subject: [PATCH] GTK: Add debug logging on OpenGL initialisation issues Thanks @thesourcehim for the suggestion! --- desmume/src/frontend/posix/gtk/sdl_3Demu.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/desmume/src/frontend/posix/gtk/sdl_3Demu.cpp b/desmume/src/frontend/posix/gtk/sdl_3Demu.cpp index 5d750bad7..fb05b157c 100644 --- a/desmume/src/frontend/posix/gtk/sdl_3Demu.cpp +++ b/desmume/src/frontend/posix/gtk/sdl_3Demu.cpp @@ -61,12 +61,16 @@ bool init_sdl_3Demu(void) SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); win = SDL_CreateWindow(NULL, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 256, 192, SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN); - if (!win) + if (!win) { + fprintf(stderr, "SDL: Failed to create a window: %s\n", SDL_GetError()); return false; + } ctx = SDL_GL_CreateContext(win); - if (!ctx) + if (!ctx) { + fprintf(stderr, "SDL: Failed to create an OpenGL context: %s\n", SDL_GetError()); return false; + } printf("OGL/SDL Renderer has finished the initialization.\n");