1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-10-13 10:00:43 +00:00

Apply SDL2 patch by ryan, with some adjustments to apply properly.

The fix as suggested by Jonas Kulla on the mailing list is also in.
There hasn't been any extensive testing, and it may not yet compile
on platforms other than win32.
This commit is contained in:
fgenesis 2013-07-18 23:29:55 +02:00
commit 03f99058c3
8 changed files with 584 additions and 145 deletions

View file

@ -888,7 +888,19 @@ void DSQ::setVersionLabelText()
#ifdef BBGE_BUILD_SDL
static bool sdlVideoModeOK(const int w, const int h, const int bpp)
{
#ifdef BBGE_BUILD_SDL2
SDL_DisplayMode mode;
const int modecount = SDL_GetNumDisplayModes(0);
for (int i = 0; i < modecount; i++) {
SDL_GetDisplayMode(0, i, &mode);
if (!mode.w || !mode.h || (w >= mode.w && h >= mode.h)) {
return true;
}
}
return false;
#else
return SDL_VideoModeOK(w, h, bpp, SDL_OPENGL | SDL_FULLSCREEN);
#endif
}
#endif

View file

@ -157,7 +157,13 @@ static void init()
userAgent = os.str();
if(!worker)
{
#ifdef BBGE_BUILD_SDL2
worker = SDL_CreateThread(_NetworkWorkerThread, "network", NULL);
#else
worker = SDL_CreateThread(_NetworkWorkerThread, NULL);
#endif
}
}
void shutdown()