Skip to content

Commit

Permalink
tr1: log details for SDL OpenGL context fails
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Oct 24, 2024
1 parent 666a484 commit 6a3d249
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/libtrx/gfx/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,13 @@ void GFX_Context_Attach(void *window_handle)

m_Context.context = SDL_GL_CreateContext(m_Context.window_handle);

if (!m_Context.context) {
Shell_ExitSystem("Can't create OpenGL context");
if (m_Context.context == NULL) {
Shell_ExitSystemFmt("Can't create OpenGL context: %s", SDL_GetError());
}

if (SDL_GL_MakeCurrent(m_Context.window_handle, m_Context.context)) {
Shell_ExitSystem("Can't activate OpenGL context");
Shell_ExitSystemFmt(
"Can't activate OpenGL context: %s", SDL_GetError());
}

LOG_INFO("OpenGL vendor string: %s", glGetString(GL_VENDOR));
Expand Down
2 changes: 0 additions & 2 deletions src/libtrx/log.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "log.h"

#include "memory.h"

#include <stdarg.h>
#include <stdio.h>

Expand Down
2 changes: 1 addition & 1 deletion src/tr1/game/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void Shell_Init(const char *gameflow_path)
Screen_Init();

if (!GameFlow_LoadFromFile(gameflow_path)) {
Shell_ExitSystem("MAIN: unable to load script file");
Shell_ExitSystemFmt("Unable to load gameflow file: %s", gameflow_path);
return;
}
Savegame_Init();
Expand Down

0 comments on commit 6a3d249

Please sign in to comment.