<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>resize display handling</title>
		<link>http://www.allegro.cc/forums/view/614370</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 23 Jun 2014 02:35:26 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hey guys I have a question for you. I&#39;ve got some code that scales my ui when I resize my display. In my program I&#39;ve noticed the following behaviors: While dragging the window to resize my graphics change size(display not acknowledged yet) then once I let it go, display is acknowledged(it returns to the correct size), then my scaling code kicks in and you can see it change. I&#39;m wondering if there&#39;s a way to make this whole process more &quot;smooth&quot;. Is there anything I could do in my end or is this all allegro backend stuff? ALLEGRO_EVENT_DISPLAY_RESIZE should be called ALLEGRO_EVENT_DISPLAY_RESIZED because it doesn&#39;t seem to call as I&#39;m resizing. Is there a way to automatically acknowledge resize while I&#39;m dragging that window? Or some kind of ALLEGRO_EVENT_DISPLAY_RESIZING kind of event I could use? Here&#39;s a snippet of my code for reference:</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span>    <span class="k1">while</span><span class="k2">(</span>app.currentEvent.display.type <span class="k3">!</span><span class="k3">=</span> ALLEGRO_EVENT_DISPLAY_CLOSE<span class="k2">)</span>
<span class="number">  2</span>    <span class="k2">{</span>
<span class="number">  3</span>        <a href="http://www.allegro.cc/manual/al_wait_for_event"><span class="a">al_wait_for_event</span></a><span class="k2">(</span>app.eventQueue, <span class="k3">&amp;</span>app.currentEvent<span class="k2">)</span><span class="k2">;</span>
<span class="number">  4</span>
<span class="number">  5</span>        <span class="k1">if</span><span class="k2">(</span>app.currentEvent.timer.type <span class="k3">=</span><span class="k3">=</span> ALLEGRO_EVENT_TIMER<span class="k2">)</span>
<span class="number">  6</span>        <span class="k2">{</span>
<span class="number">  7</span>            <span class="k1">if</span><span class="k2">(</span>app.currentEvent.timer.source <span class="k3">=</span><span class="k3">=</span> app.bufferTimer<span class="k2">)</span>
<span class="number">  8</span>            <span class="k2">{</span>
<span class="number">  9</span>                app.redraw <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span>
<span class="number"> 10</span>            <span class="k2">}</span>
<span class="number"> 11</span>        <span class="k2">}</span>
<span class="number"> 12</span>
<span class="number"> 13</span>        <span class="k1">if</span><span class="k2">(</span>app.currentEvent.display.type <span class="k3">=</span><span class="k3">=</span> ALLEGRO_EVENT_DISPLAY_RESIZE<span class="k2">)</span>
<span class="number"> 14</span>        <span class="k2">{</span>
<span class="number"> 15</span>            <a href="http://www.allegro.cc/manual/al_acknowledge_resize"><span class="a">al_acknowledge_resize</span></a><span class="k2">(</span>app.mainDisplay<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 16</span>            app.ScaleUi<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 17</span>        <span class="k2">}</span>
<span class="number"> 18</span>
<span class="number"> 19</span>        <span class="k1">if</span><span class="k2">(</span>app.redraw <span class="k3">&amp;</span><span class="k3">&amp;</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>app.eventQueue<span class="k2">)</span><span class="k2">)</span>
<span class="number"> 20</span>        <span class="k2">{</span>
<span class="number"> 21</span>            app.Draw<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 22</span>        <span class="k2">}</span>
<span class="number"> 23</span>    <span class="k2">}</span>
</div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (shadyvillian)</author>
		<pubDate>Thu, 12 Jun 2014 20:37:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s supposed to work continuously... but whoever implemented it in windows messed up. You could file a bug report.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Fri, 13 Jun 2014 00:36:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I mean the display does resize but I want the event to keep firing as I drag not just once the mouse button is let off. I&#39;ll probably end up poking in the source files tonight and see if I can figure it out I suppose(just for fun)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (shadyvillian)</author>
		<pubDate>Fri, 13 Jun 2014 02:55:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t think you really want that. Every single resize would cause DX and Allegro to have to reinitialize your entire context, including textures. I can&#39;t imagine that would perform well at all.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 13 Jun 2014 02:57:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Other applications seem to be able to handle window resizing with no problem (non-allegro apps). I just tried CodeBlocks in a window and it resizes smoothly as butter, with no black or uninitialized areas. So it is possible. I don&#39;t know what it would take to do so though.</p><p>Thomas, are you sure there&#39;s no way to resize a window without reinitializing the entire context?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 13 Jun 2014 03:00:52 +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/614370/1002018#target">Edgar Reynaldo</a> said:</div><div class="quote"><p>Other applications seem to be able to handle window resizing with no problem (non-allegro apps). I just tried CodeBlocks in a window and it resizes smoothly as butter, with no black or uninitialized areas. So it is possible. I don&#39;t know what it would take to do so though.</p></div></div><p>Windows GDI apps are not equivalent to 3d apps.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Thomas, are you sure there&#39;s no way to resize a window without reinitializing the entire context?</p></div></div><p>If they use a 3D surface, you tend to have to reinitialize everything. I could be wrong on that, but D3D at least seems like it&#39;d impose that limitation.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 13 Jun 2014 03:02:59 +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/614370/1002019#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p>
Windows GDI apps are not equivalent to 3d apps.
</p></div></div><p>
Okay, this is something I&#39;m not familiar with. Is it possible to make a GDI app with allegro? Would that require another driver for windows?</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
If they use a 3D surface, you tend to have to reinitialize everything. I could be wrong on that, but D3D at least seems like it&#39;d impose that limitation. 
</p></div></div><p>
What exactly is a 3D surface? Just a D3D context? Or is it substantially different from a GDI context (if there is such a thing)...?</p><p>You can tell I know very little about this sort of thing....
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 13 Jun 2014 03:12:27 +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/614370/1002020#target">Edgar Reynaldo</a> said:</div><div class="quote"><p> Is it possible to make a GDI app with allegro?</p></div></div><p>A4 can stretch a 2D image with ease.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Fri, 13 Jun 2014 03:14:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>A4 doesn&#39;t and probably never will have resizable windows, so that&#39;s kind of moot in this case...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 13 Jun 2014 03:18:35 +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/614370/1002020#target">Edgar Reynaldo</a> said:</div><div class="quote"><p>Okay, this is something I&#39;m not familiar with. Is it possible to make a GDI app with allegro? Would that require another driver for windows?</p></div></div><p>A4 has a GDI driver. It&#39;s pretty slow, but it works. A5 pretty much wants an accelerated driver, but it isn&#39;t <i>required</i>. Someone could implement a GDI driver, but I don&#39;t know why you&#39;d want such a thing.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>What exactly is a 3D surface? Just a D3D context?</p></div></div><p>
Yeah, for the most part. a 3D surface can also be a texture or FBO (Frame Buffer Object. in GL terms).</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Or is it substantially different from a GDI context (if there is such a thing)...?</p></div></div><p>Very different. A &quot;GDI Context&quot; i assume is just a regular windows window. I don&#39;t think classic GDI has a &quot;context&quot; as such, other than some hidden state associated with a given program.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614370/1002022#target">Edgar Reynaldo</a> said:</div><div class="quote"><p>A4 doesn&#39;t and probably never will have resizable windows, so that&#39;s kind of moot in this case...</p></div></div><p>There&#39;s a patch for it. That no-one bothered to apply.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 13 Jun 2014 03:43:12 +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/614370/1002029#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p>
There&#39;s a patch for it. That no-one bothered to apply. 
</p></div></div><p>
Lost in the mailing list somewhere? Or is it still floating around?</p><p>GDI on Windows with A4 never worked reliably for me.</p><div class="quote_container"><div class="title">Allegro 5.1.GIT said:</div><div class="quote"><p>
</p><div class="source-code"><div class="toolbar"><span class="name">wwindow.c</span><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number"> 871</span>      <span class="k1">case</span> WM_SIZE:
<span class="number"> 872</span>         <span class="k1">if</span> <span class="k2">(</span>wParam <span class="k3">=</span><span class="k3">=</span> SIZE_RESTORED <span class="k3">|</span><span class="k3">|</span> wParam <span class="k3">=</span><span class="k3">=</span> SIZE_MAXIMIZED <span class="k3">|</span><span class="k3">|</span> wParam <span class="k3">=</span><span class="k3">=</span> SIZE_MINIMIZED<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 873</span>            <span class="c">/*</span>
<span class="number"> 874</span><span class="c">             * Delay the resize event so we don't get bogged down with them</span>
<span class="number"> 875</span><span class="c">             */</span>
<span class="number"> 876</span>            <span class="k1">if</span> <span class="k2">(</span><span class="k3">!</span>resize_postponed<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 877</span>               resize_postponed <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span>
<span class="number"> 878</span>               _beginthread<span class="k2">(</span>postpone_thread_proc, <span class="n">0</span>, <span class="k2">(</span><span class="k1">void</span> <span class="k3">*</span><span class="k2">)</span>d<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 879</span>            <span class="k2">}</span>
<span class="number"> 880</span>         <span class="k2">}</span>
<span class="number"> 881</span>         <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 882</span>      <span class="k1">case</span> WM_ENTERSIZEMOVE:
<span class="number"> 883</span>         <span class="c">/* DefWindowProc for WM_ENTERSIZEMOVE enters a modal loop, which also</span>
<span class="number"> 884</span><span class="c">          * ends up blocking the loop in d3d_display_thread_proc (which is</span>
<span class="number"> 885</span><span class="c">          * where we are called from, if using D3D).  Rather than batching up</span>
<span class="number"> 886</span><span class="c">          * intermediate resize events which the user cannot acknowledge in the</span>
<span class="number"> 887</span><span class="c">          * meantime anyway, make it so only a single resize event is generated</span>
<span class="number"> 888</span><span class="c">          * at WM_EXITSIZEMOVE.</span>
<span class="number"> 889</span><span class="c">          */</span>
<span class="number"> 890</span>         <span class="k1">if</span> <span class="k2">(</span>d-&gt;flags <span class="k3">&amp;</span> ALLEGRO_DIRECT3D_INTERNAL<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 891</span>            resize_postponed <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span>
<span class="number"> 892</span>         <span class="k2">}</span>
<span class="number"> 893</span>         <span class="k1">break</span><span class="k2">;</span>
<span class="number"> 894</span>      <span class="k1">case</span> WM_EXITSIZEMOVE:
<span class="number"> 895</span>         <span class="k1">if</span> <span class="k2">(</span>resize_postponed<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 896</span>            win_generate_resize_event<span class="k2">(</span>win_display<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 897</span>            win_display-&gt;ignore_resize <span class="k3">=</span> <span class="k1">false</span><span class="k2">;</span>
<span class="number"> 898</span>            resize_postponed <span class="k3">=</span> <span class="k1">false</span><span class="k2">;</span>
<span class="number"> 899</span>            win_display-&gt;can_acknowledge <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span>
<span class="number"> 900</span>         <span class="k2">}</span>
<span class="number"> 901</span>         <span class="k1">break</span><span class="k2">;</span>
<span class="number"> 902</span>   <span class="k2">}</span>
<span class="number"> 903</span>
<span class="number"> 904</span>   <span class="k1">return</span> DefWindowProc<span class="k2">(</span>hWnd,message,wParam,lParam<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 905</span><span class="k2">}</span>
</div></div><p>
</p></div></div><p>
It looks like everything happens in WM_EXITSIZEMOVE. WM_SIZE messages are mostly ignored, and WM_ENTERSIZEMOVE can&#39;t respond if using d3d (according to the comments).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 13 Jun 2014 04:02:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>My point was that it&#39;s much easier to stretch a 2D image rather than resizing an entire 3D context.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Fri, 13 Jun 2014 04:05:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yeah, that&#39;s fine. I just want to know if we can get a smooth resize and use D3D at the same time....</p><p>EDIT<br />This looks promising :<br /><a href="http://blogs.msdn.com/b/oldnewthing/archive/2008/01/16/7123299.aspx">http://blogs.msdn.com/b/oldnewthing/archive/2008/01/16/7123299.aspx</a></p><p>Seems you can intercept the resize before it actually occurs, using WM_WINDOWPOSCHANGING or WM_SIZING.</p><p>Edit<br />This is the current state of affairs on D3D with Windows :<br /><span class="remote-thumbnail"><span class="json">{"name":"608726","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/f\/9fccccc67c7e58de521fd1dbb9563d89.png","w":877,"h":600,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/f\/9fccccc67c7e58de521fd1dbb9563d89"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/9/f/9fccccc67c7e58de521fd1dbb9563d89-240.jpg" alt="608726" width="240" height="164" /></span></p><p>The current screen is frozen in place, with black or white filling in the excess area of the window until it is resized. Not very pretty.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 13 Jun 2014 04:09:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yeah Edgar is on the same page as to what I mean, but as to a fix I know it can be done I guess implementing it in the correct way is the issue. My program is more of an app than a game(though I understand allegro is for games) I&#39;m sure it would benefit allegro to have it implemented even if its just an optional flag.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (shadyvillian)</author>
		<pubDate>Fri, 13 Jun 2014 06:08:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms648055%28v=vs.85%29.aspx">WM_ERASEBKGND</a> might be useful to at least clear the background to a single color when resizing. If you specify a default background brush when creating the window WM_ERASEBKGND should handle it for us.</p><p>What would be ideal is to detect WM_SIZING messages and then have the window background be repainted by the user or a default function if not specified.</p><p>I will have to hack on Allegro for a while and see what I can come up with.</p><p>EDIT</p><p>Here are some of the events that are being fired during a window resize :</p><p>It starts out with WM_PAINT when the window is opened.<br />Then WM_WINDOWPOSCHANGING and WM_ENTERSIZEMOVE and WM_SIZING when you grab the handle on the window to resize it. Then a bunch of groups of these :</p><p>WM_SIZING<br />WM_WINDOWPOSCHANGING<br />WM_ERASEBKGND<br />WM_WINDOWPOSCHANGED<br />WM_SIZE<br />WM_PAINT</p><p>and then closes with a group of </p><p>WM_SIZING<br />WM_WINDOWPOSCHANGING<br />WM_WINDOWPOSCHANGING<br />WM_EXITSIZEMOVE<br />WM_WINDOWPOSCHANGING<br />WM_WINDOWPOSCHANGED</p><p>when you let go of the window handle.</p><p>So something we could do is provide a default background brush when creating the window handle. Also, we should be able to set a default clear color for the window when resized.</p><p>EDIT 2 :<br />Changing it to <span class="source-code">window_class.hbrBackground <span class="k3">=</span> <span class="k2">(</span>HBRUSH<span class="k2">)</span><span class="k2">(</span>COLOR_BACKGROUND <span class="k3">+</span> <span class="n">1</span><span class="k2">)</span><span class="k2">;</span></span> clears the screen to black during each resize, blanking out what was showing. That&#39;s not quite what we want, but it is a start.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 13 Jun 2014 06:31:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think we should just continuously fire events. The resizing only happens after the user acknowledges it anyway. Maybe we could also have a different event used during the resize, so the current behavior stays for those who prefer it (I don&#39;t see why anyone would though). The Windows behavior is also not what we do on other platforms as far as I know.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Fri, 13 Jun 2014 12:54:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Here&#39;s what I&#39;m getting on Linux.  Is this what it looks like in motion on Windows?</p><p><span class="remote-thumbnail"><span class="json">{"name":"608730","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/7\/37b1646e7cad640d428a07942ac9fcdf.gif","w":687,"h":333,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/7\/37b1646e7cad640d428a07942ac9fcdf"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/3/7/37b1646e7cad640d428a07942ac9fcdf-240.jpg" alt="608730" width="240" height="116" /></span></p><p>Everything goes immediately back to normal after releasing the, err... mouse.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Gideon Weems)</author>
		<pubDate>Fri, 13 Jun 2014 21:29:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Is your WM set to show contents while resizing? If not, we&#39;ll never get a resize event until the resize is done.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 13 Jun 2014 22:10:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>@Gideon - yeah that is what it looks like on Windows.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 13 Jun 2014 23:51:38 +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/614370/1002078#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p>Is your WM set to show contents while resizing?</p></div></div><p>
Hehe, I&#39;m not <i>that</i> archaic.</p><p>As far as I can tell, this sort of resize behavior only occurs with Allegro programs--though to be honest, I never considered it much of a problem.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Gideon Weems)</author>
		<pubDate>Sat, 14 Jun 2014 05:29:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>When resizing a window you can (and will) get hundreds of resize events if you don&#39;t batch them. I don&#39;t think you want to be trying to resize the GL/D3D backbuffer for every one. But if we can tell the context to maybe stretch the backbuffer when resizing, or at least clear the empty area, that would look better.</p><p>We had stretching at one point I think but people complained <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sat, 14 Jun 2014 10:39:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The problem with using a HBRUSH for the hbrBackground is that during WM_ERASEBKGND it covers the entire surface of the window with whatever brush you use. I tried (NULL_BRUSH) and (COLOR_BACKGROUND + 1), which resulted in white and black using D3D. With OpenGL the window resizes the backbuffer each time its size is changed, almost immediately, with only a brief flash of black or white along the border. If we handle WM_WINDOWPOSCHANGED and send an event then we could repaint the border or provide a way for the user to do so. The user probably knows what he wants to draw with a larger window there. So why not let him acknowledge the resize right away if they want to?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 14 Jun 2014 16:42:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m with Edgar. Let the user decide. If they want to redraw 100s of times, let them (I for one want to). If they only want to redraw once, that&#39;s also fine. But Allegro shouldn&#39;t force to draw only once by hiding the other events.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Sat, 14 Jun 2014 17:51:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>As a user, I&#39;m with Edgar as well.  Processing a batch of resize events every tick of the main loop would be easy.  Am I correct in thinking it would look like the following?</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><span class="c">/* Event handler. */</span>
<span class="number">  2</span><span class="k1">switch</span> <span class="k2">(</span>event.type<span class="k2">)</span> <span class="k2">{</span>
<span class="number">  3</span>    <span class="k1">case</span> ALLEGRO_EVENT_TIMER:
<span class="number">  4</span>        bUpdate <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span>
<span class="number">  5</span>        <span class="k1">break</span><span class="k2">;</span>
<span class="number">  6</span>    <span class="k1">case</span> ALLEGRO_EVENT_DISPLAY_RESIZE:
<span class="number">  7</span>        bHandleResize <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span>
<span class="number">  8</span>        <span class="k1">break</span><span class="k2">;</span>
<span class="number">  9</span><span class="k2">}</span>
<span class="number"> 10</span>
<span class="number"> 11</span><span class="c">/* Logic updater. */</span>
<span class="number"> 12</span><span class="k1">if</span> <span class="k2">(</span>bUpdate<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 13</span>    bUpdate <span class="k3">=</span> <span class="k1">false</span><span class="k2">;</span>
<span class="number"> 14</span>    <span class="k1">if</span> <span class="k2">(</span>bHandleResize <span class="k3">=</span><span class="k3">=</span> <span class="k1">true</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 15</span>        bHandleResize <span class="k3">=</span> <span class="k1">false</span><span class="k2">;</span>
<span class="number"> 16</span>        bDraw <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span>
<span class="number"> 17</span>    <span class="k2">}</span>
<span class="number"> 18</span><span class="k2">}</span>
<span class="number"> 19</span>
<span class="number"> 20</span><span class="k1">if</span> <span class="k2">(</span>bDraw<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 21</span>    bDraw <span class="k3">=</span> <span class="k1">false</span><span class="k2">;</span>
<span class="number"> 22</span>    <span class="c">// Draw.</span>
<span class="number"> 23</span><span class="k2">}</span>
</div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Gideon Weems)</author>
		<pubDate>Sat, 14 Jun 2014 23:09:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>For backwards compatibility I&#39;d keep the ALLEGRO_EVENT_DISPLAY_RESIZE as it is, and add a ALLEGRO_EVENT_DISPLAY_RESIZING event that is sent while the resize is going on. Like that, people can choose whether to continuously resize or only once.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (beoran)</author>
		<pubDate>Sun, 15 Jun 2014 00:10:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think the best message to handle would be WM_WINDOWPOSCHANGED. It is sent when a window is shown, hidden, moved, or resized, and contains info about the WINDOWPOS in the lParam.</p><p>WINDOWPOSCHANGED<br /><a href="http://blogs.msdn.com/b/oldnewthing/archive/2008/01/15/7113860.aspx">http://blogs.msdn.com/b/oldnewthing/archive/2008/01/15/7113860.aspx</a></p><p>WINDOWPOS<br /><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms632612%28v=vs.85%29.aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/ms632612%28v=vs.85%29.aspx</a></p><p>EDIT<br />Trying to understand the comments on this code :
</p><div class="source-code snippet"><div class="inner"><pre>      <span class="k1">case</span> WM_ENTERSIZEMOVE:
         <span class="c">/* DefWindowProc for WM_ENTERSIZEMOVE enters a modal loop, which also</span>
<span class="c">          * ends up blocking the loop in d3d_display_thread_proc (which is</span>
<span class="c">          * where we are called from, if using D3D).  Rather than batching up</span>
<span class="c">          * intermediate resize events which the user cannot acknowledge in the</span>
<span class="c">          * meantime anyway, make it so only a single resize event is generated</span>
<span class="c">          * at WM_EXITSIZEMOVE.</span>
<span class="c">          */</span>
         <span class="k1">if</span> <span class="k2">(</span>d-&gt;flags <span class="k3">&amp;</span> ALLEGRO_DIRECT3D_INTERNAL<span class="k2">)</span> <span class="k2">{</span>
            resize_postponed <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span>
         <span class="k2">}</span>
         <span class="k1">break</span><span class="k2">;</span>
</pre></div></div><p>

I was thinking of doing away with WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE and replacing them with WM_WINDOWPOSCHANGING, but then that would change the current behaviour.</p><p>What I am really worried about is this modal loop that the comment above is talking about.</p><p>I tried only generating an event on WM_WINDOWPOSCHANGING but in D3D for some reason all the ALLEGRO_EVENT_DISPLAY_RESIZE events get backed up until you stop resizing the window. That may be the modal loop effect from above.</p><p>Not sure where to go from here...</p><p>Edit2<br />Somehow my changes corrupted all the title bars on all my windows. <img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" /> Yeah, Aero is corrupted somehow. I&#39;m gonna reboot and hope it gets fixed.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 16 Jun 2014 11:01:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yeah, I&#39;m betting ENTERSIZEMOVE&#39;s default (windows provided) handler just enter&#39;s a loop to handle the resizing. Not sure, but we could not call the defwndproc on ENTERSIZEMOVE/EXITSIZEMOVE. That might break something though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Mon, 16 Jun 2014 20:11:44 +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/614370/1002200#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p>
Not sure, but we could not call the defwndproc on ENTERSIZEMOVE/EXITSIZEMOVE. That might break something though.
</p></div></div><p>
I think that is why the title bars of all my windows got corrupted. I think we have to call DefWndProc, but then it starts that modal loop mentioned above in WM_ENTERSIZEMOVE. Not sure how / if the loop can be broken. I think that is why all of my EVENT_RESIZE&#39;s get piled up when using WM_WINDOWPOSCHANGING.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 23 Jun 2014 02:35:26 +0000</pubDate>
	</item>
</rss>
