<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>lost device again</title>
		<link>http://www.allegro.cc/forums/view/612164</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 07 Mar 2013 15:42:42 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I have to continue this problem:<br /><a href="https://www.allegro.cc/forums/thread/611811/974446#target">https://www.allegro.cc/forums/thread/611811/974446#target</a></p><p>I haven&#39;t looked yet into the 5.1.5-branch, but tested Allegro 5.0.9 with my<br />problem. So, for your information:</p><p>With Allegro 5.0.9 a combination like this handles the problem in most cases:</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/ALLEGRO_LOCKED_REGION"><span class="a">ALLEGRO_LOCKED_REGION</span></a><span class="k3">*</span> ar<span class="k2">;</span>
<span class="number"> 2</span>
<span class="number"> 3</span>  <span class="k1">while</span> <span class="k2">(</span><a href="http://www.allegro.cc/manual/al_is_d3d_device_lost"><span class="a">al_is_d3d_device_lost</span></a><span class="k2">(</span>al5_display<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 4</span>
<span class="number"> 5</span>  ar <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_lock_bitmap"><span class="a">al_lock_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>al5_display<span class="k2">)</span>, ALLEGRO_PIXEL_FORMAT_ANY, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
</div></div><p>

...but there is still a little timing glitch that may slip through to:
</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>      ALLEGRO_DISPLAY_D3D <span class="k3">*</span>d3d_disp <span class="k3">=</span> <span class="k2">(</span>ALLEGRO_DISPLAY_D3D <span class="k3">*</span><span class="k2">)</span>bitmap-&gt;display<span class="k2">;</span>
<span class="number"> 2</span>      <span class="k1">if</span> <span class="k2">(</span>d3d_disp-&gt;render_target-&gt;LockRect<span class="k2">(</span><span class="k3">&amp;</span>d3d_bmp-&gt;locked_rect, <span class="k3">&amp;</span><a href="http://www.allegro.cc/manual/rect"><span class="a">rect</span></a>, Flags<span class="k2">)</span> <span class="k3">!</span><span class="k3">=</span> D3D_OK<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 3</span>         ALLEGRO_ERROR<span class="k2">(</span><span class="s">"LockRect failed in d3d_lock_region.\n"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 4</span>
<span class="number"> 5</span><a href="http://www.allegro.cc/manual/line"><span class="a">line</span></a> <span class="n">769</span> in d3d_bmp.cpp
</div></div><p>
and throws an exception.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (allandy)</author>
		<pubDate>Wed, 06 Mar 2013 15:07:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Can you provide a test case?</p><p>Also, use proper code tags.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Thu, 07 Mar 2013 03:40:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><a href="http://www.akluwi.de/al/al_lcktest.zip">http://www.akluwi.de/al/al_lcktest.zip</a></p><p>This is even more mysterious.<br />The device exists until the routine &#39;stretchblit&#39; is reached - then it&#39;s lost...<br />It&#39;s cutted and reduced from the original program which uses to run fine.<br />I&#39;m really confused at the moment.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (allandy)</author>
		<pubDate>Thu, 07 Mar 2013 15:42:42 +0000</pubDate>
	</item>
</rss>
