<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Why allegro pause the game if the window lost focus?</title>
		<link>http://www.allegro.cc/forums/view/603513</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 23 Mar 2010 20:43:54 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi all,</p><p>May I ask why allegro pause the game if the window lost focus??</p><p>I use a while loop for running the game.<br />How can I fix it(as I want to create a game that will still run even the window lose focus)?</p><p>Thanks
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (davidcorns)</author>
		<pubDate>Sat, 20 Mar 2010 16:35:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><span class="source-code"><a href="http://www.allegro.cc/manual/set_display_switch_mode" target="_blank"><span class="a">set_display_switch_mode</span></a><span class="k2">(</span><span class="k2">)</span></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Sat, 20 Mar 2010 16:54:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks for your reply.</p><p>I have tried set_display_switch_mode(SWITCH_BACKGROUND) under window xp, but still when the window lose focus, the sound delay to play and the whole game stop.</p><p>What&#39;s going wrong?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (davidcorns)</author>
		<pubDate>Sat, 20 Mar 2010 17:47:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>A couple of questions..<br />What platfrom are you running the application on?<br />What is the return value of <span class="source-code"><a href="http://www.allegro.cc/manual/set_display_switch_mode" target="_blank"><span class="a">set_display_switch_mode</span></a><span class="k2">(</span><span class="k2">)</span></span>?</p><p>Not all modes are supported on all platforms, I can only suggest that you setup your code so that you try the variety of background modes in the most preferable order. Then you either dont use video bitmaps, or be prepared to reload them when you get the display switch callback. (<span class="source-code"><a href="http://www.allegro.cc/manual/set_display_switch_callback" target="_blank"><span class="a">set_display_switch_callback</span></a><span class="k2">(</span><span class="k2">)</span></span>)</p><p>If you solve the problem in this way, it will work on more platforms without you having to modify your code.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Timorg)</author>
		<pubDate>Sat, 20 Mar 2010 18:00:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks for your reply.</p><p>&gt;What platfrom are you running the application on?<br />MS Window XP sp2</p><p>&gt;What is the return value of set_display_switch_mode()?<br />it is 0.</p><p>Thanks
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (davidcorns)</author>
		<pubDate>Sun, 21 Mar 2010 10:46:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Returns -1 if the requested mode is not currently possible.
</p></div></div><p>

....</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
SWITCH_BACKAMNESIA<br />Like SWITCH_BACKGROUND, but this mode doesn&#39;t bother to remember the contents of video memory (see SWITCH_AMNESIA). It is again the only mode supported by the fullscreen drivers under Windows that lets the program keep running in the background.
</p></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ImLeftFooted)</author>
		<pubDate>Sun, 21 Mar 2010 13:56:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks you all.</p><p>Finally, I found that while it did not work even if I had used set_display_switch_mode(SWITCH_BACKGROUND) under window.</p><p>It is because I wrote this code before &quot;set_gfx_mode&quot; = =</p><p>Anyway, thanks again
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (davidcorns)</author>
		<pubDate>Tue, 23 Mar 2010 20:43:54 +0000</pubDate>
	</item>
</rss>
