void setfullscreen(bool enable)
{
    if(!screen) return;
#if defined(WIN32) || defined(__APPLE__)
    initwarning(enable ? "fullscreen" : "windowed");
#else
    if(enable == !(screen->flags&SDL_FULLSCREEN))
    {
        SDL_WM_ToggleFullScreen(screen);
        inputgrab(grabinput);
    }
#endif
}
예제 #2
0
void setfullscreen(bool enable, bool force)
{
    if(!screen) return;
    fullscreen = enable ? 1 : 0;
#if defined(WIN32) || defined(__APPLE__)
    initwarning(enable ? "fullscreen" : "windowed", INIT_RESET, CHANGE_GFX, force);
#else
    if(enable == !(screen->flags&SDL_FULLSCREEN))
    {
        SDL_WM_ToggleFullScreen(screen);
        inputgrab(grabinput!=0);
    }
#endif
}
예제 #3
0
void keyrepeat(bool on)
{
    SDL_EnableKeyRepeat(on ? SDL_DEFAULT_REPEAT_DELAY : 0, SDL_DEFAULT_REPEAT_INTERVAL);
}

void inputgrab(bool on)
{
#ifndef WIN32
    if(!(screen->flags & SDL_FULLSCREEN)) SDL_WM_GrabInput(SDL_GRAB_OFF);
    else
#endif
    SDL_WM_GrabInput(on ? SDL_GRAB_ON : SDL_GRAB_OFF);
    showcursor(!on);
}

VARF(0, grabinput, 0, 0, 1, inputgrab(grabinput!=0));
VAR(IDF_PERSIST, autograbinput, 0, 1, 1);

extern void cleargamma();

void cleanup()
{
    recorder::stop();
    cleanupserver();
    showcursor(true);
//#ifdef FAKESHOWCURSOR
//    if(scursor) SDL_FreeCursor(scursor);
//    scursor = ncursor = NULL;
//#endif
    SDL_WM_GrabInput(SDL_GRAB_OFF);
    cleargamma();