src/video/nanox/SDL_nxmodes.c
author Ryan C. Gordon <icculus@icculus.org>
Fri, 06 Jan 2006 13:20:10 +0000
changeset 1234 73676c1f56ee
parent 769 b8d311d90021
child 1338 604d73db6802
permissions -rw-r--r--
For sanity's sake, removed the '&' when passing copy_row array to asm.
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@30
    26
slouken@30
    27
#include <stdlib.h>
slouken@30
    28
slouken@30
    29
#include "SDL_nxmodes_c.h"
slouken@30
    30
slouken@30
    31
SDL_Rect ** NX_ListModes (_THIS, SDL_PixelFormat * format, Uint32 flags)
slouken@30
    32
{
slouken@30
    33
    if (flags & SDL_FULLSCREEN)
slouken@30
    34
        return SDL_modelist ;
slouken@30
    35
slouken@30
    36
    if (SDL_Visual.bpp == format -> BitsPerPixel) {
slouken@30
    37
        return ((SDL_Rect **) -1) ;
slouken@30
    38
    } else {
slouken@30
    39
        return ((SDL_Rect **) 0) ;
slouken@30
    40
    }
slouken@30
    41
}
slouken@30
    42
slouken@30
    43
void NX_FreeVideoModes (_THIS)
slouken@30
    44
{
slouken@30
    45
    int i ;
slouken@30
    46
slouken@30
    47
    if (SDL_modelist) {
slouken@30
    48
        for (i = 0; SDL_modelist [i]; ++ i) {
slouken@30
    49
            free (SDL_modelist [i]) ;
slouken@30
    50
        }
slouken@30
    51
        free (SDL_modelist) ;
slouken@30
    52
        SDL_modelist = NULL;
slouken@30
    53
    }
slouken@30
    54
}
slouken@30
    55
slouken@30
    56
int NX_EnterFullScreen (_THIS)
slouken@30
    57
{
slouken@30
    58
    if (! currently_fullscreen) {
slouken@30
    59
        GR_SCREEN_INFO si ;
slouken@30
    60
slouken@30
    61
        GrGetScreenInfo (& si) ;
slouken@30
    62
        GrResizeWindow (FSwindow, si.cols, si.rows) ;
slouken@30
    63
        GrUnmapWindow (SDL_Window) ;
slouken@30
    64
        GrMapWindow (FSwindow) ;
slouken@30
    65
        GrRaiseWindow (FSwindow) ;
slouken@30
    66
        GrSetFocus (FSwindow) ;
slouken@30
    67
        currently_fullscreen = 1 ;      
slouken@30
    68
    }
slouken@30
    69
slouken@30
    70
    return 1 ;
slouken@30
    71
}
slouken@30
    72
slouken@30
    73
int NX_LeaveFullScreen (_THIS)
slouken@30
    74
{
slouken@30
    75
    if (currently_fullscreen) {
slouken@30
    76
        GrUnmapWindow (FSwindow) ;
slouken@30
    77
        GrMapWindow (SDL_Window) ;
slouken@30
    78
        GrRaiseWindow (SDL_Window) ;
slouken@30
    79
        GrSetFocus (SDL_Window) ;
slouken@30
    80
        currently_fullscreen = 0 ;
slouken@30
    81
    }
slouken@30
    82
slouken@30
    83
    return 0 ;
slouken@30
    84
}