⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sdlsetvideomode.html

📁 VC5.6.7的一个扩展库。跟DirectX的功能差不多。
💻 HTML
字号:
<HTML><HEAD><TITLE>SDL_SetVideoMode</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="SDL Library Documentation"HREF="index.html"><LINKREL="UP"TITLE="Video"HREF="video.html"><LINKREL="PREVIOUS"TITLE="SDL_VideoModeOK"HREF="sdlvideomodeok.html"><LINKREL="NEXT"TITLE="SDL_UpdateRect"HREF="sdlupdaterect.html"></HEAD><BODYCLASS="REFENTRY"BGCOLOR="#FFF8DC"TEXT="#000000"LINK="#0000ee"VLINK="#551a8b"ALINK="#ff0000"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">SDL Library Documentation</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="sdlvideomodeok.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="sdlupdaterect.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><H1><ANAME="SDLSETVIDEOMODE"></A>SDL_SetVideoMode</H1><DIVCLASS="REFNAMEDIV"><ANAME="AEN1239"></A><H2>Name</H2>SDL_SetVideoMode&nbsp;--&nbsp;Set up a video mode with the specified width, height and bits-per-pixel.</DIV><DIVCLASS="REFSYNOPSISDIV"><ANAME="AEN1242"></A><H2>Synopsis</H2><DIVCLASS="FUNCSYNOPSIS"><ANAME="AEN1243"></A><P></P><PRECLASS="FUNCSYNOPSISINFO">#include "SDL.h"</PRE><P><CODE><CODECLASS="FUNCDEF">SDL_Surface *<BCLASS="FSFUNC">SDL_SetVideoMode</B></CODE>(int width, int height, int bpp, Uint32 flags);</CODE></P><P></P></DIV></DIV><DIVCLASS="REFSECT1"><ANAME="AEN1249"></A><H2>Description</H2><P>Set up a video mode with the specified width, height and bits-per-pixel.</P><P>If <TTCLASS="PARAMETER"><I>bpp</I></TT> is 0, it is treated as the current display bits per pixel.</P><P>The <TTCLASS="PARAMETER"><I>flags</I></TT> parameter is the same as the <TTCLASS="STRUCTFIELD"><I>flags</I></TT> field of the <AHREF="sdlsurface.html"><SPANCLASS="STRUCTNAME">SDL_Surface</SPAN></A> structure. OR'd combinations of the following values are valid.</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN1259"></A><P></P><TABLEBORDER="1"CLASS="CALSTABLE"><TBODY><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="LITERAL">SDL_SWSURFACE</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Create the video surface in system memory</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="LITERAL">SDL_HWSURFACE</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Create the video surface in video memory</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="LITERAL">SDL_ASYNCBLIT</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Enables the use of asynchronous updates of the display surface. This willusually slow down blitting on single CPU machines, but may provide a speedincrease on SMP systems.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="LITERAL">SDL_ANYFORMAT</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Normally, if a video surface of the requested bits-per-pixel (<TTCLASS="PARAMETER"><I>bpp</I></TT>) is not available, SDL will emulate one with a shadow surface. Passing <TTCLASS="LITERAL">SDL_ANYFORMAT</TT> prevents this and causes SDL to use the video surface, regardless of its pixel depth.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="LITERAL">SDL_HWPALETTE</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Give SDL exclusive palette access. Without this flag you may not always get the the colors you request with <AHREF="sdlsetcolors.html"><TTCLASS="FUNCTION">SDL_SetColors</TT></A> or <AHREF="sdlsetpalette.html"><TTCLASS="FUNCTION">SDL_SetPalette</TT></A>.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="LITERAL">SDL_DOUBLEBUF</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Enable hardware double buffering; only valid with SDL_HWSURFACE. Calling<AHREF="sdlflip.html"><TTCLASS="FUNCTION">SDL_Flip</TT></A> will flip thebuffers and update the screen. All drawing will take place on the surfacethat is not displayed at the moment. If double buffering could not be enabledthen <TTCLASS="FUNCTION">SDL_Flip</TT> will just perform a<AHREF="sdlupdaterect.html"><TTCLASS="FUNCTION">SDL_UpdateRect</TT></A>on the entire screen.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="LITERAL">SDL_FULLSCREEN</TT></TD><TDALIGN="LEFT"VALIGN="TOP">SDL will attempt to use a fullscreen mode. If a hardware resolution change isnot possible (for whatever reason), the next higher resolution will be used andthe display window centered on a black background.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="LITERAL">SDL_OPENGL</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Create an OpenGL rendering context. You should have previously set OpenGL video attributes with <AHREF="sdlglsetattribute.html"><TTCLASS="FUNCTION">SDL_GL_SetAttribute</TT></A>.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="LITERAL">SDL_OPENGLBLIT</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Create an OpenGL rendering context, like above, but allow normal blittingoperations. The screen (2D) surface may have an alpha channel, and<AHREF="sdlupdaterects.html"><TTCLASS="FUNCTION">SDL_UpdateRects</TT></A>must be used for updating changes to the screen surface. NOTE: This optionis kept for compatibility only, and is <SPANCLASS="emphasis"><ICLASS="EMPHASIS">not</I></SPAN> recommended fornew code.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="LITERAL">SDL_RESIZABLE</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Create a resizable window. When the window is resized by the user a <AHREF="sdlresizeevent.html"><TTCLASS="LITERAL">SDL_VIDEORESIZE</TT></A> event is generated and <TTCLASS="FUNCTION">SDL_SetVideoMode</TT> can be called again with the new size.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="LITERAL">SDL_NOFRAME</TT></TD><TDALIGN="LEFT"VALIGN="TOP">If possible, <TTCLASS="LITERAL">SDL_NOFRAME</TT> causes SDL to create a window with no title bar or frame decoration. Fullscreen modes automatically have this flag set.</TD></TR></TBODY></TABLE><P></P></DIV><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>Note: </B>Whatever <TTCLASS="PARAMETER"><I>flags</I></TT> <TTCLASS="FUNCTION">SDL_SetVideoMode</TT> could satisfy are set in the <TTCLASS="STRUCTFIELD"><I>flags</I></TT> member of the returned surface.</P></BLOCKQUOTE></DIV><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>Note: </B>The <TTCLASS="PARAMETER"><I>bpp</I></TT> parameter is the number of bits per pixel,so a <TTCLASS="PARAMETER"><I>bpp</I></TT> of 24 uses the packed representation of3 bytes/pixel. For the more common 4 bytes/pixel mode, use a<TTCLASS="PARAMETER"><I>bpp</I></TT> of 32. Somewhat oddly, both 15 and 16 willrequest a 2 bytes/pixel mode, but different pixel formats.</P></BLOCKQUOTE></DIV></DIV><DIVCLASS="REFSECT1"><ANAME="AEN1336"></A><H2>Return Value</H2><P>The framebuffer surface, or <SPANCLASS="RETURNVALUE">NULL</SPAN> if it fails.The surface returned is freed by SDL_Quit() and should nt be freed bythe caller.</P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN1340"></A><H2>See Also</H2><P><AHREF="sdllocksurface.html"><TTCLASS="FUNCTION">SDL_LockSurface</TT></A>,<AHREF="sdlsetcolors.html"><TTCLASS="FUNCTION">SDL_SetColors</TT></A>,<AHREF="sdlflip.html"><TTCLASS="FUNCTION">SDL_Flip</TT></A>,<AHREF="sdlsurface.html"><SPANCLASS="STRUCTNAME">SDL_Surface</SPAN></A></P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="sdlvideomodeok.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="index.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="sdlupdaterect.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">SDL_VideoModeOK</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="video.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">SDL_UpdateRect</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -