comparison src/video/nanox/SDL_nxmodes.c @ 30:57bf11a5efd7

Added initial support for Nano-X (thanks Hsieh-Fu!)
author Sam Lantinga <slouken@lokigames.com>
date Fri, 11 May 2001 01:13:35 +0000
parents
children e8157fcb3114
comparison
equal deleted inserted replaced
29:a8360daed17d 30:57bf11a5efd7
1 /*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
4 Copyright (C) 2001 Hsieh-Fu Tsai
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public
17 License along with this library; if not, write to the Free
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
20 Sam Lantinga
21 slouken@devolution.com
22
23 Hsieh-Fu Tsai
24 clare@setabox.com
25 */
26
27 #include <stdlib.h>
28
29 #include "SDL_nxmodes_c.h"
30
31 SDL_Rect ** NX_ListModes (_THIS, SDL_PixelFormat * format, Uint32 flags)
32 {
33 if (flags & SDL_FULLSCREEN)
34 return SDL_modelist ;
35
36 if (SDL_Visual.bpp == format -> BitsPerPixel) {
37 return ((SDL_Rect **) -1) ;
38 } else {
39 return ((SDL_Rect **) 0) ;
40 }
41 }
42
43 void NX_FreeVideoModes (_THIS)
44 {
45 int i ;
46
47 if (SDL_modelist) {
48 for (i = 0; SDL_modelist [i]; ++ i) {
49 free (SDL_modelist [i]) ;
50 }
51 free (SDL_modelist) ;
52 SDL_modelist = NULL;
53 }
54 }
55
56 int NX_EnterFullScreen (_THIS)
57 {
58 if (! currently_fullscreen) {
59 GR_SCREEN_INFO si ;
60
61 GrGetScreenInfo (& si) ;
62 GrResizeWindow (FSwindow, si.cols, si.rows) ;
63 GrUnmapWindow (SDL_Window) ;
64 GrMapWindow (FSwindow) ;
65 GrRaiseWindow (FSwindow) ;
66 GrSetFocus (FSwindow) ;
67 currently_fullscreen = 1 ;
68 }
69
70 return 1 ;
71 }
72
73 int NX_LeaveFullScreen (_THIS)
74 {
75 if (currently_fullscreen) {
76 GrUnmapWindow (FSwindow) ;
77 GrMapWindow (SDL_Window) ;
78 GrRaiseWindow (SDL_Window) ;
79 GrSetFocus (SDL_Window) ;
80 currently_fullscreen = 0 ;
81 }
82
83 return 0 ;
84 }