<?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>Dev Hub</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>Thu, 25 Jun 2009 20:33:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Just to check up&#8230;</title>
		<link>http://www.sdltutorials.com/just-to-check-up/</link>
		<comments>http://www.sdltutorials.com/just-to-check-up/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 11:12:04 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[C++ tutorials]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=112</guid>
		<description><![CDATA[So, how is everyone doing so far in the contest? Run into any problems? 
Some inspiration again:


]]></description>
			<content:encoded><![CDATA[<p>So, how is everyone doing so far in the contest? Run into any problems? </p>
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
<p>Some inspiration again:</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/0t7jeIk-OzQ&#038;hl=en&#038;fs=1&#038;color1=0x006699&#038;color2=0x54abd6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/0t7jeIk-OzQ&#038;hl=en&#038;fs=1&#038;color1=0x006699&#038;color2=0x54abd6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/8Rr8K_WScYc&#038;hl=en&#038;fs=1&#038;color1=0x006699&#038;color2=0x54abd6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/8Rr8K_WScYc&#038;hl=en&#038;fs=1&#038;color1=0x006699&#038;color2=0x54abd6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/just-to-check-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Contest &#124; Resources</title>
		<link>http://www.sdltutorials.com/contest-resources/</link>
		<comments>http://www.sdltutorials.com/contest-resources/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 11:54:16 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[C++ tutorials]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=104</guid>
		<description><![CDATA[As a helpful gesture to all you out there that may need some resources (sounds, music, art), visit the link below:
http://forums.sdltutorials.com/viewtopic.php?f=19&#038;t=36
]]></description>
			<content:encoded><![CDATA[<p>As a helpful gesture to all you out there that may need some resources (sounds, music, art), visit the link below:</p>
<p><a href="http://forums.sdltutorials.com/viewtopic.php?f=19&#038;t=36">http://forums.sdltutorials.com/viewtopic.php?f=19&#038;t=36</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/contest-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Contest &#124; Prize increase</title>
		<link>http://www.sdltutorials.com/contest-prize-increase/</link>
		<comments>http://www.sdltutorials.com/contest-prize-increase/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 15:42:17 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[C++ tutorials]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=101</guid>
		<description><![CDATA[The dollar prize has changed to: $200 (PayPal)
A special thanks to Sergey Tikhonov for the donation!
]]></description>
			<content:encoded><![CDATA[<p>The dollar prize has changed to: <span style='color: red;'>$200</span> (PayPal)</p>
<p>A special thanks to Sergey Tikhonov for the donation!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/contest-prize-increase/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Contest &#124; Project Submissions</title>
		<link>http://www.sdltutorials.com/contest-project-submissions/</link>
		<comments>http://www.sdltutorials.com/contest-project-submissions/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 17:22:04 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=98</guid>
		<description><![CDATA[The following are some guidelines for when you submit projects. A real quick note first: by submitting your project multiple times up to the deadline, I can give you feedback and/or help. Please note, I will not give you any code, or any links to code. All I will simply do is point you in [...]]]></description>
			<content:encoded><![CDATA[<p>The following are some guidelines for when you submit projects. A real quick note first: by submitting your project multiple times up to the deadline, I can give you feedback and/or help. Please note, I will not give you any code, or any links to code. All I will simply do is point you in the right direction. This should even the playing field a bit for newbies.</p>
<ol>
<li>Please provide a project file and/or makefile for me to compile your code depending on the target platform.</li>
<li>Please include any and all libraries involved with your project; <b>already compiled</b>. I don&#8217;t want to have to sit here for hours compiling libraries that are used in your project. Exceptions: if the library is <u>easy</u> to grab myself, simply let me know in a ReadMe.txt or something (i.e., being able to apt-get what I need, or simply download).</li>
<li>Please compress your project into a single file, and email it to me with the subject: CONTEST &#8211; [My Project Name] ; remember, email to: kizare [at] gmail.com</li>
<li>Though you can submit projects ahead of time for help, please do not submit your project more than once a week to me. I will provide help, but very limited; remember, this is a contest. I would only ask for help if you really need it; it&#8217;s very likely I&#8217;ll give more kudos to a project that asked for very little to no help, v. the person that asked every week.</li>
<li>Please&#8230;. please! Comment your code. Please.</li>
</ol>
<p>In a few days I&#8217;ll post all of this up on a single page, timestamped, to make everything easier for people to see, and so the posts don&#8217;t get lost in the coming months.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/contest-project-submissions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Contest &#124; Follow Up</title>
		<link>http://www.sdltutorials.com/contest-follow-up/</link>
		<comments>http://www.sdltutorials.com/contest-follow-up/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 11:03:37 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=89</guid>
		<description><![CDATA[Update:
To keep things a bit more in-line with the prize, the deadline has been moved to September 1, 2009.

After some thought, I would like to be able to give more of a prize to the winner. If anyone has any ideas, donations, suggestions, I am all ears. Seeing as this is a volunteer driven community, [...]]]></description>
			<content:encoded><![CDATA[<p><b>Update:</b><br />
To keep things a bit more in-line with the prize, the deadline has been moved to <span style="color: red">September 1, 2009</span>.</p>
<hr/>
<p>After some thought, I would like to be able to give more of a prize to the winner. If anyone has any ideas, donations, suggestions, I am all ears. Seeing as this is a volunteer driven community, it&#8217;s hard to gather resources for something like this, especially since this is the first time. I want to be able to be nice to all those outside of the U.S. as well. Again, any ideas welcome.</p>
<p><b>Updates to Contest:</b></p>
<ol>
<li>No more than 2 people per project</li>
<li>You may submit as many projects as you like</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/contest-follow-up/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Contest</title>
		<link>http://www.sdltutorials.com/contest/</link>
		<comments>http://www.sdltutorials.com/contest/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 14:00:00 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=74</guid>
		<description><![CDATA[Here it is! The first (possibly annual) SDL Game Contest. Woo hoo! 
The Goal: Make a side-scrolling shooter.
The Inspirition: R-Type
The Rules: This contest is open to all game developers, with the following requirements and/or conditions:

No more than 2 people per project
You may submit as many projects as you like
I prefer SDL / C/C++ (optionally can [...]]]></description>
			<content:encoded><![CDATA[<p>Here it is! The first (possibly annual) SDL Game Contest. Woo hoo! </p>
<p><strong>The Goal:</strong> Make a side-scrolling shooter.<br />
<strong>The Inspirition:</strong> <a href="http://en.wikipedia.org/wiki/R-Type">R-Type</a><br />
<strong>The Rules:</strong> This contest is open to all game developers, with the following requirements and/or conditions:</p>
<ol>
<li>No more than 2 people per project</li>
<li>You may submit as many projects as you like</li>
<li>I prefer SDL / C/C++ (optionally can use OpenGL <u>with</u> SDL); SDL <u>must be used</u>. Other languages allowed: Delphi, VC++.NET, Java</li>
<li>Project must compile/work on at least one major operating system (Windows, Mac OSX, *nix); extra bonus points for cross-platformy*</li>
<li>You give SDLtutorials.com permission to use any and all submitted resources, code, and/or files for non-commercial use. Submitter retains the rights to his/her project. (SDLtutorials.com will most likely use the winning project as the basis for a tutorial)</li>
<li>All code, resources, and/or files submitted must be the submitters original work, with the exception of use of 3rd party open-source libraries, and/or royalty free resources. No commercial libraries and/or resources are allowed, and will result in immediate disqualification.</li>
<li>No plagiarism is allowed, with the exception of the &#8220;minor&#8221;** use of code from tutorials. Code used from tutorials cannot make up more than 20%** of a submitted project&#8217;s code. You may use the framework provided on this website without limitation.</li>
<li>SDLtutorials.com has full discretion to accept/reject any projects submitted, and can cancel this contest at any time.</li>
</ol>
<p>* No actual points are involved in the judging of entries.<br />
** This, obviously, is hard to determine. Be fair, do your own work; if you use code from online, make it your own.</p>
<p><strong>The Details:</strong></p>
<ul>
<li>You must make one complete level that has at minimum 3 minutes of game-play</li>
<li>You must provide a scalable structure that allows players to easily add additional levels</li>
<li>You must provide a basic menu (Start, Exit at minimum)</li>
<li>You must provide lives, and score at minimum</li>
<li>You must provide at least 3 different weapons</li>
<li>You may make the side-scroller shooter any theme you would like (i.e., a banana flying through the air with a machine gun)</li>
<li>It is <strong>not</strong> required to provide any sound effects/music, but this would be a major plus</li>
<li>You must provide at least 3 basic enemies, and 1 boss</li>
<li>The game may be 2D or 3D (using OpenGL), and may use scripting</li>
</ul>
<p><strong>The Prize:</strong></p>
<ul>
<li><span style='color: red;'>$200</span> (PayPal) (Thanks Sergey Tikhonov for the donation!)</li>
<li>Permission to help moderate SDLtutorials.com (if the winner wishes)</li>
<li>SDLtutorials.com email address (if the winner wishes)</li>
<li>Has first grabs at joining (as a developer) Tim&#8217;s upcoming Indie Game Development Website.</li>
<li>Free Copy of Half Life 2 (via Steam)</li>
</ul>
<p><strong>The Deadline:</strong><br />
<span style="color: red">September 1, 2009</span></p>
<p>Once all entries are received, I will post 5 of the top projects received. The community will then be able to voice their opinion (which should help weed out any plagiarism). A week after the deadline, I will post who is the winner. If I cannot contact the winner within 30 days, the 2nd place project will become the winner (and so on).</p>
<p>Be creative as possible. If you want 30 enemies, that&#8217;s fine. If you want 30 bosses, that&#8217;s fine. &#8220;The Details&#8221; section is sort of a general guideline, but aim to go above and beyond it.</p>
<p>Please send all completed Projects to: kizare [at] gmail.com</p>
<p>You may send your project multiple times up to the deadline. The last project I receive before <b>midnight</b> is the one that I will use.</p>
<p>Good luck everyone!</p>
<p>Terms are subject to change at any time; I will give notice to such changes.</p>
<p><b>Update (6.5.2009):</b><br />
The following are some guidelines for when you submit projects. A real quick note first: by submitting your project multiple times up to the deadline, I can give you feedback and/or help. Please note, I will not give you any code, or any links to code. All I will simply do is point you in the right direction. This should even the playing field a bit for newbies.</p>
<ol>
<li>Please provide a project file and/or makefile for me to compile your code depending on the target platform.</li>
<li>Please include any and all libraries involved with your project; <b>already compiled</b>. I don&#8217;t want to have to sit here for hours compiling libraries that are used in your project. Exceptions: if the library is <u>easy</u> to grab myself, simply let me know in a ReadMe.txt or something (i.e., being able to apt-get what I need, or simply download).</li>
<li>Please compress your project into a single file, and email it to me with the subject: CONTEST &#8211; [My Project Name] ; remember, email to: kizare [at] gmail.com</li>
<li>Though you can submit projects ahead of time for help, please do not submit your project more than once a week to me. I will provide help, but very limited; remember, this is a contest. I would only ask for help if you really need it; it&#8217;s very likely I&#8217;ll give more kudos to a project that asked for very little to no help, v. the person that asked every week.</li>
<li>Please&#8230;. please! Comment your code. Please.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/contest/feed/</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
		<item>
		<title>Next Lineup</title>
		<link>http://www.sdltutorials.com/next-lineup/</link>
		<comments>http://www.sdltutorials.com/next-lineup/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 12:35:21 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=53</guid>
		<description><![CDATA[I&#8217;ve hit another one of those &#8220;busy&#8221; periods of my life, but no worries, I am gearing up for the next batch of tutorials. Here&#8217;s the lineup I was thinking:
1. SDL Collision Events
2. SDL SpaceShooter
3. C++ Variables
4. SDL + OpenGL Basics
Someone also asked about doing Isometric games, no promises, but I might fit that in.
No [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve hit another one of those &#8220;busy&#8221; periods of my life, but no worries, I am gearing up for the next batch of tutorials. Here&#8217;s the lineup I was thinking:</p>
<p>1. SDL Collision Events<br />
2. SDL SpaceShooter<br />
3. C++ Variables<br />
4. SDL + OpenGL Basics</p>
<p>Someone also asked about doing Isometric games, no promises, but I might fit that in.</p>
<p>No word on any release dates yet for the list above. I&#8217;m also planning to have a contest very soon; more news on that later &#8211; but please state your interest now so I can see how many people are willing to participate. Also, if you haven&#8217;t noticed the Forums, please check it out and sign up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/next-lineup/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>SDL 1.3</title>
		<link>http://www.sdltutorials.com/sdl-13/</link>
		<comments>http://www.sdltutorials.com/sdl-13/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 13:41:30 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[C++ tutorials]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/?p=50</guid>
		<description><![CDATA[It seems there has been a lot of improvement with SDL lately, and that it is nearing its next major release. Here&#8217;s an announcement made by Sam Lantinga recently:
SDL 1.3 is ready for a massive bug hunt!
http://www.libsdl.org/tmp/SDL-1.3.zip
or
http://www.libsdl.org/tmp/SDL-1.3.tar.gz
The first person to report any particular bug for SDL 1.3 in bugzilla (http://bugzilla.libsdl.org) will get their names added [...]]]></description>
			<content:encoded><![CDATA[<p>It seems there has been a lot of improvement with SDL lately, and that it is nearing its next major release. Here&#8217;s an announcement made by Sam Lantinga recently:</p>
<blockquote><p>SDL 1.3 is ready for a massive bug hunt!<br />
http://www.libsdl.org/tmp/SDL-1.3.zip<br />
or<br />
http://www.libsdl.org/tmp/SDL-1.3.tar.gz</p>
<p>The first person to report any particular bug for SDL 1.3 in bugzilla (http://bugzilla.libsdl.org) will get their names added to the CREDITS list for the great SDL Bug Hunt of January 2009!</p>
<p>Anyone who contributes an SDL 1.3 bug fix which is accepted, regardless of whether they reported it, will have their names added to the CREDITS list as bug squashers in the great SDL Bug Hunt.  The top three squashers will be featured on the SDL website with a link to their favorite project (if they want.)</p>
<p>When contributing a patch, please include permission for me to release your code with SDL 1.3 and future versions of SDL under both the LGPL and a closed-source commercial license.</p>
<p>Contributors to SDL 1.3 are eligible for a discount on commercial licensing. Please contact me for details if you&#8217;re interested.</p>
<p>See ya!<br />
       -Sam Lantinga, Founder and President, Galaxy Gameworks LLC</p></blockquote>
<p>As such, after the official release all tutorials will get a makeover to reflect the changes in 1.3. Until then, I encourage everyone to continue to use SDL 1.2.x. Also, anyone interested in Commercial Games with SDL, should pay attention to this site now (<a href="http://galaxygameworks.com/">http://galaxygameworks.com/</a>).  You&#8217;re still free to use the library as long as you dynamically link the library, but for static links, you need a commercial license now. One incentive to get a license is official iPhone/iPod support now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/sdl-13/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>C++ Tutorial Basics</title>
		<link>http://www.sdltutorials.com/cpp-tutorial-basics/</link>
		<comments>http://www.sdltutorials.com/cpp-tutorial-basics/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 18:01:43 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[C++ tutorials]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/c-tutorial-basics/</guid>
		<description><![CDATA[Okay, so you are here. You&#8217;ve deceided, hey, I want to start making games. Good idea! I certainly encourage you in your mission, but lets face facts. Making games is hard. Really hard. And not to throw unscientific percentages at you, but practically 90% of all those wanting to make games never finish anything. There [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, so you are here. You&#8217;ve deceided, hey, I want to start making games. Good idea! I certainly encourage you in your mission, but lets face facts. Making games is hard. Really hard. And not to throw unscientific percentages at you, but practically 90% of all those wanting to make games never finish anything. There are always two reasons, lack of discipline, or lack of understanding. You hit a wall, try to find the easiest way around, and then give up for the next project. Or, you get tired of the game you are working on, think of a &#8220;better&#8221; idea, and then start on that. Games are subjective, tastes change, and along with helping you on the way to programming, I also hope I can give you some discipline to finish your work.</p>
<p><span id="more-49"></span></p>
<p>Now, here we are, at the very beginning of it all. Don&#8217;t worry, before you know it you&#8217;ll be making games in no time. Don&#8217;t rush yourself. Believe me, once you know how to program, you&#8217;ll miss all the learning (not that you won&#8217;t have more to learn). The journey is the most important part, and the most fun.</p>
<p>Some some very very basics first. That thing in front of you, that&#8217;s a computer (okay, technically a monitor probably, but let&#8217;s not be picky). For all you know, it does stuff. You click, you open windows, you download music (hopefully legally), play games, talk to friends. That&#8217;s about all it has been so far. Then, you got the brilliant idea to make a game. Well, exactly what is a game? More pointedly, how does anything work on a computer? </p>
<p>As you may know, everything in the computer world is represented in binary, 0 and 1. Meaning, on or off, true or false, or whatever other representation you want. This poses a slight problem to human beings, we cannot figure out the right combination of 0s and 1s to do anything. Imagine putting billions upon billions of 0s and 1s to write a game &#8211; it&#8217;s impossible! So, &#8220;in the beginning&#8221;, nice nerd people developed languages. They were crude at first, getting simple things done. These were called low-level languages. They performed basic things, extremely well. They told the computer to store bits into memory, or to get them back out, and so on. Well, that worked for a while, and then things got more complex. Now, we have high-level languages. C++, happens to be one of those languages. So, we use C++ and a bunch of commands and such, and it gets converted into those nice 0s and 1s (please understand, I am being very basic here).</p>
<p>Now, in order to get your C++ code into binary, we use something called a compiler. This is a middle-man program that takes your code, and spits out a program. Click the program just like anything else, and hey, it works! Now, alongside this, is something called a linker. You see, linker and compiler work together, they&#8217;re brothers! Linker is nice, it lets you take Joe&#8217;s C++ code and combine it with your own code &#8211; this then is sent over to compiler. Beyond this, as a beginner, don&#8217;t worry about how it works right now. As you progress, and gain experience, you&#8217;ll learn more about how these two tools (and many other tools) actually work. But for now, understand code go in to compiler, program come out of compiler. <img src='http://www.sdltutorials.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So what is code exactly? Well, it&#8217;s just text (basically). It&#8217;s like the text on this page, except it has a different meaning. Take, for example, this math equation:</p>
<div class="dean_ch" style="white-space: wrap;">
X = <span class="nu0">1</span> + <span class="nu0">1</span><br />
&nbsp;</div>
<p>That can be seen as code. In itself, it doesn&#8217;t mean anything. But if given to something like a compiler, it can be a program!</p>
<p>Now, one important aspect is to have the right environment. First, we know, you need a compiler and a linker. And for beginners, you&#8217;ll need an IDE (technically, you could code in text editor if you wanted). Now, an IDE, or Integrated Development Environment, is basically a program where you code. But it comes with some nice features, like it comes with a compiler and linker, and sets it up for you! It also gives you a lot of other people&#8217;s code; most of which we&#8217;ll be using in these tutorials. Why use other people&#8217;s code? Because, believe me, if you started with a clean slate, you&#8217;d have to code even the ability to print a single pixel to the screen. So, first task! Go download CodeBlocks:</p>
<p>http://www.codeblocks.org</p>
<p>Important note: Download the most stable, and the one <u>with</u> mingw. I&#8217;ve had quite a few people download the one without (sigh). Once installed, and opened, you&#8217;re ready to continue.</p>
<p>Click File, and then New Project. On the window that opens, click Empty Project and then Go. For the project title, pick what you want. I am putting C++ Basics. For a folder, put whatever. Click Next. Check only the &#8220;Create &#8216;Release&#8217; Configuration&#8221;. Click Finish. Now click, File and then New Empty File. On the window that pops up, be sure to add to your project. For the file name, put main.cpp. Copy this code below, and paste it in:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="co2">#include &lt;iostream&gt;</span></p>
<p><span class="kw4">int</span> main<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; std::<span class="kw3">cout</span> &lt;&lt; <span class="st0">&quot;Hello World!<span class="es0">\n</span>&quot;</span>;</p>
<p>&nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">0</span>;<br />
<span class="br0">&#125;</span><br />
&nbsp;</div>
<p>Click Build and then Build and run. If successful, you should see &#8220;Hello World!&#8221; followed by some other text. If so, congratutations! You just made your first program, sort of. <img src='http://www.sdltutorials.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>How lets explain what&#8217;s going here. First off at the very top, we have #include. Now would be a good time to explain the differences between two areas of your code. The first area is code to used by your compiler, the second area is your actual code to be made into a program. Anything that has a # before it, is code to be used by the compiler. Meaning, this code never actually makes it into the program. Why is this useful? Well, in this tutorial we have #include, this tells the compiler to include another file. In this case, we&#8217;re telling the compiler to go out and grab the file iostream and include it in the program. Another example would be #define.</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="co2">#define MY_NAME &quot;Tim&quot;</span></p>
<p>std::<span class="kw3">cout</span> &lt;&lt; MY_NAME;<br />
&nbsp;</div>
<p>Now, wherever we put MY_NAME, it is replaced with &#8220;Tim.&#8221; This first area is called preprocessor directives. These &#8220;direct&#8221; the compiler before getting to the actual code. So, to explain the first line again, we&#8217;re including the file iostream into our program. The reason why we do that is because the code for std::cout is in there. And we need that.</p>
<p>Next, we have int main() { }. This is called a function, and while we won&#8217;t get into functions until later, I need to try to explain them briefly. First, whenever you first run your program, the operating system needs to know where your code begins. That&#8217;s what main() is for, that&#8217;s where your code begins. So, when you open your program, it starts at the top of main, and goes down line by line. When it reaches the end, it&#8217;s done, and your program stops. Now, the { } simply define ownership. Everything within the curly braces { } belongs to main. Secondly, main is also a function. A function is simply a group of code. So, for example, we might have:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw4">int</span> Group1<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw4">int</span> Group2<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw4">int</span> main<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="br0">&#125;</span><br />
&nbsp;</div>
<p>We have three functions, each with its own code. But there are some important things about functions. A function may return some data:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw4">int</span> MyAge<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">22</span>;<br />
<span class="br0">&#125;</span><br />
&nbsp;</div>
<p>In this case, the function MyAge returns 22. Meaning, when the function is done, it&#8217;ll give back the number 22 from wherever it was first called. So, when the operating system opens our program, and our function main returns 0, it&#8217;s giving the number 0 back to the operating system. Why do we return 0? Well, lets say something wen&#8217;t wrong with your program when loading, in that case we can return 1, and if everything is okay, we can return 0. Again, this is a very very basic explanation of functions, and there&#8217;s a lot more to them. Just understand that when your program first opens that it starts at the top of main. </p>
<p>Next, we have the actual magic, std::cout. Now, this is really hard to explain to beginners, but for all purposes std::cout is simply a way for you to print text. You can use the << to separate text as well. Like:</p>
<div class="dean_ch" style="white-space: wrap;">
std::<span class="kw3">cout</span> &lt;&lt; <span class="st0">&quot;Hi &quot;</span> &lt;&lt; <span class="st0">&quot;my &quot;</span> &lt;&lt; <span class="st0">&quot;name &quot;</span> &lt;&lt; <span class="st0">&quot;is &quot;</span> &lt;&lt; <span class="st0">&quot;Tim.<span class="es0">\n</span>&quot;</span>;<br />
&nbsp;</div>
<p>Here&#8217;s the things I want to get across though. Notice the ; at the end? This is important, this is your period, so to speak. It signals the end of your particular command/code. Notice the code below:</p>
<div class="dean_ch" style="white-space: wrap;">
std::<span class="kw3">cout</span> &lt;&lt; <span class="st0">&quot;Test&quot;</span>;<br />
std::<span class="kw3">cout</span> &lt;&lt; <span class="st0">&quot;Test&quot;</span>;<br />
std::<span class="kw3">cout</span> &lt;&lt; <span class="st0">&quot;Test&quot;</span>;<br />
&nbsp;</div>
<p>Each command is separated not by a newline, but by a semi-colon. For beginners this is important, don&#8217;t forget your semi-colons! (Notice the one on return too). So, what&#8217;s that \n funny thing? That&#8217;s a newline character, which basically says, hey, move down a line. Like pressing Enter in a text editor.</p>
<p>Well, that&#8217;s all for now. This tutorial was very basic, and was intended that way. Future tutorials will tackle harder subjects at an increasing rate. <img src='http://www.sdltutorials.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Note: If your program opens and closes suddenly, run it from the command prompt. Start -> Run -> cmd. Navigate to your folder, and then type in your program. Hit enter!</p>
<p><b>C++ Basics &#8211; Tutorial Files:</b><br />
<b>Win32:</b> <a href="../tutorials/cpp-tutorial-basics.zip">Zip</a>, <a href="../tutorials/cpp-tutorial-basics.rar">Rar</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/cpp-tutorial-basics/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>DevHub is over 1 years old!</title>
		<link>http://www.sdltutorials.com/devhub-is-over-1-years-old/</link>
		<comments>http://www.sdltutorials.com/devhub-is-over-1-years-old/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 13:38:42 +0000</pubDate>
		<dc:creator>Tim Jones</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sdltutorials.com/devhub-is-over-1-years-old/</guid>
		<description><![CDATA[Wow, what a ways we have come! To help celebrate this momentous occasion, drums please&#8230; I have released the new tutorial in the series! Woo hoo!
P.S.
1  year was actually a few weeks ago, but oh well.  
]]></description>
			<content:encoded><![CDATA[<p>Wow, what a ways we have come! To help celebrate this momentous occasion, drums please&#8230; I have released the new tutorial in the series! Woo hoo!</p>
<p>P.S.<br />
1  year was actually a few weeks ago, but oh well. <img src='http://www.sdltutorials.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sdltutorials.com/devhub-is-over-1-years-old/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
