<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Programhalla</title>
	<atom:link href="http://noz3001.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://noz3001.wordpress.com</link>
	<description>Programming, Hacking and Tutorials</description>
	<lastBuildDate>Mon, 19 Sep 2011 19:05:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='noz3001.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/66d85d166de42e32a974d3b8c99dabaa?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Programhalla</title>
		<link>http://noz3001.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://noz3001.wordpress.com/osd.xml" title="Programhalla" />
	<atom:link rel='hub' href='http://noz3001.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Ubuntu font rendering on Debian Wheezy &amp; Sid</title>
		<link>http://noz3001.wordpress.com/2011/07/01/ubuntu-font-rendering-on-debian-wheezy/</link>
		<comments>http://noz3001.wordpress.com/2011/07/01/ubuntu-font-rendering-on-debian-wheezy/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 00:13:12 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cairo]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[libcairo]]></category>
		<category><![CDATA[rendering]]></category>
		<category><![CDATA[sid]]></category>
		<category><![CDATA[sid unstable]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unstable]]></category>
		<category><![CDATA[wheezy]]></category>

		<guid isPermaLink="false">http://noz3001.wordpress.com/?p=198</guid>
		<description><![CDATA[The one thing which always kept me from using Debian was the horrific font rendering on LCD screens which has plagued it since it was born. I&#8217;ve always liked the way Ubuntu renders fonts, so now Debian has pretty much the same libcairo2 package by default, making the fonts render like Ubuntu&#8217;s is pretty easy. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=198&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://noz3001.files.wordpress.com/2011/07/swirl-thumb.jpg"><img class="alignleft size-full wp-image-200" title="swirl-thumb" src="http://noz3001.files.wordpress.com/2011/07/swirl-thumb.jpg?w=121&#038;h=150" alt="" width="121" height="150" /></a>The one thing which always kept me from using Debian was the horrific font rendering on LCD screens which has plagued it since it was born. I&#8217;ve always liked the way Ubuntu renders fonts, so now Debian has pretty much the same libcairo2 package by default, making the fonts render like Ubuntu&#8217;s is pretty easy.</p>
<p>First thing to do is grab Ubuntu&#8217;s fonconfig-config package from any of the mirrors here: <a href="http://packages.ubuntu.com/natty/all/fontconfig-config/download">http://packages.ubuntu.com/natty/all/fontconfig-config/download</a> and save it somewhere. Now open the .deb file with Archive Manager (file-roller) as <strong>root </strong>and enter the <strong>/etc/fonts </strong>directory within the archive. Next, open nautilus as <strong>root</strong> (Alt + F2, gksudo nautilus) and brows to <strong>/etc/fonts </strong>on your Debian file system.</p>
<p>Next step is mega easy, just drag all the files and folders from the archive into the file browser, replacing all files which already exist.</p>
<p>Log out and back in, and change font preferences so they looks something like this:</p>
<div id="attachment_199" class="wp-caption aligncenter" style="width: 310px"><a href="http://noz3001.files.wordpress.com/2011/07/screenshot1.png"><img class="aligncenter size-medium wp-image-204" title="Screenshot" src="http://noz3001.files.wordpress.com/2011/07/screenshot1.png?w=300&#038;h=168" alt="" width="300" height="168" /></a><p class="wp-caption-text">Font configuration</p></div>
<p>Once this is done, fonts should be Ubuntu pretty!</p>
<p><strong>NOTE:</strong> It works fantastically well with Ubuntu fonts! <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/noz3001.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/noz3001.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/noz3001.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/noz3001.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/noz3001.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/noz3001.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/noz3001.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/noz3001.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/noz3001.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/noz3001.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/noz3001.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/noz3001.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/noz3001.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/noz3001.wordpress.com/198/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=198&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://noz3001.wordpress.com/2011/07/01/ubuntu-font-rendering-on-debian-wheezy/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15ef3253eaeccde12340a8c52183009e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">noz3001</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2011/07/swirl-thumb.jpg" medium="image">
			<media:title type="html">swirl-thumb</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2011/07/screenshot1.png?w=300" medium="image">
			<media:title type="html">Screenshot</media:title>
		</media:content>
	</item>
		<item>
		<title>[Fix] Metacity vs gnome-panel shadow race</title>
		<link>http://noz3001.wordpress.com/2011/06/21/fix-metacity-vs-gnome-panel-shadow-race/</link>
		<comments>http://noz3001.wordpress.com/2011/06/21/fix-metacity-vs-gnome-panel-shadow-race/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 14:24:11 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[--replace]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[doesnt]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[gnome-panel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[metacity]]></category>
		<category><![CDATA[natty]]></category>
		<category><![CDATA[shadow]]></category>
		<category><![CDATA[show]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[until]]></category>
		<category><![CDATA[up]]></category>
		<category><![CDATA[vs]]></category>

		<guid isPermaLink="false">http://noz3001.wordpress.com/?p=192</guid>
		<description><![CDATA[Using the classic desktop with metacity on Ubuntu 11.04, I got sick of having to reload metacity every time I logged in just so gnome-panel would get a nice drop shadow from metacity&#8217;s compositing manager. This post contains a really quick fix to make the shadow work and get the panel to look pretty again! [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=192&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Using the classic desktop with metacity on Ubuntu 11.04, I got sick of having to reload metacity every time I logged in just so gnome-panel would get a nice drop shadow from metacity&#8217;s compositing manager. This post contains a really quick fix to make the shadow work and get the panel to look pretty again!</p>
<p>This is my temporary workaround for this bug: <a href="https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/269670" target="_blank">LP #269670</a></p>
<p><span id="more-192"></span></p>
<p>As root, create a new file in <strong>/usr/bin</strong> named something remember-able along the lines of metacity. I chose <strong>/usr/bin/metashitty</strong>. Open it up in your favorite editor, as root, and paste the following short script and save it:</p>
<pre>#!/bin/bash

sleep 1 # Let gnome-panel have 1 second to register
metacity $* &amp;</pre>
<p>Next, give the script executable privileges:</p>
<pre>sudo chmod 775 /usr/bin/metashitty</pre>
<p>Now run <strong>gnome-session-properties</strong> from a terminal or by pressing Alt+F2, press <strong>Add</strong> and in the <strong>Command</strong> text field, enter the following:</p>
<pre>metashitty --replace</pre>
<p>And then press save and close the window. (You can give it a title and description if you wish)</p>
<p>Now if you log out and back in, the shadow should appear below the gnome-panel. If it doesn&#8217;t, you need to increase the number after <strong><em>sleep</em></strong> in the script we wrote earlier. Increase it by 1 each time until the shadow appears as soon as you log in. If the shadow appears too late, you need to decrease the number.</p>
<p>&nbsp;</p>
<div id="attachment_195" class="wp-caption aligncenter" style="width: 310px"><a href="http://noz3001.files.wordpress.com/2011/06/screenshot.png"><img class="size-medium wp-image-195" title="Screenshot" src="http://noz3001.files.wordpress.com/2011/06/screenshot.png?w=300&#038;h=168" alt="" width="300" height="168" /></a><p class="wp-caption-text">Resulting drop shadow on the top panel</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/noz3001.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/noz3001.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/noz3001.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/noz3001.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/noz3001.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/noz3001.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/noz3001.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/noz3001.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/noz3001.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/noz3001.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/noz3001.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/noz3001.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/noz3001.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/noz3001.wordpress.com/192/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=192&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://noz3001.wordpress.com/2011/06/21/fix-metacity-vs-gnome-panel-shadow-race/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15ef3253eaeccde12340a8c52183009e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">noz3001</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2011/06/screenshot.png?w=300" medium="image">
			<media:title type="html">Screenshot</media:title>
		</media:content>
	</item>
		<item>
		<title>2D Game Development with OpenGL &#8211; Drawing a basic tank</title>
		<link>http://noz3001.wordpress.com/2011/06/19/2d-game-development-with-opengl-drawing-a-basic-tank/</link>
		<comments>http://noz3001.wordpress.com/2011/06/19/2d-game-development-with-opengl-drawing-a-basic-tank/#comments</comments>
		<pubDate>Sun, 19 Jun 2011 19:21:25 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[2d]]></category>
		<category><![CDATA[box2d]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[gamedev_tanks]]></category>
		<category><![CDATA[glfw]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[tank]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://noz3001.wordpress.com/?p=179</guid>
		<description><![CDATA[This post will cover the very basics of how we will draw a tank, made up of 2 squares, one for the tank body and one for the tank turret. We will be drawing the tank the same way we drew the big white square, but by re-sizing and changing its colour! Pretty simple. There [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=179&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This post will cover the very basics of how we will draw a tank, made up of 2 squares, one for the tank body and one for the tank turret. We will be drawing the tank the same way we drew the big white square, but by re-sizing and changing its colour! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  Pretty simple.</p>
<p>There is only a small change to the original code. The addition of a new square for the turret and a change in colour for both squares along with a change in size so that they look like a tank and a turret.</p>
<p><span id="more-179"></span></p>
<p>In <strong>Player.cpp</strong> the draw method will change to look like this:</p>
<pre>/**
	&lt;Insert obvious comment here&gt;
*/
void Player::draw()
{
	glPushMatrix();
	glTranslatef(x, y, 0);

	// Draw the tank bottom
	glColor3f(0.0f, 0.2f, 0.0f);
	glBegin(GL_QUADS);
		glVertex3f(0.0f, 0.0f, 0.0f);
		glVertex3f(0.05f, 0.0f, 0.0f);
		glVertex3f(0.05f, 0.1f, 0.0f);
		glVertex3f(0.0f, 0.1f, 0.0f);
	glEnd();

	// Draw turret
	glColor3f(0.0f, 0.15f, 0.0f);
	glBegin(GL_QUADS);
		glVertex3f(0.02f, -0.04f, 0.0f);
		glVertex3f(0.03f, -0.04f, 0.0f);
		glVertex3f(0.03f, 0.05f, 0.0f);
		glVertex3f(0.02f, 0.05f, 0.0f);
	glEnd();

	glPopMatrix();
}
</pre>
<p>The first new function added is <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPushMatrix.xml">glPushMatrix</a>. This is so anything we change will only apply to the tank as we call <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPushMatrix.xml">glPopMatrix</a> to pop the stored matrix from the stack once we are finished with our tank drawing code. Also introduced is <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTranslate.xml">glTranslatef</a> which will be explained if you click the link ;D. <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">glColor3f</a> sets the colour which will be used within the next <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBegin.xml">glBegin</a> and <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBegin.xml">glEnd</a> calls. <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertex.xml">glVertex3f</a> defines the 4 points of the rectangles which will represent our tank body and turret.</p>
<p>If you save and run the code as it is, you should get something a little like this:</p>
<div id="attachment_180" class="wp-caption aligncenter" style="width: 310px"><a href="http://noz3001.files.wordpress.com/2011/06/screenshot-untitled-window1.png"><img class="size-medium wp-image-180" title="Screenshot-Game Window" src="http://noz3001.files.wordpress.com/2011/06/screenshot-untitled-window1.png?w=300&#038;h=236" alt="" width="300" height="236" /></a><p class="wp-caption-text">Tank on screen!</p></div>
<p>&nbsp;</p>
<p>See, it kinda looks like a tank facing south, kinda.. But that&#8217;s as graphically pleasing as it really needs to be for now!</p>
<p><strong>The next post will demonstrate how to handle input and move the tank </strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/noz3001.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/noz3001.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/noz3001.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/noz3001.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/noz3001.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/noz3001.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/noz3001.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/noz3001.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/noz3001.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/noz3001.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/noz3001.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/noz3001.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/noz3001.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/noz3001.wordpress.com/179/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=179&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://noz3001.wordpress.com/2011/06/19/2d-game-development-with-opengl-drawing-a-basic-tank/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15ef3253eaeccde12340a8c52183009e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">noz3001</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2011/06/screenshot-untitled-window1.png?w=300" medium="image">
			<media:title type="html">Screenshot-Game Window</media:title>
		</media:content>
	</item>
		<item>
		<title>2D Game Development with OpenGL &#8211; Setting up Box2D</title>
		<link>http://noz3001.wordpress.com/2011/06/19/2d-game-development-with-opengl-setting-up-box2d/</link>
		<comments>http://noz3001.wordpress.com/2011/06/19/2d-game-development-with-opengl-setting-up-box2d/#comments</comments>
		<pubDate>Sun, 19 Jun 2011 16:39:54 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[2d]]></category>
		<category><![CDATA[box2d]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[gamedev_tanks]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[physics]]></category>

		<guid isPermaLink="false">http://noz3001.wordpress.com/?p=168</guid>
		<description><![CDATA[This post will explain how to install Box2D on a Linux/Unix system and then add it to your game, ready to be used. Box2D is a physics engine specifically designed to be used in 2D graphics software to bring real world physics. You can find a list of features Box2D contains here: http://www.box2d.org/features.html Downloading and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=168&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This post will explain how to install Box2D on a Linux/Unix system and then add it to your game, ready to be used. <a href="http://www.box2d.org/">Box2D</a> is a physics engine specifically designed to be used in 2D graphics software to bring real world physics. You can find a list of features Box2D contains here: <a href="http://www.box2d.org/features.html">http://www.box2d.org/features.html</a></p>
<p><span id="more-168"></span></p>
<h2></h2>
<h2>Downloading and compiling for Linux</h2>
<p>The first thing you will need to do is download the Box2D archive from the Google code website, found here: <a href="http://code.google.com/p/box2d/downloads/list">http://code.google.com/p/box2d/downloads/list</a>. The latest version at the time of writing this post is v2.1.2. Once downloaded, extract the archive to any folder you want to use as the build directory.</p>
<p>The next step is to open a terminal and cd to the directory you have extracted Box2D to and then cd again into <strong>Box2D_v2.1.2</strong> (or whatever version you have downloaded). And then finally, cd into the <strong>Box2D</strong> directory.</p>
<p>Once in this directory, use cmake to create the Makefile needed to build Box2D:</p>
<pre>cmake .</pre>
<p>You will need cmake to be installed before you do this, if you do not, you can install it on Debian distributions as follows:</p>
<pre>sudo apt-get install cmake</pre>
<p>If all is successful, you should receive no errors and your output should look something like this:</p>
<p><a href="http://noz3001.files.wordpress.com/2011/06/screenshot-terminal.png"><img class="aligncenter size-medium wp-image-169" title="Screenshot - Terminal" src="http://noz3001.files.wordpress.com/2011/06/screenshot-terminal.png?w=300&#038;h=179" alt="" width="300" height="179" /></a></p>
<p>Next step is easy, just type make and Box2D will begin to compile. Output should look like this:</p>
<p><a href="http://noz3001.files.wordpress.com/2011/06/screenshot-terminal-1.png"><img class="aligncenter size-medium wp-image-170" title="Screenshot-Terminal-1" src="http://noz3001.files.wordpress.com/2011/06/screenshot-terminal-1.png?w=300&#038;h=179" alt="" width="300" height="179" /></a></p>
<p>Once that has completed, go ahead and install the build Box2D libraries and header files with the following command:</p>
<pre>sudo make install</pre>
<p>Once this command is completed, type:</p>
<pre>whereis Box2D</pre>
<p>and the output should be the location the libraries have been installed to. In my case, they are at <strong>/usr/local/lib/Box2D</strong>.</p>
<p>You have now installed Box2D on your system and are ready to use it in your project.</p>
<h2></h2>
<h2>Including it in our tank game</h2>
<p>Including it in our game at this point only requires 2 changes, the first being the addition of the Box2D header file to <strong>Main.cpp</strong> and the addition of the library to the <strong>Makefile</strong> build line.</p>
<p>Add to the top of <strong>Main.cpp</strong>:</p>
<pre>#include &lt;Box2D/Box2D.h&gt;</pre>
<p>and then add:</p>
<pre>-lBox2D</pre>
<p>to the end of your makefile build line. Type <strong>make </strong>to build your game again and it should compile with Box2D included.</p>
<p>&nbsp;</p>
<p><a href="http://noz3001.wordpress.com/2011/06/19/2d-game-development-with-opengl-drawing-a-basic-tank/"><strong>In the next step we will be drawing a basic tank to the screen</strong></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/noz3001.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/noz3001.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/noz3001.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/noz3001.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/noz3001.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/noz3001.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/noz3001.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/noz3001.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/noz3001.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/noz3001.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/noz3001.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/noz3001.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/noz3001.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/noz3001.wordpress.com/168/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=168&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://noz3001.wordpress.com/2011/06/19/2d-game-development-with-opengl-setting-up-box2d/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15ef3253eaeccde12340a8c52183009e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">noz3001</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2011/06/screenshot-terminal.png?w=300" medium="image">
			<media:title type="html">Screenshot - Terminal</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2011/06/screenshot-terminal-1.png?w=300" medium="image">
			<media:title type="html">Screenshot-Terminal-1</media:title>
		</media:content>
	</item>
		<item>
		<title>2D Game Development with OpenGL – Creating the player object</title>
		<link>http://noz3001.wordpress.com/2011/06/19/2d-game-development-with-opengl-%e2%80%93-creating-the-player-object/</link>
		<comments>http://noz3001.wordpress.com/2011/06/19/2d-game-development-with-opengl-%e2%80%93-creating-the-player-object/#comments</comments>
		<pubDate>Sun, 19 Jun 2011 13:19:47 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[2d]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[gamedev_tanks]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[tank]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://noz3001.wordpress.com/?p=157</guid>
		<description><![CDATA[The next step in the development of the game is to add a player object. To keep the game simple, we wont be using any sort of inheritance and will be keeping all object types entirely separate. This section will be pretty small, adding 2 more files to our source tree, making a small modification [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=157&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The next step in the development of the game is to add a player object. To keep the game simple, we wont be using any sort of inheritance and will be keeping all object types entirely separate. This section will be pretty small, adding 2 more files to our source tree, making a small modification to the <strong>Makefile</strong> and adding 3 lines of code to <strong>Main.cpp</strong>.</p>
<p><span id="more-157"></span></p>
<h2></h2>
<h2>Player.h</h2>
<p>The first new file which will be added is <strong>Player.h</strong> which will hold the definition for our Player object. This file&#8217;s basic form is as follows:</p>
<pre>class Player
{
        private:
                int health;
                float x, y;
                bool moving;

        public:
                int getHealth(void);
                float getX(void);
                float getY(void);
                void startMoving(void);
                void stopMoving(void);

                void update();
                void draw();
};</pre>
<p>This basic class contains elements which will help simulate our tank. The health attribute will be used to determine whether the tank has been destroyed or not, x and y are pretty obvious (the tank location), the moving boolean will be used in the <em>update</em> method to decide whether to move the tank or not and there are a few public functions which can be used to access these attributes. It is good to note, however, that most of these attributes might become deprecated later on in the development phase due to the possible implementation of the <a href="http://www.box2d.org/">Box2D physics engine</a>.  The <em>update</em> and <em>draw</em> methods will be called from the update and render methods in the game loop found in<strong> Main.cpp</strong>.</p>
<h2></h2>
<h2>Player.cpp</h2>
<p>The next file to be added is <strong>Player.cpp</strong>. This contains the code for the functions defined in the <em>Player</em> class from <strong>Player.h</strong>.</p>
<pre>#include "Player.h"

#include &lt;GL/gl.h&gt; 

/**
	Return health of player
*/
int Player::getHealth(void)
{
	return health;
}

/**
	Return X location
*/
float Player::getX(void)
{
	return x;
}

/**
	Return y location
*/
float Player::getY(void)
{
	return y;
}

/**
	Start tank moving forward
*/
void Player::startMoving(void)
{
	moving = true;
}

/**
	Stop tank moving forward
*/
void Player::stopMoving(void)
{
	moving = false;
}

/**
	Player's update function
*/
void Player::update()
{

}

/**
	&lt;Insert obvious comment here&gt;
*/
void Player::draw()
{
	glBegin(GL_QUADS);
		glVertex3f(0.0f, 0.0f, 0.0f);
		glVertex3f(1.0f, 0.0f, 0.0f);
		glVertex3f(1.0f, 1.0f, 0.0f);
		glVertex3f(0.0f, 1.0f, 0.0f);
	glEnd();
}</pre>
<p>Reading through the functions should give you a general idea of what each one does, most of them being simple one line return statements. The only change is within the <em>draw</em> function in which I have added code to test whether OpenGL is working correctly. If the <em>draw </em>function gets called, a big white box should be drawn, filling to top right area of the window. If this behavior is confusing, I recommend reading about the OpenGL co-ordinate system. For the OpenGL code to work, <strong> GL/gl.h </strong>had to be included at the top. This file <em>might </em>be in a different location on your system!</p>
<p>For now, this is our complete starting point for the <em>Player</em> object. We will add it to <strong>Main.cpp </strong>and set it up for use.</p>
<h2></h2>
<h2>Main.cpp Changes</h2>
<p>First change we are going to make to <strong>Main.cpp</strong> is the inclusion of <strong>Player.h</strong> so that we can access the new class we have made. Just add the following to the list of the includes at the top:</p>
<pre>#include "Player.h"</pre>
<p>Then we can create a new object of type <em>Player</em> as a global variable for use throughout the game loop.</p>
<pre>Player Player1;</pre>
<p>The next step is to call the <em>player1 </em>functions <em>update</em> and <em>draw</em>. The update function should be called from the <em>update</em> function located in <strong>Main.cpp</strong> as follows:</p>
<pre>Player1.update();</pre>
<p>And then add the <em>draw</em> function call to the <em>render </em>function in <strong>Main.cpp</strong>:</p>
<pre>Player1.draw();</pre>
<p>These additions should be sufficient for now so save all source code files and open up the <strong>Makefile</strong>, ready to include <strong>Player.cpp </strong>into the compilation.</p>
<p>The whole source code in <strong>Main.cpp </strong>should now look something like this, the changes from this stage have been highlighted:</p>
<pre>#include &lt;iostream&gt;
#include &lt;ctime&gt;

#include &lt;GL/glfw.h&gt;

<strong><span style="color:#ff0000;">#include "Player.h"</span></strong>

void render();
void update();

<span style="color:#ff0000;"><strong>Player Player1;</strong></span>

/**
	- sleep function -
	Cross platform sleep implementation
*/
void _sleep(double ms)
{
    double st = clock();
    if (ms &lt;= 0)
        ms = 10;
    while (clock() &lt; (st + ms));
}

/**
	- main function -
	Program entry point
*/
int main(int argc, char** argv)
{
	std::cout &lt;&lt; "Loading Tank Game v1 (Noz3001.wordpress.com)" &lt;&lt; std::endl;
	glfwInit();

	// Create glfw window
	if (glfwOpenWindow(800, 600, 5, 6, 5, 0, 8, 0, GLFW_WINDOW) != GL_TRUE)
		std::cout &lt;&lt; "Error creating window!" &lt;&lt; std::endl;

	// Set window title
	glfwSetWindowTitle("Tank Game");

	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();

	// Start main game loop
	// This calls the functions which update objects and render them to screen
	while (true)
	{
		update();
		render();

		glfwSwapBuffers(); // Switch buffers (double buffering)
		_sleep(10); // Let a bit of CPU time for other processes
	}	

	return 0;
}

/**
	- Render function -
	Used to draw objects to the screen.
*/
void render()
{
	glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Colour to clear the scene
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	// TODO: Draw stuff here!
	<span style="color:#ff0000;"><strong>Player1.draw(); </strong></span>
}

/**
	- Update function -
	Updates objects. States, locations, etc
*/
void update()
{
	// TODO: Update objects here
	<span style="color:#ff0000;"><strong>Player1.update();</strong></span>
}</pre>
<h2></h2>
<h2>Makefile Changes</h2>
<p>Not much needs to be changed in the Makefile, it should now look like this:</p>
<pre>all:
        g++ Main.cpp Player.cpp -o Game -lGL -lglfw</pre>
<p>You should now be able to compile the changes with the</p>
<pre>make</pre>
<p>command and test them out. If you see the big white box, everything was successful!</p>
<div id="attachment_160" class="wp-caption aligncenter" style="width: 310px"><a href="http://noz3001.files.wordpress.com/2011/06/screenshot-untitled-window.png"><img class="size-medium wp-image-160" title="Tank Game Window" src="http://noz3001.files.wordpress.com/2011/06/screenshot-untitled-window.png?w=300&#038;h=236" alt="" width="300" height="236" /></a><p class="wp-caption-text">Screenshot of the window with the big white box!</p></div>
<p>&nbsp;</p>
<p><a href="http://noz3001.wordpress.com/2011/06/19/2d-game-development-with-opengl-setting-up-box2d/"><strong>In the next step, we will set up Box2D.</strong></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/noz3001.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/noz3001.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/noz3001.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/noz3001.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/noz3001.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/noz3001.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/noz3001.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/noz3001.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/noz3001.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/noz3001.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/noz3001.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/noz3001.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/noz3001.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/noz3001.wordpress.com/157/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=157&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://noz3001.wordpress.com/2011/06/19/2d-game-development-with-opengl-%e2%80%93-creating-the-player-object/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15ef3253eaeccde12340a8c52183009e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">noz3001</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2011/06/screenshot-untitled-window.png?w=300" medium="image">
			<media:title type="html">Tank Game Window</media:title>
		</media:content>
	</item>
		<item>
		<title>2D Game Development with OpenGL &#8211; Part 1</title>
		<link>http://noz3001.wordpress.com/2011/06/17/2d-game-development-with-opengl-part-1/</link>
		<comments>http://noz3001.wordpress.com/2011/06/17/2d-game-development-with-opengl-part-1/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 22:44:08 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[2d]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[gamedev_tanks]]></category>
		<category><![CDATA[glfw]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[rendering]]></category>
		<category><![CDATA[tanks]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://noz3001.wordpress.com/?p=128</guid>
		<description><![CDATA[In this tutorial I will be demonstrating a “quick and easy” way to make a 2D game using OpenGL and a programming language, no engines involved! To follow this tutorial you are expected to have at least a bit of experience using OpenGL and the language you want to use, even if you have only [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=128&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this tutorial I will be demonstrating a “quick and easy” way to make a 2D game using OpenGL and a programming language, no engines involved! To follow this tutorial you are expected to have at least a bit of experience using OpenGL and the language you want to use, even if you have only ever gotten as far as making a window and a triangle! I will be using C++ throughout the creation of the game and will be writing this whilst developing the software. I&#8217;ll be using Ubuntu 11.04 with the proprietary ATI driver as the platform but it shouldn&#8217;t make much difference, the window creation code might be the only difference if the platform being used does not have GLFW.</p>
<p>The whole development process will be split up into 4 stages, each should reach significant milestones leading up to the project&#8217;s completion. I&#8217;m not going to bother with a design stage, for now the game is going to consist of basic shapes with solid colour. This can be changed later on in development to actual graphics will little effort anyway.</p>
<p><span id="more-128"></span></p>
<h1>Development: Stage 1</h1>
<h2> Creating a Window</h2>
<p>Hopefully you have GLFW installed somewhere if you are going to use C++ to follow this tutorial. If not, and you are using Ubuntu (maybe Debian, but I don&#8217;t know):</p>
<pre>sudo apt-get install libglfw-dev</pre>
<p style="text-align:left;" align="CENTER">Once all of the dependencies are installed, we can create the first two files which will be used in the development process. These files are <strong>Main.cpp</strong> and <strong>Makefile</strong>. Main.cpp contains the <em>main()</em> method which will be called when the program is loaded and will initialise the GLFW window, OpenGL and start the main game loop. Makefile is used for making compiling easier on Linux so if you are on windows or using an IDE, you probably won&#8217;t want/need one.</p>
<h3 style="text-align:left;" align="CENTER">Makefile</h3>
<p>The contents of the Makefile file are as follows:</p>
<pre>all:
        g++ Main.cpp -o Game -lGL -lglfw</pre>
<p>SIMPLES! Right? It just calls <em>g++</em> and compiles <em>Main.cpp</em> into <em>Game</em> and links the two libraries <em>GL </em>and <em>glfw</em> usually found in <em>/usr/lib/gl(fw).o</em>.</p>
<h4></h4>
<h3>Main.cpp</h3>
<p>The entry point to the program. It contains the main function which sets up the glfw window and starts the game loop, ready to render objects. The following code does all of the above and is a simple framework on which a game or graphical application can be developed upon.</p>
<pre>#include &lt;iostream&gt;
#include &lt;ctime&gt;

#include &lt;GL/glfw.h&gt;

void render();
void update();

/**
    - sleep function -
    Cross platform sleep implementation
*/
void _sleep(double ms)
{
    double st = clock();
    if (ms &lt;= 0)
        ms = 10;
    while (clock() &lt; (st + ms));
}

/**
    - main function -
    Program entry point
*/
int main(int argc, char** argv)
{
    std::cout &lt;&lt; "Loading Tank Game v1 (Noz3001.wordpress.com)" &lt;&lt; std::endl;
    glfwInit(); // Initialise GLFW

    // Create glfw window
    if (glfwOpenWindow(800, 600, 5, 6, 5, 0, 8, 0, GLFW_WINDOW) != GL_TRUE)
        std::cout &lt;&lt; "Error creating window!" &lt;&lt; std::endl;

    // Set window title
    glfwSetWindowTitle("Tank Game");

    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();

    // Start main game loop
    // This calls the functions which update objects and render them to screen
    while (true)
    {
        update();
        render();

        glfwSwapBuffers(); // Switch buffers (double buffering)
        _sleep(10); // Let a bit of CPU time for other processes
    }    

    return 0;
}

/**
    - Render function -
    Used to draw objects to the screen.
*/
void render()
{
    glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Colour to clear the scene
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    // TODO: Draw stuff here!    
}

/**
    - Update function -
    Updates objects. States, locations, etc
*/
void update()
{
    // TODO: Update objects here
}</pre>
<p>You should now have two files saved and ready to be compiled! Read through the code if you want, it is all pretty self explanatory. It just creates the window and then goes into an infinite loop, ready to render and update!</p>
<p>To build this on Linux, just type <em>make</em> into a terminal and then run it with <em>./Game</em>. On windows, do whatever you have to to build it <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p>Once ran, you should be presented with a window like this:</p>
<div id="attachment_130" class="wp-caption aligncenter" style="width: 310px"><a href="http://noz3001.files.wordpress.com/2011/06/screenshot-untitled-window-1.png"><img class="size-medium wp-image-130" title="GLFW Game Window" src="http://noz3001.files.wordpress.com/2011/06/screenshot-untitled-window-1.png?w=300&#038;h=236" alt="Game Window" width="300" height="236" /></a><p class="wp-caption-text">Blank window ready for rendering</p></div>
<p>It may look a bit bland, but this is the base on which we will create a fully functional game! You can test that OpenGL is actually doing something by changing the code on line 63:</p>
<pre>glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Colour to clear the scene</pre>
<p>The parameters this function takes are Red value, Green value, Blue value and Alpha value. By changing the first parameter to 1, the window should be red instead of black.</p>
<p><a href="http://noz3001.wordpress.com/2011/06/19/2d-game-development-with-opengl-%e2%80%93-creating-the-player-object/">In part 2, we will create the player object!</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/noz3001.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/noz3001.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/noz3001.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/noz3001.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/noz3001.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/noz3001.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/noz3001.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/noz3001.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/noz3001.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/noz3001.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/noz3001.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/noz3001.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/noz3001.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/noz3001.wordpress.com/128/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=128&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://noz3001.wordpress.com/2011/06/17/2d-game-development-with-opengl-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15ef3253eaeccde12340a8c52183009e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">noz3001</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2011/06/screenshot-untitled-window-1.png?w=300" medium="image">
			<media:title type="html">GLFW Game Window</media:title>
		</media:content>
	</item>
		<item>
		<title>VICE C64: Saving programs to disk</title>
		<link>http://noz3001.wordpress.com/2010/06/18/vice-c64-saving-programs-to-disk/</link>
		<comments>http://noz3001.wordpress.com/2010/06/18/vice-c64-saving-programs-to-disk/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 15:42:02 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[64]]></category>
		<category><![CDATA[c64]]></category>
		<category><![CDATA[commodore]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[emulator]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[loading]]></category>
		<category><![CDATA[Program]]></category>
		<category><![CDATA[saving]]></category>
		<category><![CDATA[tape]]></category>
		<category><![CDATA[to]]></category>
		<category><![CDATA[vice]]></category>

		<guid isPermaLink="false">http://noz3001.wordpress.com/?p=104</guid>
		<description><![CDATA[In yesterday&#8217;s post, creating simple BASIC programs, saving them into memory and running them was demonstrated. This post will be a small one demonstrating how to save your program from memory to a disk so it can be retrieved again after restarting the C64 or clearing the memory. The emulated disk drives VICE supports both [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=104&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_002.png"><img class="aligncenter size-medium wp-image-105" title="VICE: C64 emulator" src="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_002.png?w=300&#038;h=245" alt="VICE: C64 emulator" width="300" height="245" /></a></p>
<p>In yesterday&#8217;s post, creating simple BASIC programs, saving them into memory and running them was demonstrated. This post will be a small one demonstrating how to save your program from memory to a disk so it can be retrieved again after restarting the C64 or clearing the memory.</p>
<h2>The emulated disk drives</h2>
<p>VICE supports both C64 disc images and tape images by emulating the original devices. The use of an emulator means that we will have to use images of the storage media saved as files on the host operating system&#8217;s file system.</p>
<p>It is possible to create empty disk image files through VICE, ready to save data to them as if they were a real medium.  To create one of these empty images, click <em>File &gt; Create and attach an empty disk &gt; Unit #8&#8230;</em> and then choose a name and location to create the image. <strong> </strong></p>
<p><strong>Make sure not to forget to include the .C64 file extension. </strong></p>
<p><a href="http://noz3001.files.wordpress.com/2010/06/selection_003.png"><img class="alignleft size-thumbnail wp-image-106" title="VICE" src="http://noz3001.files.wordpress.com/2010/06/selection_003.png?w=150&#038;h=114" alt="" width="150" height="114" /></a> Once the file has been created, it will be attached to Unit #8. This is the identifier of the drive in which the disk has been loaded. It is necessary to remember the ID of the drive because to save and load from it, the number is used as a parameter.</p>
<p>If all went well, the C64 should still show READY and we can move on to writing the program to be saved.</p>
<h2></h2>
<h2><span id="more-104"></span></h2>
<h2>Writing the program</h2>
<p>We shall begin by creating a basic program, saving it in memory and then writing it to the disk. The program will be a simple loop, printing out a string a few times before exiting.</p>
<p>The program:</p>
<p style="text-align:left;"><code>0 FOR I = 0 TO 10<br />
1 PRINT "HI, I'M NATHAN"<br />
2 NEXT I<br />
3 END</code></p>
<p>Go ahead and test the program to make sure it works before we write it to the disk.</p>
<h2>Saving our program</h2>
<p>Once the program has been tested, it&#8217;s time to save it to our disk image. The process of saving is relatively simple and quite easy to remember, consisting of only one command, <em>SAVE</em>.</p>
<p>The usage of <em>SAVE</em> is as follows:</p>
<p><code>SAVE [Name of program], [Device ID]</code></p>
<p>To save the program currently saved in memory, type:</p>
<p><code>SAVE "MYPROGRAM", 8</code></p>
<p>The C64 will then attempt to save the code under the title <strong>MYPROGRAM</strong> to the disk attached to device number <strong>8</strong>. If all goes well, the C64 should announce that it is saving the program and then become READY for more input. The program should now be saved for future use.</p>
<h2>Loading and testing</h2>
<p>Now the program is saved, testing it out should be easy and will require one new command, <em>LOAD</em>. If re-attaching the disk is needed, click <em>File &gt; Attach a disk image &gt; Unit #8&#8230;</em> and then choose the disk image file which contains the program.</p>
<p>To test properly, it is necessary to clear memory of any program which might be stored by using the <em>NEW</em> command and then <em>LIST</em> to check memory contents have been removed.</p>
<p>The <em>LOAD</em> command is to be used as follows:</p>
<p><code>LOAD [Program name], [Device ID]</code></p>
<p>Go ahead and load up the program from the disk by typing <em>LOAD &#8220;MYPROGRAM&#8221;, 8</em>. The C64 should announce that it is searching for the program and once found, it will begin to load it into memory. When it becomes READY, go ahead and type <em>LIST</em> to check the contents now stored in memory.</p>
<p><a href="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_0051.png"><img class="alignleft size-thumbnail wp-image-107" title="VICE: C64 emulator" src="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_0051.png?w=150&#038;h=122" alt="" width="150" height="122" /></a> Once the <em>LIST</em> command finished, the output on screen should perfectly resemble the program you saved to the disk. Use the <em>RUN</em> command to execute the program and check that it loaded successfully.</p>
<p>The loop will be executed and the string printed. The program has been successfully saved to disk.</p>
<p><a href="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_0061.png"><img class="aligncenter size-medium wp-image-108" title="VICE: C64 emulator" src="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_0061.png?w=300&#038;h=245" alt="" width="300" height="245" /></a></p>
<h2>The quick way</h2>
<p><a href="http://noz3001.files.wordpress.com/2010/06/attach-disk-image-as-unit-8_007.png"><img class="alignleft size-medium wp-image-109" title="Attach Disk Image" src="http://noz3001.files.wordpress.com/2010/06/attach-disk-image-as-unit-8_007.png?w=126&#038;h=120" alt="" width="126" height="120" /></a>There is also a quicker and easier way to load a program from disk with VICE. In the <em>Attach Disk Image</em> dialog, clicking once on the disk image file will display the contents of it in the box to the right. There will be a list of programs stored and clicking on once will automatically load it and run it within the C64.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/noz3001.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/noz3001.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/noz3001.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/noz3001.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/noz3001.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/noz3001.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/noz3001.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/noz3001.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/noz3001.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/noz3001.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/noz3001.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/noz3001.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/noz3001.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/noz3001.wordpress.com/104/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=104&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://noz3001.wordpress.com/2010/06/18/vice-c64-saving-programs-to-disk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15ef3253eaeccde12340a8c52183009e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">noz3001</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_002.png?w=300" medium="image">
			<media:title type="html">VICE: C64 emulator</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2010/06/selection_003.png?w=150" medium="image">
			<media:title type="html">VICE</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_0051.png?w=150" medium="image">
			<media:title type="html">VICE: C64 emulator</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_0061.png?w=300" medium="image">
			<media:title type="html">VICE: C64 emulator</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2010/06/attach-disk-image-as-unit-8_007.png?w=300" medium="image">
			<media:title type="html">Attach Disk Image</media:title>
		</media:content>
	</item>
		<item>
		<title>The joys of BASIC and the Commodore 64</title>
		<link>http://noz3001.wordpress.com/2010/06/17/the-joys-of-basic-and-the-commodore-64/</link>
		<comments>http://noz3001.wordpress.com/2010/06/17/the-joys-of-basic-and-the-commodore-64/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 20:45:05 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[64]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[commodore]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[v2]]></category>

		<guid isPermaLink="false">http://noz3001.wordpress.com/?p=72</guid>
		<description><![CDATA[Every programmer has a secret (or not so secret) soft spot for the Commodore 64, I know I do so off to Google shopping search I go to try and find a cheap one. £100+ is a bit too ridiculous for me though so I managed to find an alternative. Meet VICE. Installing VICE VICE [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=72&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Every programmer has a secret (or not so secret) soft spot for the Commodore 64, I know I do so off to Google shopping search I go to try and find a cheap one. £100+ is a bit too ridiculous for me though so I managed to find an alternative.</p>
<p>Meet VICE.</p>
<div id="attachment_73" class="wp-caption alignleft" style="width: 160px"><a href="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_005.png"><img class="size-thumbnail wp-image-73" title="VICE: C64 emulator" src="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_005.png?w=150&#038;h=122" alt="VICE: C64 emulator" width="150" height="122" /></a><p class="wp-caption-text">VICE: C64 emulator</p></div>
<h2>Installing VICE</h2>
<p>VICE C64 is a cross platform Commodore 64 emulator and best of all, it&#8217;s free software. (This doesn&#8217;t mean the Commodore 64 roms are!) Ubuntu users can install VICE via the Ubuntu Software Centre. Just search for &#8220;VICE&#8221; and install the emulator.</p>
<p>Once installed, you will need to download the ROM&#8217;s. You can find them <a href="http://www.zimmers.net/anonftp/pub/cbm/crossplatform/emulators/VICE/old/vice-0.15.0-roms.tar.gz">HERE</a>. Once downloaded, extract the contents of the &#8220;data&#8221; folder to ~/.vice and then run the emulator via the Applications&gt;Other menu or typing &#8220;x64&#8243; into a terminal.</p>
<h2>Post boot</h2>
<p>Once the emulator boots up, hopefully successfully, you should be greeted with the ever so famous &#8220;<strong><em>COMMODORE 64 BASIC V2</em></strong>&#8221; message. If you&#8217;re lucky enough to have reached this point, it&#8217;s time to write your first (unless you&#8217;ve done this before) BASIC program for the C64 and where better to start than the almighty Hello World application.</p>
<p>When I look at the lovely blue screen of the C64, I try to think of it as a BASIC interpreter quite similar to Python&#8217;s. This enables the user to enter BASIC commands without having to save them to memory, preserving valuable storage space in the 38911 byte block of memory.</p>
<p><span id="more-72"></span></p>
<p><a href="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_006.png"><img class="size-thumbnail wp-image-74" src="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_006.png?w=150&#038;h=122" alt="VICE: C64 emulator" width="150" height="122" /></a></p>
<h2>First BASIC commands</h2>
<p>Possibly the most important of all BASIC commands on the C64 is the <em>PRINT</em> command. True to it&#8217;s title, this command will output (print) information to the graphics memory <del datetime="2010-06-17T17:56:39+00:00">at the current location of the cursor</del>.</p>
<p>This command is going to be one of 3 commands which are going to be used in the Hello World program. Before writing anything, typing <em>&#8220;NEW&#8221;</em> will clear memory of any variables and code which might have been previously saved. This is not necessary if the C64 has only just booted because memory will already be clean.</p>
<p>The first &#8220;Hello World&#8221; is really simple. One line of BASIC code will achieve it. Type the following into the emulator and press enter:</p>
<p><code>PRINT "HELLO WORLD!"</code></p>
<p>By now, you might have noticed that everything typed is in capital letters. This is a C64 standard and you will have to get used to it. The shift key on the C64 is used to type alternate characters, my favourite being SHIFT+S. Try some of these alternate characters in another <em>PRINT</em> command.</p>
<p>You&#8217;re now probably thinking &#8220;well that didn&#8217;t really feel like programming.. I can do that in a normal terminal&#8221;. You&#8217;d be correct to think that, it wasn&#8217;t a true program but it&#8217;s an example of how the C64 is basically like an interpretor.</p>
<p>The next step is to actually store a BASIC program in memory and run it. To store code in memory, one must prefix each line with a number incrementally. The lines are typed in the format <em>&#8220;&#8221;</em>. The following is an example of how to store to last program into memory without running the command.</p>
<p><code>0 PRINT "HELLO WORLD!"<br />
1 END </code></p>
<p>Noticeably, each line of code in the above is prefixed with a line number. This tells the C64 to save the command in memory instead of executing it when the return key is hit. This allows the programmer to write whole programs without having to run each command separately. There is a new command introduced at the end of this program. The <em>END</em> command signals the termination of the program to the C64, simple as that.</p>
<p>Once the return key is pressed after the last line, the program will be stored in memory. It is possible to view every line of code which has been stored in memory by using the <em>LIST</em> command. This will output the contents of the memory.</p>
<p><a href="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_007.png"><img class="size-thumbnail wp-image-75" src="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_007.png?w=150&#038;h=122" alt="VICE: C64 emulator" width="150" height="122" /></a></p>
<p>If the output looks similar to the above image, then everything has gone well so far and it&#8217;s time to execute the program stored in memory. This is as simple as typing <em>&#8220;RUN&#8221;</em>.</p>
<p>The <em>RUN</em> command will execute the program which is stored in memory. Output should look similar to the following picture.</p>
<p><a href="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_008.png"><img class="alignleft size-thumbnail wp-image-76" src="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_008.png?w=150&#038;h=122" alt="" width="150" height="122" /></a></p>
<p>If a syntax error occurs, check back through the code entered and look for the problem. Replacing lines is as simple as prefixing a new line with the same number of that which is to be replaced.</p>
<h2>POKE and PEEK</h2>
<p>Along with the <em>PRINT</em> command, there are many others which are necessary for creating a useful program. I&#8217;m going to cover 3 more important commands in this section, starting with POKE.</p>
<p>POKE is quite a simple command which is used to modify bytes at any address in memory. The syntax of this command is relatively simple and is as follows:</p>
<p><code>POKE [Address], [byte to write]</code></p>
<p>A good example to demonstrate the use of <em>POKE</em> is using it to write a character to graphics memory, thus displaying it on screen. Graphics memory on the C64 starts at address 1024 (all memory block documentation can be found <a href="http://project64.c64.org/hw/c64.html">HERE</a> in txt format) so we will write to address 1024+15 so it will output the character 15 columns across at the top of the screen.</p>
<p><code>POKE 1024+15, 1</code></p>
<p>The above code will set the byte at address 1024 to 1, the ascii code for &#8216;a&#8217;.  Remember, the C64 is all uppercase so it will show an A.</p>
<p><a href="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_009.png"><img class="alignleft size-thumbnail wp-image-79" src="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_009.png?w=150&#038;h=122" alt="" width="150" height="122" /></a></p>
<p>The opposite to the <em>POKE</em> command, is <em>PEEK</em>. The peek command is to be used as a parameter to <em>PRINT</em> and is for reading bytes at an address. Example usage is as follows:</p>
<p><code>0 PRINT PEEK(2)<br />
1 POKE 2, 66<br />
2 PRINT PEEK(2)<br />
3 END</code></p>
<p>RUN</p>
<p>Line 0 reads the byte stored at address 2. This address is unused and reserved for user programs so it should display 0. Line 1 uses the <em>POKE</em> command to set the byte at address 2 to 66 and the next line reads it again and should display the change.</p>
<p><a href="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_010.png"><img class="alignleft size-thumbnail wp-image-80" src="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_010.png?w=150&#038;h=122" alt="" width="150" height="122" /></a></p>
<h2>Combining commands into a program</h2>
<p>Now a few basic BASIC commands have been introduced, it&#8217;s time to write a bit more of an advanced program and test it out. The example program will clear the screen, fill it with a selected character and then clear it again. The 1Mhz processor is not fast enough for the screen to be filled instantly so it will fill gradually.</p>
<p>The code for this example program is as follows:</p>
<p><code>0 PRINT CHR$(147)<br />
1 FOR I=0 TO 1023<br />
2 POKE 1024+I, 3<br />
3 NEXT I<br />
4 PRINT CHR$(147)<br />
5 END</code></p>
<p>The first thing to explain in this code is the usage of <em>CHR$(147)</em> on both line 0 and 4. This prints out the character used to clear the screen, thus giving us a blank area to write to. It&#8217;s used at the end of the program so more commands can be entered once the program terminates.</p>
<p>A basic FOR loop is also introduced in this code. The variable is initialised to 0 and the loop will continue until I is equal to 1023. We use this in the next line to write to the next address in the graphics memory. The <em>POKE</em> command is writing ASCII code 3 to memory, which is equal to a &#8216;c&#8217;.<br />
Line 3 is necessary as it increases I by 1 each time the for loop is executed. Line 4 clears the screen again and then the program terminates.</p>
<p>Run the program with the <em>RUN</em> command and the screen should <em>slowly</em> fill with the character &#8216;C&#8217;.</p>
<p><a href="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_011.png"><img class="alignleft size-thumbnail wp-image-81" src="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_011.png?w=150&#038;h=122" alt="" width="150" height="122" /></a></p>
<p>Remember to clear the memory of code and variables with <em>NEW</em> each time a new program is to be created and have fun with the emulator.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/noz3001.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/noz3001.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/noz3001.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/noz3001.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/noz3001.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/noz3001.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/noz3001.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/noz3001.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/noz3001.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/noz3001.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/noz3001.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/noz3001.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/noz3001.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/noz3001.wordpress.com/72/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=72&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://noz3001.wordpress.com/2010/06/17/the-joys-of-basic-and-the-commodore-64/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15ef3253eaeccde12340a8c52183009e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">noz3001</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_005.png?w=150" medium="image">
			<media:title type="html">VICE: C64 emulator</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_006.png?w=150" medium="image">
			<media:title type="html">VICE: C64 emulator</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_007.png?w=150" medium="image">
			<media:title type="html">VICE: C64 emulator</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_008.png?w=150" medium="image" />

		<media:content url="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_009.png?w=150" medium="image" />

		<media:content url="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_010.png?w=150" medium="image" />

		<media:content url="http://noz3001.files.wordpress.com/2010/06/vice-c64-emulator_011.png?w=150" medium="image" />
	</item>
		<item>
		<title>Window Picker Applet &#8211; Title Bar Removal</title>
		<link>http://noz3001.wordpress.com/2010/04/04/window-picker-applet-title-bar-removal/</link>
		<comments>http://noz3001.wordpress.com/2010/04/04/window-picker-applet-title-bar-removal/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 20:08:46 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[applet]]></category>
		<category><![CDATA[bar]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[gnome-panel]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[picker]]></category>
		<category><![CDATA[removal]]></category>
		<category><![CDATA[title]]></category>
		<category><![CDATA[Window]]></category>
		<category><![CDATA[window picker applet]]></category>

		<guid isPermaLink="false">http://noz3001.wordpress.com/?p=65</guid>
		<description><![CDATA[If you are on arch Linux, you can get a pre-edited version straight from the AUR &#62; Here &#60;. Users of other distros can download the modified source too. Here&#8217;s a quick and easy way to remove the annoying title bar from the window picker applet so it&#8217;s a bit more like the Windows 7 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=65&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you are on arch Linux, you can get a pre-edited version straight from the AUR <a href="http://aur.archlinux.org/packages.php?ID=36184">&gt; Here &lt;</a>. Users of other distros can download the modified source too.</p>
<p>Here&#8217;s a quick and easy way to remove the annoying title bar from the window picker applet so it&#8217;s a bit more like the Windows 7 task bar.</p>
<h2>Source Editing</h2>
<p>First of all, un-install any versions of the applet you already have.</p>
<p>Next, download the source from <a href="https://launchpad.net/window-picker-applet/+download">&gt; here &lt;</a> and extract it to any directory.</p>
<p>Make sure you have C compiler and other dependencies.</p>
<p>Now, browse to the directory in a terminal window and type:<br />
<code>./configure --prefix=/usr</code></p>
<p>Next, browse to the /src sub-folder and open &#8220;applet.c&#8221; in your preferred text editor.</p>
<p>We are going to comment out a few lines. (Place // at the beginning of the line)</p>
<p><span id="more-65"></span></p>
<p>Comment out the following:<br />
<code>#include "task-title.h"</code><br />
<code>GtkWidget    *title;</code><br />
<code>title = app-&gt;title = task_title_new ();</code><br />
<code>gtk_box_pack_start (GTK_BOX (eb), title, TRUE, TRUE, 0);</code><br />
<code>gtk_widget_modify_bg (mainapp-&gt;title, GTK_STATE_NORMAL, colour); </code></p>
<p>Change this line:<br />
<code>GtkWidget *eb, *tasks, *title;</code><br />
To this:<br />
<code>GtkWidget *eb, *tasks;//, *title;</code></p>
<p>Change this block of code:<br />
<code>gtk_widget_set_style (mainapp-&gt;title, NULL);<br />
rc_style = gtk_rc_style_new ();<br />
gtk_widget_modify_style (mainapp-&gt;title, rc_style);<br />
gtk_rc_style_unref (rc_style);</code></p>
<p>To this:<br />
<code>/*gtk_widget_set_style (mainapp-&gt;title, NULL);<br />
rc_style = gtk_rc_style_new ();<br />
gtk_widget_modify_style (mainapp-&gt;title, rc_style);<br />
gtk_rc_style_unref (rc_style);*/</code></p>
<p>That&#8217;s all the editing which needs to be done. The next step is to build and install the applet.</p>
<p>Type the following commands into the terminal:<br />
<code>make<br />
sudo make install</code></p>
<p>If all goes well, log out of gnome and log back in. You should be able to add it to the panel and the title bar will be disabled.</p>
<div id="attachment_67" class="wp-caption alignleft" style="width: 160px"><a href="http://noz3001.files.wordpress.com/2010/04/screenshot.png"><img class="size-thumbnail wp-image-67" title="Window Picker Applet Screenshot" src="http://noz3001.files.wordpress.com/2010/04/screenshot.png?w=150&#038;h=84" alt="Window Picker final product" width="150" height="84" /></a><p class="wp-caption-text">Window Picker Applet</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/noz3001.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/noz3001.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/noz3001.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/noz3001.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/noz3001.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/noz3001.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/noz3001.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/noz3001.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/noz3001.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/noz3001.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/noz3001.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/noz3001.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/noz3001.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/noz3001.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=65&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://noz3001.wordpress.com/2010/04/04/window-picker-applet-title-bar-removal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15ef3253eaeccde12340a8c52183009e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">noz3001</media:title>
		</media:content>

		<media:content url="http://noz3001.files.wordpress.com/2010/04/screenshot.png?w=150" medium="image">
			<media:title type="html">Window Picker Applet Screenshot</media:title>
		</media:content>
	</item>
		<item>
		<title>WriteProcessMemory Examples</title>
		<link>http://noz3001.wordpress.com/2009/10/07/writeprocessmemory-examples/</link>
		<comments>http://noz3001.wordpress.com/2009/10/07/writeprocessmemory-examples/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 13:16:02 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Example]]></category>
		<category><![CDATA[memory edit]]></category>
		<category><![CDATA[speedhack]]></category>
		<category><![CDATA[star sonata]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[writeprocessmemory]]></category>

		<guid isPermaLink="false">http://noz3001.wordpress.com/?p=62</guid>
		<description><![CDATA[Why? It&#8217;s time to put all the beginner tutorials back onto my blog. I&#8217;ll start with a WriteProcessMemory tutorial (the basics of memory editing). WriteProcessMemory is useful when you don&#8217;t want to be loaded into the memory space of the target program. First of all you are going to need to know the address of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=62&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Why?</h2>
<p>It&#8217;s time to put all the beginner tutorials back onto my blog. I&#8217;ll start with a WriteProcessMemory tutorial (the basics of memory editing). WriteProcessMemory is useful when you don&#8217;t want to be loaded into the memory space of the target program.</p>
<p>First of all you are going to need to know the address of the memory you want to edit. Use Cheat Engine or some similar program (I recommend Cheat Engine, obviously) to find it.</p>
<p>In this example, I am going to write to a game called Star Sonata and enable a speed hack. You don&#8217;t have to get this game, you can use any game but make sure you change the addresses to the ones you find.</p>
<h2><strong>The Code</strong></h2>
<p>There&#8217;s not much to explain for this code so I&#8217;ve commented most lines in the source. Should make it easy to understand.</p>
<h2>Source<strong> </strong></h2>
<pre>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;windows.h&gt;

int main()
{
    int iChoice; // Store users choice.

    DWORD dwProcId; // Store Star Sonata Process ID
    HWND hStarSonata; //
    HANDLE hProcess; // Handle to Star Sonata process

    // Always do error checking, even if it takes a few seconds more to type!
    if ((hStarSonata = FindWindow(NULL, "Star Sonata")) == NULL) { // Try to find the Star Sonata window.
        printf("Cannot find Star Sonata window!"); // We couldn't find it
        exit(1); // So let the user know and exit.
    }

    if (! GetWindowThreadProcessId(hStarSonata, &amp;dwProcId)) { // Try to get the Process ID for use in OpenProcess
        printf("Cannot retrieve process Id!"); // Let them know we cant get it
        exit(1); // Exit...
    }

    // Now we are going to get a process handle to the game
    if ((hProcess = OpenProcess(PROCESS_VM_WRITE, FALSE, dwProcId)) == NULL) { // Call OpenProcess to get VM Write access
        printf("Cannot open process!"); // Failed to open process. Wrong priviliges?
        exit(1);
    }

    printf("Star Sonata Speed Hack (Noz3001)\n\n(1)Enable Speed Hack\t(2)Disable Speed Hack\t(3)Quit\n\n"); // Show Options

    while(iChoice != 3) { // Whilst option is not 3
        printf("NOZ&gt; _\b");
        scanf("%i", &amp;iChoice); // Get next option

        switch(iChoice) {
            case 1:
                // Enable speed hack
                if (! WriteProcessMemory(hProcess, (void*)0x00463de0, 0x75, 1, NULL)) { // Try to write 0x75 (jne) to 0x00463de0 (my address)
                    printf("Failed to write to memory!\n");
                }
                printf("Speed hack enabled.\n");
                break;

            case 2:
                // Disable speed hack
                if (! WriteProcessMemory(hProcess, (void*)0x00463de0, 0x74, 1, NULL)) { // 0x74 is (je). The original opcode.
                    printf("Failed to write to memory!\n");
                }
                printf("Speed hack disabled.\n");
                break;

            case 3:
                printf("Leaving...\n");
                continue;

            default:
                printf("No such option!\n");
                break;
        }
    }

    CloseHandle(hProcess);
    exit(0);
}</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/noz3001.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/noz3001.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/noz3001.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/noz3001.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/noz3001.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/noz3001.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/noz3001.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/noz3001.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/noz3001.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/noz3001.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/noz3001.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/noz3001.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/noz3001.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/noz3001.wordpress.com/62/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=noz3001.wordpress.com&amp;blog=843566&amp;post=62&amp;subd=noz3001&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://noz3001.wordpress.com/2009/10/07/writeprocessmemory-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15ef3253eaeccde12340a8c52183009e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">noz3001</media:title>
		</media:content>
	</item>
	</channel>
</rss>
