<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Tint bitmap</title>
		<link>http://www.allegro.cc/forums/view/616857</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 19 Apr 2017 19:08:56 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I am trying to make a bitmap in my game be able to be tinted red, but I am having trouble with al_set_blender. I need it to not draw the red where the bitmap has no alpha. Here is my code.</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><a href="http://www.allegro.cc/manual/al_set_target_bitmap"><span class="a">al_set_target_bitmap</span></a><span class="k2">(</span>temp<span class="k2">)</span><span class="k2">;</span>
<span class="number">  2</span><a href="http://www.allegro.cc/manual/al_draw_bitmap_region"><span class="a">al_draw_bitmap_region</span></a><span class="k2">(</span>enemyImages, imageSize <span class="k3">*</span> frame, imageSize <span class="k3">*</span> type, imageSize, imageSize, <span class="n">0</span>, <span class="n">0</span>, NULL<span class="k2">)</span><span class="k2">;</span>
<span class="number">  3</span><a href="http://www.allegro.cc/manual/al_set_blender"><span class="a">al_set_blender</span></a><span class="k2">(</span>ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_ONE<span class="k2">)</span><span class="k2">;</span>
<span class="number">  4</span><a href="http://www.allegro.cc/manual/al_draw_filled_rectangle"><span class="a">al_draw_filled_rectangle</span></a><span class="k2">(</span><span class="n">0</span>, <span class="n">0</span>, imageSize, imageSize, <a href="http://www.allegro.cc/manual/al_map_rgba"><span class="a">al_map_rgba</span></a><span class="k2">(</span><span class="n">255</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="n">50</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  5</span><a href="http://www.allegro.cc/manual/al_set_blender"><span class="a">al_set_blender</span></a><span class="k2">(</span>ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA<span class="k2">)</span><span class="k2">;</span>
<span class="number">  6</span><a href="http://www.allegro.cc/manual/al_set_target_bitmap"><span class="a">al_set_target_bitmap</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_get_backbuffer"><span class="a">al_get_backbuffer</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  7</span><a href="http://www.allegro.cc/manual/al_draw_rotated_bitmap"><span class="a">al_draw_rotated_bitmap</span></a><span class="k2">(</span>temp, imageSize <span class="k3">/</span> <span class="n">2</span>, imageSize <span class="k3">/</span> <span class="n">2</span>, x, y, dir, NULL<span class="k2">)</span><span class="k2">;</span>
<span class="number">  8</span><a href="http://www.allegro.cc/manual/al_destroy_bitmap"><span class="a">al_destroy_bitmap</span></a><span class="k2">(</span>temp<span class="k2">)</span><span class="k2">;</span>
</div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bingocat)</author>
		<pubDate>Mon, 17 Apr 2017 12:36:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Is there any reason not to use <span class="source-code"><a href="http://www.allegro.cc/manual/al_draw_tinted_bitmap"><span class="a">al_draw_tinted_bitmap</span></a></span>?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Polybios)</author>
		<pubDate>Mon, 17 Apr 2017 21:30:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>There are several ways to do it, but if you can&#39;t figure out the right blending mode one simple way would be to disable alpha writes: <span class="source-code">al_set_render_state<span class="k2">(</span>ALLEGRO_WRITE_MASK_FLAGS, ALLEGRO_MASK_RGB<span class="k2">)</span></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Tue, 18 Apr 2017 02:53:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I tried drawing a tinted bitmap, but the image is mostly black so I don&#39;t think it works because there isn&#39;t color to tint. Also, for some reason it seems like al_set_render_state() is nowhere to be found.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bingocat)</author>
		<pubDate>Tue, 18 Apr 2017 06:18:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You mean your version of Allegro doesn&#39;t have al_set_render_state?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Tue, 18 Apr 2017 06:32:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What do I have to include to use it? I can&#39;t really find information on it anywhere.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bingocat)</author>
		<pubDate>Tue, 18 Apr 2017 07:06:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Nothing? It is a normal function like any other: <a href="http://liballeg.org/a5docs/trunk/graphics.html#al_set_render_state">http://liballeg.org/a5docs/trunk/graphics.html#al_set_render_state</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Tue, 18 Apr 2017 19:00:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well it just isn&#39;t showing up for me. Maybe I have a weird version of Allegro, but it doesn&#39;t matter cause I decided to just do something different for the enemy anyway.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bingocat)</author>
		<pubDate>Wed, 19 Apr 2017 04:26:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You need 5.1.2 or later, according to the docs.</p><p>If you&#39;re on Linux, it&#39;s fairly easy to grab the newest version and compile it. On Windows, someone will have to provide the link to a new enough binary version.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Wed, 19 Apr 2017 04:36:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>&quot;On Windows, someone will have to provide the link to a new enough binary version&quot;</p><p>I never had problems compiling on windows.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Wed, 19 Apr 2017 19:08:56 +0000</pubDate>
	</item>
</rss>
