[转载]SDL Guide 中文译版

论坛 期权论坛     
匿名技术用户   2021-1-17 10:54   1130   0
<div class="postTitle">
<font face="Courier New"><span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">SDL</span>即<font face="Times New Roman">Simple DirectMedia Layer,类似DirectX,是完整的游戏、多媒体开发包,但不同的是它跨越几乎所有的平台,有各种语言的接口,多种语言的文档,而这一切都是广大志愿者完成的。目前扩展部分还没有正式的文档,以下为核心部分文档的向导部分。</font></font>
</div>
<div class="postText">
<h1>序言</h1>
<h3>关于<span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">SDL</span></h3>
<p><span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">SDL</span>为方便制作能跨跃Linux、BSD、MacOS、Win32和BeOS平台,使用本地高性能媒体接口,并且让您可以只需使用一份源代码级API而设计。<span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">SDL</span>是相当低层的API,但使用它可以让你以极大的灵活性写出完全跨平台的程序。<br><br> SDL:http://www.libsdl.org/</p>
<h3>关于<span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">SDL</span>文档</h3>
<p><span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">SDL</span>doc项目即要重新编写<span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">SDL</span>文档并同步更新。项目组有使用<span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">SDL</span>的志愿者组成。</p>
<p>最新版本可在<a href="http://sdldoc.sourceforge.net/"><font color="#000080">http://<span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">sdl</span>doc.sourceforge.net</font></a>下载</p>
<h3>谢启</h3>
<p>Sam Lantinga, slouken&#64;lib<span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">sdl</span>.org</p>
<p>Martin Donlon, akawaka&#64;skynet.ie</p>
<p>Mattias Engdeg?rd</p>
<p>Julian Peterson</p>
<p>Ken Jordan</p>
<p>Maxim Sobolev</p>
<p>Wesley Poole</p>
<p>Michael Vance</p>
<p>Andreas Umbach</p>
<p>Andreas Hofmeister</p>
<hr>
<h2>第一章 基础</h2>
<h3>初始化</h3>
<p><span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">SDL</span>由八个子系统组成——音频、CDROM、事件处理、文件I/O、游戏杆、线程、记时器和视频。使用前必须调用<span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">SDL</span>_Init或<span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">SDL</span>_InitSubSystem初始化。<span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">SDL</span>_Init必须早于其他所有<span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">SDL</span>调用,它将自动初始化事件处理、文件I/O和线程子系统,并根据参数选择启动其他子系统。例如,初始化缺省和视频子系统:</p>
<pre class="blockcode"><span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">SDL</span>_Init(<span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">SDL</span>_INIT_VIDEO);</pre>
<p>初始化缺省、视频和记时器子系统:</p>
<pre class="blockcode"><span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; COLOR: #ee6600; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffff00; EE6600:">SDL</span>_Init(<span id="highlight_tag" style="PADDING-RIGHT: 0px; PADDING-
分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP