<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Temporally blocking window resizing. </title>
		<link>http://www.allegro.cc/forums/view/617595</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 28 Oct 2018 18:43:20 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Due to a plethora of technical reasons, when my game runs the opening credits in windowed mode, you shouldn&#39;t resize the window. To enforce this, I want to make the window not resizable until the game proper starts. However, I can&#39;t seem to flip it on and off at will. Actually I can&#39;t seem to turn an option off once I evoke it.</p><p>here is code to set up the window.</p><div class="source-code snippet"><div class="inner"><pre><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_WINDOWED<span class="k2">)</span><span class="k2">;</span>
DisplayWidth <span class="k3">=</span> <span class="n">1366</span><span class="k2">;</span>
DisplayHeight <span class="k3">=</span> <span class="n">768</span><span class="k2">;</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>DisplayWidth, DisplayHeight<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_set_window_position"><span class="a">al_set_window_position</span></a><span class="k2">(</span>DISPLAY, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
and here is when I want to make it resizable later
</p><div class="source-code snippet"><div class="inner"><pre><span class="c">//Allow for window resize</span>
<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_WINDOWED <span class="k3">|</span> ALLEGRO_RESIZABLE<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_resize_display"><span class="a">al_resize_display</span></a><span class="k2">(</span>DISPLAY, <a href="http://www.allegro.cc/manual/al_get_display_width"><span class="a">al_get_display_width</span></a><span class="k2">(</span>DISPLAY<span class="k2">)</span>, <a href="http://www.allegro.cc/manual/al_get_display_height"><span class="a">al_get_display_height</span></a><span class="k2">(</span>DISPLAY<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

should I be using al_resize_display()? How to you impose new display flags on a currently running display?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (nshade)</author>
		<pubDate>Wed, 24 Oct 2018 18:05:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think that <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> is only used to set flags for a display that you&#39;re about to <u>create</u>. Since there&#39;s no &quot;see also&quot; links for a function to change flags on the fly I&#39;m assuming to accomplish this you&#39;ll need to manage multiple &quot;displays&quot;. Or else settle for a game that never resizes (which honestly is most of them in my experience anyway).</p><p>Destroying and creating a new display will likely have some kind of a &quot;glitch&quot; appearance to the user, but would probably accomplish what you&#39;re asking. You&#39;ll have to test it on all of your target platforms to see what it looks like, and how reliable it is.</p><p>It might be possible to create two displays, and show/hide them as appropriate. However, it sounds like you might need platform specific code to do this. Unless the API has grown since <a href="https://www.allegro.cc/forums/thread/616620">this</a>. And according to that, having multiple displays killed the performance of one of them.</p><p>I don&#39;t really know what I&#39;m talking about though. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> Just giving you the best advice I can.</p><p><b>Append:</b></p><p>As mentioned, one solution is to never support resizing. Instead, you have an options screen that allows the user to change resolutions, and when the user applies those settings you&#39;d destroy and create a display again. It&#39;s normal for this process to be clunky in all games so we&#39;re all used to it.</p><p>The other thing to discuss is what about the credit screen is preventing you from resizing it the way the game is. I doubt there&#39;s a simple solution to it, but you might as well explain what is different about it so that other great minds here (not mine necessarily) can process it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Wed, 24 Oct 2018 18:55:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Using the current mechanism, you would have to destroy and re-create the window to change its resizability.</p><p>You can probably use SetWindowLong or some such to change the window properties after getting the HWND from allegro.</p><p>You can&#39;t change the resizability of a display after creating it. Not with allegro anyway.</p><p><a href="https://liballeg.org/a5docs/trunk/display.html#al_set_display_flag">https://liballeg.org/a5docs/trunk/display.html#al_set_display_flag</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 27 Oct 2018 19:30:36 +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/617595/1039717#target">Edgar Reynaldo</a> said:</div><div class="quote"><p>
You can&#39;t change the resizability of a display after creating it. Not with allegro anyway.
</p></div></div><p>
Is there any good reason A5 doesn&#39;t support changing configurations of already created windows?</p><p>I mean, fixed resolution and color depth makes sense. But say, a window&#39;s title? Clearly there&#39;s a case for changing that often.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Sun, 28 Oct 2018 03:10:04 +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/617595/1039772#target">Chris Katko</a> said:</div><div class="quote"><p> But say, a window&#39;s title? Clearly there&#39;s a case for changing that often. </p></div></div><p>You can, <span class="source-code"><a href="http://www.allegro.cc/manual/al_set_window_title"><span class="a">al_set_window_title</span></a></span>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Erin Maus)</author>
		<pubDate>Sun, 28 Oct 2018 05:18:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Chris catco you&#39;re welcome to add the function to change the window property.
</p><div class="source-code snippet"><div class="inner"><pre><span class="k2">:</span><span class="k2">:</span>SetWindowLong<span class="k2">(</span>hWnd, GWL_STYLE, GetWindowLong<span class="k2">(</span>hWnd, GWL_STYLE<span class="k2">)</span><span class="k3">&amp;</span>~WS_SIZEBOX<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sun, 28 Oct 2018 15:32:05 +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/617595/1039773#target">Aaron Bolyard</a> said:</div><div class="quote"><p>
You can, al_set_window_title.
</p></div></div><p>

You missed the point. I&#39;m talking about generic window settings, not one, specific, hardcoded function.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/617595/1039780#target">Edgar Reynaldo</a> said:</div><div class="quote"><p>
Chris catco you&#39;re welcome to add the function to change the window property.
</p></div></div><p>
To Allegro? I may do that.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Sun, 28 Oct 2018 18:43:20 +0000</pubDate>
	</item>
</rss>
