Skip to content

Commit

Permalink
Change #6173: Update SDL driver to use SDL 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolas committed Jan 23, 2019
1 parent ed325ad commit 0a9d162
Show file tree
Hide file tree
Showing 5 changed files with 218 additions and 146 deletions.
2 changes: 1 addition & 1 deletion config.lib
Expand Up @@ -2500,7 +2500,7 @@ detect_sdl() {
sleep 5
fi

detect_pkg_config "$with_sdl" "sdl" "sdl_config" "1.2"
detect_pkg_config "$with_sdl" "sdl2" "sdl_config" "2.0"
}

detect_osx_sdk() {
Expand Down
9 changes: 6 additions & 3 deletions src/crashlog.cpp
Expand Up @@ -269,12 +269,15 @@ char *CrashLog::LogLibraries(char *buffer, const char *last) const

#ifdef WITH_SDL
#ifdef DYNAMICALLY_LOADED_SDL
if (SDL_CALL SDL_Linked_Version != NULL) {
SDL_version linked;
SDL_CALL SDL_GetVersion(&linked);
if (linked != NULL) {
#else
{
#endif
const SDL_version *v = SDL_CALL SDL_Linked_Version();
buffer += seprintf(buffer, last, " SDL: %d.%d.%d\n", v->major, v->minor, v->patch);
SDL_version v;
SDL_CALL SDL_GetVersion(&v);
buffer += seprintf(buffer, last, " SDL: %d.%d.%d\n", v.major, v.minor, v.patch);
}
#endif /* WITH_SDL */

Expand Down
2 changes: 1 addition & 1 deletion src/sdl.cpp
Expand Up @@ -94,7 +94,7 @@ const char *SdlOpen(uint32 x)
}
#endif
if (_sdl_usage++ == 0) {
if (SDL_CALL SDL_Init(x | SDL_INIT_NOPARACHUTE) == -1) return SDL_CALL SDL_GetError();
if (SDL_CALL SDL_Init(x) == -1) return SDL_CALL SDL_GetError();
} else if (x != 0) {
if (SDL_CALL SDL_InitSubSystem(x) == -1) return SDL_CALL SDL_GetError();
}
Expand Down

0 comments on commit 0a9d162

Please sign in to comment.