<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>locking backbuffer when notebook gets closed</title>
		<link>http://www.allegro.cc/forums/view/611811</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 12 Jan 2013 16:16:50 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I realized, that this command gives a NULL-pointer as soon as a notebook gets closed:</p><p>  ALLEGRO_LOCKED_REGION* ar =<br />   al_lock_bitmap(al_get_backbuffer(al5_display), ALLEGRO_PIXEL_FORMAT_ANY, 0);</p><p>Just looping until a pointer is available again isn&#39;t possible.<br />I then get an exception at d3d_bmp.cpp, line 767:</p><p>      if (d3d_disp-&gt;render_target-&gt;LockRect(&amp;d3d_bmp-&gt;locked_rect, &amp;rect, Flags) != D3D_OK) {<br />         ALLEGRO_ERROR(&quot;LockRect failed in d3d_lock_region.\n&quot;);<br />         return NULL;<br />      }</p><p>I need &#39;ar&#39; for fast pixel draeings. Is there a solution?</p><p>It&#39;s a self-compiled allegro 5.08 - maybe due to my compilation?<br />DirectX9c used.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (allandy)</author>
		<pubDate>Sat, 12 Jan 2013 14:03:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s a directx &quot;feature.&quot; You need to use al_d3d_set_restore|release_callback. Google for &quot;Direct3D lost device&quot; or similar for background.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sat, 12 Jan 2013 14:10:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Isn&#39;t there a display lost or a switch out event when the notebook gets closed? If so, you can just set a flag and not draw during that period.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 12 Jan 2013 14:43:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>An event-message is too critical. This also can happen between the event-request and the drawing. I have to try Trent&#39;s hint.</p><p>It&#39;s my first trial with 5.x. There was never a problem using Allegro 4.2.<br />Miss the midi-driver too and I hate it that the event-queue gets flooded when you are at a breakpoint.<br />Just had to port it because a friend has problems with Allegro 4.2 on a 64-bit-system. This all ain&#39;t no fun anymore. Think I&#39;m getting old...</p><p>Think it&#39;s worth to post the solution then, because this can happen to almost each program that uses Allegro 5. Will try my very best.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (allandy)</author>
		<pubDate>Sat, 12 Jan 2013 15:42:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I fixed a couple of bugs with respect to device lost handling on the 5.1 branch. These changes are not yet in any released version. 5.1.5 will be released soon.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/611811/974437#target">Trent Gamblin</a> said:</div><div class="quote"><p>
It&#39;s a directx &quot;feature.&quot; You need to use al_d3d_set_restore|release_callback. Google for &quot;Direct3D lost device&quot; or similar for background.
</p></div></div><p>

Do you really need them in the common case? The documentation only mentions &quot;d3d resources you have created yourself&quot;. AFAICS, the mechanisms in 5.0 are enough to handle device lost otherwise.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Sat, 12 Jan 2013 16:16:50 +0000</pubDate>
	</item>
</rss>
