<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Rendering modes for bitmaps?</title>
		<link>http://www.allegro.cc/forums/view/617871</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 30 Jun 2019 03:35:35 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I couldn&#39;t find any info on this in the docs. What is the rendering mode for ALLEGRO_BITMAPs and is there a way to set it? By rendering mode I mean how does the 2D being drawn, quads?</p><p>Thanks.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Alianix)</author>
		<pubDate>Tue, 25 Jun 2019 02:56:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You&#39;re going to have to be more specific, please.</p><p>You said <span class="source-code"><a href="http://www.allegro.cc/manual/ALLEGRO_BITMAP"><span class="a">ALLEGRO_BITMAP</span></a></span> so you&#39;re using Allegro 5.</p><p>You mentioned quad, so I assume you want to texture a quad?</p><p>You can draw two triangles, using the correct texture coordinates.</p><p>Try using an <span class="source-code"><a href="http://www.allegro.cc/manual/ALLEGRO_VERTEX"><span class="a">ALLEGRO_VERTEX</span></a><span class="k2">[</span><span class="k2">]</span> <span class="k3">&amp;</span><span class="k3">&amp;</span> <a href="http://www.allegro.cc/manual/al_draw_prim"><span class="a">al_draw_prim</span></a></span>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 25 Jun 2019 11:34:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Forgive me perhaps I&#39;m in a deep confusion but I understand that ALLEGRO_BITMAP is a rectangular region in Allegro 5. So is the underlying call to the renderer uses quad to draw it or something else? Is there any polygon trimming by default? If I understand correctly with al_draw_prim it&#39;s possible to draw a &quot;bitmap&quot; a rectangular region as a quad or other number of vertices. Is there any advantage in doing so?</p><p>Thanks Edgar
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Alianix)</author>
		<pubDate>Wed, 26 Jun 2019 04:03:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Everything is ultimately drawn as triangles. This means bitmaps are rendered as two triangles that are coplanar. A quad doesn&#39;t have to be aligned with the screen or the z-axis either. But all the 2D drawing functions just map a quad yes.</p><p>If you only need 2D then there&#39;s no point using al_draw_prim unless you&#39;re drawing polygons, lines, or points.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 26 Jun 2019 04:31:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thank you. Why do you think there is no point in polygon sprites for 2d? If you have a human character (sprite) for example there will be many empty spaces, so it should be faster with more then a few triangles?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Alianix)</author>
		<pubDate>Wed, 26 Jun 2019 04:38:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That&#39;s not what I said.</p><p>2D sprites generally don&#39;t need meshes unless they&#39;re skeletal animations or Pseudo3D.</p><p>And no, more smaller triangles does not equal better performance.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 26 Jun 2019 07:14:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>According to what I&#39;ve read about polygon sprites is that they do perform better on the GPU, as lot of the empty spaces aren&#39;t drawn. However they may cost more CPU to process vertices. So there could be a significant speed improvement in drawing larger sprites with more triangles or the optimal number of triangles, this is why I was wondering if allegro 5 supports any such operations? I&#39;ve no test of the speed improvement but Unity and also Cocos2d employs polygon sprites for performance.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Alianix)</author>
		<pubDate>Wed, 26 Jun 2019 10:36:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You&#39;ll have to triangulate the sprites yourself. Allegro does not do such things.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 26 Jun 2019 18:54:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So, if I draw a line using a for loop and <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><span class="k2">;</span></span> will it be slower than using <span class="source-code"><a href="http://www.allegro.cc/manual/al_draw_line"><span class="a">al_draw_line</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></span>?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Doctor Cop)</author>
		<pubDate>Sat, 29 Jun 2019 12:33:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It will take longer because you&#39;re using multiple drawing calls instead of one.</p><p>However, turning a 2D sprite into triangles could potentially save gpu work, but not cpu, unless you upload your vertices to the gpu.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sun, 30 Jun 2019 03:35:35 +0000</pubDate>
	</item>
</rss>
