<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Lags after changing resolution on-the-fly</title>
		<link>http://www.allegro.cc/forums/view/609132</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 28 Dec 2011 00:34:05 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello, i have a little problem here, i have display running on some predefined <span class="source-code">WIDTH</span> and <span class="source-code">HEIGHT</span> .. when i try to switch to fullscreen from windowed and using <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_display_mode"><span class="a">al_get_display_mode</span></a></span>, <span class="source-code"><a href="http://www.allegro.cc/manual/al_set_new_display_flags"><span class="a">al_set_new_display_flags</span></a><span class="k2">(</span>ALLEGRO_FULLSCREEN<span class="k2">)</span></span> and then <span class="source-code"><a href="http://www.allegro.cc/manual/al_destroy_display"><span class="a">al_destroy_display</span></a></span> and <span class="source-code"><a href="http://www.allegro.cc/manual/al_create_display"><span class="a">al_create_display</span></a></span> with new screen resolution from `al_get_display_mod`e .. my screen really lags .. changing back to windowed (again on the fly) didn&#39;t help.</p><p> I ve tried add counter before redrawing routine where is <span class="source-code"><span class="k1">if</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_is_event_queue_empty"><span class="a">al_is_event_queue_empty</span></a><span class="k2">(</span>event_queue<span class="k2">)</span><span class="k2">)</span></span> .. and counter is about 120 when it jumps in with normal screen but after resolution change it is about 600</p><p>Thanks for all advices
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Frenzy)</author>
		<pubDate>Mon, 26 Dec 2011 15:04:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I wonder if this is related to the behavior I&#39;ve had with multiple displays. When switching focus from one to the other it takes more than a second before events come through to my program. Might not be related at all though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trezker)</author>
		<pubDate>Mon, 26 Dec 2011 17:14:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hm, maybe i use two monitors but dont work with it in allegro .. i will try to disconnect it</p><p>EDIT: still same lags :/ <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /><br />EDIT 2: tried to delete event queue and register a new one, still lagging :/<br />EDIT 3: Fraps: before resize 60FPS, after 11FPS .. CPU: before 2% after 25%
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Frenzy)</author>
		<pubDate>Mon, 26 Dec 2011 17:23:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It might lag because you lose your video bitmaps and they become memory bitmaps?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Mon, 26 Dec 2011 19:27:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/609132/941614#target">jmasterx</a> said:</div><div class="quote"><p>It might lag because you lose your video bitmaps and they become memory bitmaps?</p></div></div><p>
Very likely, this. Try reloading your bitmaps, see if that helps.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Itachihro)</author>
		<pubDate>Mon, 26 Dec 2011 22:12:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hmm that is highly possible .. i will definetly try it, but reloading mean only reloading or iniciating all bitmaps to null and then reload ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Frenzy)</author>
		<pubDate>Mon, 26 Dec 2011 22:35:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think you&#39;d want to free the memory they used first, then reload them.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (J-Gamer)</author>
		<pubDate>Mon, 26 Dec 2011 22:37:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thank all of you. It&#39;s working now, it really was memory problem. Freeing memory and reloading bitmaps works <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> THX a lot !
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Frenzy)</author>
		<pubDate>Mon, 26 Dec 2011 22:58:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Isn&#39;t there a way to do it without loading again from the disk?(which is probably the biggest bottleneck without an SSD) I mean, if there&#39;s both a memory and video bitmap copy, shouldn&#39;t it be possible to use <span class="source-code"><a href="http://www.allegro.cc/manual/al_clone_bitmap"><span class="a">al_clone_bitmap</span></a></span> or something like that to recreate the video bitmap from the memory bitmap and send it to the GPU again with the new display?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Tue, 27 Dec 2011 00:49:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Allegro 5.1 handles this automatically. Or you can use <span class="source-code">al_convert_bitmap<span class="k2">(</span><span class="k2">)</span></span> manually.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Tue, 27 Dec 2011 01:01:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>al_clone_bitmap works on 5.0.x, but memory is wasted somewhere when you use it that way.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Tue, 27 Dec 2011 04:12:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/609132/941648#target">torhu</a> said:</div><div class="quote"><p>al_clone_bitmap works on 5.0.x, but memory is wasted somewhere when you use it that way.</p></div></div><p>How much? I can&#39;t really imagine what it&#39;d be unless you&#39;re forgetting to delete the old bitmap.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 27 Dec 2011 14:03:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t have a number for an individual bitmap, sorry.  Memory use went up about 5 MB each time I cloned my 30 or so bitmaps.  To try to reduce memory fragmentation, I tried cloning all bitmaps first, then destroying all in one go. But it didn&#39;t seem to matter.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Tue, 27 Dec 2011 20:38:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you have a test case, or ever try it again, please report it <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Wed, 28 Dec 2011 00:34:05 +0000</pubDate>
	</item>
</rss>
