<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Patch to add window constraint functions</title>
		<link>http://www.allegro.cc/forums/view/608744</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 20 Nov 2011 19:04:53 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I have made a patch for the latest 5.1 svn that adds:</p><p>void al_set_window_constraints(ALLEGRO_DISPLAY *display, int min_w, int min_h, int max_w, int max_h)</p><p>and</p><p>void al_get_window_constraints(ALLEGRO_DISPLAY *display, int *min_w, int *min_h, int *max_w, int *max_h )</p><p>to Windows, OSX, and X.</p><p>It seems to be working fine on Windows. I have not tested it on OSX or Linux / X.</p><p>Hopefully this can make it to the SVN <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>I was unable to attach it through a.cc so I have uploaded it here:<br /><a href="http://www.mediafire.com/?46w947jk3rcjic7">http://www.mediafire.com/?46w947jk3rcjic7</a></p><p>Edit:<br />Fixed version that fixes OSX support:<br /><a href="http://www.mediafire.com/?7m0l5v3pd550kqt">http://www.mediafire.com/?7m0l5v3pd550kqt</a></p><p>Edit2:<br />Revision 3 fixes OSX support again.<br /><a href="http://www.mediafire.com/?h4n2m5homhhbv9l">http://www.mediafire.com/?h4n2m5homhhbv9l</a></p><p>Edit3<br />Revision 4 fixes Linux support<br /><a href="http://www.mediafire.com/?299l97yrrooazgo">http://www.mediafire.com/?299l97yrrooazgo</a></p><p>Edit4<br />Revision 5 makes them boolean functions, formatted the code<br /><a href="http://www.mediafire.com/?wx8kz3zor3f9ekv">http://www.mediafire.com/?wx8kz3zor3f9ekv</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Sat, 05 Nov 2011 10:09:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>pastebin.com would be a good place to upload something like this.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Sat, 05 Nov 2011 10:18:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Do you have an example I can use to test it on OSX?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sat, 05 Nov 2011 17:46:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I tested it on Windows by modifying ex_resize:</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="p">#include "allegro5/allegro.h"</span>
<span class="number">  2</span><span class="p">#include &lt;allegro5/allegro_primitives.h&gt;</span>
<span class="number">  3</span>
<span class="number">  4</span><span class="p">#include "common.c"</span>
<span class="number">  5</span>
<span class="number">  6</span><span class="k1">static</span> <span class="k1">void</span> redraw<span class="k2">(</span><span class="k1">void</span><span class="k2">)</span>
<span class="number">  7</span><span class="k2">{</span>
<span class="number">  8</span>  <a href="http://www.allegro.cc/manual/ALLEGRO_COLOR"><span class="a">ALLEGRO_COLOR</span></a> black, white<span class="k2">;</span>
<span class="number">  9</span>  <span class="k1">int</span> w, h<span class="k2">;</span>
<span class="number"> 10</span>
<span class="number"> 11</span>  white <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_map_rgba_f"><span class="a">al_map_rgba_f</span></a><span class="k2">(</span><span class="n">1</span>, <span class="n">1</span>, <span class="n">1</span>, <span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 12</span>  black <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_map_rgba_f"><span class="a">al_map_rgba_f</span></a><span class="k2">(</span><span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 13</span>
<span class="number"> 14</span>  <a href="http://www.allegro.cc/manual/al_clear_to_color"><span class="a">al_clear_to_color</span></a><span class="k2">(</span>white<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 15</span>  w <span class="k3">=</span> <span class="n">100</span><span class="k2">;</span>
<span class="number"> 16</span>  h <span class="k3">=</span> <span class="n">100</span><span class="k2">;</span>
<span class="number"> 17</span>  <a href="http://www.allegro.cc/manual/al_draw_line"><span class="a">al_draw_line</span></a><span class="k2">(</span><span class="n">0</span>, h, w <span class="k3">/</span> <span class="n">2</span>, <span class="n">0</span>, black, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 18</span>  <a href="http://www.allegro.cc/manual/al_draw_line"><span class="a">al_draw_line</span></a><span class="k2">(</span>w <span class="k3">/</span> <span class="n">2</span>, <span class="n">0</span>, w, h, black, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 19</span>  <a href="http://www.allegro.cc/manual/al_draw_line"><span class="a">al_draw_line</span></a><span class="k2">(</span>w <span class="k3">/</span> <span class="n">4</span>, h <span class="k3">/</span> <span class="n">2</span>, <span class="n">3</span> <span class="k3">*</span> w <span class="k3">/</span> <span class="n">4</span>, h <span class="k3">/</span> <span class="n">2</span>, black, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 20</span>  <a href="http://www.allegro.cc/manual/al_flip_display"><span class="a">al_flip_display</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 21</span><span class="k2">}</span>
<span class="number"> 22</span>
<span class="number"> 23</span><span class="k1">int</span> main<span class="k2">(</span><span class="k1">void</span><span class="k2">)</span>
<span class="number"> 24</span><span class="k2">{</span>
<span class="number"> 25</span>  <a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a> <span class="k3">*</span>display<span class="k2">;</span>
<span class="number"> 26</span>  <a href="http://www.allegro.cc/manual/ALLEGRO_TIMER"><span class="a">ALLEGRO_TIMER</span></a> <span class="k3">*</span>timer<span class="k2">;</span>
<span class="number"> 27</span>  <a href="http://www.allegro.cc/manual/ALLEGRO_EVENT_QUEUE"><span class="a">ALLEGRO_EVENT_QUEUE</span></a> <span class="k3">*</span>events<span class="k2">;</span>
<span class="number"> 28</span>  <a href="http://www.allegro.cc/manual/ALLEGRO_EVENT"><span class="a">ALLEGRO_EVENT</span></a> event<span class="k2">;</span>
<span class="number"> 29</span>  <span class="k1">int</span> rs <span class="k3">=</span> <span class="n">100</span><span class="k2">;</span>
<span class="number"> 30</span>  <span class="k1">bool</span> resize <span class="k3">=</span> <span class="k1">false</span><span class="k2">;</span>
<span class="number"> 31</span>
<span class="number"> 32</span>  <span class="c">/* Initialize Allegro and create an event queue. */</span>
<span class="number"> 33</span>  <span class="k1">if</span> <span class="k2">(</span><span class="k3">!</span><a href="http://www.allegro.cc/manual/al_init"><span class="a">al_init</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 34</span>    abort_example<span class="k2">(</span><span class="s">"Could not init Allegro.\n"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 35</span>    <span class="k1">return</span> <span class="n">1</span><span class="k2">;</span>
<span class="number"> 36</span>  <span class="k2">}</span>
<span class="number"> 37</span>  <a href="http://www.allegro.cc/manual/al_init_primitives_addon"><span class="a">al_init_primitives_addon</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 38</span>  events <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_create_event_queue"><span class="a">al_create_event_queue</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 39</span>
<span class="number"> 40</span>  <span class="c">/* Setup a display driver and register events from it. */</span>
<span class="number"> 41</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_RESIZABLE<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 42</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">640</span>, <span class="n">480</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 43</span>  <span class="k1">if</span> <span class="k2">(</span><span class="k3">!</span>display<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 44</span>    abort_example<span class="k2">(</span><span class="s">"Could not create display.\n"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 45</span>    <span class="k1">return</span> <span class="n">1</span><span class="k2">;</span>
<span class="number"> 46</span>  <span class="k2">}</span>
<span class="number"> 47</span>  al_set_window_constraints<span class="k2">(</span>display,<span class="n">640</span>,<span class="n">0</span>,<span class="n">0</span>,<span class="n">600</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 48</span>  <a href="http://www.allegro.cc/manual/al_register_event_source"><span class="a">al_register_event_source</span></a><span class="k2">(</span>events, <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>
<span class="number"> 49</span>
<span class="number"> 50</span>  timer <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_create_timer"><span class="a">al_create_timer</span></a><span class="k2">(</span><span class="n">0</span>.<span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 51</span>  <a href="http://www.allegro.cc/manual/al_start_timer"><span class="a">al_start_timer</span></a><span class="k2">(</span>timer<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 52</span>
<span class="number"> 53</span>  <span class="c">/* Setup a keyboard driver and register events from it. */</span>
<span class="number"> 54</span>  <a href="http://www.allegro.cc/manual/al_install_keyboard"><span class="a">al_install_keyboard</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 55</span>  <a href="http://www.allegro.cc/manual/al_register_event_source"><span class="a">al_register_event_source</span></a><span class="k2">(</span>events, <a href="http://www.allegro.cc/manual/al_get_keyboard_event_source"><span class="a">al_get_keyboard_event_source</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 56</span>  <a href="http://www.allegro.cc/manual/al_register_event_source"><span class="a">al_register_event_source</span></a><span class="k2">(</span>events, <a href="http://www.allegro.cc/manual/al_get_timer_event_source"><span class="a">al_get_timer_event_source</span></a><span class="k2">(</span>timer<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 57</span>
<span class="number"> 58</span>  <span class="c">/* Display a pulsating window until a key or the closebutton is pressed. */</span>
<span class="number"> 59</span>  redraw<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 60</span>  <span class="k1">while</span> <span class="k2">(</span><span class="k1">true</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 61</span>    <span class="k1">if</span> <span class="k2">(</span><span class="k1">true</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 62</span>      <span class="k1">int</span> s<span class="k2">;</span>
<span class="number"> 63</span>      rs <span class="k3">+</span><span class="k3">=</span> <span class="n">10</span><span class="k2">;</span>
<span class="number"> 64</span>      <span class="k1">if</span> <span class="k2">(</span>rs <span class="k3">=</span><span class="k3">=</span> <span class="n">300</span><span class="k2">)</span>
<span class="number"> 65</span>        rs <span class="k3">=</span> <span class="n">100</span><span class="k2">;</span>
<span class="number"> 66</span>      s <span class="k3">=</span> rs<span class="k2">;</span>
<span class="number"> 67</span>      <span class="k1">if</span> <span class="k2">(</span>s <span class="k3">&gt;</span> <span class="n">200</span><span class="k2">)</span>
<span class="number"> 68</span>        s <span class="k3">=</span> <span class="n">400</span> <span class="k3">-</span> s<span class="k2">;</span>
<span class="number"> 69</span>      <span class="c">//al_resize_display(display, s, s);</span>
<span class="number"> 70</span>      redraw<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 71</span>      resize <span class="k3">=</span> <span class="k1">false</span><span class="k2">;</span>
<span class="number"> 72</span>    <span class="k2">}</span>
<span class="number"> 73</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>events, <span class="k3">&amp;</span>event<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 74</span>    <span class="k1">if</span> <span class="k2">(</span>event.type <span class="k3">=</span><span class="k3">=</span> ALLEGRO_EVENT_TIMER<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 75</span>      resize <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span>
<span class="number"> 76</span>    <span class="k2">}</span>
<span class="number"> 77</span>    <span class="k1">else</span> <span class="k1">if</span> <span class="k2">(</span>event.type <span class="k3">=</span><span class="k3">=</span> ALLEGRO_EVENT_DISPLAY_CLOSE<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 78</span>      <span class="k1">break</span><span class="k2">;</span>
<span class="number"> 79</span>    <span class="k2">}</span>
<span class="number"> 80</span>    <span class="k1">else</span> <span class="k1">if</span> <span class="k2">(</span>event.type <span class="k3">=</span><span class="k3">=</span> ALLEGRO_EVENT_KEY_DOWN<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 81</span>      <span class="k1">break</span><span class="k2">;</span>
<span class="number"> 82</span>    <span class="k2">}</span>
<span class="number"> 83</span>    <span class="k1">else</span> <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="number"> 84</span>      <a href="http://www.allegro.cc/manual/al_acknowledge_resize"><span class="a">al_acknowledge_resize</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 85</span>      
<span class="number"> 86</span>    <span class="k2">}</span>
<span class="number"> 87</span>  <span class="k2">}</span>
<span class="number"> 88</span>
<span class="number"> 89</span>  <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 90</span><span class="k2">}</span>
<span class="number"> 91</span>
<span class="number"> 92</span><span class="c">/* vim: set sts=4 sw=4 et: */</span>
</div></div><p>

That way it is minimum restricted on the x axis and maximum restricted on the y, zero means no restriction.</p><p>Now that I think about it, it may be nessesary to call al_resize_display(display, display-&gt;w, display-&gt;h) after to sync up the backbuffer.</p><p>If you need to make changes to the patch to get OSX to work just let me know ad Ill edit the first post.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Sat, 05 Nov 2011 18:11:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The patch has no effect on OSX. One thing that should be done here if you&#39;re going to fix this is to make these display options set with al_set_new_display_option. I don&#39;t think we need another function, that&#39;s what display options are for... someone correct me if I&#39;m wrong.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sat, 05 Nov 2011 19:49:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I just went with what Matthew had suggested. It is possible that for certain scenarios that the user may want to change this after the display is created.</p><p>I&#39;ll boot into OSX and try some things to see if I can get it working.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Sat, 05 Nov 2011 19:55:30 +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/608744/936352#target">jmasterx</a> said:</div><div class="quote"><p>
I just went with what Matthew had suggested. It is possible that for certain scenarios that the user may want to change this after the display is created.
</p></div></div><p>

Yeah, that is true.. so it&#39;s probably best as you have it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sat, 05 Nov 2011 20:09:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>FIXED IT <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" />. I forgot to actually assign the min and max values to the display -_-&#39;.<br />I&#39;ll boot back to Windows and give you the new patch.</p><p>Edit:<br />Here&#39;s the new revised version, confirmed working on OSX. <br /><a href="http://www.mediafire.com/?7m0l5v3pd550kqt">http://www.mediafire.com/?7m0l5v3pd550kqt</a></p><p>Unfortunately, I do not have Linux native installed. I only have it in a VM and I cannot seem to get an Allegro window created in the VM so I cannot test it for Linux. If someone could try it and report back It&#39;d be appreciated.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Sat, 05 Nov 2011 20:15:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I was checking to make sure the actual size of the window was exactly 640x600 and I got this image (attached). If you look at it closely you can see there are 3 pixels in each bottom corner that are transparent. Any idea why that would be?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sat, 05 Nov 2011 20:45:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I really do not know why that would happen. What did you use to capture the image? I&#39;ll try to reproduce it here.</p><p>In the mean time, it seems that the OSX window does not sem to apply the constraints when al_resize_display is called, so I will try to address this.</p><p>Edit:<br />Here is revision 3. <br />OSX seems to be working as good as Windows now. <br /><a href="http://www.mediafire.com/?h4n2m5homhhbv9l">http://www.mediafire.com/?h4n2m5homhhbv9l</a></p><p>I do not know if this fixes your 3 pixel issue but it might since I fixed al_resize_display to work with constraints on osx.</p><p>I guess I&#39;ll install Linux native on my PC and get the Linux version working properly so it can be committed today and I can forget about it and check it off my todo list.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Sat, 05 Nov 2011 21:00: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/608744/936350#target">Trent Gamblin</a> said:</div><div class="quote"><p> I don&#39;t think we need another function, that&#39;s what display options are for... someone correct me if I&#39;m wrong.
</p></div></div><p>There&#39;s always a bit of a struggle between those who favor of monolithic options and those who favor explicit functions. I generally prefer explicit functions, so of course I suggested an explicit function.</p><p>I think display options should be limited to those things that affect the creation of the display (or are very unlikely to ever be needed.) That is, here are a list of properties that I require or want, and let me know if you can create the display. It shouldn&#39;t be about minimizing the number of functions for the sake of minimizing functions.</p><p>Constraints, IMO, do not fall under either of those restrictions and therefore do deserve a dedicated function.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/608744/936366#target">jmasterx</a> said:</div><div class="quote"><p> In the mean time, it seems that the OSX window does not sem to apply the constraints when al_resize_display is called, so I will try to address this.
</p></div></div><p>So is <span class="source-code"><a href="http://www.allegro.cc/manual/al_resize_display"><span class="a">al_resize_display</span></a><span class="k2">(</span><span class="k2">)</span></span> meant to be constrained? I don&#39;t know that it really needs to be, if it&#39;s not something that&#39;s easily supported. The main benefit of constraints is for abstract resizing from the user.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Sun, 06 Nov 2011 00:05:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It was easier to support constraining for al_resize_display.</p><p>I just got done proper Linux support. With this new revision, all 3 platforms seem to show consistent results which means it should be pretty much ready for the svn, I&#39;ve tested on all 3 platforms.</p><p>Here it is:<br /><a href="http://www.mediafire.com/?299l97yrrooazgo">http://www.mediafire.com/?299l97yrrooazgo</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Sun, 06 Nov 2011 01:33:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>al_set_window_constraints and al_get_window_constraints should return a boolean indicating success.</p><p>Add documentation and fix the coding style please. It&#39;s not that hard.</p><p>I still would like a constrain-aspect-ratio display flag. This might be a good time to add it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Sun, 06 Nov 2011 04:54:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>How is failure determined? I did not think it was possible for it to fail?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Sun, 06 Nov 2011 05:01:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It might return false on full screen or on certain mobile devices, or if you send invalid parameters like -42 or a positive value that&#39;s too small.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Sun, 06 Nov 2011 05:04:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Then why doesn&#39;t al_set_window_position return success? You cannot move a window in fullscreen nor can you move it to a ridiculous place like -2000,-2000.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Sun, 06 Nov 2011 05:09:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It should, too. Not everything was scrutinised as it might have been when 5.0 was developed.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Sun, 06 Nov 2011 05:17:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So then I should return false on unsupported platforms, if any of the values are &lt; 0 and return false if the fullscreen flag is set? Are there any other ways it can fail?</p><p>For the documentation I&#39;ll add more comments.</p><p>I&#39;m not sure how to address coding style. What needs to change? Would you rather:
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">if</span><span class="k2">(</span>something<span class="k2">)</span>
<span class="k2">{</span>
   x <span class="k3">=</span> something<span class="k2">;</span>
<span class="k2">}</span>
<span class="k1">else</span>
<span class="k2">{</span>
  x <span class="k3">=</span> something_else<span class="k2">;</span>
<span class="k2">}</span>

over

<span class="k1">if</span><span class="k2">(</span>something<span class="k2">)</span>
x <span class="k3">=</span> something<span class="k2">;</span>
<span class="k1">else</span> x <span class="k3">=</span> something_else<span class="k2">;</span>
</pre></div></div><p>

Do you think this functionality will make it into 5.05? I and I&#39;m sure others would find it useful to add to their current projects.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Sun, 06 Nov 2011 05:24:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Max might be smaller than min? Maybe some platforms have other restrictions, e.g. must be multiple of four.</p><p>Documentation means adding text to docs/src/refman/display.txt</p><p>For code style, just look at the code around you: K&amp;R with 3 space indents (no hard tabs in new code), and no cuddled else. Space after if, while, for, etc. keywords. I prefer lines wrapped at 80 chars; this is mandatory for code which is copied into documentation (e.g. prototypes after Function: headers). Capitalise and punctuate comments.</p><p>For your example:</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">if</span> <span class="k2">(</span>something<span class="k2">)</span> <span class="k2">{</span>
   x <span class="k3">=</span> something<span class="k2">;</span>
<span class="k2">}</span>
<span class="k1">else</span> <span class="k2">{</span>
   x <span class="k3">=</span> something_else<span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Sun, 06 Nov 2011 05:51:28 +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/608744/936408#target">jmasterx</a> said:</div><div class="quote"><p>
For the documentation I&#39;ll add more comments.
</p></div></div><p>
Comments are not documentation. You need to document the functions in docs/src/refman/display.txt</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I&#39;m not sure how to address coding style.
</p></div></div><p>
I&#39;ve noted three things. You used tabs instead of spaces (Allegro source uses 3 spaces per indentation level). You&#39;ve used C++ comments in C files (<span class="source-code"><span class="c">//</span></span> instead of <span class="source-code"><span class="c">/* */</span></span>) Also, use attached braces, like so:</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">if</span> <span class="k2">(</span>blah<span class="k2">)</span> <span class="k2">{</span>

<span class="k2">}</span>
</pre></div></div><p>

instead of </p><div class="source-code snippet"><div class="inner"><pre><span class="k1">if</span> <span class="k2">(</span>blah<span class="k2">)</span>
<span class="k2">{</span>

<span class="k2">}</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Sun, 06 Nov 2011 05:53:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Alright, I&#39;ll see if I can address those issues. I&#39;ve gotten too used to auto formatting by the IDE.</p><p>I&#39;ve never coded in pure C, so this is a new experience for me.</p><p>Edit:<br />I have made them boolean functions.<br />I have cleaned up and standardized the code as well as I could.<br />I have documented the functions.</p><p>It should be good for the svn now.</p><p>Here is the link:<br /><a href="http://www.mediafire.com/?wx8kz3zor3f9ekv">http://www.mediafire.com/?wx8kz3zor3f9ekv</a></p><p>Edit2:<br />Is there any particular reason this has not made it into the svn yet? If there&#39;s anything still wrong with it, or any additional tests I need to run I&#39;ll gladly do it. Someone just needs to let me know.</p><p>Thanks
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Mon, 07 Nov 2011 18:47:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, the patch still has hard tabs in quite a few places. Surely your IDE has an option to show whitespace? The actual reason is probably the people are a bit busy <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Mon, 07 Nov 2011 20:54:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>We need a new example for this. You can start with ex_resize2. Hook it up in cmake. Still need to know why those pixels are missing too. But yeah, it&#39;s just people being busy.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Mon, 07 Nov 2011 21:25:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Alright, tonight or tomorrow I&#39;ll try to address those issues.<br />I&#39;ll make an example ex_window_constraints<br />and I will also try my best to remove those darn tabs, but it is tricky since Visual Studio and Visual Assist like to add tabs.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Mon, 07 Nov 2011 22:01:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>MSVC has an untabify command on the Edit-&gt;Advanced menu.  And you can press Ctrl-Shift-8 to show whitespace.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Tue, 08 Nov 2011 06:37:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Here is (what I hope is) the final version of the patch.</p><p>This one includes an example, and no more tabs. The example has been tested on all 3 platforms and performs consistently across all 3.</p><p>The example lets you press keys to toggle constraints so that is tested too.<br />It also displays the resolution and the result of al_get_constraints for easy debugging.</p><p>Here it is:<br /><a href="http://www.mediafire.com/?l7h595pp6cbtz67">http://www.mediafire.com/?l7h595pp6cbtz67</a><br /><span class="remote-thumbnail"><span class="json">{"name":"605085","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/9\/f99ee73ef41ecf75d04af0b10aa5d1eb.png","w":800,"h":600,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/9\/f99ee73ef41ecf75d04af0b10aa5d1eb"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/f/9/f99ee73ef41ecf75d04af0b10aa5d1eb-240.jpg" alt="605085" width="240" height="180" /></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Wed, 09 Nov 2011 03:46:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Where did the 9000 come from?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Wed, 09 Nov 2011 05:56:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I needed some kind of value, I do not know how to get the maximum window size but I figure a window won&#39;t be bigger than 9000. Is there a better way?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Wed, 09 Nov 2011 06:00:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t know off the top of my head.</p><p>Also, the constraints don&#39;t apply to maximisation, at least on X. Should they? The docs don&#39;t say. I don&#39;t know if it&#39;s even possible, short of disabling the maximise button.</p><p>Anyway, the patch is in my local workspace with additional formatting fixes.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Wed, 09 Nov 2011 06:09:02 +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/608744/936897#target">Peter Wang</a> said:</div><div class="quote"><p> Also, the constraints don&#39;t apply to maximisation, at least on X. Should they? 
</p></div></div><p>On Windows and Linux, I would say no. They have a proper maximized state. (Windows does, at least. I guess it may vary on the window manager for Linux.) If the maximize button isn&#39;t wanted, then it should be disabled. I don&#39;t think Allegro should override it to provide non-standard functionality.</p><p>But OS X has that silly zoom button, so I think the constraint should apply there.</p><p>REVISION:</p><p>It appears that the maximize button was thrown into ALLEGRO_RESIZABLE, even though they are two distinct concepts. There should be two flags that control them separately.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Wed, 09 Nov 2011 06:13:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>On Windows and OSX, pressing the zoom, maximize etc maintains the constraints, and on Mint Linux for me maximizing respects the constraints, but remember, these are hints so the underlying window manager might not listen.</p><p>Here is what it looks like for me. Left is &quot;maximized&quot; right is not.</p><p><span class="remote-thumbnail"><span class="json">{"name":"605089","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/9\/393320cafed0b24dd8925835aea2b4ff.png","w":1680,"h":1050,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/9\/393320cafed0b24dd8925835aea2b4ff"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/3/9/393320cafed0b24dd8925835aea2b4ff-240.jpg" alt="605089" width="240" height="150" /></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Wed, 09 Nov 2011 06:28:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve committed it now with some minor changes.</p><p>I saw on the Apple documentation that the window environment restricts windows to 10000 pixels so I replaced the 9000 with that. It also says the default is FLT_MAX so probably that&#39;s what we should be using in the no-constraint case. Can you check that and send a patch?</p><p>For X, I made it not set any size hints if all constraints are disabled. Again, removed the arbitrary limit of 9000.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Sat, 12 Nov 2011 09:35:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Here is the patch.</p><p>I removed your comments about FLT_MAX and replaced 10000 with FLT_MAX. It compiled and works as well as before.</p><p><a href="http://www.allegro.cc/files/attachment/605098">http://www.allegro.cc/files/attachment/605098</a></p><p>I was also wondering if this function will be able to go in the 5.0 branch (5.0.6) or if it breaks binary compatibility and thus must go into 5.1?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Sat, 12 Nov 2011 18:41:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It could. I&#39;ve been considering a 5.0.6 release to backport some minor feature additions. It would be the first time we&#39;ve done that, so I&#39;d want to be doubly sure we don&#39;t break backwards compatibility.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Sun, 13 Nov 2011 06:23:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think as long as you do not change 5.0 function signatures I do not see how it could break backwards compatibility. I think dynamic libraries are intended with the idea of adding more functionality / functions without breaking the old.</p><p>Since things like ALLEGRO_DSPLAY are opaque data types to the user, the additions of data into ALLEGRO_DISPLAY should not be a problem.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Sun, 13 Nov 2011 06:35:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Of course, but <span class="cuss"><span><span class="cuss"><span>shit</span></span></span></span> happens.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Sun, 13 Nov 2011 07:30:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You could get it tested by the community before officially releasing it. I&#39;d be glad to test it out with some of my projects and see if it is still binary compatible.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Sun, 13 Nov 2011 07:40:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>ex_window_constraints shows only the red background if I use video bitmaps and the Direct3D driver.  Can you confirm this and investigate?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Sun, 20 Nov 2011 10:48:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It seems this might be an Allegro bug. If I call al_resize_display before al_flip_display and after al_set_new_bitmap_flags(ALLEGRO_VIDEO_BITMAP) a call to al_resize_display seems to cause the backbuffer to stop working.</p><p>To &#39;fix&#39; the example I simply moved the call to al_set_window_constraints to before setting the bitmap flag.</p><p>This bug shouldn&#39;t really affect developers since calls to al_resize_display and al_set_window_constraints are usually done before setting bitmap flags and after flipping the display but someone might eventually want to look into this.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Sun, 20 Nov 2011 19:04:53 +0000</pubDate>
	</item>
</rss>
