Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
90 lines (74 loc) · 2.13 KB

SDL_nxmodes.c

File metadata and controls

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