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

<channel>
	<title>Nito &#187; Gonp Saga</title>
	<atom:link href="http://blog.pirelenito.org/category/gonp-saga/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.pirelenito.org</link>
	<description>Thoughts dump yard</description>
	<lastBuildDate>Tue, 20 Jul 2010 02:18:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Gonp Saga: The Final Chapter</title>
		<link>http://blog.pirelenito.org/2010/07/gonp-saga-the-final-chapter/</link>
		<comments>http://blog.pirelenito.org/2010/07/gonp-saga-the-final-chapter/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 02:18:47 +0000</pubDate>
		<dc:creator>nito</dc:creator>
				<category><![CDATA[Gonp Saga]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[OpenGL]]></category>

		<guid isPermaLink="false">http://blog.pirelenito.org/?p=132</guid>
		<description><![CDATA[After a couple more coding sessions, we decided to stop the project&#8217;s development for the time being. To promote an open collaboration I just moved the repository to GitHub for easy forking. The code got all the foundations to start developing a real game, so if you are just starting Android Development, I recommend you [...]]]></description>
			<content:encoded><![CDATA[<p>After a couple more coding sessions, we decided to stop the project&#8217;s development for the time being.</p>
<p>To promote an open collaboration I just moved the repository to <a href="http://github.com/pirelenito/gonp">GitHub</a> for easy forking.</p>
<p>The code got all the foundations to start developing a real game, so if you are just starting Android Development, I recommend you go and take a look at <a href="http://github.com/pirelenito/gonp">http://github.com/pirelenito/gonp</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pirelenito.org/2010/07/gonp-saga-the-final-chapter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gonp, An Android Saga: Part I</title>
		<link>http://blog.pirelenito.org/2010/04/gonp-an-android-saga-part-i/</link>
		<comments>http://blog.pirelenito.org/2010/04/gonp-an-android-saga-part-i/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 11:59:45 +0000</pubDate>
		<dc:creator>nito</dc:creator>
				<category><![CDATA[Gonp Saga]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[saga]]></category>

		<guid isPermaLink="false">http://blog.pirelenito.org/?p=107</guid>
		<description><![CDATA[Today myself and a couple of friends (Renato Besen and Vitor Pelizza) started on a saga to develop a game on Android, there is not much to see or do after our approximately three hours of work but of what is on the screenshot bellow: A green square, composed of 2 triangles and 4 points. Which might [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.pirelenito.org/wp-content/uploads/2010/04/Screen-shot-2010-04-13-at-10.45.22-PM.png"><img class="size-full wp-image-111 alignleft" title="First glimpse of the running application." src="http://blog.pirelenito.org/wp-content/uploads/2010/04/Screen-shot-2010-04-13-at-10.45.22-PM.png" alt="" width="128" height="188" /></a></p>
<p>Today myself and a couple of friends (<a href="http://besen.posterous.com/" target="_blank">Renato Besen</a> and <a href="http://twitter.com/vpelizza" target="_blank">Vitor Pelizza</a>) started on a saga to develop a game on Android, there is not much to see or do after our approximately three hours of work but of what is on the screenshot bellow:</p>
<p>A green square, composed of 2 triangles and 4 points. Which might not seem much at a first glance, but there was a lot of learning in the process.</p>
<p>Through the development we followed loosely <a href="http://www.droidnova.com/android-3d-game-tutorial-part-i,312.html" target="_blank">this tutorial</a> series, but as good questioners as we are, we quickly started to put some query upon some of the tutorial&#8217;s solutions. For instance, why does the buffer creation needs all this code:</p>
<blockquote><p>ByteBuffer ibb = ByteBuffer.allocateDirect(_nrOfVertices * 2);<br />
ibb.order(ByteOrder.nativeOrder());<br />
_indexBuffer = ibb.asShortBuffer();<br />
_indexBuffer.put(_indicesArray);</p></blockquote>
<p>When we thought it could be done with something like this:</p>
<blockquote><p>ShortBuffer _indexBuffer = ShortBuffer.wrap(_indicesArray);</p></blockquote>
<p>After seeing the app crash on start we understood that all buffers used by OpenGL ES need to be of the device&#8217;s native byte order, which is not the default order when creating a Buffer through the wrap method. To solve this more elegantly we <a href="http://labs.pirelenito.org/repositories/entry/gonp/src/org/gonp/NativeBufferFactory.java">created a factory</a> for native byte order buffers.</p>
<p>Next up was drawing our Player(the square), but since OpenGL ES does not support QUADs, it would need to be composed of two triangles. After figuring out how the <a href="http://www.khronos.org/opengles/documentation/opengles1_0/html/glVertexPointer.html" target="_blank">glVertexPointer</a> and <a href="http://www.khronos.org/opengles/documentation/opengles1_0/html/glDrawElements.html" target="_blank">glDrawElements</a> methods work, we finally made our <a href="http://labs.pirelenito.org/repositories/entry/gonp/src/org/gonp/Player.java" target="_self">Player</a> class render on the screen:</p>
<blockquote><p>gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexes);<br />
gl.glDrawElements(GL10.GL_TRIANGLES, indexes.capacity() &#8230;</p></blockquote>
<p>On the first line we tell OpenGL wich are the points that it needs to render, next we pass an array containing the order that they need to be drawn.</p>
<p><span style="text-decoration: line-through;">That is it for now, but you can follow our progress through the <a href="http://labs.pirelenito.org/projects/activity/gonp">project&#8217;s Redmine</a> or by checking out the code at the <a href="http://labs.pirelenito.org/gonp/git">git repository</a>.</span></p>
<p><strong>Update</strong>: Moved the repository to <a href="http://github.com/pirelenito/gonp">github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pirelenito.org/2010/04/gonp-an-android-saga-part-i/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

