5131 |
clevermous |
1 |
|
|
|
2 |
> |
|
|
3 |
> |
|
|
4 |
>SDL_ListModes |
|
|
5 |
> |
|
|
6 |
NAME="GENERATOR" |
|
|
7 |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
|
|
8 |
"> |
|
|
9 |
REL="HOME" |
|
|
10 |
TITLE="SDL Library Documentation" |
|
|
11 |
HREF="index.html"> |
|
|
12 |
REL="UP" |
|
|
13 |
TITLE="Video" |
|
|
14 |
HREF="video.html"> |
|
|
15 |
REL="PREVIOUS" |
|
|
16 |
TITLE="SDL_VideoDriverName" |
|
|
17 |
HREF="sdlvideodrivername.html"> |
|
|
18 |
REL="NEXT" |
|
|
19 |
TITLE="SDL_VideoModeOK" |
|
|
20 |
HREF="sdlvideomodeok.html"> |
|
|
21 |
> |
|
|
22 |
CLASS="REFENTRY" |
|
|
23 |
BGCOLOR="#FFF8DC" |
|
|
24 |
TEXT="#000000" |
|
|
25 |
LINK="#0000ee" |
|
|
26 |
VLINK="#551a8b" |
|
|
27 |
ALINK="#ff0000" |
|
|
28 |
> |
|
|
29 |
CLASS="NAVHEADER" |
|
|
30 |
>
|
|
31 |
WIDTH="100%" |
|
|
32 |
BORDER="0" |
|
|
33 |
CELLPADDING="0" |
|
|
34 |
CELLSPACING="0" |
|
|
35 |
>
|
|
36 |
> | |
|
|
37 |
COLSPAN="3" |
|
|
38 |
ALIGN="center" |
|
|
39 |
>SDL Library Documentation |
|
|
40 |
> | |
|
|
41 |
>
|
|
42 |
> |
|
|
|
43 |
WIDTH="10%" |
|
|
44 |
ALIGN="left" |
|
|
45 |
VALIGN="bottom" |
|
|
46 |
> |
|
|
47 |
HREF="sdlvideodrivername.html" |
|
|
48 |
>Prev |
|
|
49 |
> |
|
|
50 |
> |
|
|
|
51 |
WIDTH="80%" |
|
|
52 |
ALIGN="center" |
|
|
53 |
VALIGN="bottom" |
|
|
54 |
> |
|
|
55 |
> |
|
|
|
56 |
WIDTH="10%" |
|
|
57 |
ALIGN="right" |
|
|
58 |
VALIGN="bottom" |
|
|
59 |
> |
|
|
60 |
HREF="sdlvideomodeok.html" |
|
|
61 |
>Next |
|
|
62 |
> |
|
|
63 |
> | |
|
|
64 |
> | |
|
|
65 |
>
|
|
|
66 |
ALIGN="LEFT" |
|
|
67 |
WIDTH="100%"> |
|
|
68 |
> |
|
|
69 |
> |
|
|
70 |
NAME="SDLLISTMODES" |
|
|
71 |
>SDL_ListModes |
|
|
72 |
> |
|
|
73 |
> |
|
|
74 |
CLASS="REFNAMEDIV" |
|
|
75 |
> |
|
|
76 |
NAME="AEN754" |
|
|
77 |
> |
|
|
78 |
> |
|
|
79 |
>Name |
|
|
80 |
>SDL_ListModes -- Returns a pointer to an array of available screen dimensions for |
|
|
81 |
the given format and video flags |
|
|
82 |
> |
|
|
83 |
CLASS="REFSYNOPSISDIV" |
|
|
84 |
> |
|
|
85 |
NAME="AEN757" |
|
|
86 |
> |
|
|
87 |
> |
|
|
88 |
>Synopsis |
|
|
89 |
> |
|
|
90 |
CLASS="FUNCSYNOPSIS" |
|
|
91 |
> |
|
|
92 |
NAME="AEN758" |
|
|
93 |
> |
|
|
94 |
> |
|
|
95 |
> |
|
|
96 |
> |
|
|
97 |
CLASS="FUNCSYNOPSISINFO" |
|
|
98 |
>#include "SDL.h" |
|
|
99 |
> |
|
|
100 |
>
|
|
|
101 |
>
|
|
|
102 |
CLASS="FUNCDEF" |
|
|
103 |
>SDL_Rect ** |
|
|
104 |
CLASS="FSFUNC" |
|
|
105 |
>SDL_ListModes |
|
|
106 |
> |
|
|
107 |
>(SDL_PixelFormat *format, Uint32 flags); |
|
|
108 |
> |
|
|
109 |
> |
|
|
110 |
> |
|
|
111 |
> |
|
|
112 |
> |
|
|
113 |
> |
|
|
114 |
CLASS="REFSECT1" |
|
|
115 |
> |
|
|
116 |
NAME="AEN764" |
|
|
117 |
> |
|
|
118 |
> |
|
|
119 |
>Description |
|
|
120 |
> |
|
|
121 |
>Return a pointer to an array of available screen dimensions for the given |
|
|
122 |
format and video flags, sorted largest to smallest. Returns |
|
|
123 |
|
|
|
124 |
CLASS="LITERAL" |
|
|
125 |
>NULL |
|
|
126 |
> if there are no dimensions available for a particular |
|
|
127 |
format, or |
|
|
128 |
CLASS="RETURNVALUE" |
|
|
129 |
>-1 |
|
|
130 |
> if any dimension is okay for |
|
|
131 |
the given format. |
|
|
132 |
> |
|
|
133 |
>If |
|
|
134 |
CLASS="PARAMETER" |
|
|
135 |
> |
|
|
136 |
>format |
|
|
137 |
> |
|
|
138 |
> is |
|
|
139 |
CLASS="LITERAL" |
|
|
140 |
>NULL |
|
|
141 |
>, the mode list |
|
|
142 |
will be for the format returned by |
|
|
143 |
HREF="sdlgetvideoinfo.html" |
|
|
144 |
>SDL_GetVideoInfo() |
|
|
145 |
>-> |
|
|
146 |
CLASS="STRUCTFIELD" |
|
|
147 |
> |
|
|
148 |
>vfmt |
|
|
149 |
> |
|
|
150 |
>. The |
|
|
151 |
CLASS="PARAMETER" |
|
|
152 |
> |
|
|
153 |
>flag |
|
|
154 |
> |
|
|
155 |
> parameter is an OR'd combination of |
|
|
156 |
HREF="sdlsurface.html" |
|
|
157 |
>surface |
|
|
158 |
> flags. The flags are the same as those used |
|
|
159 |
HREF="sdlsetvideomode.html" |
|
|
160 |
> |
|
|
161 |
CLASS="FUNCTION" |
|
|
162 |
>SDL_SetVideoMode |
|
|
163 |
> |
|
|
164 |
> and they play a strong role in deciding what modes are valid. For instance, if you pass |
|
|
165 |
CLASS="LITERAL" |
|
|
166 |
>SDL_HWSURFACE |
|
|
167 |
> as a flag only modes that support hardware video surfaces will be returned. |
|
|
168 |
> |
|
|
169 |
> |
|
|
170 |
CLASS="REFSECT1" |
|
|
171 |
> |
|
|
172 |
NAME="AEN779" |
|
|
173 |
> |
|
|
174 |
> |
|
|
175 |
>Example |
|
|
176 |
> |
|
|
177 |
CLASS="PROGRAMLISTING" |
|
|
178 |
>SDL_Rect **modes; |
|
|
179 |
int i; |
|
|
180 |
. |
|
|
181 |
. |
|
|
182 |
. |
|
|
183 |
|
|
|
184 |
/* Get available fullscreen/hardware modes */ |
|
|
185 |
modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE); |
|
|
186 |
|
|
|
187 |
/* Check is there are any modes available */ |
|
|
188 |
if(modes == (SDL_Rect **)0){ |
|
|
189 |
printf("No modes available!\n"); |
|
|
190 |
exit(-1); |
|
|
191 |
} |
|
|
192 |
|
|
|
193 |
/* Check if or resolution is restricted */ |
|
|
194 |
if(modes == (SDL_Rect **)-1){ |
|
|
195 |
printf("All resolutions available.\n"); |
|
|
196 |
} |
|
|
197 |
else{ |
|
|
198 |
/* Print valid modes */ |
|
|
199 |
printf("Available Modes\n"); |
|
|
200 |
for(i=0;modes[i];++i) |
|
|
201 |
printf(" %d x %d\n", modes[i]->w, modes[i]->h); |
|
|
202 |
} |
|
|
203 |
. |
|
|
204 |
. |
|
|
205 |
> |
|
|
206 |
> |
|
|
207 |
CLASS="REFSECT1" |
|
|
208 |
> |
|
|
209 |
NAME="AEN782" |
|
|
210 |
> |
|
|
211 |
> |
|
|
212 |
>See Also |
|
|
213 |
> |
|
|
214 |
> |
|
|
215 |
HREF="sdlsetvideomode.html" |
|
|
216 |
> |
|
|
217 |
CLASS="FUNCTION" |
|
|
218 |
>SDL_SetVideoMode |
|
|
219 |
> |
|
|
220 |
>, |
|
|
221 |
|
|
|
222 |
HREF="sdlgetvideoinfo.html" |
|
|
223 |
> |
|
|
224 |
CLASS="FUNCTION" |
|
|
225 |
>SDL_GetVideoInfo |
|
|
226 |
> |
|
|
227 |
>, |
|
|
228 |
|
|
|
229 |
HREF="sdlrect.html" |
|
|
230 |
> |
|
|
231 |
CLASS="STRUCTNAME" |
|
|
232 |
>SDL_Rect |
|
|
233 |
> |
|
|
234 |
>, |
|
|
235 |
|
|
|
236 |
HREF="sdlpixelformat.html" |
|
|
237 |
> |
|
|
238 |
CLASS="STRUCTNAME" |
|
|
239 |
>SDL_PixelFormat |
|
|
240 |
> |
|
|
241 |
> |
|
|
242 |
> |
|
|
243 |
> |
|
|
244 |
CLASS="NAVFOOTER" |
|
|
245 |
>
|
|
|
246 |
ALIGN="LEFT" |
|
|
247 |
WIDTH="100%"> |
|
|
299 |
> |
|
|
300 |
> |
|
|
301 |
> |
|
|
302 |
> |