Skip to content

Commit

Permalink
fix(build): Fix compilation error on SDL before v2.0.22 (endless-sky#…
Browse files Browse the repository at this point in the history
  • Loading branch information
quyykk authored Dec 17, 2023
1 parent 5c9b49c commit b984760
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/GameWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ bool GameWindow::Init(bool headless)

// When running the integration tests, don't create a window nor an OpenGL context.
if(headless)
#if defined(__linux__) && !SDL_VERSION_ATLEAST(2, 0, 22)
setenv("SDL_VIDEODRIVER", "dummy", true);
#else
SDL_SetHint(SDL_HINT_VIDEODRIVER, "dummy");
#endif

// This needs to be called before any other SDL commands.
if(SDL_Init(SDL_INIT_VIDEO) != 0)
Expand Down

0 comments on commit b984760

Please sign in to comment.