src/video/nanox/SDL_nxmodes.c
author Sam Lantinga <slouken@libsdl.org>
Sun, 07 Dec 2008 22:37:40 +0000
changeset 2853 6258fa7cd300
parent 1895 c121d94672cb
child 2859 99210400e8b9
permissions -rw-r--r--
Fixed picking blit function when RLE fails
slouken@30
     1
/*
slouken@30
     2
    SDL - Simple DirectMedia Layer
slouken@769
     3
    Copyright (C) 1997-2004 Sam Lantinga
slouken@30
     4
    Copyright (C) 2001  Hsieh-Fu Tsai
slouken@30
     5
slouken@30
     6
    This library is free software; you can redistribute it and/or
slouken@30
     7
    modify it under the terms of the GNU Library General Public
slouken@30
     8
    License as published by the Free Software Foundation; either
slouken@30
     9
    version 2 of the License, or (at your option) any later version.
slouken@30
    10
slouken@30
    11
    This library is distributed in the hope that it will be useful,
slouken@30
    12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@30
    13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@30
    14
    Library General Public License for more details.
slouken@30
    15
slouken@30
    16
    You should have received a copy of the GNU Library General Public
slouken@30
    17
    License along with this library; if not, write to the Free
slouken@30
    18
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
slouken@30
    19
slouken@30
    20
    Sam Lantinga
slouken@252
    21
    slouken@libsdl.org
slouken@30
    22
    
slouken@30
    23
    Hsieh-Fu Tsai
slouken@30
    24
    clare@setabox.com
slouken@30
    25
*/
slouken@1402
    26
#include "SDL_config.h"
slouken@30
    27
slouken@1358
    28
#include "SDL_stdinc.h"
slouken@30
    29
#include "SDL_nxmodes_c.h"
slouken@30
    30
slouken@1895
    31
SDL_Rect **
slouken@1895
    32
NX_ListModes(_THIS, SDL_PixelFormat * format, Uint32 flags)
slouken@30
    33
{
slouken@30
    34
    if (flags & SDL_FULLSCREEN)
slouken@1895
    35
        return SDL_modelist;
slouken@30
    36
slouken@1895
    37
    if (SDL_Visual.bpp == format->BitsPerPixel) {
slouken@1895
    38
        return ((SDL_Rect **) - 1);
slouken@30
    39
    } else {
slouken@1895
    40
        return ((SDL_Rect **) 0);
slouken@30
    41
    }
slouken@30
    42
}
slouken@30
    43
slouken@1895
    44
void
slouken@1895
    45
NX_FreeVideoModes(_THIS)
slouken@30
    46
{
slouken@1895
    47
    int i;
slouken@30
    48
slouken@30
    49
    if (SDL_modelist) {
slouken@1895
    50
        for (i = 0; SDL_modelist[i]; ++i) {
slouken@1895
    51
            SDL_free(SDL_modelist[i]);
slouken@30
    52
        }
slouken@1895
    53
        SDL_free(SDL_modelist);
slouken@30
    54
        SDL_modelist = NULL;
slouken@30
    55
    }
slouken@30
    56
}
slouken@30
    57
slouken@1895
    58
int
slouken@1895
    59
NX_EnterFullScreen(_THIS)
slouken@30
    60
{
slouken@1895
    61
    if (!currently_fullscreen) {
slouken@1895
    62
        GR_SCREEN_INFO si;
slouken@30
    63
slouken@1895
    64
        GrGetScreenInfo(&si);
slouken@1895
    65
        GrResizeWindow(FSwindow, si.cols, si.rows);
slouken@1895
    66
        GrUnmapWindow(SDL_Window);
slouken@1895
    67
        GrMapWindow(FSwindow);
slouken@1895
    68
        GrRaiseWindow(FSwindow);
slouken@1895
    69
        GrSetFocus(FSwindow);
slouken@1895
    70
        currently_fullscreen = 1;
slouken@30
    71
    }
slouken@30
    72
slouken@1895
    73
    return 1;
slouken@30
    74
}
slouken@30
    75
slouken@1895
    76
int
slouken@1895
    77
NX_LeaveFullScreen(_THIS)
slouken@30
    78
{
slouken@30
    79
    if (currently_fullscreen) {
slouken@1895
    80
        GrUnmapWindow(FSwindow);
slouken@1895
    81
        GrMapWindow(SDL_Window);
slouken@1895
    82
        GrRaiseWindow(SDL_Window);
slouken@1895
    83
        GrSetFocus(SDL_Window);
slouken@1895
    84
        currently_fullscreen = 0;
slouken@30
    85
    }
slouken@30
    86
slouken@1895
    87
    return 0;
slouken@30
    88
}
slouken@1895
    89
slouken@1895
    90
/* vi: set ts=4 sw=4 expandtab: */