mirror of
https://github.com/love2d/megasource.git
synced 2026-08-19 12:14:41 +02:00
Upgrade to SDL2.0.2 (8393682d9d96d1516831a397290cb34ceb82129f).
This commit is contained in:
@@ -421,8 +421,10 @@ int
|
||||
SDL_VideoInit(const char *driver_name)
|
||||
{
|
||||
SDL_VideoDevice *video;
|
||||
const char *hint;
|
||||
int index;
|
||||
int i;
|
||||
SDL_bool allow_screensaver;
|
||||
|
||||
/* Check to make sure we don't overwrite '_this' */
|
||||
if (_this != NULL) {
|
||||
@@ -430,7 +432,7 @@ SDL_VideoInit(const char *driver_name)
|
||||
}
|
||||
|
||||
#if !SDL_TIMERS_DISABLED
|
||||
SDL_InitTicks();
|
||||
SDL_TicksInit();
|
||||
#endif
|
||||
|
||||
/* Start the event loop */
|
||||
@@ -504,6 +506,22 @@ SDL_VideoInit(const char *driver_name)
|
||||
_this->DestroyWindowFramebuffer = SDL_DestroyWindowTexture;
|
||||
}
|
||||
|
||||
/* Disable the screen saver by default. This is a change from <= 2.0.1,
|
||||
but most things using SDL are games or media players; you wouldn't
|
||||
want a screensaver to trigger if you're playing exclusively with a
|
||||
joystick, or passively watching a movie. Things that use SDL but
|
||||
function more like a normal desktop app should explicitly reenable the
|
||||
screensaver. */
|
||||
hint = SDL_GetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER);
|
||||
if (hint) {
|
||||
allow_screensaver = SDL_atoi(hint) ? SDL_TRUE : SDL_FALSE;
|
||||
} else {
|
||||
allow_screensaver = SDL_FALSE;
|
||||
}
|
||||
if (!allow_screensaver) {
|
||||
SDL_DisableScreenSaver();
|
||||
}
|
||||
|
||||
/* If we don't use a screen keyboard, turn on text input by default,
|
||||
otherwise programs that expect to get text events without enabling
|
||||
UNICODE input won't get any events.
|
||||
|
||||
Reference in New Issue
Block a user