GTK: Add debug logging on OpenGL initialisation issues

Thanks @thesourcehim for the suggestion!
This commit is contained in:
Emmanuel Gil Peyrot 2020-11-26 19:43:36 +01:00
parent 6e35440436
commit eab1fb9583
1 changed files with 6 additions and 2 deletions

View File

@ -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");