<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Allegro with resizable windows - ready for testing on MSVC</title>
		<link>http://www.allegro.cc/forums/view/591813</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 10 Jun 2007 00:40:11 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Attached is a version of Allegro which compiles in Visual Studio (7 or higher) and has a working GDI driver with resizable windows, with a small demo file.  This will NOT build from the makefile because it&#39;s based on an 4.2 SVN checkout which had a broken file</p><p>Instructions:<br />-  Download and unzip the attached file<br />-  Open build\msvc\Allegro42.sln   <br />-  build Allegro Static  -  Warning! will install alld_s.lib(edit: not alld.lib) in $VCInstallDir/lib    <br />-  install allegro headers manually (sorry I forgot about this until I was typing this post)<br />-  build exresize<br />-  run or debug exresize.exe</p><p>You will now have a picture of mysha in a window.  The window edges can be dragged, and the maximise button is now active.  </p><p>There is a refresh problem currently, which is probably due to the primitive callback in the demo, although I will look for internal reasons. </p><p>The modified directx drivers are also in place but not yet working.</p><p>This is based on Elias&#39; version for X, which has been on the mailing list for some time, and has been tested quite hard. the principle is solid.</p><p>I have added the global <tt>allegro_resizable_window_flag</tt> but this is only temporary, and not in the X version.</p><p>TODO   <br />fix refresh problem<br />finish directx versions<br />get resize cursors working when mouse is on border<br />user documentation
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matt Smith)</author>
		<pubDate>Sat, 09 Jun 2007 09:18:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hows it work, does it resize screen-&gt;w / screen-&gt;h and or SCREEN_W and SCREEN_H?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ImLeftFooted)</author>
		<pubDate>Sat, 09 Jun 2007 10:00:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>yep, both</p><p>When you call resize_screen() then the old screen is destroyed and a new one made with the new dimensions.  With this current setup it would be best to redraw immediately afterwards.   The callback is supposed to be optional, but in the example is used to trigger resize_screen().  The minimum size params in set_resize_callback() are not currently honoured.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matt Smith)</author>
		<pubDate>Sat, 09 Jun 2007 11:19:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I haven&#39;t looked at it in detail, but the demo worked fine on Vista.</p><p>It didn&#39;t update after moving to full screen until I restored the window (back to original size), and at that point it thought it was in full screen. But maybe that&#39;s what you meant by a refresh problem.</p><p>The only other thing I noticed was the mouse resize icon didn&#39;t appear when the mouse was near the edge of the window. Edit: I guess you mentioned that too.</p><p>Update:</p><p>Is there a way to explicitly resize the window? I would expect it to work something like:</p><div class="source-code snippet"><div class="inner"><pre>
<span class="k1">void</span> my_display_callback<span class="k2">(</span><span class="k2">)</span> <span class="k2">{</span> <span class="k2">}</span> 

al_allow_resize_flag <span class="k3">=</span> TRUE<span class="k2">;</span> <span class="c">// let the user resize, by default to any size</span>

<span class="c">// set_gfx_mode</span>

al_set_minmax_size<span class="k2">(</span><span class="n">320</span>,<span class="n">240</span>, <span class="n">1024</span>,<span class="n">768</span><span class="k2">)</span><span class="k2">;</span> <span class="c">// user can resize from minimum of 320x240 to max of 1024x768</span>

<span class="c">// OR</span>

<span class="c">// resize it myself. Doesn't require al_allow_resize to be set.</span>
<span class="c">// works with full screen as well.</span>
al_resize<span class="k2">(</span><span class="n">640</span>, <span class="n">480</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Sat, 09 Jun 2007 17:47:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
al_set_minmax_size(320,240, 1024,768); // user can resize from minimum of 320x240 to max of 1024x768
</p></div></div><p>

I considered adding 2 extra params to set_resize_callback() for max, but I&#39;ve gone off that idea and a seperate func like yours would be better.</p><p>I also think that the callback should be passed the new width &amp; height, because threading issues might make SCREEN_W and SCREEN_H change during the callback</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
// resize it myself. Doesn&#39;t require al_allow_resize to be set.<br />// works with full screen as well.<br />al_resize(640, 480);
</p></div></div><p>

Great idea.  noted and started.  I think I&#39;ll do it as <tt>al_window_size(NULL, 640, 480);</tt> where the NULL is a dummy placeholder for an AL_DISPLAY* in 4.9</p><p>edit: btw the fullscreen behaviour you described is exactly what I have here.  I think the driver needs an internal flag and resize_screen() should be called unconditionally every loop. </p><p>more edit:  Instead of a single global flag, should I move towards a 4.9 friendly approach and replace it with the following?</p><div class="source-code snippet"><div class="inner"><pre>al_window_setflags<span class="k2">(</span>NULL <span class="c">/*dummy AL_DISPLAY* again */</span>, AL_DF_RESIZABLE<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matt Smith)</author>
		<pubDate>Sun, 10 Jun 2007 00:40:11 +0000</pubDate>
	</item>
</rss>
