<?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>libgdx &#8211; WLGfx</title>
	<atom:link href="https://csnorwood.com/category/libgdx/feed/" rel="self" type="application/rss+xml" />
	<link>https://csnorwood.com</link>
	<description>Programmers Website and Blog</description>
	<lastBuildDate>Tue, 30 Jan 2024 16:33:07 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://csnorwood.com/wp-content/uploads/2024/01/cropped-wlgfx-favicon-white-32x32.png</url>
	<title>libgdx &#8211; WLGfx</title>
	<link>https://csnorwood.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>LibGdx and Overlap2D issue (and HNY!)</title>
		<link>https://csnorwood.com/2018/01/01/libgdx-and-overlap2d-issue-and-hny/</link>
		
		<dc:creator><![CDATA[csnorwood]]></dc:creator>
		<pubDate>Mon, 01 Jan 2018 00:29:33 +0000</pubDate>
				<category><![CDATA[libgdx]]></category>
		<guid isPermaLink="false">https://wlgfx.com/?p=512</guid>

					<description><![CDATA[Oh yeah&#8230; Happy New Year! Anyway, just like the classic meme, I carried on from Dec 31st into Jan 1st. I did watch some fireworks on the CCTV and heard them. That was about as much as I could put up with. Definitely a grump but I don&#8217;t care. The issue I&#8217;m having at the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Oh yeah&#8230;</p>
<h2>Happy New Year!</h2>
<p>Anyway, just like the classic meme, I carried on from Dec 31st into Jan 1st. I did watch some fireworks on the CCTV and heard them. That was about as much as I could put up with. Definitely a grump but I don&#8217;t care.</p>
<p>The issue I&#8217;m having at the moment lies with the latest version of LibGdx, which is 1.9.8, and it&#8217;s animation class which doesn&#8217;t work with the Overlap2D package. That&#8217;s kind of a big &#8216;DAMN!&#8217; thingy. Apparently it works with version 1.9.4 or less. I found the problem also on <a href="https://stackoverflow.com/questions/41469214/libgdx-animated-sprite-no-method-error">stackoverflow too</a>.</p>
<p>Another problem is the Overlap2D website has been down for quite some time, a month or more maybe.</p>
<p>The project is hosted on github, but I&#8217;m as of yet unfamiliar with building it even though I&#8217;ve downloaded the source. I&#8217;ve still yet to get around to that.</p>
<p>So&#8230; I&#8217;m stuck&#8230;</p>
<p>I&#8217;ve got my scene loaded up and displaying perfectly. As soon as I add an animated sprite to the scene, it doesn&#8217;t want to work. I&#8217;ll dig deeper later on today maybe.</p>
<p>One thing I do like about LibGdx is, after spending a lot of time with DarkBasic Pro, many writing C++ plugins, it is much faster and smoother. The only thing I need to add is native libraries to cover all CPU&#8217;s.</p>
<p><strong>EDIT:</strong></p>
<p>Up until I find a solution, it&#8217;s back to Linux. I can do much more with that OS.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Java vs C++ for 3D mesh building</title>
		<link>https://csnorwood.com/2017/10/17/java-vs-c-for-3d-mesh-building/</link>
		
		<dc:creator><![CDATA[csnorwood]]></dc:creator>
		<pubDate>Tue, 17 Oct 2017 20:09:13 +0000</pubDate>
				<category><![CDATA[android]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[libgdx]]></category>
		<category><![CDATA[openGL]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[threads]]></category>
		<guid isPermaLink="false">http://wlgfx.com/?p=318</guid>

					<description><![CDATA[A few days ago, playing around with LibGDX again I was getting back into 3D programming and created a very simple demo of a load of spheres and the camera rotating around the scene as below: Which on my laptop ran just fine. It took about a second to generate all the meshes for each [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>A few days ago, playing around with LibGDX again I was getting back into 3D programming and created a very simple demo of a load of spheres and the camera rotating around the scene as below:</p>
<p><img fetchpriority="high" decoding="async" class="alignnone size-large wp-image-319" src="https://csnorwood.com/wp-content/uploads/2017/10/ballslibgdx-1024x654.png" alt="" width="678" height="433" srcset="https://csnorwood.com/wp-content/uploads/2017/10/ballslibgdx-1024x654.png 1024w, https://csnorwood.com/wp-content/uploads/2017/10/ballslibgdx-300x192.png 300w, https://csnorwood.com/wp-content/uploads/2017/10/ballslibgdx-768x491.png 768w, https://csnorwood.com/wp-content/uploads/2017/10/ballslibgdx.png 1600w" sizes="(max-width: 678px) 100vw, 678px" /></p>
<p>Which on my laptop ran just fine. It took about a second to generate all the meshes for each of the spheres.</p>
<p>Took bloody ages on my phone though, even though it&#8217;s a quad core 64 bit android phone. Approximately 5 to 8 seconds. Ouch.</p>
<p>None of this nonsense in C++ for starters. I know this from a very old project I was working back in the day. Procedural map generator. More about that here: <a href="https://forum.thegamecreators.com/thread/193276">PROCMAP DBP LINK</a></p>
<p><img decoding="async" class="alignnone size-large" src="https://forum.thegamecreators.com/xt/xt_apollo_pic.php?i=2315899" width="640" height="480" /></p>
<p>So for the last couple of days (actually on the evenings because of work), I&#8217;ve looked into creating a single sphere mesh and then duplicating it. In LibGdx</p>
<p>A minor problem to start off with is that a lot of LibGdx&#8217;s mesh generators have been deprecated and I don&#8217;t know how long for now, and I can&#8217;t find examples on how to use the new stuff. This would have made things easier, but that minor problem got bigger.</p>
<p>It seems that ModelBuilder only runs on the GL thread, so I tried the MeshBuilder. No luck there after trying to hunt info down on google, (Maybe google is hiding it from me :P) how to use the thing.</p>
<p>So I gave up, closed the project, might go back to it if the next step fails.</p>
<p>I&#8217;m waiting on a huge update from Qt. Oh! At this time it has finished downloading and updated.</p>
<p>The previous versions of Qt didn&#8217;t work with the latest Android SDK/NDK. Fingers crossed with this one&#8230;</p>
<p>Next&#8230;</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>LibGdx TextureAtlas (non .pack file)</title>
		<link>https://csnorwood.com/2016/09/04/libgdx-textureatlas-non-pack-file/</link>
		
		<dc:creator><![CDATA[csnorwood]]></dc:creator>
		<pubDate>Sun, 04 Sep 2016 08:56:30 +0000</pubDate>
				<category><![CDATA[android]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[libgdx]]></category>
		<guid isPermaLink="false">http://wlgfx.com/?p=119</guid>

					<description><![CDATA[Okay, I hit a block when I was starting to think about writing a quick networked multiplayer shoot em up game in LibGdx. LibGdx texture atlas&#8217;s are very handy things because you can store a load of smaller images in one image. This also optimises the GPU draw routines because it doesn&#8217;t have to keep [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Okay, I hit a block when I was starting to think about writing a quick networked multiplayer shoot em up game in LibGdx.</p>
<p>LibGdx texture atlas&#8217;s are very handy things because you can store a load of smaller images in one image. This also optimises the GPU draw routines because it doesn&#8217;t have to keep swapping textures for each sprite drawn.</p>
<p>I found pre-made free to use sprites from <a href="http://kenney.nl/" target="_blank" rel="noopener">Kenney.nl</a>, below is a section of what they look like:</p>
<p><img decoding="async" class="alignnone size-full wp-image-120" src="http://csnorwood.com/wp-content/uploads/2016/09/spritesheet.png" alt="spritesheet" width="630" height="424" srcset="https://csnorwood.com/wp-content/uploads/2016/09/spritesheet.png 630w, https://csnorwood.com/wp-content/uploads/2016/09/spritesheet-300x202.png 300w" sizes="(max-width: 630px) 100vw, 630px" /></p>
<p>Unfortunately though, LibGdx uses .pack files for it&#8217;s texture atlas&#8217;s and this one come with one that looks like this:</p>
<pre>&lt;TextureAtlas imagePath="sprites.png"&gt;
 &lt;SubTexture name="spaceAstronauts_001.png" x="998" y="847" width="34" height="44"/&gt;
 &lt;SubTexture name="spaceAstronauts_002.png" x="919" y="142" width="37" height="44"/&gt;
 &lt;SubTexture name="spaceAstronauts_003.png" x="824" y="0" width="50" height="44"/&gt;

...
&lt;/TextureAtlas&gt;</pre>
<p>Which is completely different to a .pack file.</p>
<p>So without further ado I decided to test out an xml parser to retrieve all the sub-regions from the xml file.</p>
<p>Test code as follows:</p>
<p>[snippet id=&#8221;19&#8243;]</p>
<p>So, armed with this now, all thanks mainly to working with GWT, I can quickly move on to creating my own class to generate the texture atlas in LibGdx.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
