<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Allegro 5 Android high CPU usage</title>
		<link>http://www.allegro.cc/forums/view/617540</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 16 Aug 2018 02:18:27 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>This is another of my recent Android-related threads. Once I finally set up the tools for building Allegro for Android applications, I&#39;ve started making some tests with my own code. First thing I noticed was that, while the sample code that clears the screen to different colors 60 times per second has a very low CPU usage, adding a few primitives makes the CPU usage increase dramatically. </p><p>Drawing a few primitives can make the emulator use up to 200% CPU (2 full cores). I thought maybe the emulator is not using hardware acceleration but, even on the real tablet, drawing a few hundreds of primitives or only a few dozens of bitmaps can take up to 40% of the CPU.</p><p>Granted, I&#39;m using a really old tablet for my tests but still, it seems like a lot of CPU for such a simple test program.</p><p>Is this normal on Android devices? I mean, I didn&#39;t expect the CPU usage to increase so dramatically by drawing operations.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (kenmasters1976)</author>
		<pubDate>Tue, 14 Aug 2018 22:14:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t have much experience on Android-systems but I can tell that the al_draw_pixel and al_put_pixel functions slow down things a lot (as mentioned in the manual) ...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Frank Drebin)</author>
		<pubDate>Wed, 15 Aug 2018 00:03:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sounds like it&#39;s using software rendering.</p><p>With all your recent experience with setting up Allegro 5 and Android, what is the best guide to follow to get a working allegro program?</p><p>I have Android Studio installed, but the NDK might be out of date.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 15 Aug 2018 09:39:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/617540/1038929#target">Frank Drebin</a> said:</div><div class="quote"><p> I can tell that the al_draw_pixel and al_put_pixel functions slow down things
</p></div></div><p>I&#39;m not using <span class="source-code"><a href="http://www.allegro.cc/manual/al_draw_pixel"><span class="a">al_draw_pixel</span></a><span class="k2">(</span><span class="k2">)</span>, <a href="http://www.allegro.cc/manual/al_put_pixel"><span class="a">al_put_pixel</span></a><span class="k2">(</span><span class="k2">)</span></span> but other primitives like <span class="source-code"><a href="http://www.allegro.cc/manual/al_draw_rectangle"><span class="a">al_draw_rectangle</span></a><span class="k2">(</span><span class="k2">)</span>, <a href="http://www.allegro.cc/manual/al_draw_circle"><span class="a">al_draw_circle</span></a><span class="k2">(</span><span class="k2">)</span></span>.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/617540/1038935#target">Edgar Reynaldo</a> said:</div><div class="quote"><p> With all your recent experience with setting up Allegro 5 and Android, what is the best guide to follow to get a working allegro program?
</p></div></div><p>Hmm... I had a lot of trouble because of the old tablet I was trying to use and for which it took a while to find a solution. Other than that, the instructions in <i>README_android.txt</i> should be easy to follow. In fact, I literally got Allegro to build successfully on the first attempt following those instructions, it was just due to <a href="https://www.allegro.cc/forums/thread/617522/1038856#target">this issue</a> that I had trouble with it.</p><p>While fighting with that issue, I also tried other alternatives and <a href="https://github.com/liballeg/android/blob/master/install_android.py">this python script</a> also can help in building Allegro as it does it automatically. Even though it seems the script is not meant for the final user, I guess with some simple modifications the script can be an useful way to build Allegro for final users.</p><p>Finally, once you have built Allegro, building Allegro programs is also possible <b>without</b> having to launch Android Studio just by setting the corresponding environment variables and using the Android Studio NDK <i>Hello world</i> sample code as a starting point, just as described in <i>README_android.txt</i>.</p><p>In general, it&#39;s not that hard to use Allegro on Android be it with or without Android Studio.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (kenmasters1976)</author>
		<pubDate>Thu, 16 Aug 2018 02:18:27 +0000</pubDate>
	</item>
</rss>
