<?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>Badlogic Games</title>
	<atom:link href="http://www.badlogicgames.com/wordpress/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.badlogicgames.com/wordpress</link>
	<description></description>
	<lastBuildDate>Thu, 17 May 2012 06:27:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Some libgdx HTML5 games</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2416</link>
		<comments>http://www.badlogicgames.com/wordpress/?p=2416#comments</comments>
		<pubDate>Thu, 17 May 2012 06:27:26 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[libgdx]]></category>

		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2416</guid>
		<description><![CDATA[Quite a few people have used libgdx to create WebGL/HTML5 versions of their games, both 2D and 3D. Stefan Wagner, alias Bompo created this for the last ludum dare (click image to play): It&#8217;s a 3D arcade game. You control a ship in a backyard pond and fire at other ships. Really neat for 48h! [...]]]></description>
			<content:encoded><![CDATA[<p>Quite a few people have used libgdx to create WebGL/HTML5 versions of their games, both 2D and 3D. Stefan Wagner, alias Bompo created this for the last ludum dare (click image to play):</p>
<p><a href="http://bompo.github.com/BackyardPirates/index_webgl.html"><img src="http://www.ludumdare.com/compo/wp-content/compo2/123793/7570-shot1.png" alt="" /></a></p>
<p>It&#8217;s a 3D arcade game. You control a ship in a backyard pond and fire at other ships. Really neat for 48h!</p>
<p>Dimitry Fink created Stargazer for Android and Facebook:</p>
<p><a href="http://apps.facebook.com/stargazergame/"><img src="https://lh4.ggpht.com/qTZcIe_3APDEntS9vMqL6xqIKJG4ngMf9x4U6VeWfCYIRRnA45oqyxeROUNDYSZX8w=w705?.png" alt="" /></a></p>
<p>This one&#8217;s a puzzle game, where you rotate a star configuration in 3D to become a 2D object. It&#8217;s an insanely cool idea and the mechanics got me hooked this morning. What&#8217;s interesting about this one is that it integrates with the Facebook APIs via JSNI, a way to communicate with Javascript from Java in GWT. Hopefully Dimitri will enlighten us on what was involved getting this to work.</p>
<p>Robert Engelbert ported his Frogger tutorial game not only to Android put to WebGL as well:</p>
<p><a href="http://www.rengelbert.com/blog/swf/froggerhtml5/"><img src="http://www.rengelbert.com/blog/wp-content/themes/donewithcomputers/images/entries/img_froggerLibGDX.png" alt="" /></a></p>
<p>You should totally check out his <a href="http://rengelbert.com/blog/">blog </a> which is filled with all kinds of game programming tutorials. He has a series on implementing frogger with various frameworks, including libgdx. Well worth a read.</p>
<p>Those are just 3 recent games i discoverd, there are a lot more WebGL/libgdx games out there already, some on the Google Chrome store. Let&#8217;s hope WebGL compatibility gets even better in the coming months!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.badlogicgames.com/wordpress/?feed=rss2&#038;p=2416</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change to Preferences in Android Backend</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2414</link>
		<comments>http://www.badlogicgames.com/wordpress/?p=2414#comments</comments>
		<pubDate>Mon, 14 May 2012 15:49:47 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[libgdx]]></category>
		<category><![CDATA[OMG Ponies!]]></category>

		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2414</guid>
		<description><![CDATA[This message is brought to you by Nex, thanks mate! In order to reduce overhead in the Android backend when putting values into Preferences, we&#8217;ve updated the implementation to not commit changes until flush() is called on the Preferences object. Previously, every time you put a value into Preferences the Android implementation would create an [...]]]></description>
			<content:encoded><![CDATA[<p><b>This message is brought to you by Nex, thanks mate!</b></p>
<p>In order to reduce overhead in the Android backend when putting values into Preferences, we&#8217;ve updated the implementation to not commit changes until flush() is called on the Preferences object.  Previously, every time you put a value into Preferences the Android implementation would create an Editor, put the value, then commit it. While this was good for ensuring that values would be persisted quickly, it also meant File I/O for each and every value placed into preferences. When putting more than one or two values, this could create noticeable slowness.</p>
<p>This may sounds like a big deal, but this actually brings the Android implementation more in line with the other backends, which have always required flush() to be called in order to persist the changes. It also mirrors the normal workflow for working with SharedPreferences in normal Android development.</p>
<p>TL;DR Version: You must now call flush() in all cases where you want changes to Preferences to be persisted.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.badlogicgames.com/wordpress/?feed=rss2&#038;p=2414</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Libgdx Documentation Initiative</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2411</link>
		<comments>http://www.badlogicgames.com/wordpress/?p=2411#comments</comments>
		<pubDate>Wed, 09 May 2012 13:36:18 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[libgdx]]></category>

		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2411</guid>
		<description><![CDATA[After thinking about my last post and poking around Google Code i came up with a plan. I want to improve the documentation of libgdx, by a lot. The Javadocs are not horrible per se, but Javadocs (without package html) are usually only good for reference and don&#8217;t answer more high-level questions. I thus want [...]]]></description>
			<content:encoded><![CDATA[<p>After thinking about my last post and poking around Google Code i came up with a plan. I want to improve the documentation of libgdx, by a lot. The Javadocs are not horrible per se, but Javadocs (without package html) are usually only good for reference and don&#8217;t answer more high-level questions. I thus want to propose the crowd-sourced <b>libgdx documentation initiative</b>. Here&#8217;s how that works.</p>
<h4>Everyone becomes a Contributor!</h4>
<p>Everyone will be capable of contributing to both the development guide/wiki as well as the javadocs. The first thing you need to do is drop me an e-mail at contact at badlogicgames dot com. Provide a valid Google account so i can add you as a contributor to libgdx on <a href="http://code.google.com/p/libgdx/">Google Code</a>. You will be granted write permissions for the Wiki only. If you want to also contribute to Javadocs, follow the instructions below.</p>
<p>Next decide on what you want to work on.</p>
<h4>Development Guide/Wiki</h4>
<p>The <a href="http://code.google.com/p/libgdx/wiki/TableOfContents?tm=6">wiki/development guide</a> is currently a work in process. As you can see there&#8217;s already an outline of which topics it should cover. Check out what&#8217;s there so far to get a feel for how individual dev-guide articles should look like. Then pick one of the items and create the article for it. In general you want to give an overview of a feature, provide info on differences between platforms if any, and show a few code snippets demonstrating the usage of the feature.</p>
<p>The second type of wiki contributions are articles. An article illustrates a complete working example for some specific functionality, e.g. <a href="http://code.google.com/p/libgdx/wiki/AdMobInLibgdx">wrapping 3rd party services</a>. You can chose to embed your code in the article and refer to the <a href="http://code.google.com/p/libgdx/wiki/ProjectSetupNew">project setup article</a> for the project creation step. </p>
<h4>Java Docs</h4>
<p>While libgdx&#8217;s javadocs are comparatively complete, some parts might be outdated or badly written (or actually missing). Fork libgdx on <a href="https://github.com/badlogic/libgdx">Github</a>, load up the Java files you want to improve, push the changes back to Github and send a pull request. Please only improve on the Javadocs, do not manipulate the code itself. I&#8217;ll merge all pull requests manually, don&#8217;t try to trick me <img src='http://www.badlogicgames.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <a href="http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html">This guid</a>e shows you how to write proper Javadocs (more or less).</p>
<p>The best way to identify underdocumented class is to check out the <a href="http://libgdx.badlogicgames.com/nightlies/docs/api/">online Javadocs</a>. Browse through the classes and if anything seems bad, fire up your IDE/editor, edit the docs, commit and push. To lower merge burden, please batch up your commits into a single pull request.</p>
<h4>What about the User Wiki?</h4>
<p>The user wiki effort has died down somewhere around september. None of the development team ever maintained any portions of it, so it was a very undirected effort. With the outline of the TOC and articles already written as well as our commitment to curate additions by users, it is my hope that this new effort will result in a more structured, high quality result. Again, the user wiki effort is/was fantastic and we are very thankful to Radioking that he took it up. Time for user wiki 2.0!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.badlogicgames.com/wordpress/?feed=rss2&#038;p=2411</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Status Report</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2404</link>
		<comments>http://www.badlogicgames.com/wordpress/?p=2404#comments</comments>
		<pubDate>Wed, 09 May 2012 12:10:33 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[libgdx]]></category>
		<category><![CDATA[OMG Ponies!]]></category>

		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2404</guid>
		<description><![CDATA[Hi there, long time no see. I&#8217;ve been sort of on a break for the past few weeks. I want to detail the reasons for this, just to clear out my head and give you insight into what happened over the last few months, explaining certain down-times. From August 2011 to February 2012 i&#8217;ve been [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there,</p>
<p>long time no see. I&#8217;ve been sort of on a break for the past few weeks. I want to detail the reasons for this, just to clear out my head and give you insight into what happened over the last few months, explaining certain down-times.</p>
<p>From August 2011 to February 2012 i&#8217;ve been working for a mobile gaming startup in SF. Three months i spent at their office in SF, the rest i worked from home. It was an exhausting marathon, with work hours way beyond what&#8217;s healthy for me (can&#8217;t speak for the entire team). I was mentoring people, trying to coordinate the different sub dev-teams and come up with architectures for various parts of the application. It was an interesting ride, together with a team of very young folks, some of which i happen to think of as friends now. I eventually left the company for various reasons at the end of December. I just wasn&#8217;t happy. I continued to work with them for another month and a half on a contracting basis to help out with a few things until the middle of February or so. </p>
<p>Around November signs of burn out started to surface, but i largely ignored them. I just continued on working on even more stuff.</p>
<p>From January onwards i started working on private projects again. I rewrote <a href="http://www.badlogicgames.com/wordpress/?p=1779">Tyonar</a> to allow multiple &#8220;instruments&#8221; and infinite steps. I never published it, not being happy with the user interface. I wrote a <a href="http://www.badlogicgames.com/wordpress/?p=2282">reddit client</a> (<a href="http://libgdx.badlogicgames.com/downloads/timesink-android.apk">APK</a>), spent over a month on it but also never published it. I rewrote the libgdx build system, rewrote the way we handle native code, creating a tool that allows me to write JNI code faster, added tons of new extensions and finally added an entirely new backend so people can deploy HTML5 libgdx apps. I started working on the iOS backend again, completely switching it over to MonoTouch. I started a working on a pirate game with Shiu and Kalle. All of that was done in roughly 2 months. I took of maybe 2-4 days in total during that period, visiting Tamas and Nate in London. I can&#8217;t say it helped with the burn out thing.</p>
<p>My old company, for which i&#8217;ve been working for the last 6 years, made me a nice new offer which i couldn&#8217;t refuse. Whether this is a smart career decision i can&#8217;t tell. My record doesn&#8217;t look to diverse, i&#8217;ve been working for only 2 companies so far. However, I really like the job there, it&#8217;s a mixture of R&#038;D and product development which allows me to get into all kinds of fields, from information retrieval solutions, to distributed computing, visual analytics, web-technologies and even some RFID work. I worked with an incredibly broad set of technologies over the years and helped ship quite a few products of our partners. The only thing i haven&#8217;t touched in depth are JavaEE technologies, which again might be a problem in terms of a future career path. I started working there at the beginning of April.</p>
<p>In mid April Apress approached me and asked if i wanted to write a real second edition of &#8220;Beginning Android Games&#8221;, this time without a missleading title like &#8220;Beginning Android 5 Games&#8221;. Robert and me agreed to do that, we just can&#8217;t give up our baby. The additions will mostly consist of overhauling the material that&#8217;s already there and adding chapters on integrating with in-app purchase services as well as one of the game services like Swarm or OpenFeint. That&#8217;s probably around ~60 new pages, a pretty standard delta between tech book editions. This will fill up most of my spare time for a few months i guess.</p>
<p>I&#8217;m in maintainance mode with libgdx, meaning i go onto the forums, fix the occassional issue on the tracker and write a bit of documentation. In terms of features there are two things that bug me: scene2d needs an overhaul in terms of API and documentation (we hinted at the former a while ago) and we need to finish the 3D API. Kalle has been doing a lot of awesome work in that regard, but i&#8217;m still responsible for the GL10 branch, and i just can&#8217;t get my ass up working on that. There&#8217;s also the problem of format support, i&#8217;d love to support FBX and make that the number one format, but FBX is a monster, and there&#8217;s only the FBX SDK which can handle most of the modeller apps out there. It&#8217;s a pain. The iOS port is also something i want to spent some time on. I would also like to see more people on the dev team, at the moment we have about 4-5 active committers. We can&#8217;t of course just let anyone contribute to core, but there&#8217;S a lot of places even inexperienced people can help out, e.g. cleaning up Javadocs and so on. Here&#8217;s a list of things that need to be done:</p>
<ul>
<li>Refactor Scene2d: getters/setters, exposing fields is incredibly stupid. This would mean reworking the UI framework as well. I&#8217;d also like to rework the action system, at least the interpolators.</li>
<li>Complete the <a href="http://code.google.com/p/libgdx/source/browse/#svn%2Ftrunk%2Fextensions%2Fmodel-loaders%2Fmodel-loaders">3D API</a>: implement GL10/GL20 renderer (the later is mostly done, thanks Kalle), add FBX loading support and integrate it into the core API.</li>
<li>Look through the issues on the <a href="http://code.google.com/p/libgdx/issues/list">issue tracker</a> and close as many as possible.</li>
<li>Finish the <a href="http://code.google.com/p/libgdx/wiki/TableOfContents">development guide</a>.</li>
<li>Overhaul Javadocs where necessary.</li>
<li>iOS port via MonoTouch.</li>
</ul>
<p>If you think you can help out with any of those, we are happy to get you on board. You&#8217;ll have to follow a couple of rules of course, and if you work has a detrimental effect (breaks things, no compliance to set rules) we&#8217;ll likely revoke your contributor status. Yes, i&#8217;m a nazi.</p>
<p>Save for the iOS port, what do you think we should focus on? I&#8217;d really like to focus on docs for some time.</p>
<p>A full-time job, a book and libgdx is a lot of work. I need some time to reorganize my time schedule to make everything fit together. Rest assued that work on libgdx continues <img src='http://www.badlogicgames.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.badlogicgames.com/wordpress/?feed=rss2&#038;p=2404</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>libgdx 0.9.3 released</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2381</link>
		<comments>http://www.badlogicgames.com/wordpress/?p=2381#comments</comments>
		<pubDate>Tue, 03 Apr 2012 22:30:54 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[libgdx]]></category>
		<category><![CDATA[OMG Ponies!]]></category>

		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2381</guid>
		<description><![CDATA[Time for a new release. Here&#8217;s what we changed/added/fixed Tons of fixes for issues on the tracker, have a look yourself. Fixes and additions to the UI framework And all new build system that allows us to more easily integrate new extensions and backends. Big performance improvements for OpenGL ES 2.0 by using vertex arrays [...]]]></description>
			<content:encoded><![CDATA[<p>Time for a new release. Here&#8217;s what we changed/added/fixed</p>
<ul>
<li>Tons of fixes for issues on the tracker, have a <a href="http://code.google.com/p/libgdx/issues/list?can=1&#038;q=&#038;colspec=ID+Type+Status+Priority+Milestone+Owner+Summary&#038;groupby=&#038;sort=&#038;x=&#038;y=&#038;cells=tiles&#038;mode=grid">look yourself</a>.</li>
<li>Fixes and additions to the UI framework</li>
<li>And all <a href="http://www.badlogicgames.com/wordpress/?p=2242">new build system</a> that allows us to more easily integrate new extensions and backends.</li>
<li>Big performance improvements for OpenGL ES 2.0 by using vertex arrays instead of VBOs for SpriteBatch and friends.</li>
<li>Lifted the memory limit for native resources, see <a href="http://www.badlogicgames.com/wordpress/?p=2367">here</a>.</li>
<li><a href="http://www.badlogicgames.com/wordpress/?p=2289">Non-continuous rendering support</a></li>
<li><a href="http://www.badlogicgames.com/wordpress/?p=2297">PixmapPacker</a>, pack your images to a TextureAtlas at runtime.</li>
<li>An entire <a href="http://www.badlogicgames.com/wordpress/?s=html5">new backend</a> allowing you to target native HTML5 via <a href="https://developers.google.com/web-toolkit/">GWT</a>.</li>
<li>Support for <a href="http://www.badlogicgames.com/wordpress/?p=2305">local files</a>.</li>
<li>gdx-stb-truetype, a wrapper around stb-truetype to generate BitmapFonts from Unicode characters. Sadly its visual quality is not to good for small font sizes</li>
<li><a href="http://www.badlogicgames.com/wordpress/?p=2254">gdx-jnigen</a>, a tool that let&#8217;s you embed your JNI code in your Java files and helps you generate ant scripts to build the code for multiple platforms. All of libgdx&#8217;s native code has been converted to use this tool.</li>
<li><a href="http://www.badlogicgames.com/wordpress/?p=2269">gdx-audio</a>, wraps <a href="http://www.mpg123.de/api/">libmpg123</a> and <a href="http://xiph.org/vorbis/">tremor</a> to help you decode mp3 and ogg files to plain PCM samples, wraps <a href="http://www.surina.net/soundtouch/">SoundTouch</a> to allow you to pitch shift and timestretch your PCM samples, wraps <a href="http://sourceforge.net/projects/kissfft/">kissfft</a> to give you the frequency domain of a signal.</li>
<li><a href="http://www.badlogicgames.com/wordpress/?p=2300">gdx-freetype</a>, wraps <a href="http://freetype.org/index2.html">FreeType</a> and allows you to generate BitmapFonts on the fly from common TTF files.</li>
</ul>
<p>There&#8217;s currently work being done on a <a href="http://bulletphysics.org/wordpress/">Bullet Physics</a> wrapper (gdx-bullet) and libjpeg/libpng/libgif wrapper (gdx-image). The Bullet Physics wrapper seems to be mostly complete but needs extensive testing. The image library wrapper is in it&#8217;s infancy, only libjpeg works for now. Both are packaged in the release for you to test them out if you wish.</p>
<p>We also created a few new ways to make libgdx project setup a lot easier. Check out this new <a href="http://code.google.com/p/libgdx/wiki/ProjectSetupNew">Wiki page</a>. Massive thanks to Aurelien Ribon for writting this fancy thing. I&#8217;ll add some screenshots to the article and will most likely replace the old introduction videos. </p>
<p>We also recognize the need for mavenization (edit: meaning everyone but Nate). We can now push artifacts to central, and as soon as i get the time, i&#8217;ll try to set things up so that happens automagically. Ruben and Arielsan of Gemserk kindly offered their help, so thanks for that as well.</p>
<p>I&#8217;ll write an extensive post on the new GWT backend asap. I&#8217;m working full time again since monday, so please be patient <img src='http://www.badlogicgames.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.badlogicgames.com/wordpress/?feed=rss2&#038;p=2381</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Get your libgdx game listed!</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2388</link>
		<comments>http://www.badlogicgames.com/wordpress/?p=2388#comments</comments>
		<pubDate>Tue, 27 Mar 2012 15:45:35 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[libgdx]]></category>
		<category><![CDATA[OMG Ponies!]]></category>

		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2388</guid>
		<description><![CDATA[I want to gather an exhaustive list of games build with libgdx as a show case. For this purpose i want you to post the following markup snippet on the forums in this thread: == Game Name by [http://www.mycompany.com Company Name] == [http://www.link-to-my-game.com http://www.link-to-a-screenshot-of-mygame-705x345-max-resolution.jpg] One paragraph description of your game, no longer than a hundred [...]]]></description>
			<content:encoded><![CDATA[<p>I want to gather an exhaustive list of games build with libgdx as a show case. For this purpose i want you to post the following markup snippet on the forums in <a href="http://www.badlogicgames.com/forum/viewtopic.php?f=16&#038;t=3741">this thread</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">== Game Name by [http://www.mycompany.com Company Name] ==
[http://www.link-to-my-game.com http://www.link-to-a-screenshot-of-mygame-705x345-max-resolution.jpg]
One paragraph description of your game, no longer than a hundred words. Embed additional 
links [http://www.my-other-link.com like this]. Do not include additional images or videos!</pre></div></div>

<p>It would be preferable if you could use the banner that you uploaded to Google Play! Portrait screenshots should be scaled down to a height of 345. We&#8217;ll eventually write a thumbnailer. Also, please submit Jpegs only. The page will load like crap anyways, but with jpeg it might load a tad bit less like crap :p <b>Your link must end in .png or .jpeg/.jpg, so do not just copy the link of your Banner on Google Play!</b></p>
<p>The result will be displayed <a href="http://code.google.com/p/libgdx/wiki/LibgdxGames?ts=1332862877&#038;updated=LibgdxGames">here</a> for now, i want that to be more structured in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.badlogicgames.com/wordpress/?feed=rss2&#038;p=2388</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Change in GWT/HTML5 Libgdx Asset Mechanism</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2372</link>
		<comments>http://www.badlogicgames.com/wordpress/?p=2372#comments</comments>
		<pubDate>Mon, 26 Mar 2012 18:07:21 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[libgdx]]></category>

		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2372</guid>
		<description><![CDATA[So far one had to copy over all the assets to the GWT project&#8217;s war/ folder and right a file called assets.txt manually. No longer. Through the magic of GWT Generators this is done automatically for you now. Here&#8217;s what you need to change: In your GWT project&#8217;s module file (gwt.xml), add the following line: [...]]]></description>
			<content:encoded><![CDATA[<p>So far one had to copy over all the assets to the GWT project&#8217;s war/ folder and right a file called assets.txt manually. No longer. Through the magic of GWT Generators this is done automatically for you now. Here&#8217;s what you need to change:</p>
<p>In your GWT project&#8217;s module file (gwt.xml), add the following line:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set-configuration-property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;gdx.assetpath&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;path/to/your/assets&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>That&#8217;s it. You can remove your assets.txt and the assets themselves from the war/ folder, the generator will copy them over everytime you launch or compile your HTML5 app. The path you specify can be absolute (bad if you share your project with other people) or relative to the GWT project&#8217;s root folder (e.g. &#8220;../superjumper-android/assets&#8221; for the superjumper-gwt project). The generator will output a ton of debugging messages, detailing what is going on.</p>
<p>The classification of assets into images, audio, text and binary files is done via an <a href="http://code.google.com/p/libgdx/source/browse/trunk/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/preloader/AssetFilter.java">AssetFilter</a>. If you do not specify your own, the <a href="http://code.google.com/p/libgdx/source/browse/trunk/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/preloader/DefaultAssetFilter.java">DefaultAssetFilter</a> is used. It&#8217;s pretty basic and might not fit your needs. If you want to overwrite that, implement the AssetFilter interface, make sure you have a public default constructor and that the class is accessible in your GWT project. Then add the following line to you GWT project&#8217; module file:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set-configuration-property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;gdx.assetfilterclass&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;your.package.name.and.ClassName&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>The filter will then be instantiated by the generator and decide which files/directories to include and what AssetType they should have.</p>
<p>All demos and tests have been updated to use this mechanism, if in doubt, check those out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.badlogicgames.com/wordpress/?feed=rss2&#038;p=2372</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Direct Buffers are counted against the Java heap on Android/Dalvik</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2367</link>
		<comments>http://www.badlogicgames.com/wordpress/?p=2367#comments</comments>
		<pubDate>Sat, 24 Mar 2012 14:33:47 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[libgdx]]></category>

		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2367</guid>
		<description><![CDATA[When i was in SF we worked on a pretty resource intensive app that easily goes beyond the Java heap limit on Android if one counts native resources against the Java heap. We received quite a few OutOfMemoryExceptions, which would happen if we&#8217;d have used Android&#8217;s Bitmap class, which stores pixel data on the native [...]]]></description>
			<content:encoded><![CDATA[<p>When i was in SF we worked on a pretty resource intensive app that easily goes beyond the Java heap limit on Android if one counts native resources against the Java heap. We received quite a few OutOfMemoryExceptions, which would happen if we&#8217;d have used Android&#8217;s Bitmap class, which stores pixel data on the native heap, but counts it against the Java heap. We did not use Bitmap, so it was puzzling to us how our app could throw OOMs. On the Java side we barely scratched the 10mb barrier.</p>
<p>To communicate with native code (non-Java, e.g. C/C++) one has two options. Either transfer data from the Java heap to the native heap, or allocate space on the native heap in the first place, circumnavigating the Java heap completely. One mechanism to do the later is to use direct buffers, A Java object that wraps the address and size of a native heap memory location. The VM usually doesn&#8217;t count the native heap memory of a direct buffer against it&#8217;s Java heap memory. Turns out Android&#8217;s Dalvik VM is special in that regard compared to say Hotspot.</p>
<p>The first, generally known, situation where the Dalvik VM counts native heap memory against the Java heap memory is the use of the Bitmap class. A Bitmap is a thin wrapper around a native heap memory area that stores pixel data. To enfore application memory limits, that native heap memory of the Bitmap is counted against the Java heap, which is limited to 16-25mb on Android. Hard to cope with for Android developers at times (see Stackoverflow), but understandable from the perspective that a mobile device has limited resources, even more so if you have true multitasking.</p>
<p>For direct buffers i assumed the situation to be different. Direct buffers provide a way to allocate memory outside the bounds of the Java heap memory and are not counted against the Java heap on most VMs. Let&#8217;s see what happens on Dalvik. Observe the following code:</p>
<p><a href="https://github.com/CyanogenMod/android_libcore/blob/gingerbread/luni/src/main/java/java/nio/BufferFactory.java#L92">https://github.com/CyanogenMod/android_libcore/blob/gingerbread/luni/src/main/java/java/nio/BufferFactory.java#L92</a></p>
<p>This method is called when one allocates a new direct ByteBuffer through ByteBuffer.allocateDirect(int numBytes), which returns a ByteBuffer that points at a native memory area of numBytes bytes. Following through we get to</p>
<p><a href="https://github.com/CyanogenMod/android_libcore/blob/gingerbread/luni/src/main/java/java/nio/ReadWriteDirectByteBuffer.java#L47">https://github.com/CyanogenMod/android_libcore/blob/gingerbread/luni/src/main/java/java/nio/ReadWriteDirectByteBuffer.java#L47</a></p>
<p>which calls</p>
<p><a href="https://github.com/CyanogenMod/android_libcore/blob/gingerbread/luni/src/main/java/java/nio/DirectByteBuffer.java#L64">https://github.com/CyanogenMod/android_libcore/blob/gingerbread/luni/src/main/java/java/nio/DirectByteBuffer.java#L64</a></p>
<p>This is where it gets interesting. The first statement in that constructor allocates the native memory through a call to PlatformAddressFactory.alloc(). The second statement tells the address wrapper object (SafeAddress) that this memory area should be automatically deallocated when the buffer instance (and thus the address wrapper instance) is garbage collected.  Let&#8217;s see what the PlatformAddressFactory.alloc() method does.</p>
<p><a href="https://github.com/CyanogenMod/android_libcore/blob/gingerbread/luni/src/main/java/org/apache/harmony/luni/platform/PlatformAddressFactory.java#L128">https://github.com/CyanogenMod/android_libcore/blob/gingerbread/luni/src/main/java/org/apache/harmony/luni/platform/PlatformAddressFactory.java#L128</a></p>
<p>It calls into OSMemory.malloc(), which invokes a C++ method that actually allocates the native heap memory. Also observe line 140, where the memorySpy is informed of the newly allocated memory area. We&#8217;ll get to that later, as it has some more implications.</p>
<p>What happens in OSMemory.malloc()? This:</p>
<p><a href="https://github.com/CyanogenMod/android_libcore/blob/gingerbread/luni/src/main/native/org_apache_harmony_luni_platform_OSMemory.cpp#L43">https://github.com/CyanogenMod/android_libcore/blob/gingerbread/luni/src/main/native/org_apache_harmony_luni_platform_OSMemory.cpp#L43</a></p>
<p>It actually tracks the native memory allocated and counts it against the Java heap:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">jboolean allowed <span style="color: #339933;">=</span> env<span style="color: #339933;">-&gt;</span>CallBooleanMethod<span style="color: #009900;">&#40;</span>gIDCache.<span style="color: #202020;">runtimeInstance</span><span style="color: #339933;">,</span>
            gIDCache.<span style="color: #202020;">method_trackExternalAllocation</span><span style="color: #339933;">,</span> static_cast<span style="color: #339933;">&lt;</span>jlong<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span>size<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This will return false if the requested memory size would exceed the Java heap.  In line 64 we see that the first 8 bytes store the size of the buffer so memory can be subtracted from the used Java heap size again if the buffer is deallocated (when it&#8217;s GCed), see</p>
<p><a href="https://github.com/CyanogenMod/android_libcore/blob/gingerbread/luni/src/main/native/org_apache_harmony_luni_platform_OSMemory.cpp#L72">https://github.com/CyanogenMod/android_libcore/blob/gingerbread/luni/src/main/native/org_apache_harmony_luni_platform_OSMemory.cpp#L72</a></p>
<p>The second issue is the memory spy thing i mentioned above. What does that do? Bucket of salt: this is my understanding of it which might be wrong. </p>
<p>Every time we allocate a new direct buffer (and thus PlatformAddress) the memory spy is informed of that event. It keeps so called PhantomReferences to all of these PlatformAddresses. These references allow us to get information on whether a Java object was garbage collected. The problem is that you have to poll that information, as you can&#8217;t register a callback that gets invoked when the GC kills a Java object. So, the designers of that code had to come up with a mechanism to frequently do that.</p>
<p><a href="https://github.com/CyanogenMod/android_libcore/blob/gingerbread/luni/src/main/java/org/apache/harmony/luni/platform/RuntimeMemorySpy.java#L50">https://github.com/CyanogenMod/android_libcore/blob/gingerbread/luni/src/main/java/org/apache/harmony/luni/platform/RuntimeMemorySpy.java#L50</a></p>
<p>This method is called whenever we allocate new native heap memory. The first couple of lines poll the reference queue, if a platform address was GCed, the spy can also free up the native heap memory (orphanedMemory(ref)). Due to this design you always leak one direct buffer, as you have to allocate a new buffer so that the polling mechanism is kicked off.</p>
<p>Games written in C/C++ do not suffer from these problems. They can allocate memory all day long without Android ever getting angry about it. Games like Shadowgun wouldn&#8217;t be possible without that ignorance of Dalvik. If you write a pure Java game for Android you&#8217;ll suffer from that problem.</p>
<p>For libgdx games you don&#8217;t have to worry as we added a very nasty 3 line hack that will ensure that the memory allocated for a ByteBuffer is not counted against the Java heap. While i completely understand that there have to be memory limits, the situation is different for games. Adding this little &#8220;hack&#8221; at least allows us to cheat just as the native guys do. (See BufferUtils#newUnsafeByteBuffer()).</p>
<p>I&#8217;d like to introduce a new change to libgdx, where we do not load any resources from disk anymore. Instead we cache everything (pixel and vertex data) in memory. This would mean we&#8217;d have to change the semantics of a few things for the better. Any unmanaged textures would be managed now, e.g. textures constructed from Pixmaps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.badlogicgames.com/wordpress/?feed=rss2&#038;p=2367</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Android Development Tools R17 break your Libgdx Project?</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2362</link>
		<comments>http://www.badlogicgames.com/wordpress/?p=2362#comments</comments>
		<pubDate>Thu, 22 Mar 2012 17:24:55 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[libgdx]]></category>

		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2362</guid>
		<description><![CDATA[Some kind folks on the forums informed me that the latest Android ADT plugin breaks libgdx projects. The reason for this is that an Android Eclipse project no longer adds the sources of referenced Java projects to the APK it compiles. Why they had to do this is beyond me, the fix is simple however. [...]]]></description>
			<content:encoded><![CDATA[<p>Some kind folks on the forums informed me that the latest Android ADT plugin breaks libgdx projects. The reason for this is that an Android Eclipse project no longer <a href="http://tools.android.com/recent/dealingwithdependenciesinandroidprojects">adds the sources of referenced Java projects to the APK it compiles</a>. Why they had to do this is beyond me, the fix is simple however.</p>
<ul>
<li>Click on your Android Project</li>
<li>Select <b>Properties</b></li>
<li>Select <b>Java Build Path</b></li>
<li>Select <b>Order and Export</b></li>
<li>Check all your references, e.g. the gdx.jar, the gdx-backend-android.jar, your main code project etc.</li>
</ul>
<p>That&#8217;s it. Here&#8217;s a before and after image for a project that uses the jars.</p>
<p><a href="http://screensnapr.com/e/HKRoa7.png"><img alt="" src="http://screensnapr.com/e/HKRoa7.png" title="before" class="aligncenter" width="726" height="551" /></a><br />
<img alt="" src="http://screensnapr.com/e/WEMKvL.png" title="after" class="aligncenter" width="727" height="553" /></p>
<p>You don&#8217;t necessarily have to check the .jar files in this case if they are in your Android project&#8217;s libs/ folder.</p>
<p>If you run from SVN, just check the referenced gdx and gdx-backend-android project in the same settings dialog.</p>
<p>Now i have to redo all the tutorials&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.badlogicgames.com/wordpress/?feed=rss2&#038;p=2362</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Libgdx HTML5 Backend Update</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2346</link>
		<comments>http://www.badlogicgames.com/wordpress/?p=2346#comments</comments>
		<pubDate>Wed, 21 Mar 2012 13:28:28 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[libgdx]]></category>
		<category><![CDATA[OMG Ponies!]]></category>

		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2346</guid>
		<description><![CDATA[I spent almost a week and a half on the HTML5 backend now and i&#8217;m happy to say that i could actually add more than i expected. New Additions Reflection. Yes, that&#8217;s a stupid idea with GWT, but it enables a few things. You can&#8217;t use it for your own apps at the moment. Not [...]]]></description>
			<content:encoded><![CDATA[<p>I spent almost a week and a half on the HTML5 backend now and i&#8217;m happy to say that i could actually add more than i expected. </p>
<h3>New Additions</h3>
<ul>
<li>Reflection. Yes, that&#8217;s a stupid idea with GWT, but it enables a few things. You can&#8217;t use it for your own apps at the moment. Not sure i&#8217;ll open up that can of worms. If you are interested in how it works, check out <a href="http://code.google.com/p/libgdx/source/browse/trunk/backends/gdx-backends-gwt/src/com/badlogic/gwtref/gen/ReflectionCacheSourceCreator.java">this bozo</a>.</li>
<li>Json parsing with reflection. If you read into an ObjectMap things will just work. If you want to deserialize into your own POJOs i&#8217;ll have to add something so your POJOs are reflected.</li>
<li>The entire scene2d package, including the UI stuff. This was enabled by adding basic Reflection capabilities</li>
<li>All of Box2D works now, expect for GearJoint, WheelJoint and RopeJoint. The former two are currently broken in the <a href="http://code.google.com/p/jbox2d/">JBox2D trunk</a>, once those are fixed we have everything apart from RopeJoint.</li>
<li>Preferences</li>
<li>Fullscreen support</li>
<li>Tons of other stuff under the hood that won&#8217;t affect you</li>
<li>Binary file support, altough i recommend not using it, it&#8217;s slow by nature</li>
</ul>
<p>You can try out most of <a href="http://libgdx.badlogicgames.com/downloads/gwt">our tests in HTML5</a> now. Some box2d tests might be slow due to ShapeRenderer. The box2d simulation itself runs blazingly fast <img src='http://www.badlogicgames.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Todo</h3>
<ul>
<li><del datetime="2012-03-24T22:24:33+00:00">Replace <a href="http://code.google.com/p/gwt-voices/">gwt-voices</a> with something else, e.g. a Sound Manager 2 wrapper. I didn&#8217;t dig into the gwt-voices sources to much, but for some reason it refuses to work at all in Safari and partially in Firefox.</del> Done, custom wrapper around SoundManager 2, a fantastic API that works perfectly.</li>
<li><del datetime="2012-03-24T22:24:33+00:00">Fix the backspace button problem so UI textfields work.</del> Done</li>
<li>Add a very simple HttpUtils class that allows one to send POST/GET requests to a server. Note that due to the &#8220;Same Origin Policy&#8221; you&#8217;ll be restricted to send requests to the domain your app/game is hosted on.</li>
<li><del datetime="2012-03-24T22:24:33+00:00">Go through the list of FIXMEs in the source.</del> Done, anything that&#8217;s  marked as FIXME is either undoable for now, or non-critical.</li>
</ul>
<p>I&#8217;ll most likely not support local files for the time being. Preferences should be sufficient for most games for now.</p>
<h3>What Won&#8217;t Work</h3>
<p>Tilemaps, Audio recorder/device, that&#8217;s about it. If i can find a nice Gzip decoder for GWT we can add Tilemaps in as well. Other than that we&#8217;ll be pretty much feature complete.</p>
<h3>Simple Tutorial</h3>
<p>I didn&#8217;t have time to write a tutorial on how to port your game yet. Here&#8217;s a <a href="http://moldedbits.com/blog/2012/03/13/porting-libgdx-applications-to-html5/">nice tutorial by Molded Bits</a> on how to get started with the new backend. <b>The markers for files in the assets.txt file are: i -> image, t -> text file, b -> binary file</b>. For now i won&#8217;t pack the backend jar with the nightlies as i want things to mature a tiny bit. I&#8217;ll follow up with something more in depth that will also show you how you can debug the emitted Javascript easily if necessary.</p>
<h3>Ports</h3>
<p>Here are a few recent ports.</p>
<h4>Pax Britannica by Stefan Wagner.</h4>
<p><a href="http://dl.dropbox.com/u/39448/www/paxbritannica/index.html"><img src="http://www.badlogicgames.com/wordpress/wp-content/uploads/2012/03/paxbritannica-300x170.png" alt="" title="paxbritannica" width="300" height="170" class="aligncenter size-medium wp-image-2347" /></a></p>
<h4>Mathematiles by Nex</h4>
<p><a href="http://nexsoftware.net/gdx/mathematiles/"><img src="http://www.badlogicgames.com/wordpress/wp-content/uploads/2012/03/mathematiles-198x300.png" alt="" title="mathematiles" width="198" height="300" class="aligncenter size-medium wp-image-2348" /></a></p>
<h4>Vector Pinball (see libgdx trunk/demos/)</h4>
<p><a href="http://libgdx.badlogicgames.com/downloads/demos/vectorpinball/"><img src="http://www.badlogicgames.com/wordpress/wp-content/uploads/2012/03/vectorpinball-201x300.png" alt="" title="vectorpinball" width="201" height="300" class="aligncenter size-medium wp-image-2349" /></a></p>
<h4>Gdx invaders (see libgdx trunk/demos/)</h4>
<p><a href="http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/"><img src="http://www.badlogicgames.com/wordpress/wp-content/uploads/2012/03/invaders-300x196.png" alt="" title="invaders" width="300" height="196" class="aligncenter size-medium wp-image-2350" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.badlogicgames.com/wordpress/?feed=rss2&#038;p=2346</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

