<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Window Resize??</title>
		<link>http://www.allegro.cc/forums/view/618623</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 06 Mar 2022 19:58:38 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, i have a fixed window (not resizable) that changes the size 1x,2x and so on...<br />I tought it would be easy to &quot;detect&quot; when the main window is sized/resized so i found ALLEGRO_EVENT_DISPLAY_RESIZE to do the job, but it seems the &quot;resize&quot; message is not put to the queue.</p><p>This is what a i do:</p><div class="source-code snippet"><div class="inner"><pre> <a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a><span class="k3">*</span> display <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_create_display"><span class="a">al_create_display</span></a><span class="k2">(</span><span class="n">320</span>, <span class="n">240</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
And properly &quot;register&quot; display events in my queue.
</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/al_register_event_source"><span class="a">al_register_event_source</span></a><span class="k2">(</span>queue, <a href="http://www.allegro.cc/manual/al_get_display_event_source"><span class="a">al_get_display_event_source</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
Then i do a resize like:
</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/al_resize_display"><span class="a">al_resize_display</span></a><span class="k2">(</span>display, <span class="n">640</span>, <span class="n">480</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

But in the loop where in checks for &quot;messages&quot;, after calling al_resize_display() the code never falls here:
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">if</span> <span class="k2">(</span>event.type <span class="k3">=</span><span class="k3">=</span> ALLEGRO_EVENT_DISPLAY_RESIZE<span class="k2">)</span>
<span class="k2">{</span>
    <span class="c">//something to do with the new resized window.</span>
<span class="k2">}</span>
</pre></div></div><p>

Any Help?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Lucas Dalmasso)</author>
		<pubDate>Sun, 06 Mar 2022 06:43:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>al_resize_display does not trigger an ALLEGRO_EVENT_DISPLAY_RESIZE because you called it yourself so you already know it happened. The resize event happens when a user resizes the window using the drag icons.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sun, 06 Mar 2022 19:58:38 +0000</pubDate>
	</item>
</rss>
