<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SDLTutorials.com</title>
	<atom:link href="http://www.sdltutorials.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sdltutorials.com</link>
	<description>SDL Tutorials - Game Tutorials - Programming Tutorials</description>
	<lastBuildDate>Tue, 20 Jul 2010 19:56:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Keep an eye out&#8230;</title>
		<link>http://www.sdltutorials.com/keep-an-eye-out/</link>
		<comments>http://www.sdltutorials.com/keep-an-eye-out/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 19:48:09 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=481</guid>
		<description><![CDATA[Upgrading to WordPress 3.0 &#8211; let me know if any of you experience any issues. Thanks. Edit: Updated. Everything seem okay?]]></description>
			<content:encoded><![CDATA[<p>Upgrading to WordPress 3.0 &#8211; let me know if any of you experience any issues. Thanks.</p>
<p><b>Edit:</b> Updated. Everything seem okay?</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/-3OJCECgDFo&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/-3OJCECgDFo&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/keep-an-eye-out/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SDL Video Tutorials</title>
		<link>http://www.sdltutorials.com/sdl-video-tutorials/</link>
		<comments>http://www.sdltutorials.com/sdl-video-tutorials/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 10:55:33 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=474</guid>
		<description><![CDATA[I&#8217;m just kind of throwing this idea out there &#8211; but would any of you benefit from video tutorials with me explaining things as each tutorial is coded? As an aside, here&#8217;s a quick plug for Skylar Payne. He has made some video tutorials that you can check out:]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m just kind of throwing this idea out there &#8211; but would any of you benefit from video tutorials with me explaining things as each tutorial is coded?</p>
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
<p>As an aside, here&#8217;s a quick plug for Skylar Payne. He has made some video tutorials that you can check out:</p>
<p><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/dOiGss-ObL0&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/dOiGss-ObL0&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/ypTeAUzGT_k&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ypTeAUzGT_k&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/sdl-video-tutorials/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Contest Ideas Needed</title>
		<link>http://www.sdltutorials.com/contest-ideas-needed-2/</link>
		<comments>http://www.sdltutorials.com/contest-ideas-needed-2/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 10:55:23 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[Contests]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=478</guid>
		<description><![CDATA[The new tutorials are well under way (I&#8217;ve decided to make a side-tutorial for game states, but it&#8217;s tightly integrated into the space shooter tutorial). But while we&#8217;re waiting for that, I think I&#8217;d like to run another contest. But before we get to any sort of contest announcement, I&#8217;d like to get everyone&#8217;s ideas [...]]]></description>
			<content:encoded><![CDATA[<p>The new tutorials are well under way (I&#8217;ve decided to make a side-tutorial for game states, but it&#8217;s tightly integrated into the space shooter tutorial). But while we&#8217;re waiting for that, I think I&#8217;d like to run another contest.  But before we get to any sort of contest announcement, I&#8217;d like to get everyone&#8217;s ideas out there on what we should do. Donations are also welcome that will be pooled directly into a contest prize.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/contest-ideas-needed-2/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>C++ Tip &#8211; Packing Data</title>
		<link>http://www.sdltutorials.com/cpp-tip-packing-data/</link>
		<comments>http://www.sdltutorials.com/cpp-tip-packing-data/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 12:25:19 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[C++ Tips]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=472</guid>
		<description><![CDATA[Here&#8217;s a quick tip that is useful if you are sending data over a network. If you ever messed with any sockets in programming then you know you can only send bytes of data. Why is this problem? Well, you can&#8217;t exactly send over a 4 byte integer in a single 1 byte char. To [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick tip that is useful if you are sending data over a network. If you ever messed with any sockets in programming then you know you can only send bytes of data. Why is this problem? Well, you can&#8217;t exactly send over a 4 byte integer in a single 1 byte char. To get around this, we do something called packing.</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw4">char</span> Buffer<span class="br0">&#91;</span><span class="nu0">3</span><span class="br0">&#93;</span>;<br />
<span class="kw4">int</span> Data = <span class="nu0">1024</span>;</p>
<p><span class="co2">#if SDL_BYTEORDER == SDL_BIG_ENDIAN</span><br />
Buffer<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> = <span class="br0">&#40;</span>Data &gt;&gt; <span class="nu0">24</span><span class="br0">&#41;</span> &amp; 0xFF;<br />
Buffer<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> = <span class="br0">&#40;</span>Data &gt;&gt; <span class="nu0">16</span><span class="br0">&#41;</span> &amp; 0xFF;<br />
Buffer<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span> = <span class="br0">&#40;</span>Data &gt;&gt; &nbsp;<span class="nu0">8</span><span class="br0">&#41;</span> &amp; 0xFF;<br />
Buffer<span class="br0">&#91;</span><span class="nu0">3</span><span class="br0">&#93;</span> = <span class="br0">&#40;</span>Data<span class="br0">&#41;</span> &nbsp; &nbsp; &nbsp; &amp; 0xFF;<br />
<span class="co2">#elseif</span><br />
Buffer<span class="br0">&#91;</span><span class="nu0">3</span><span class="br0">&#93;</span> = <span class="br0">&#40;</span>Data &gt;&gt; <span class="nu0">24</span><span class="br0">&#41;</span> &amp; 0xFF;<br />
Buffer<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span> = <span class="br0">&#40;</span>Data &gt;&gt; <span class="nu0">16</span><span class="br0">&#41;</span> &amp; 0xFF;<br />
Buffer<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> = <span class="br0">&#40;</span>Data &gt;&gt; &nbsp;<span class="nu0">8</span><span class="br0">&#41;</span> &amp; 0xFF;<br />
Buffer<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> = <span class="br0">&#40;</span>Data<span class="br0">&#41;</span> &nbsp; &nbsp; &nbsp; &amp; 0xFF;<br />
<span class="co2">#endif</span><br />
&nbsp;</div>
<p>Now, we can easily send over the Buffer char array. Two things to note here. First, depending on the system you are working on, the endianness can change (to read up on what endianness is, look here: http://en.wikipedia.org/wiki/Endianness) &#8211; that is what the #if SDL_BYTEORDER == SDL_BIG_ENDIAN statement is for. Secondly, we did nothing here to specify if the data being packed is signed or unsigned. You will need to know on the other end what type of data you are receiving.</p>
<p>Here&#8217;s how you can unpack this data:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw4">char</span> Buffer<span class="br0">&#91;</span><span class="nu0">3</span><span class="br0">&#93;</span>;<br />
<span class="kw4">int</span> Data = <span class="nu0">0</span>;</p>
<p><span class="co2">#if SDL_BYTEORDER == SDL_BIG_ENDIAN</span><br />
Data = <span class="br0">&#40;</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="br0">&#40;</span>Uint8 *<span class="br0">&#41;</span>Buffer<span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> &lt;&lt; <span class="nu0">24</span><span class="br0">&#41;</span> | <span class="br0">&#40;</span><span class="br0">&#40;</span><span class="br0">&#40;</span>Uint8 *<span class="br0">&#41;</span>Buffer<span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> &lt;&lt; <span class="nu0">16</span><span class="br0">&#41;</span> | <span class="br0">&#40;</span><span class="br0">&#40;</span><span class="br0">&#40;</span>Uint8 *<span class="br0">&#41;</span>Buffer<span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span> &lt;&lt; &nbsp;<span class="nu0">8</span><span class="br0">&#41;</span> | &nbsp;<span class="br0">&#40;</span><span class="br0">&#40;</span>Uint8 *<span class="br0">&#41;</span>Buffer<span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">3</span><span class="br0">&#93;</span> &lt;&lt; &nbsp;<span class="nu0">0</span><span class="br0">&#41;</span>;<br />
<span class="co2">#elseif</span><br />
Data = <span class="br0">&#40;</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="br0">&#40;</span>Uint8 *<span class="br0">&#41;</span>Buffer<span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">3</span><span class="br0">&#93;</span> &lt;&lt; <span class="nu0">24</span><span class="br0">&#41;</span> | <span class="br0">&#40;</span><span class="br0">&#40;</span><span class="br0">&#40;</span>Uint8 *<span class="br0">&#41;</span>Buffer<span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span> &lt;&lt; <span class="nu0">16</span><span class="br0">&#41;</span> | <span class="br0">&#40;</span><span class="br0">&#40;</span><span class="br0">&#40;</span>Uint8 *<span class="br0">&#41;</span>Buffer<span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> &lt;&lt; &nbsp;<span class="nu0">8</span><span class="br0">&#41;</span> | &nbsp;<span class="br0">&#40;</span><span class="br0">&#40;</span>Uint8 *<span class="br0">&#41;</span>Buffer<span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> &lt;&lt; &nbsp;<span class="nu0">0</span><span class="br0">&#41;</span>;<br />
<span class="co2">#endif</span><br />
&nbsp;</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/cpp-tip-packing-data/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>SDL_ttf 2.0.10 RELEASED!</title>
		<link>http://www.sdltutorials.com/sdl-ttf-2-0-10/</link>
		<comments>http://www.sdltutorials.com/sdl-ttf-2-0-10/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 15:37:20 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[SDL Tutorials]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=470</guid>
		<description><![CDATA[Official SDL announcment: Announcing the latest release of SDL_ttf! http://www.libsdl.org/projects/SDL_ttf/ CHANGES:  * Find the Unicode or symbol character map if it&#8217;s available in the font  * Set the appropriate font styles for bold and italic fonts  * Added font style TTF_STYLE_STRIKETHROUGH  * Fixed size calculations taking outline and underline into account  * Added API for [...]]]></description>
			<content:encoded><![CDATA[<p>Official SDL announcment:</p>
<p>Announcing the latest release of SDL_ttf!</p>
<p>http://www.libsdl.org/projects/SDL_ttf/</p>
<p>CHANGES:<br />
 * Find the Unicode or symbol character map if it&#8217;s available in the font<br />
 * Set the appropriate font styles for bold and italic fonts<br />
 * Added font style TTF_STYLE_STRIKETHROUGH<br />
 * Fixed size calculations taking outline and underline into account<br />
 * Added API for font outlining: TTF_GetFontOutline()/TTF_SetFontOutline()<br />
 * Added API to disable kerning: TTF_GetFontKerning()/TTF_SetFontKerning()<br />
 * Fixed height calculation for fonts that extend below the font height<br />
 * Added access to font hinting: TTF_GetFontHinting()/TTF_SetFontHinting()<br />
 * Added TTF_GlyphIsProvided() to check whether a glyph is in a given font</p>
<p>Thanks to everybody who contributed feedback and patches for this release!<br />
&#8211;<br />
       -Sam Lantinga, Founder and President, Galaxy Gameworks LLC</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/sdl-ttf-2-0-10/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Next Tutorial ???</title>
		<link>http://www.sdltutorials.com/next-tutorial/</link>
		<comments>http://www.sdltutorials.com/next-tutorial/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 18:11:34 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=463</guid>
		<description><![CDATA[I&#8217;m pondering over what tutorial should be next. What do you think should be next? Update: I think it&#8217;s pretty obvious. I&#8217;ll go for making the space shooter the next tutorials. Bits and pieces will be taken from Ace of Space (of course). I may throw in Game States in the same tutorial, or make [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m pondering over what tutorial should be next. What do you think should be next?</p>
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
<p><strong>Update:</strong><br />
I think it&#8217;s pretty obvious. I&#8217;ll go for making the space shooter the next tutorials. Bits and pieces will be taken from Ace of Space (of course). I may throw in Game States in the same tutorial, or make a side tutorial (as it would be relevant here). </p>
<p>Thanks everyone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/next-tutorial/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>C++ Tip &#8211; Literals</title>
		<link>http://www.sdltutorials.com/literals/</link>
		<comments>http://www.sdltutorials.com/literals/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 10:56:44 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[C++ Tips]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=445</guid>
		<description><![CDATA[A common area that people don&#8217;t even know exist in C++, is called literals or literal constants. But even though you may not have heard of the term before, you no doubt have been using them all the time. For example, 2.0f is a float literal, while 2.0 is a double literal. 0&#215;1 is a [...]]]></description>
			<content:encoded><![CDATA[<p>A common area that people don&#8217;t even know exist in C++, is called literals or literal constants. But even though you may not have heard of the term before, you no doubt have been using them all the time. For example, 2.0f is a float literal, while 2.0 is a double literal. 0&#215;1 is a hex int literal, while 0x1L is a long int literal. This is important to remember, especially when precision and data size is involved. You may be losing out on data, and you didn&#8217;t even know you were!</p>
<p>Here&#8217;s a quick table run-down, taken from <a href="http://cpp.comsci.us/etymology/literals.html">http://cpp.comsci.us/etymology/literals.html</a>.</p>
<table border="1" cellspacing="0">
<tr bgcolor="#E8FFFF">
<th>Type&nbsp;</th>
<th>Base&nbsp;</th>
<th>Example&nbsp;</th>
<th>Description&nbsp;</th>
</tr>
<tr bgcolor="#FFFFFF">
<td style="border: 1px #BBBBBB solid;">char *</td>
<td style="border: 1px #BBBBBB solid;">ASCII</td>
<td style="border: 1px #BBBBBB solid;">&#8220;hello&#8221;</td>
<td style="border: 1px #BBBBBB solid;">Any string of characters enclosed in double quotes (&#8220;) (see<br />
Note 1)</td>
</tr>
<tr bgcolor="#EEEEEE">
<td style="border: 1px #BBBBBB solid;">char</td>
<td style="border: 1px #BBBBBB solid;">ASCII</td>
<td style="border: 1px #BBBBBB solid;">&#8217;1&#8242;</td>
<td style="border: 1px #BBBBBB solid;">One character in single quotes (&#8216;)</td>
</tr>
<tr bgcolor="#FFFFFF">
<td style="border: 1px #BBBBBB solid;">unsigned short int</td>
<td style="border: 1px #BBBBBB solid;">ASCII</td>
<td style="border: 1px #BBBBBB solid;">L&#8217;ab&#8217;</td>
<td style="border: 1px #BBBBBB solid;">One or two characters in single quotes (&#8216;), preceded by the<br />
letter L</td>
</tr>
<tr bgcolor="#EEEEEE">
<td style="border: 1px #BBBBBB solid;" rowspan="4">int</td>
<td style="border: 1px #BBBBBB solid;">octal</td>
<td style="border: 1px #BBBBBB solid;">01</td>
<td style="border: 1px #BBBBBB solid;">Any octal number (digits 0-7) beginning with a 0 (zero)</td>
</tr>
<tr bgcolor="#FFFFFF">
<td style="border: 1px #BBBBBB solid;">decimal</td>
<td style="border: 1px #BBBBBB solid;">1</td>
<td style="border: 1px #BBBBBB solid;">Any decimal number (digits 0-9) not beginning with a 0<br />
(zero)</td>
</tr>
<tr bgcolor="#EEEEEE">
<td style="border: 1px #BBBBBB solid;">hexadecimal</td>
<td style="border: 1px #BBBBBB solid;">0&#215;1</td>
<td style="border: 1px #BBBBBB solid;">0X (zero X) or 0x (zero x) followed by any hexadecimal number<br />
(digits 0-F)</td>
</tr>
<tr bgcolor="#FFFFFF">
<td style="border: 1px #BBBBBB solid;">ASCII</td>
<td style="border: 1px #BBBBBB solid;">&#8216;ABC&#8217;</td>
<td style="border: 1px #BBBBBB solid;">Two to four characters in single quotes (&#8216;)</td>
</tr>
<tr bgcolor="#EEEEEE">
<td style="border: 1px #BBBBBB solid; background-color: white;" rowspan="3">unsigned int</td>
<td style="border: 1px #BBBBBB solid;">octal</td>
<td style="border: 1px #BBBBBB solid;">01U</td>
<td style="border: 1px #BBBBBB solid;">Any octal number (digits 0-7) beginning with a 0 (zero) and<br />
followed by U or u</td>
</tr>
<tr bgcolor="#FFFFFF">
<td style="border: 1px #BBBBBB solid;">decimal</td>
<td style="border: 1px #BBBBBB solid;">1U</td>
<td style="border: 1px #BBBBBB solid;">Any decimal number (digits 0-9) not beginning with a 0 (zero)<br />
and followed by U or u</td>
</tr>
<tr bgcolor="#EEEEEE">
<td style="border: 1px #BBBBBB solid;">hexadecimal</td>
<td style="border: 1px #BBBBBB solid;">0x1U</td>
<td style="border: 1px #BBBBBB solid;">0X (zero X) or 0x (zero x) followed by any hexadecimal number<br />
(digits 0-F) and followed by U or u</td>
</tr>
<tr bgcolor="#FFFFFF">
<td style="border: 1px #BBBBBB solid; background-color: #EEEEEE;" rowspan="3">long int</td>
<td style="border: 1px #BBBBBB solid;">octal</td>
<td style="border: 1px #BBBBBB solid;">01L</td>
<td style="border: 1px #BBBBBB solid;">Any octal number (digits 0-7) beginning with a 0 (zero) and<br />
followed by L or l</td>
</tr>
<tr bgcolor="#EEEEEE">
<td style="border: 1px #BBBBBB solid;">decimal</td>
<td style="border: 1px #BBBBBB solid;">1L</td>
<td style="border: 1px #BBBBBB solid;">Any decimal number (digits 0-9) not beginning with a 0 (zero)<br />
and followed by L or l</td>
</tr>
<tr bgcolor="#FFFFFF">
<td style="border: 1px #BBBBBB solid;">hexadecimal</td>
<td style="border: 1px #BBBBBB solid;">0x1L</td>
<td style="border: 1px #BBBBBB solid;">0X (zero X) or 0x (zero x) followed by any hexadecimal number<br />
(digits 0-F) and followed by L or l</td>
</tr>
<tr bgcolor="#EEEEEE">
<td style="border: 1px #BBBBBB solid; background-color: white;" rowspan="3">unsigned long int</td>
<td style="border: 1px #BBBBBB solid;">octal</td>
<td style="border: 1px #BBBBBB solid;">01UL</td>
<td style="border: 1px #BBBBBB solid;">Any octal number (digits 0-7) beginning with a 0 (zero) and<br />
followed by U or u and L or l</td>
</tr>
<tr bgcolor="#FFFFFF">
<td style="border: 1px #BBBBBB solid;">decimal</td>
<td style="border: 1px #BBBBBB solid;">1UL</td>
<td style="border: 1px #BBBBBB solid;">Any decimal number (digits 0-9) not beginning with a 0 (zero)<br />
and followed by U or u and L or l</td>
</tr>
<tr bgcolor="#EEEEEE">
<td style="border: 1px #BBBBBB solid;">hexadecimal</td>
<td style="border: 1px #BBBBBB solid;">0x1UL</td>
<td style="border: 1px #BBBBBB solid;">0X (zero X) or 0x (zero x) followed by any hexadecimal number<br />
(digits 0-F) and followed by U or u and L or l</td>
</tr>
<tr bgcolor="#FFFFFF">
<td style="border: 1px #BBBBBB solid; background-color: #EEEEEE;" rowspan="2">float</td>
<td style="border: 1px #BBBBBB solid;">decimal</td>
<td style="border: 1px #BBBBBB solid;">12.3F</td>
<td style="border: 1px #BBBBBB solid;">Any number (digits 0-9) containing a decimal point (.) and<br />
followed by F or f</td>
</tr>
<tr bgcolor="#EEEEEE">
<td style="border: 1px #BBBBBB solid;">decimal</td>
<td style="border: 1px #BBBBBB solid;">12E1F</td>
<td style="border: 1px #BBBBBB solid;">Any number (digits 0-9) followed by E or e, followed by an<br />
exponent of 10 (12E1 = 12 * 101 = 120.), and followed by F or<br />
f</td>
</tr>
<tr bgcolor="#FFFFFF">
<td style="border: 1px #BBBBBB solid; background-color: white;" rowspan="2">double</td>
<td style="border: 1px #BBBBBB solid;">decimal</td>
<td style="border: 1px #BBBBBB solid;">12.3</td>
<td style="border: 1px #BBBBBB solid;">Any number (digits 0-9) containing a decimal point (.)</td>
</tr>
<tr bgcolor="#EEEEEE">
<td style="border: 1px #BBBBBB solid;">decimal</td>
<td style="border: 1px #BBBBBB solid;">12E1</td>
<td style="border: 1px #BBBBBB solid;">Any number (digits 0-9) followed by E or e and followed by an<br />
exponent of 10 (12E1 = 12 * 101 = 120.)</td>
</tr>
<tr bgcolor="#FFFFFF">
<td style="border: 1px #BBBBBB solid; background-color: #EEEEEE;" rowspan="2">long double</td>
<td style="border: 1px #BBBBBB solid;">decimal</td>
<td style="border: 1px #BBBBBB solid;">12.3L</td>
<td style="border: 1px #BBBBBB solid;">Any number (digits 0-9) containing a decimal point (.) and<br />
followed by L or l</td>
</tr>
<tr bgcolor="#EEEEEE">
<td style="border: 1px #BBBBBB solid;">decimal</td>
<td style="border: 1px #BBBBBB solid;">12E1L</td>
<td style="border: 1px #BBBBBB solid;">Any number (digits 0-9) followed by E or e, followed by an<br />
exponent of 10 (12E1 = 12 * 101 = 120.), and followed by L or<br />
l</td>
</tr>
<tr>
<td colspan="4" bgcolor="#E8FFFF"><b>Notes:</b><br />
String constants are stored as the literal characters followed<br />
by a byte of binary 0.&nbsp; The value returned is a pointer to the<br />
first character.&nbsp;
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/literals/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SDL + OpenGL Tutorial Basics</title>
		<link>http://www.sdltutorials.com/sdl-opengl-tutorial-basics/</link>
		<comments>http://www.sdltutorials.com/sdl-opengl-tutorial-basics/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 16:25:18 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[SDL + OpenGL Tutorials]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=435</guid>
		<description><![CDATA[In this new tutorial series, we will be looking at using SDL along with OpenGL. SDL as it stands is nice for basic 2D graphics/composition, but when it comes to more intensive gaming applications or 3D graphics, we need to leverage the use of other libraries. SDL works so well with OpenGL because we can [...]]]></description>
			<content:encoded><![CDATA[<p>In this new tutorial series, we will be looking at using SDL along with OpenGL. SDL as it stands is nice for basic 2D graphics/composition, but when it comes to more intensive gaming applications or 3D graphics, we need to leverage the use of other libraries. SDL works so well with OpenGL because we can use OpenGL to manage only graphical rendering, and leave SDL for everything else (Events, Window management, etc).</p>
<p><span id="more-435"></span></p>
<p>So, lets get started. We&#8217;ll be basing our code off of the &#8220;<a href="/sdl-tutorial-basics/">SDL Tutorial Basics</a>&#8221; tutorial &#8211; so head on over there first if you haven&#8217;t had a chance to look at it. Primarily what we&#8217;ll be doing here is making any necessary changes to the code for use with OpenGL. What&#8217;s nice about SDL is that it provides an easy way to setup OpenGL. On the technical side of things, whenever a window is created on an operating system, an OpenGL context must also be created (with certain properties) and linked to that window. SDL makes this rather easy for us. </p>
<p>Before we get started with modifying our code, open up your project file (the one from SDL Tutorial Basics). Because we are using another library now, we are going to need to link to it. So, open up your Project Properties, and add &#8220;opengl32&#8243;, &#8220;glu32&#8243; to your linker settings (this is the same area that has mingw32, SDLmain, SDL). If you are another operating system besides Windows, your library names will most likely be &#8220;opengl&#8221;, &#8220;glu.&#8221; Most people already have the OpenGL library installed (as it usually comes with CodeBlocks). If you don&#8217;t, make sure you downloaded the CodeBlocks with mingw. If you are on some Linux flavor, try installing <a href="http://www.mesa3d.org/">Mesa</a>. Also, as a last note, put the new libraries after the SDL libraries.</p>
<p>That&#8217;s it for project settings, lets move on to modifying our code. Open up CApp.h and include our OpenGL header file.</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="co2">#ifndef _CAPP_H_</span><br />
&nbsp; &nbsp; <span class="co2">#define _CAPP_H_</span></p>
<p><span class="co2">#include &lt;SDL.h&gt;</span><br />
<span class="co2">#include &lt;gl/gl.h&gt;</span><br />
<span class="co2">#include &lt;gl/glu.h&gt;</span></p>
<p><span class="co1">// &#8230; other code below</span><br />
&nbsp;</div>
<p><br/></p>
<p>If you are wondering what the difference between gl and glu, gl contains the primary functions from the OpenGL specification, and glu contains several helper/utility functions for creating complex shapes, moving the camera, etc. So now that we have that, lets actually get OpenGL up and running. Open up CApp_OnInit.cpp. Right now this is what we have:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="co2">#include &quot;CApp.h&quot;</span></p>
<p><span class="kw4">bool</span> CApp::<span class="me2">OnInit</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>SDL_Init<span class="br0">&#40;</span>SDL_INIT_EVERYTHING<span class="br0">&#41;</span> &lt; <span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="br0">&#40;</span>Surf_Display = SDL_SetVideoMode<span class="br0">&#40;</span><span class="nu0">640</span>, <span class="nu0">480</span>, <span class="nu0">32</span>, SDL_HWSURFACE | SDL_DOUBLEBUF<span class="br0">&#41;</span><span class="br0">&#41;</span> == <span class="kw2">NULL</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">true</span>;<br />
<span class="br0">&#125;</span><br />
&nbsp;</div>
<p><br/></p>
<p>The first thing we need to do is tell SDL that we are going to be using OpenGL. Thankfully, SDL provides an easy way to do this. Add the flag SDL_OPENGL just after SDL_DOUBLEBUF, and change SDL_DOUBLEBUF to SDL_GL_DOUBLEBUFFER:</p>
<div class="dean_ch" style="white-space: wrap;">
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="br0">&#40;</span>Surf_Display = SDL_SetVideoMode<span class="br0">&#40;</span><span class="nu0">640</span>, <span class="nu0">480</span>, <span class="nu0">32</span>, SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER | SDL_OPENGL<span class="br0">&#41;</span><span class="br0">&#41;</span> == <span class="kw2">NULL</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp;</div>
<p><br/></p>
<p>Now, there are several settings you can set for OpenGL. By default, most are fine just as is, but I want to make you aware of them:</p>
<div class="dean_ch" style="white-space: wrap;">
SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_RED_SIZE, &nbsp; &nbsp;&nbsp; &nbsp; <span class="nu0">8</span><span class="br0">&#41;</span>;<br />
SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_GREEN_SIZE, &nbsp;&nbsp; &nbsp; <span class="nu0">8</span><span class="br0">&#41;</span>;<br />
SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_BLUE_SIZE, &nbsp; &nbsp; &nbsp; <span class="nu0">8</span><span class="br0">&#41;</span>;<br />
SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_ALPHA_SIZE, &nbsp;&nbsp; &nbsp; <span class="nu0">8</span><span class="br0">&#41;</span>;</p>
<p>SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_DEPTH_SIZE, &nbsp;&nbsp; &nbsp; <span class="nu0">16</span><span class="br0">&#41;</span>;<br />
SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_BUFFER_SIZE,&nbsp;&nbsp; &nbsp; <span class="nu0">32</span><span class="br0">&#41;</span>;</p>
<p>SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_ACCUM_RED_SIZE,&nbsp; <span class="nu0">8</span><span class="br0">&#41;</span>;<br />
SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_ACCUM_GREEN_SIZE,&nbsp; &nbsp; <span class="nu0">8</span><span class="br0">&#41;</span>;<br />
SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_ACCUM_BLUE_SIZE,&nbsp;<span class="nu0">8</span><span class="br0">&#41;</span>;<br />
SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_ACCUM_ALPHA_SIZE,&nbsp; &nbsp; <span class="nu0">8</span><span class="br0">&#41;</span>;</p>
<p>SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_MULTISAMPLEBUFFERS, &nbsp;<span class="nu0">1</span><span class="br0">&#41;</span>;<br />
SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_MULTISAMPLESAMPLES, &nbsp;<span class="nu0">2</span><span class="br0">&#41;</span>;<br />
&nbsp;</div>
<p><br/></p>
<p>These are all basic memory sizes for how much data OpenGL will store (except SDL_GL_MULTISAMPLEBUFFERS/SDL_GL_MULTISAMPLESAMPLES, those are for something else). By increasing these, you will effectively increase how much memory OpenGL will use for color information, and the buffer. As I mentioned before, the default on all of these is usually just fine. If you wish to set these, the values I have up above are pretty good. Be sure to call SDL_GL_SetAttribute <u>before</u> calling SDL_SetVideoMode. One thing I want to mention is on SDL_GL_MULTISAMPLEBUFFERS. This is basically your anti-aliasing flag. By turning this on, you are turning on anti-aliasing. SDL_GL_MULTISAMPLESAMPLES is how much to anti-alias. A value of 2 is pretty standard if turned on, 4 is also commonly used. Just keep in mind that this can be resource intensive for some systems. Also, not every computer is able to perform anti-aliasing. And one last note! Make sure your SDL_GL_DEPTH_SIZE is a power of two (16, 32 works), otherwise anti-aliasing may not work for you.</p>
<p>Moving on. Now we basically have OpenGL setup with our window, but the problem is that OpenGL requires additional information about the rendering area. What I mean by this is that because OpenGL is a 3D rendering library, it needs to know some basic things like where the camera is, what our 3D world looks like, what color is our rendering area, etc.</p>
<p>So, lets add a few more lines of code after SDL_SetVideoMode.</p>
<div class="dean_ch" style="white-space: wrap;">
glClearColor<span class="br0">&#40;</span><span class="nu0">0</span>, <span class="nu0">0</span>, <span class="nu0">0</span>, <span class="nu0">0</span><span class="br0">&#41;</span>;<br />
glClearDepth<span class="br0">&#40;</span><span class="nu0">1</span>.0f<span class="br0">&#41;</span>;</p>
<p>glViewport<span class="br0">&#40;</span><span class="nu0">0</span>, <span class="nu0">0</span>, <span class="nu0">640</span>, <span class="nu0">480</span><span class="br0">&#41;</span>;</p>
<p>glMatrixMode<span class="br0">&#40;</span>GL_PROJECTION<span class="br0">&#41;</span>;<br />
glLoadIdentity<span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>glOrtho<span class="br0">&#40;</span><span class="nu0">0</span>, <span class="nu0">640</span>, <span class="nu0">480</span>, <span class="nu0">0</span>, <span class="nu0">1</span>, <span class="nu0">-1</span><span class="br0">&#41;</span>;</p>
<p>glMatrixMode<span class="br0">&#40;</span>GL_MODELVIEW<span class="br0">&#41;</span>;</p>
<p>glEnable<span class="br0">&#40;</span>GL_TEXTURE_2D<span class="br0">&#41;</span>;</p>
<p>glLoadIdentity<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp;</div>
<p><br/></p>
<p>Okay, this is where we actually get to start using OpenGL. First, note that OpenGL is a C library (like SDL), and that all function calls begin with gl* (much like all SDL function calls begin with SDL_*). So what are we doing here exactly? The first function call, glClearColor, tells OpenGL what color to render the view when the color buffer is cleared. The color buffer is the buffer OpenGL uses to render pixels to the screen. glClearDepth does something similar. It tells OpenGL what value to reset the depth buffer when it is cleared. The depth buffer is used to determine the z-axis of a pixel. There are other buffers as well, but only worry about these two for now. The 4 arguments are basically Red, Green, Blue, Alpha. With 1.0f being full color, and 0.0f being no color. If you want to define values as regular RGB 255 values, do this:</p>
<div class="dean_ch" style="white-space: wrap;">
glClearColor<span class="br0">&#40;</span><span class="br0">&#40;</span><span class="nu0">128</span>.0f / <span class="nu0">255</span>.0f<span class="br0">&#41;</span>, <span class="nu0">1</span>.0f, <span class="nu0">1</span>.0f, <span class="nu0">1</span>.0f<span class="br0">&#41;</span>; <span class="co1">//Cyan color</span><br />
&nbsp;</div>
<p><br/></p>
<p>Next, we setup the viewport for opengl. This, in essence, is the window area OpenGL will use. If you set it smaller to the SDL window size you&#8217;ll have black borders, and if you set it larger then the SDL window, you&#8217;ll have your view clipped. Usually, this will always be the same as the regular window size, but there are certain cases you would want it smaller (you can actually create multiple viewports, and have them all display different camera angles of a single scene). Arguments are X, Y, Width, Height.</p>
<p>After that, we tell OpenGL to change to GL_PROJECTION mode. OpenGL contains certain matrix modes that affect certain things. I don&#8217;t want to confuse you with technical details, but you&#8217;ll only ever want to use GL_PROJECTION when you are setting up the &#8220;projection&#8221; of the scene (which is what the glOrtho call does). Other possible projection functions are glLoadIdentity / gluPerspective / glFrustum / gluOrtho2D. Otherwise, you&#8217;ll almost always want to be in GL_MODELVIEW mode.</p>
<p>So, after we are in projection mode, we call glLoadIdentity (which is basically a &#8220;reset matrix&#8221; call). Then, we call glOrtho. Now, to take a quick aside for a moment, we have been working in 2D thus far in all the tutorials on this website. This tutorial is no different, so we are going to use glOrtho to setup a &#8220;2D Perspective.&#8221; An ortho, or orthogonal, perspective is one that flattens a 3D environment into a 2D one. This more or less elmiminates any 3D look, and makes it render like a regular 2D game. Please note though, you can still using the z-axis for layering. On the flip side, if you wanted a 3D environment, you would use gluPerspective or similar to setup a &#8220;3D Perspective.&#8221; So, in simple basic terms, for 2D us glOrtho, and for 3D use gluPerspective. Regarding the arguments of the function, they are Left, Right, Bottom, Top, Near, Far. So, by setting Left to 0, and Right to 640, I am defining the perspective area. If you set these values to something different than the window size, it&#8217;d basically stretch / shrink everything.</p>
<p>Moving on, we switch to GL_MODELVIEW mode, reset it, and also enable GL_TEXTURE_2D (By default, textures are not enabled). What is a texture? A texture is very much like an SDL_Surface. It&#8217;s an image stored in memory that can be rendered to the display, but unline SDL_Surface&#8217;s, Textures cannot be rendered to the screen on there own. They must be attached to some sort of primitive. Meaning, if you want to render a basic texture like an SDL_Surface, you have to &#8220;Bind&#8221; the texture (make it active), render a square, and then attach the texture to the four corners of that square. It sounds more complex then it really is, and we&#8217;ll take a look at doing that in future tutorials.</p>
<p>This is how our OnInit methods ends up looking like:</p>
<div class="dean_ch" style="white-space: wrap;">
bool CApp::<span class="me2">OnInit</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>SDL_Init<span class="br0">&#40;</span>SDL_INIT_EVERYTHING<span class="br0">&#41;</span> &lt; <span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_RED_SIZE, &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">8</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_GREEN_SIZE, &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">8</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_BLUE_SIZE, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">8</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_ALPHA_SIZE, &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">8</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_DEPTH_SIZE, &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">16</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_BUFFER_SIZE,&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">32</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_ACCUM_RED_SIZE,&nbsp; &nbsp; &nbsp; <span class="nu0">8</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_ACCUM_GREEN_SIZE,&nbsp; &nbsp; <span class="nu0">8</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_ACCUM_BLUE_SIZE,&nbsp; &nbsp; &nbsp;<span class="nu0">8</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_ACCUM_ALPHA_SIZE,&nbsp; &nbsp; <span class="nu0">8</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_MULTISAMPLEBUFFERS, &nbsp;<span class="nu0">1</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; SDL_GL_SetAttribute<span class="br0">&#40;</span>SDL_GL_MULTISAMPLESAMPLES, &nbsp;<span class="nu0">2</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="br0">&#40;</span>Surf_Display = SDL_SetVideoMode<span class="br0">&#40;</span><span class="nu0">640</span>, <span class="nu0">480</span>, <span class="nu0">32</span>, SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER | SDL_OPENGL<span class="br0">&#41;</span><span class="br0">&#41;</span> == <span class="kw2">NULL</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; glClearColor<span class="br0">&#40;</span><span class="nu0">0</span>, <span class="nu0">0</span>, <span class="nu0">0</span>, <span class="nu0">0</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; glViewport<span class="br0">&#40;</span><span class="nu0">0</span>, <span class="nu0">0</span>, <span class="nu0">640</span>, <span class="nu0">480</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; glMatrixMode<span class="br0">&#40;</span>GL_PROJECTION<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; glLoadIdentity<span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; glOrtho<span class="br0">&#40;</span><span class="nu0">0</span>, <span class="nu0">640</span>, <span class="nu0">480</span>, <span class="nu0">0</span>, <span class="nu0">1</span>, <span class="nu0">-1</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; glMatrixMode<span class="br0">&#40;</span>GL_MODELVIEW<span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; glEnable<span class="br0">&#40;</span>GL_TEXTURE_2D<span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; glLoadIdentity<span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">true</span>;<br />
<span class="br0">&#125;</span><br />
&nbsp;</div>
<p><br/></p>
<p>Okay, that&#8217;s it for our OpenGL setup. Please note that there are other setup options I haven&#8217;t mentioned, but I am sure we will get to them in future tutorials.</p>
<p>Jump on over to OnRender and lets get something to show up on the screen.</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw4">void</span> CApp::<span class="me2">OnRender</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; glClear<span class="br0">&#40;</span>GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; glLoadIdentity<span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; glBegin<span class="br0">&#40;</span>GL_QUADS<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; glColor3f<span class="br0">&#40;</span><span class="nu0">1</span>, <span class="nu0">0</span>, <span class="nu0">0</span><span class="br0">&#41;</span>; glVertex3f<span class="br0">&#40;</span><span class="nu0">0</span>, <span class="nu0">0</span>, <span class="nu0">0</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; glColor3f<span class="br0">&#40;</span><span class="nu0">1</span>, <span class="nu0">1</span>, <span class="nu0">0</span><span class="br0">&#41;</span>; glVertex3f<span class="br0">&#40;</span><span class="nu0">100</span>, <span class="nu0">0</span>, <span class="nu0">0</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; glColor3f<span class="br0">&#40;</span><span class="nu0">1</span>, <span class="nu0">0</span>, <span class="nu0">1</span><span class="br0">&#41;</span>; glVertex3f<span class="br0">&#40;</span><span class="nu0">100</span>, <span class="nu0">100</span>, <span class="nu0">0</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; glColor3f<span class="br0">&#40;</span><span class="nu0">1</span>, <span class="nu0">1</span>, <span class="nu0">1</span><span class="br0">&#41;</span>; glVertex3f<span class="br0">&#40;</span><span class="nu0">0</span>, <span class="nu0">100</span>, <span class="nu0">0</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; glEnd<span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; SDL_GL_SwapBuffers<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span><br />
&nbsp;</div>
<p><br/></p>
<p>We should be able to get through this fairly quickly. The first line clears our color and depth buffer. For all simplistic purposes, this does a type of reset, and makes our screen blank again. This is similar to calling SDL_FillRect on SDL&#8217;s primary display surface. Keep in mind though it does more than that. Then, we reset our GL_MODELVIEW matrix. Why? Whenever you move around in the 2D / 3D world in OpenGL to render things you are modifying the model view matrix. This matrix is what OpenGL uses to determine where and how to render something to the screen. So, if you are moving around rendering things, you need to reset it on every loop.</p>
<p>Next is where the magic starts to happen. glBegin is used to signal the start of the rendering of a primitive. The parameter is used to simply define what primitive you are going to render. In this case, we are going to render a Rectangle (called a Quad &#8211; 4 sides). glEnd is used to signal the end you rendering that primitive.</p>
<p>Now, when we go to render our primitive what we have to do is define each corner of that primitive. So, we start with the first corner (or vertex), specify the coordinates, and then move to the next, and so on. At the same time, I am defining the colors of each corner (each corner will have a different color). What OpenGL will do for us is color the entire primitive blending those four corner&#8217;s colors together. It ends up looking like this:</p>
<p><img src="/tutorials/sdl-opengl-tutorial-basics-ss.jpg"/><br />
<br/></p>
<p>Lastly, we call SDL_GL_SwapBuffers which basically takes the buffer and moves it to the primary display &#8211; much like SDL_Flip.</p>
<p>And that&#8217;s it! I hope you see how easy it is to setup OpenGL. There&#8217;s quiet a bit to memorize at first, but once you have it down, it&#8217;s not that bad at all.</p>
<p>If you want more information about specific functions, check out the docs here:<br />
<a href="http://www.opengl.org/sdk/docs/man/" target="_new">http://www.opengl.org/sdk/docs/man/</a></p>
<p><b>SDL + OpenGL Tutorial Basics &#8211; Tutorial Files:</b><br />
<b>Win32:</b> <a href="/tutorials/sdl-opengl-tutorial-basics.zip">Zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/sdl-opengl-tutorial-basics/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Featured SDL Library &#8211; Net2</title>
		<link>http://www.sdltutorials.com/featured-sdl-library-net2/</link>
		<comments>http://www.sdltutorials.com/featured-sdl-library-net2/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 16:36:03 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[SDL Featured Libraries]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=432</guid>
		<description><![CDATA[This post is part of something new I will be doing every once in a while. I will choose at random from a bunch of SDL libraries (that are good) and feature them here for all of you to check out. Today, we have a library called Net2 created by Bob Pendleton. He has been [...]]]></description>
			<content:encoded><![CDATA[<p>This post is part of something new I will be doing every once in a while. I will choose at random from a bunch of SDL libraries (that are good) and feature them here for all of you to check out. Today, we have a library called Net2 created by Bob Pendleton. He has been a frequent SDL contributor for quite a while now, and if you&#8217;ve ever subscribed to the SDL Mailing List, you probably have seen emails from him.</p>
<p><span id="more-432"></span></p>
<p>So what is Net2? In a nutshell, it&#8217;s a layer on top of SDL_net that passes all network communication over SDL&#8217;s existing event system. In other words, when something happens on the network (such as a new connection, or received data), you will receive an SDL_Event in your primary thread. Additionally, Net2 runs in its own thread and is thread-safe (SDL_net by itself is not thread safe). And lastly, it&#8217;s super simple to use and it just plain works.</p>
<p>Here&#8217;s an example TCP Client/Server from the Net2 documentation:</p>
<p><b>Client</b></p>
<div class="dean_ch" style="white-space: wrap;">
<span class="co2">#include &lt;string.h&gt;</span><br />
<span class="co2">#include &lt;stdlib.h&gt;</span></p>
<p><span class="co1">// The following libraries all have to be included to get all of SDL</span><br />
<span class="co1">// plus the net2 and fastevents libraries. I include my SDLUtils</span><br />
<span class="co1">// library because I have used my initialization and quit functions to</span><br />
<span class="co1">// simplify the code.</span></p>
<p><span class="co2">#include &quot;SDL.h&quot;</span><br />
<span class="co2">#include &quot;net2.h&quot;</span><br />
<span class="co2">#include &quot;SDLUtils.h&quot;</span></p>
<p><span class="kw4">int</span> main<span class="br0">&#40;</span><span class="kw4">int</span> argc, <span class="kw4">char</span> **argv<span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; <span class="kw4">char</span> buf<span class="br0">&#91;</span><span class="nu0">100</span><span class="br0">&#93;</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// storage for a message</span><br />
&nbsp; <span class="kw4">int</span> i; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// a counter</span><br />
&nbsp; <span class="kw4">int</span> s = <span class="nu0">-1</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// the socket, just an int</span><br />
&nbsp; <span class="kw4">int</span> count = <span class="nu0">0</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// how many messages to send</span><br />
&nbsp; <span class="kw4">int</span> limit = <span class="nu0">1000</span>;</p>
<p>&nbsp; mySDLInitOrQuit<span class="br0">&#40;</span>SDL_INIT_EVENTTHREAD | &nbsp; &nbsp; <span class="co1">// initialize SDL. We need</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SDL_INIT_VIDEO | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// events and it doesn&#8217;t</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SDL_INIT_NOPARACHUTE<span class="br0">&#41;</span>; &nbsp; &nbsp; <span class="co1">// work without video.</span></p>
<p><span class="co1">// Here we ask for a connection to the computer. In this case we are</span><br />
<span class="co1">// just trying to connect to the computer we are on at port 6666. We</span><br />
<span class="co1">// check to make sure we have a valid connection before going on with</span><br />
<span class="co1">// the rest of the program. Note that the socket id winds up in s.</span></p>
<p>&nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="nu0">-1</span> == <span class="br0">&#40;</span>s = NET2_TCPConnectTo<span class="br0">&#40;</span><span class="st0">&quot;localhost&quot;</span>, <span class="nu0">6666</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span class="kw3">printf</span></a><span class="br0">&#40;</span><span class="st0">&quot;ConnectTo failed<span class="es0">\n</span>&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; exit<span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;<br />
&nbsp; <span class="br0">&#125;</span></p>
<p><span class="co1">// All we do here is create a message and send it. The message is just</span><br />
<span class="co1">// the words &quot;TCP message&quot; followed by a message number.</span></p>
<p>&nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span>i = <span class="nu0">0</span>; i &lt; limit; i++<span class="br0">&#41;</span><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; memset<span class="br0">&#40;</span>buf, <span class="nu0">0</span>, <span class="kw4">sizeof</span><span class="br0">&#40;</span>buf<span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; sprintf<span class="br0">&#40;</span>buf, <span class="st0">&quot;TCP message #%08d<span class="es0">\n</span>&quot;</span>, i<span class="br0">&#41;</span>; &nbsp;<span class="co1">// create the message to send</span><br />
&nbsp; &nbsp; NET2_TCPSend<span class="br0">&#40;</span>s, buf, <span class="kw4">sizeof</span><span class="br0">&#40;</span>buf<span class="br0">&#41;</span><span class="br0">&#41;</span>; &nbsp; &nbsp; &nbsp; <span class="co1">// send it and count it.</span><br />
&nbsp; &nbsp; count += <span class="kw4">sizeof</span><span class="br0">&#40;</span>buf<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="co1">//printf(&quot;%d\n&quot;, i);</span><br />
&nbsp; &nbsp; <span class="co1">//SDL_Delay(1);</span><br />
&nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span class="kw3">printf</span></a><span class="br0">&#40;</span><span class="st0">&quot;count=%d<span class="es0">\n</span>&quot;</span>, count<span class="br0">&#41;</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// tell how many were sent</span></p>
<p>&nbsp; mySDL_Quit<span class="br0">&#40;</span><span class="br0">&#41;</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// clean up.</span><br />
<span class="br0">&#125;</span><br />
&nbsp;</div>
<p><b>Server</b></p>
<div class="dean_ch" style="white-space: wrap;">
<span class="co2">#include &lt;stdlib.h&gt;</span></p>
<p><span class="co1">// The following libraries all have to be included to get all of SDL</span><br />
<span class="co1">// plus the net2 and fastevents libraries. I include my SDLUtils</span><br />
<span class="co1">// library because I have used my initialization and quit functions to</span><br />
<span class="co1">// simplify the code.</span></p>
<p><span class="co2">#include &quot;SDL.h&quot;</span><br />
<span class="co2">#include &quot;fastevents.h&quot;</span><br />
<span class="co2">#include &quot;net2.h&quot;</span><br />
<span class="co2">#include &quot;SDLUtils.h&quot;</span></p>
<p><span class="kw4">int</span> main<span class="br0">&#40;</span><span class="kw4">int</span> argc, <span class="kw4">char</span> **argv<span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; SDL_Event ev; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// an SDL event</span><br />
&nbsp; <span class="kw4">char</span> buf<span class="br0">&#91;</span><span class="nu0">1024</span><span class="br0">&#93;</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// a message buffer</span><br />
&nbsp; <span class="kw4">int</span> len = <span class="nu0">0</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// some counters</span><br />
&nbsp; <span class="kw4">int</span> count = <span class="nu0">0</span>;<br />
&nbsp; <span class="kw4">int</span> socks = <span class="nu0">0</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// the number of</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// connected sockets,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// which is also the</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// number of connected</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// clients.</span></p>
<p>&nbsp; mySDLInitOrQuit<span class="br0">&#40;</span>SDL_INIT_EVENTTHREAD | &nbsp; &nbsp; <span class="co1">// initialize SDL. We need</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SDL_INIT_VIDEO | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// events and it doesn&#8217;t</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SDL_INIT_NOPARACHUTE<span class="br0">&#41;</span>; &nbsp; &nbsp; <span class="co1">// work without video</span></p>
<p><span class="co1">// This is where we tell NET2 to start accepting TCP/IP connections on</span><br />
<span class="co1">// port 6666. This call does not wait for a connection to come in. It</span><br />
<span class="co1">// tells NET2 to do the waiting and it returns immediately. After this</span><br />
<span class="co1">// call returns your program will get an event any time a computer</span><br />
<span class="co1">// trys to connect to the port given in this call.</span></p>
<p>&nbsp; NET2_TCPAcceptOn<span class="br0">&#40;</span><span class="nu0">6666</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; <span class="kw1">while</span> <span class="br0">&#40;</span>FE_WaitEvent<span class="br0">&#40;</span>&amp;ev<span class="br0">&#41;</span><span class="br0">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// wait for events</span><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co1">//printSDLEvent(&amp;ev);</span></p>
<p>&nbsp; &nbsp; <span class="kw1">switch</span> <span class="br0">&#40;</span>ev.<span class="me1">type</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span></p>
<p><span class="co1">// all NE2 events are SDL_USEREVENTs but not all user events are NET2</span><br />
<span class="co1">// events. If you use user events in your code you need to be careful</span><br />
<span class="co1">// to make sure you are not using the same event codes that NET2 uses.</span></p>
<p>&nbsp; &nbsp; <span class="kw1">case</span> SDL_USEREVENT:<br />
&nbsp; &nbsp; &nbsp; <span class="kw1">switch</span><span class="br0">&#40;</span>NET2_GetEventType<span class="br0">&#40;</span>&amp;ev<span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></p>
<p><span class="co1">// This next piece of code handles an accept event. This event tells</span><br />
<span class="co1">// us that an connection has been accepted. Here, all we do is count</span><br />
<span class="co1">// it. You would normally take some other action.</span></p>
<p>&nbsp; &nbsp; &nbsp; <span class="kw1">case</span> NET2_TCPACCEPTEVENT:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span class="kw3">printf</span></a><span class="br0">&#40;</span><span class="st0">&quot;accept(%d)<span class="es0">\n</span>&quot;</span>, NET2_GetSocket<span class="br0">&#40;</span>&amp;ev<span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; printNET2Event<span class="br0">&#40;</span>&amp;ev<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; socks++;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">break</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// This next piece of code is for handling receive</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// events. This kind of event tells us we have input waiting</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// on a socket. You need to grab all of it. No that we get the</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// socket from the event. You can use the socket to tell you</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// which user sent the information to you.</span></p>
<p>&nbsp; &nbsp; &nbsp; <span class="kw1">case</span> NET2_TCPRECEIVEEVENT:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">while</span> <span class="br0">&#40;</span><span class="nu0">0</span> != <span class="br0">&#40;</span>len = NET2_TCPRead<span class="br0">&#40;</span>NET2_GetSocket<span class="br0">&#40;</span>&amp;ev<span class="br0">&#41;</span>, buf, <span class="kw4">sizeof</span><span class="br0">&#40;</span>buf<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; count += len;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">break</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// If an error occurs on a socket or the other computer closes</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// the connection you will get a close event. When you get a</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// close event you must close the socket. Use the socket in</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// the event to tell you which connection went away.</span></p>
<p>&nbsp; &nbsp; &nbsp; <span class="kw1">case</span> NET2_TCPCLOSEEVENT:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span class="kw3">printf</span></a><span class="br0">&#40;</span><span class="st0">&quot;close(%d)<span class="es0">\n</span>&quot;</span>, NET2_GetSocket<span class="br0">&#40;</span>&amp;ev<span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; printNET2Event<span class="br0">&#40;</span>&amp;ev<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; NET2_TCPClose<span class="br0">&#40;</span>NET2_GetSocket<span class="br0">&#40;</span>&amp;ev<span class="br0">&#41;</span><span class="br0">&#41;</span>; &nbsp;<span class="co1">// close the socket</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span class="kw3">printf</span></a><span class="br0">&#40;</span><span class="st0">&quot;count=%d<span class="es0">\n</span>&quot;</span>, count<span class="br0">&#41;</span>; fflush<span class="br0">&#40;</span><span class="kw2">NULL</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; socks&#8211;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="nu0">0</span> &gt;= socks<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//exit(0);</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//count = 0;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">break</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Sometimes you will get errors. It is best to keep track of</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// them and try to figure out what is causing them.</span></p>
<p>&nbsp; &nbsp; &nbsp; <span class="kw1">case</span> NET2_ERROREVENT:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span class="kw3">printf</span></a><span class="br0">&#40;</span><span class="st0">&quot;Error: %s(%d)<span class="es0">\n</span>&quot;</span>, NET2_GetEventError<span class="br0">&#40;</span>&amp;ev<span class="br0">&#41;</span>, NET2_GetSocket<span class="br0">&#40;</span>&amp;ev<span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; printNET2Event<span class="br0">&#40;</span>&amp;ev<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">break</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw2">break</span>;</p>
<p>&nbsp; &nbsp; <span class="kw1">case</span> SDL_QUIT: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// time to quit</span><br />
&nbsp; &nbsp; &nbsp; mySDL_Quit<span class="br0">&#40;</span><span class="br0">&#41;</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// clean up and exit</span><br />
&nbsp; &nbsp; &nbsp; exit<span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="kw2">break</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; mySDL_Quit<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span><br />
&nbsp;</div>
<p>So what are some of the cons of this library? Mostly that the author likes to extensively use his own custom functions for things unrelated to the library. In addition, his &#8220;Fast Events&#8221; library is required to use Net2 at all (unless you want to modify the source).</p>
<p>Check out the Net2 Library here:<br />
<a href="http://www.gameprogrammer.com/net2/net2-1.html">http://www.gameprogrammer.com/net2/net2-1.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/featured-sdl-library-net2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>And the Tetris Contest winner is&#8230;</title>
		<link>http://www.sdltutorials.com/and-the-tetris-contestwinner-is/</link>
		<comments>http://www.sdltutorials.com/and-the-tetris-contestwinner-is/#comments</comments>
		<pubDate>Sat, 22 May 2010 15:19:59 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[Contests]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=428</guid>
		<description><![CDATA[Bloc! Download Congratulations! I encourage all of you to continue working on your projects, and polish them up. Regarding the winner, I found it to be well thought out, has snazzy effects, and has some pretty good source code. View past entries]]></description>
			<content:encoded><![CDATA[<p><span id="more-428"></span></p>
<p>Bloc!<br />
<a href="/Contest-Tetris/Bloc.zip"><img src="/Contest-Tetris/Bloc - SS.jpg"/><br />
Download</a></p>
<p>Congratulations! I encourage all of you to continue working on your projects, and polish them up.</p>
<p>Regarding the winner, I found it to be well thought out, has snazzy effects, and has some pretty good source code. </p>
<p><a href="http://www.sdltutorials.com/tetris-contest-your-turn/">View past entries</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/and-the-tetris-contestwinner-is/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tetris Contest &#8211; Your Turn</title>
		<link>http://www.sdltutorials.com/tetris-contest-your-turn/</link>
		<comments>http://www.sdltutorials.com/tetris-contest-your-turn/#comments</comments>
		<pubDate>Wed, 12 May 2010 11:25:18 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[SDL Tutorials]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=420</guid>
		<description><![CDATA[Alright everyone, it&#8217;s your turn to take a look at the contest entries and let me know what you think. Vote for the one you like best, and let us know in the comments what you like / dislike. Bloc Download Blockzorz Download Falling in Pieces Download Tetris with a Twist Download Yage Download Zeetrix [...]]]></description>
			<content:encoded><![CDATA[<p>Alright everyone, it&#8217;s your turn to take a look at the contest entries and let me know what you think. Vote for the one you like best, and let us know in the comments what you like / dislike.</p>
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
<p><b>Bloc</b><br />
<a href="/Contest-Tetris/Bloc.zip"><img src="/Contest-Tetris/Bloc - SS.jpg"/><br />
Download</a></p>
<p><b>Blockzorz</b><br />
<a href="/Contest-Tetris/Blockzorz.zip"><img src="/Contest-Tetris/Blockzorz - SS.jpg"/><br />
Download</a></p>
<p><b>Falling in Pieces</b><br />
<a href="/Contest-Tetris/Falling in Pieces.zip"><img src="/Contest-Tetris/Falling in Pieces - SS.jpg"/><br />
Download</a></p>
<p><b>Tetris with a Twist</b><br />
<a href="/Contest-Tetris/Tetris with a Twist.zip"><img src="/Contest-Tetris/Tetris with a Twist - SS.jpg"/><br />
Download</a></p>
<p><b>Yage</b><br />
<a href="/Contest-Tetris/Yage.zip"><img src="/Contest-Tetris/Yage - SS.jpg"/><br />
Download</a></p>
<p><b>Zeetrix</b><br />
<a href="/Contest-Tetris/Zeetrix.zip"><img src="/Contest-Tetris/Zeetrix - SS.jpg"/><br />
Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/tetris-contest-your-turn/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>The Humble Indie Bundle</title>
		<link>http://www.sdltutorials.com/the-humble-indie-bundle/</link>
		<comments>http://www.sdltutorials.com/the-humble-indie-bundle/#comments</comments>
		<pubDate>Thu, 06 May 2010 18:09:33 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=415</guid>
		<description><![CDATA[Check this out. 5 indie games for any price you specify. Games are World of Goo, Aquaria, Gish, Lugaru, and Penumbra. Money goes toward the developers, charity, or EFF (and can be split however you want). Please be a generous giver for this awesome opportunity. http://www.wolfire.com/humble P.S. Time is running out on this bundle &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.wolfire.com/humble"><img src="http://www.sdltutorials.com/wp-content/uploads/humble-indie-bundle.png" alt="" title="humble-indie-bundle" width="749" height="216" class="aligncenter size-full wp-image-418" /></a></p>
<p>Check this out. 5 indie games for any price you specify. Games are World of Goo, Aquaria, Gish, Lugaru, and Penumbra. Money goes toward the developers, charity, or EFF (and can be split however you want). Please be a generous giver for this awesome opportunity. </p>
<p><a href="http://www.wolfire.com/humble">http://www.wolfire.com/humble</a></p>
<p>P.S.<br />
Time is running out on this bundle &#8211; about 5 days left.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/the-humble-indie-bundle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top Gaming Resource Sites</title>
		<link>http://www.sdltutorials.com/top-gaming-resource-sites/</link>
		<comments>http://www.sdltutorials.com/top-gaming-resource-sites/#comments</comments>
		<pubDate>Wed, 05 May 2010 11:58:20 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[Resources]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=406</guid>
		<description><![CDATA[A lot of you out there are working on the next &#8220;big&#8221; game. Often, you&#8217;ll find yourself without the necessary resources to finish your game. Usually this means you just plain suck at graphics or audio, and don&#8217;t have the skills to pull anything cool together. Here&#8217;s my list of top websites to go to [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of you out there are working on the next &#8220;big&#8221; game. Often, you&#8217;ll find yourself without the necessary resources to finish your game. Usually this means you just plain suck at graphics or audio, and don&#8217;t have the skills to pull anything cool together. Here&#8217;s my list of top websites to go to if you are need of some resources for your game. Please keep in mind some of these sites can be used for commercial purposes, while others cannot.</p>
<p><b>Sprites</b><br />
<a href="http://sdb.drshnaps.com/">http://sdb.drshnaps.com/</a><br />
<a href="http://www.spriters-resource.com/">http://www.spriters-resource.com/</a><br />
<a href="http://opengameart.org/">http://opengameart.org/</a><br />
<a href="http://charas-project.net/">http://charas-project.net/</a></p>
<p><b>Textures</b><br />
<a href="http://mayang.com/textures/">http://mayang.com/textures/</a><br />
<a href="http://www.cgtextures.com/">http://www.cgtextures.com/</a><br />
<a href="http://www.morguefile.com/">http://www.morguefile.com/</a><br />
<a href="http://www.turbosquid.com/Textures">http://www.turbosquid.com/Textures</a><br />
<a href="http://www.deviantart.com/">http://www.deviantart.com/</a> (Also might find some sprites here)</p>
<p><b>Music</b><br />
<a href="http://ocremix.org/">http://ocremix.org/</a></p>
<p><b>Sound Effects</b><br />
<a href="http://www.soundjay.com/">http://www.soundjay.com/</a><br />
<a href="http://www.a1freesoundeffects.com/">http://www.a1freesoundeffects.com/</a></p>
<p><b>Fonts</b><br />
<a href="http://www.dafont.com/">http://www.dafont.com/</a></p>
<p><a href="http://gpwiki.org/index.php/Game_Content_Resources">Even more resources here&#8230;</a></p>
<p>Got a cool website to share? Let us know in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/top-gaming-resource-sites/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>C++ Tip &#8211; Being safe with Pointers</title>
		<link>http://www.sdltutorials.com/c-tip-being-safe-with-pointers/</link>
		<comments>http://www.sdltutorials.com/c-tip-being-safe-with-pointers/#comments</comments>
		<pubDate>Wed, 05 May 2010 11:46:34 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[C++ Tips]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=398</guid>
		<description><![CDATA[Arguably no other area of C++ confuses more people and causes more frustration than pointers. Here&#8217;s a few quick tips to keep safe while using them. Always check pointers void MyFunc&#40;int* X&#41; &#123; std::cout &#60;&#60; *X; //Bad! &#125; &#160; void MyFunc&#40;int* X&#41; &#123; if&#40;!X&#41; return; //Better std::cout &#60;&#60; *X; &#125; &#160; Always initialize pointers int* [...]]]></description>
			<content:encoded><![CDATA[<p>Arguably no other area of C++ confuses more people and causes more frustration than pointers. Here&#8217;s a few quick tips to keep safe while using them.</p>
<p><span id="more-398"></span></p>
<p><b>Always check pointers</b></p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw4">void</span> MyFunc<span class="br0">&#40;</span><span class="kw4">int</span>* X<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
std::<a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span class="kw3">cout</span></a> &lt;&lt; *X; <span class="co1">//Bad!</span><br />
<span class="br0">&#125;</span><br />
&nbsp;</div>
<p><br/></p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw4">void</span> MyFunc<span class="br0">&#40;</span><span class="kw4">int</span>* X<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="kw1">if</span><span class="br0">&#40;</span>!X<span class="br0">&#41;</span> <span class="kw1">return</span>; <span class="co1">//Better</span></p>
<p>std::<a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span class="kw3">cout</span></a> &lt;&lt; *X;<br />
<span class="br0">&#125;</span><br />
&nbsp;</div>
<p><br/></p>
<p><b>Always initialize pointers</b></p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw4">int</span>* MyPointer; <span class="co1">//Bad!</span></p>
<p>std::<a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span class="kw3">cout</span></a> &lt;&lt; *MyPointer; <span class="co1">//Potential Boom!</span><br />
&nbsp;</div>
<p><br/></p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw4">int</span>* MyOtherPointer = <span class="kw2">NULL</span>; <span class="co1">// or, = 0</span></p>
<p>std::<a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span class="kw3">cout</span></a> &lt;&lt; *MyOtherPointer; <span class="co1">//Still not good</span><br />
&nbsp;</div>
<p><br/></p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw4">int</span>* MyLastPointer = <span class="kw2">NULL</span>;</p>
<p><span class="co1">//Check for a valid pointer!</span><br />
<span class="kw1">if</span><span class="br0">&#40;</span>MyLastPointer<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
std::<a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span class="kw3">cout</span></a> &lt;&lt; *MyLastPointer; <span class="co1">//Good</span><br />
<span class="br0">&#125;</span><br />
&nbsp;</div>
<p><br/></p>
<p><b>Always free allocated memory</b></p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw4">int</span>* X = new <span class="kw4">int</span><span class="br0">&#91;</span><span class="nu0">3</span><span class="br0">&#93;</span>;<br />
<span class="kw4">int</span>* Y = new <span class="kw4">int</span>;</p>
<p>X<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> = <span class="nu0">0</span>;<br />
X<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> = <span class="nu0">1</span>;<br />
X<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span> = <span class="nu0">2</span>;</p>
<p>*Y = <span class="nu0">3</span>;</p>
<p><span class="co1">//End of program &#8211; BAD!</span><br />
&nbsp;</div>
<p><br/></p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw4">int</span>* X = new <span class="kw4">int</span><span class="br0">&#91;</span><span class="nu0">3</span><span class="br0">&#93;</span>;<br />
<span class="kw4">int</span>* Y = new <span class="kw4">int</span>;</p>
<p>X<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> = <span class="nu0">0</span>;<br />
X<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> = <span class="nu0">1</span>;<br />
X<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span> = <span class="nu0">2</span>;</p>
<p>*Y = <span class="nu0">3</span>;</p>
<p>delete <span class="br0">&#91;</span><span class="br0">&#93;</span> X; <span class="co1">//Note the []</span><br />
delete Y; <span class="co1">//Note no []</span><br />
&nbsp;</div>
<p><br/></p>
<div class="dean_ch" style="white-space: wrap;">
<span class="co1">//Even better</span><br />
<span class="kw4">int</span>* X = new <span class="kw4">int</span><span class="br0">&#91;</span><span class="nu0">3</span><span class="br0">&#93;</span>;<br />
<span class="kw4">int</span>* Y = new <span class="kw4">int</span>;</p>
<p><span class="kw1">if</span><span class="br0">&#40;</span>X<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
X<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> = <span class="nu0">0</span>;<br />
X<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> = <span class="nu0">1</span>;<br />
X<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span> = <span class="nu0">2</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="kw1">if</span><span class="br0">&#40;</span>Y<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
*Y = <span class="nu0">3</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="kw1">if</span><span class="br0">&#40;</span>X<span class="br0">&#41;</span> delete <span class="br0">&#91;</span><span class="br0">&#93;</span> X;<br />
<span class="kw1">if</span><span class="br0">&#40;</span>Y<span class="br0">&#41;</span> delete Y;<br />
&nbsp;</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/c-tip-being-safe-with-pointers/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Welcome to GSoC 2010!</title>
		<link>http://www.sdltutorials.com/welcome-to-gsoc-2010/</link>
		<comments>http://www.sdltutorials.com/welcome-to-gsoc-2010/#comments</comments>
		<pubDate>Sat, 01 May 2010 20:06:42 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[SDL Tutorials]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=395</guid>
		<description><![CDATA[Official SDL Announcement: We had some amazing applicants for this year&#8217;s Google Summer of Code, and I would like to thank everyone who applied. It was very difficult to narrow down the final list, but in the end we picked 5 excellent students for this year&#8217;s project. I&#8217;d like to introduce them and invite everyone [...]]]></description>
			<content:encoded><![CDATA[<p>Official SDL Announcement:</p>
<p>We had some amazing applicants for this year&#8217;s Google Summer of Code, and I would like to thank everyone who applied.  It was very difficult to narrow down the final list, but in the end we picked 5 excellent students for this year&#8217;s project.</p>
<p>I&#8217;d like to introduce them and invite everyone to welcome them to the SDL community! <img src='http://www.sdltutorials.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Introducing the Students:</p>
<p> * Daniel Wyatt is working on the Windows IME implementation, working with Jiang (a GSoC student from last year) to update the API and build working Japanese input support.  I will be mentoring Danial and coordinating his collaboration with Jiang.  You can find out more<br />
about his project at:<br />
<a href="http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/sdl/t127230762719">http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/sdl/t127230762719</a></p>
<p> * Eli Gottlieb is working on shaped window support for Linux, Mac OS X, and Windows.  He will be mentored by Andreas Schiffler, who has<br />
actually implemented shaped window support for commercial SDL projects.  You can find out more about his project at:<br />
<a href="http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/sdl/t127230762740">http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/sdl/t127230762740</a></p>
<p> * Jim Grandpre is working on adding support for multi-touch devices and developing a complete gesture recognition framework.  He will be mentored by Ryan Gordon, who among many other things, is working on porting games to the iPad.  You can find out more about his project at:<br />
<a href="http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/sdl/t127230762583">http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/sdl/t127230762583</a></p>
<p> * Paul Hunkin is working on an official port of SDL 1.3 to the Android.  I will be mentoring him and testing his code on my development Google Ion.  You can find out more about his project at:<br />
<a href="http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/sdl/t127230762779">http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/sdl/t127230762779</a></p>
<p>* Sunny Sachanandani is working on integrating X11 XRender support into SDL 1.3, with support for hardware accelerated blending and more.<br />
 I will be mentoring him and testing his code on a variety of Linux distributions.  You can find out more about his project at:<br />
<a href="http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/sdl/t127230762857">http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/sdl/t127230762857</a></p>
<p>Introducing the Mentors:</p>
<p> * Andreas Schiffler is an architect/dev for a commercial SDL based windows+linux application with shaped-window support.  He is volunteering as a mentor this year to help Eli with his project.</p>
<p> * Ryan Gordon is a long time friend and SDL developer, and is currently rewriting the SDL multi-mouse support.  He will be mentoring Jim on his touch input project this year.</p>
<p> * I am the original author of SDL and founder of Galaxy Gameworks LLC, a small company devoted to commercial development and support of<br />
SDL 1.3 and beyond.  I am looking forward to mentoring Daniel, Paul, and Sunny.</p>
<p>Welcome! <img src='http://www.sdltutorials.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
&#8211;<br />
      -Sam Lantinga, Founder and President, Galaxy Gameworks LLC</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/welcome-to-gsoc-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
