NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.64
REL="HOME"
TITLE="SDL Library Documentation"
REL="UP"
TITLE="Video"
REL="PREVIOUS"
TITLE="SDL_ListModes"
HREF="sdllistmodes.html"><
LINK
REL="NEXT"
TITLE="SDL_SetVideoMode"
HREF="sdlsetvideomode.html"><
/HEAD
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
CLASS="NAVHEADER"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation<
/TH
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
HREF="sdllistmodes.html"
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
HREF="sdlsetvideomode.html"
ALIGN="LEFT"
NAME="SDLVIDEOMODEOK"
CLASS="REFNAMEDIV"
NAME="AEN797"
>SDL_VideoModeOK -- Check to see if a particular video mode is supported.<
/DIV
CLASS="REFSYNOPSISDIV"
NAME="AEN800"
CLASS="FUNCSYNOPSIS"
NAME="AEN801"
CLASS="FUNCSYNOPSISINFO"
CLASS="FUNCDEF"
CLASS="FSFUNC"
>
(int
width, int
height, int bpp, Uint32 flags
);<
/CODE
CLASS="REFSECT1"
NAME="AEN807"
CLASS="FUNCTION"
CLASS="RETURNVALUE"
>
if the requested mode is not supported under any bit depth, or returns the
bits-per-pixel of the closest available mode with the given
width,
height and requested <
A
HREF="sdlsurface.html"
HREF="sdlsetvideomode.html"
CLASS="FUNCTION"
>The bits-per-pixel
value returned is only a suggested mode. You can usually request and bpp you want when <
A
HREF="sdlsetvideomode.html"
> the video mode and SDL will emulate that
color depth with a shadow video surface.<
/P
CLASS="FUNCTION"
> are the same ones you
HREF="sdlsetvideomode.html"
CLASS="REFSECT1"
NAME="AEN820"
CLASS="PROGRAMLISTING"
>SDL_Surface *screen;
Uint32 bpp;
.
.
.
printf("Checking mode 640x480@16bpp.\n");
bpp=SDL_VideoModeOK(640, 480, 16, SDL_HWSURFACE);
if(!bpp){
printf("Mode not available.\n");
exit(-1);
}
printf("SDL Recommends 640x480@%dbpp.\n", bpp);
screen=SDL_SetVideoMode(640, 480, bpp, SDL_HWSURFACE);
.
CLASS="REFSECT1"
NAME="AEN823"
HREF="sdlsetvideomode.html"
CLASS="FUNCTION"
>,
HREF="sdlgetvideoinfo.html"
CLASS="FUNCTION"
CLASS="NAVFOOTER"
ALIGN="LEFT"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
WIDTH="33%"
ALIGN="left"
VALIGN="top"
HREF="sdllistmodes.html"
WIDTH="34%"
ALIGN="center"
VALIGN="top"
HREF="index.html"
WIDTH="33%"
ALIGN="right"
VALIGN="top"
HREF="sdlsetvideomode.html"
WIDTH="33%"
ALIGN="left"
VALIGN="top"
WIDTH="34%"
ALIGN="center"
VALIGN="top"
HREF="video.html"
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>