<?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"
	>

<channel>
	<title>FasterKittyCodeCode</title>
	<atom:link href="http://fasterkittycodecode.com/wp-rss2.php" rel="self" type="application/rss+xml" />
	<link>http://fasterkittycodecode.com</link>
	<description>dev/blog</description>
	<pubDate>Sun, 04 Jan 2009 02:05:46 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
	<language>en</language>
			<item>
		<title>PVRCT texture tool&#8230;</title>
		<link>http://fasterkittycodecode.com/archives/23</link>
		<comments>http://fasterkittycodecode.com/archives/23#comments</comments>
		<pubDate>Sun, 04 Jan 2009 02:05:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://fasterkittycodecode.com/?p=23</guid>
		<description><![CDATA[More geeking out about iPhone game programming and textures. The version of the texture tool provided with the iPhone sdk outputs a compressed texture with absolutely no header information. The lack of header forces your code to know the details like width, height, bitdepth, and pixel format instead of it being nicely encapsulated in the [...]]]></description>
			<content:encoded><![CDATA[<p>More geeking out about iPhone game programming and textures. The version of the texture tool provided with the iPhone sdk outputs a compressed texture with absolutely no header information. The lack of header forces your code to know the details like width, height, bitdepth, and pixel format instead of it being nicely encapsulated in the file itself. This causes you to have to hardcode this data into your texture load calls and just makes for all around ugliness. I&#8217;ve since tossed out Apple&#8217;s version of the tool and started using the version that comes with the PowerVR sdk. While I have to do my conversions under Windows, it allows my code to be more generic in the way that it handles textures. I read in the first 52 bytes of the file to get all the information I need and then pass along the rest to OpenGL to drop into VRAM.</p>
<p>Here&#8217;s a small code snippet of what I&#8217;m now doing in my texture code.</p>
<p>struct PVR_Texture_Header<br />
{<br />
unsigned int dwHeaderSize;            /*!&lt; size of the structure */<br />
unsigned int dwHeight;                /*!&lt; height of surface to be created */<br />
unsigned int dwWidth;                /*!&lt; width of input surface */<br />
unsigned int dwMipMapCount;            /*!&lt; number of mip-map levels requested */<br />
unsigned int dwpfFlags;                /*!&lt; pixel format flags */<br />
unsigned int dwTextureDataSize;        /*!&lt; Total size in bytes */<br />
unsigned int dwBitCount;            /*!&lt; number of bits per pixel  */<br />
unsigned int dwRBitMask;            /*!&lt; mask for red bit */<br />
unsigned int dwGBitMask;            /*!&lt; mask for green bits */<br />
unsigned int dwBBitMask;            /*!&lt; mask for blue bits */<br />
unsigned int dwAlphaBitMask;        /*!&lt; mask for alpha channel */<br />
unsigned int dwPVR;                    /*!&lt; magic number identifying pvr file */<br />
unsigned int dwNumSurfs;            /*!&lt; the number of surfaces present in the pvr */<br />
} ;</p>
<p>NSData *fileContents = [[NSData dataWithContentsOfFile:[NSString stringWithUTF8String:filename]] retain];<br />
if (fileContents == nil)<br />
{<br />
return false;<br />
}</p>
<p>// pointer to the actual pvr image data, skip the header<br />
char *pvrData = (char*)[fileContents bytes] + sizeof(PVR_Texture_Header);</p>
<p>// create the header and copy in the data from the file<br />
memcpy(&amp;textureInfo, [fileContents bytes], sizeof(PVR_Texture_Header));</p>
<p>The definition for the PVR_Texture_Header was found in the PowerVR SDK.</p>
]]></content:encoded>
			<wfw:commentRss>http://fasterkittycodecode.com/archives/23/feed</wfw:commentRss>
		</item>
		<item>
		<title>OpenGL ES Sprites&#8230;</title>
		<link>http://fasterkittycodecode.com/archives/19</link>
		<comments>http://fasterkittycodecode.com/archives/19#comments</comments>
		<pubDate>Sun, 04 Jan 2009 01:46:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://fasterkittycodecode.com/?p=19</guid>
		<description><![CDATA[My first thought when planning to make a 2D game for the iPhone was to find a way to not re-invent the wheel. I did some web searching and came across the website for Cocos2D, a port of the library to the iPhone. Great, looks like just what I needed&#8230;well, not so much. After messing [...]]]></description>
			<content:encoded><![CDATA[<p>My first thought when planning to make a 2D game for the iPhone was to find a way to not re-invent the wheel. I did some web searching and came across the website for Cocos2D, a port of the library to the iPhone. Great, looks like just what I needed&#8230;well, not so much. After messing with the samples and starting to write some prototyping code I figured out a few things that concerned me not only about the library but texture handling in general.</p>
<p>Sprites with Cocos2D rely on the Texture2D class created by Apple to do their drawing as does the &#8220;game&#8221; code that Apple released at WWDC. It didn&#8217;t register at first that this would be a problem until I looked through the code to see how textures are handled. Non-compressed textures, like pngs, are first expanded to an equal power of two and dropped into a newly created texture in the correct swizzled format. Coming from a game development background, I knew that swizzling textures or doing any sort of conversion work at load or runtime is a waste so I turned my direction to the PVRCT format. This is the native texture format that can be essentially load and go. Using the new compressed texture format eliminated the conversion step but still required the power of two texture. Fine, not a problem, many sprites or frames are commonly dropped into a single texture anyway. Most video hardware require a power of two texture so this in itself didn&#8217;t surprise me, the requirement that it be an &#8220;equal&#8221; power of two though did. Meaning, a texture of 256&#215;128 just isn&#8217;t possible. Turns out this is a limitation of the PowerVR MBX chipset (you can get the docs and SDK at the Imgtec.com website). Alright, I can work around this. Just drop multiple sprites into a single texture and move around the U,V coordinates to access the invididual images I need. This will eliminate the texture state change and speed up rendering anyway. Wait a second, Cocos2D doesn&#8217;t support this. They have a strict one texture to one sprite set up. This is the easiest way to get someone up and running quickly but is horribly inefficient when writing game code. The iPhone is very restrictive on the amount of memory available for an application.</p>
<p>So, In my haste to try and use existing technology I&#8217;ve discovered that I&#8217;m pretty much back at the beginning. I tossed out the Cocos2D library (it would have been more trouble than it was worth to change their code) and tossed out Apple&#8217;s Texture2D class and Apple&#8217;s version of the texture compression tool and started writing my own code. I wasted about three days exploring other options but it did give the opportunity to learn more about the hardware that I&#8217;m working on.</p>
<p>So far I now have the underlying texure handling and resource manager complete and am about halfway through the sprite code, all written in C++. Most of the code is platform agnostic with only bits and pieces requiring porting when converting to other platforms.</p>
<p>I&#8217;ll post more info as I continue my iPhone exploration.</p>
]]></content:encoded>
			<wfw:commentRss>http://fasterkittycodecode.com/archives/19/feed</wfw:commentRss>
		</item>
		<item>
		<title>GameJam</title>
		<link>http://fasterkittycodecode.com/archives/14</link>
		<comments>http://fasterkittycodecode.com/archives/14#comments</comments>
		<pubDate>Sun, 28 Dec 2008 02:41:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Game News]]></category>

		<category><![CDATA[games jam]]></category>

		<guid isPermaLink="false">http://fasterkittycodecode.com/?p=14</guid>
		<description><![CDATA[I&#8217;m going to be participating in the Global Game Jam at FullSail here in Orlando at the end of the month. I&#8217;ve never been part of one of these events so I&#8217;m not quite sure what to expect. I&#8217;ve seen some really interesting projects come out of other Game Jam type events around the country [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m going to be participating in the <a href="http://www.fullsail.edu/globalgamejam">Global Game Jam</a> at FullSail here in Orlando at the end of the month. I&#8217;ve never been part of one of these events so I&#8217;m not quite sure what to expect. I&#8217;ve seen some really interesting projects come out of other Game Jam type events around the country so I&#8217;m definitely excited to be part of this.</p>
<p>More info can be found at <a href="http://www.globalgamejam.org/index.html">http://www.globalgamejam.org/index.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fasterkittycodecode.com/archives/14/feed</wfw:commentRss>
		</item>
		<item>
		<title>iPhone coding&#8230;</title>
		<link>http://fasterkittycodecode.com/archives/11</link>
		<comments>http://fasterkittycodecode.com/archives/11#comments</comments>
		<pubDate>Mon, 22 Dec 2008 06:13:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://fasterkittycodecode.com/?p=11</guid>
		<description><![CDATA[Plenty of challenges with the new project for the iPhone. Attempting to use someone else&#8217;s third party library is getting to be too annoying. Instead of trying to munge it to be what I need, I&#8217;ll probably just drop back to writing my own layer. My experience with 3D is with DirectX, so my openGL [...]]]></description>
			<content:encoded><![CDATA[<p>Plenty of challenges with the new project for the iPhone. Attempting to use someone else&#8217;s third party library is getting to be too annoying. Instead of trying to munge it to be what I need, I&#8217;ll probably just drop back to writing my own layer. My experience with 3D is with DirectX, so my openGL ES skills are slightly lacking, but I&#8217;m willing to figure it out if I have to even if it delays my getting into game code. I&#8217;m best at writing system/framework stuff but was trying to not get too distracted with that part this time. Guess I can&#8217;t help it.</p>
]]></content:encoded>
			<wfw:commentRss>http://fasterkittycodecode.com/archives/11/feed</wfw:commentRss>
		</item>
		<item>
		<title>update&#8230;</title>
		<link>http://fasterkittycodecode.com/archives/7</link>
		<comments>http://fasterkittycodecode.com/archives/7#comments</comments>
		<pubDate>Tue, 02 Dec 2008 17:24:43 +0000</pubDate>
		<dc:creator>Wendy</dc:creator>
		
		<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://fasterkittycodecode.com/?p=7</guid>
		<description><![CDATA[I added some new links to the right hand sidebar. Some of the links are gaming news, people I follow or just things I find entertaining. More to come in the near future.
]]></description>
			<content:encoded><![CDATA[<p>I added some new links to the right hand sidebar. Some of the links are gaming news, people I follow or just things I find entertaining. More to come in the near future.</p>
]]></content:encoded>
			<wfw:commentRss>http://fasterkittycodecode.com/archives/7/feed</wfw:commentRss>
		</item>
		<item>
		<title>New layout&#8230;</title>
		<link>http://fasterkittycodecode.com/archives/4</link>
		<comments>http://fasterkittycodecode.com/archives/4#comments</comments>
		<pubDate>Tue, 02 Dec 2008 04:58:58 +0000</pubDate>
		<dc:creator>Wendy</dc:creator>
		
		<category><![CDATA[random]]></category>

		<category><![CDATA[layout]]></category>

		<guid isPermaLink="false">http://fasterkittycodecode.com/?p=4</guid>
		<description><![CDATA[It&#8217;s time to start my blog over again. I&#8217;ve wiped out the old layout and found something a lot cuter. I may bring back the archives but for now I just want to see how things look then it&#8217;s off to bed.
]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s time to start my blog over again. I&#8217;ve wiped out the old layout and found something a lot cuter. I may bring back the archives but for now I just want to see how things look then it&#8217;s off to bed.</p>
]]></content:encoded>
			<wfw:commentRss>http://fasterkittycodecode.com/archives/4/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
