<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Unable to create Window</title>
		<link>http://www.allegro.cc/forums/view/585090</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 22 May 2006 20:55:45 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I want to create a window of 850x650px.  Every time I go to set the graphics mode, I see the window pop up, but it&#39;s filled with pink (and would segfault upon drawing if I didn&#39;t add an if in there).  850*650 isn&#39;t all that big, what&#39;s going on?  Can only certain sizes be used?
</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="k1">int</span> main<span class="k2">(</span><span class="k1">int</span> argc, <span class="k1">char</span> <span class="k3">*</span>argv<span class="k2">[</span><span class="k2">]</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">2</td><td>    <span class="k1">for</span> <span class="k2">(</span><span class="k1">int</span> i <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span> i <span class="k3">&lt;</span> <span class="n">256</span><span class="k2">;</span> i<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">3</td><td>        sysLines<span class="k3">&lt;</span>i&gt;.flags <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">4</td><td>        sysLines<span class="k3">&lt;</span>i&gt;.height <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">5</td><td>    <span class="k2">}</span></td></tr><tr><td class="number">6</td><td>    </td></tr><tr><td class="number">7</td><td>    <a href="http://www.allegro.cc/manual/allegro_init" target="_blank"><span class="a">allegro_init</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">8</td><td>  <a href="http://www.allegro.cc/manual/install_keyboard" target="_blank"><span class="a">install_keyboard</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span> </td></tr><tr><td class="number">9</td><td>  <a href="http://www.allegro.cc/manual/install_timer" target="_blank"><span class="a">install_timer</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">10</td><td>  <a href="http://www.allegro.cc/manual/LOCK_VARIABLE" target="_blank"><span class="a">LOCK_VARIABLE</span></a><span class="k2">(</span>systime<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">11</td><td>  <a href="http://www.allegro.cc/manual/LOCK_FUNCTION" target="_blank"><span class="a">LOCK_FUNCTION</span></a><span class="k2">(</span>sysTimer<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">12</td><td>  <a href="http://www.allegro.cc/manual/install_int_ex" target="_blank"><span class="a">install_int_ex</span></a><span class="k2">(</span>sysTimer, BPS_TO_TIMER<span class="k2">(</span><span class="n">30</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">13</td><td>  <a href="http://www.allegro.cc/manual/set_color_depth" target="_blank"><span class="a">set_color_depth</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/desktop_color_depth" target="_blank"><span class="a">desktop_color_depth</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">14</td><td>  <a href="http://www.allegro.cc/manual/set_window_title" target="_blank"><span class="a">set_window_title</span></a><span class="k2">(</span><span class="s">"Level Editor"</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">15</td><td>    <span class="c">//THIS ALWAYS RETURNS -1 WITH 850 &amp; 650</span></td></tr><tr><td class="number">16</td><td>    <span class="k1">if</span> <span class="k2">(</span><a href="http://www.allegro.cc/manual/set_gfx_mode" target="_blank"><span class="a">set_gfx_mode</span></a><span class="k2">(</span>GFX_AUTODETECT_WINDOWED, <span class="n">850</span>, <span class="n">650</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span> <span class="k3">=</span><span class="k3">=</span> <span class="k3">-</span><span class="n">1</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">17</td><td>       <a href="http://www.allegro.cc/manual/allegro_message" target="_blank"><span class="a">allegro_message</span></a><span class="k2">(</span><span class="s">"Error"</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">18</td><td>       <a href="http://www.allegro.cc/manual/allegro_exit" target="_blank"><span class="a">allegro_exit</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">19</td><td>       <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">20</td><td>    <span class="k2">}</span></td></tr><tr><td class="number">21</td><td>    ...</td></tr></tbody></table></div></div><p>
It&#39;s also worth noting I can&#39;t set anything bigger than 800*600 (or rather that&#39;s the smallest res it wants to set)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Cody Harris)</author>
		<pubDate>Wed, 17 May 2006 02:38:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What&#39;s the resolution of your monitor set to?  (althought that&#39;s a longshot...)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Onewing)</author>
		<pubDate>Wed, 17 May 2006 02:45:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>1024*768 (or wtv).</p><p>I tried to edit my post, but I couldn&#39;t <b>shakes fist</b>.</p><p>Anyways, I&#39;m using DevC++ with MingW 3.1 and Allegro 2.0 (off the site, compiled this morning)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Cody Harris)</author>
		<pubDate>Wed, 17 May 2006 02:48:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve seen the pink screen before. I think you do have to use one of the standard screen sizes to avoid it. (640x480, 800x600, 1024x768, etc.)</p><p>(Just did a quick test on an existing project. Even though it drew properly, the pink was a visible flash when using an awkward screen size.)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ampersand)</author>
		<pubDate>Wed, 17 May 2006 03:07:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Neither 850 nor 650 are multiples of 4, which IIRC, is a requirement of Windows. Though in that case, set_gfx_mode should be failing...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Wed, 17 May 2006 04:18:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Windows creates weird window sizes all the time, another one of my programs does a small windowed weird size, however, it&#39;s like it can&#39;t get enough memory together or something, as if I did a window of like 320*325, I can do that.</p><p>I&#39;d like to note that 1024*768 does not work windowed, but fullscreen it does.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Cody Harris)</author>
		<pubDate>Wed, 17 May 2006 06:09:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Neither 850 nor 650 are multiples of 4, which IIRC, is a requirement of Windows.
</p></div></div><p>
That&#39;s a requirement of DirectX, not Windows itself. So, 848x648 will work, as well as 852x652, or any other combination of those numbers, but not 850x650...</p><p>If 850x650 is really required and speed of drawing is not very important, you could use the GDI driver...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (miran)</author>
		<pubDate>Wed, 17 May 2006 10:15:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I&#39;d like to note that 1024*768 does not work windowed
</p></div></div><p>
You cannot create windows larger than or as large as the desktop.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Wed, 17 May 2006 12:41:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>But you can use fullscreen and have the thing you want.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Wed, 17 May 2006 12:43:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>There, a multiple of 2 fixed it, thanks!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Cody Harris)</author>
		<pubDate>Sat, 20 May 2006 08:38:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Multiple of <b>4</b>!!!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (miran)</author>
		<pubDate>Sat, 20 May 2006 16:31:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
You cannot create windows larger than or as large as the desktop.
</p></div></div><p>

Can&#39;t you? I can&#39;t say that I&#39;ve ever had this experience, although I do program under Linux. I say experience, and not problem, because there isn&#39;t actually a sensible reason why you would create a window that is bigger than the desktop resolution.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jamyskis)</author>
		<pubDate>Mon, 22 May 2006 15:38:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Can&#39;t you? I can&#39;t say that I&#39;ve ever had this experience, although I do program under Linux.
</p></div></div><p>
Oh, under X you can. I don&#39;t know if it&#39;s a limitation in Windows or Allegro that prevents you from doing it in Windows - but it&#39;s not usually a good idea to do anyway.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Mon, 22 May 2006 16:57:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>SOrry Miran, that&#39;s what I ment <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Cody Harris)</author>
		<pubDate>Mon, 22 May 2006 18:54:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I can create just any size smaller than the Windows graphics mode, which is 1024*768*32.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Johan Halmén)</author>
		<pubDate>Mon, 22 May 2006 20:55:45 +0000</pubDate>
	</item>
</rss>
