comparison src/video/nanox/SDL_nxmodes.c @ 1895:c121d94672cb

SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 10 Jul 2006 21:04:37 +0000
parents d910939febfa
children 99210400e8b9
comparison
equal deleted inserted replaced
1894:c69cee13dd76 1895:c121d94672cb
26 #include "SDL_config.h" 26 #include "SDL_config.h"
27 27
28 #include "SDL_stdinc.h" 28 #include "SDL_stdinc.h"
29 #include "SDL_nxmodes_c.h" 29 #include "SDL_nxmodes_c.h"
30 30
31 SDL_Rect ** NX_ListModes (_THIS, SDL_PixelFormat * format, Uint32 flags) 31 SDL_Rect **
32 NX_ListModes(_THIS, SDL_PixelFormat * format, Uint32 flags)
32 { 33 {
33 if (flags & SDL_FULLSCREEN) 34 if (flags & SDL_FULLSCREEN)
34 return SDL_modelist ; 35 return SDL_modelist;
35 36
36 if (SDL_Visual.bpp == format -> BitsPerPixel) { 37 if (SDL_Visual.bpp == format->BitsPerPixel) {
37 return ((SDL_Rect **) -1) ; 38 return ((SDL_Rect **) - 1);
38 } else { 39 } else {
39 return ((SDL_Rect **) 0) ; 40 return ((SDL_Rect **) 0);
40 } 41 }
41 } 42 }
42 43
43 void NX_FreeVideoModes (_THIS) 44 void
45 NX_FreeVideoModes(_THIS)
44 { 46 {
45 int i ; 47 int i;
46 48
47 if (SDL_modelist) { 49 if (SDL_modelist) {
48 for (i = 0; SDL_modelist [i]; ++ i) { 50 for (i = 0; SDL_modelist[i]; ++i) {
49 SDL_free (SDL_modelist [i]) ; 51 SDL_free(SDL_modelist[i]);
50 } 52 }
51 SDL_free (SDL_modelist) ; 53 SDL_free(SDL_modelist);
52 SDL_modelist = NULL; 54 SDL_modelist = NULL;
53 } 55 }
54 } 56 }
55 57
56 int NX_EnterFullScreen (_THIS) 58 int
59 NX_EnterFullScreen(_THIS)
57 { 60 {
58 if (! currently_fullscreen) { 61 if (!currently_fullscreen) {
59 GR_SCREEN_INFO si ; 62 GR_SCREEN_INFO si;
60 63
61 GrGetScreenInfo (& si) ; 64 GrGetScreenInfo(&si);
62 GrResizeWindow (FSwindow, si.cols, si.rows) ; 65 GrResizeWindow(FSwindow, si.cols, si.rows);
63 GrUnmapWindow (SDL_Window) ; 66 GrUnmapWindow(SDL_Window);
64 GrMapWindow (FSwindow) ; 67 GrMapWindow(FSwindow);
65 GrRaiseWindow (FSwindow) ; 68 GrRaiseWindow(FSwindow);
66 GrSetFocus (FSwindow) ; 69 GrSetFocus(FSwindow);
67 currently_fullscreen = 1 ; 70 currently_fullscreen = 1;
68 } 71 }
69 72
70 return 1 ; 73 return 1;
71 } 74 }
72 75
73 int NX_LeaveFullScreen (_THIS) 76 int
77 NX_LeaveFullScreen(_THIS)
74 { 78 {
75 if (currently_fullscreen) { 79 if (currently_fullscreen) {
76 GrUnmapWindow (FSwindow) ; 80 GrUnmapWindow(FSwindow);
77 GrMapWindow (SDL_Window) ; 81 GrMapWindow(SDL_Window);
78 GrRaiseWindow (SDL_Window) ; 82 GrRaiseWindow(SDL_Window);
79 GrSetFocus (SDL_Window) ; 83 GrSetFocus(SDL_Window);
80 currently_fullscreen = 0 ; 84 currently_fullscreen = 0;
81 } 85 }
82 86
83 return 0 ; 87 return 0;
84 } 88 }
89
90 /* vi: set ts=4 sw=4 expandtab: */