<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>al_set_target_bitmap problem</title>
		<link>http://www.allegro.cc/forums/view/607999</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 02 Aug 2011 09:02:11 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I received a ASSERT output in my program once I turned on the debugging. I am pretty sure this is a small bug that wouldn&#39;t hurt to fix.<br />I have seperate threads that load bitmaps and so I have to call al_set_target_bitmap to set the display backbuffer as the target. <br />al_set_target_bitmap has this line of code(which caused the program to quit):<br /><span class="source-code"><a href="http://www.allegro.cc/manual/ASSERT"><span class="a">ASSERT</span></a><span class="k2">(</span><span class="k3">!</span><a href="http://www.allegro.cc/manual/al_is_bitmap_drawing_held"><span class="a">al_is_bitmap_drawing_held</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></span><br />I looked into it, and that function returns false if al_get_current_display returns false. So, I am calling the function to set the current display, and it requests for the current display, causing an ASSERT. Kinda ironic <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Addison Elliott)</author>
		<pubDate>Tue, 02 Aug 2011 04:33:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That seems right. al_get_current_display returns NULL, then al_is_bitmap_draw_held returns false, which means the assertion is true.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Tue, 02 Aug 2011 04:51:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If it is failing that assert, then al_is_bitmap_drawing_held() is returning true, so somewhere you have failed to release deferred bitmap drawing...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 02 Aug 2011 09:02:11 +0000</pubDate>
	</item>
</rss>
