<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>My game doesn&#39;t work on Windows</title>
		<link>http://www.allegro.cc/forums/view/588641</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 21 Nov 2006 01:42:08 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>OK, I have done a fair amount of my game and have just got to collision detection. It was working but I changed something and I&#39;ll have to fix it again. But anyway, I ran it on Windows and it sometimes works, and sometimes it doesn&#39;t draw anything in the window until I move it. It only updates the picture when I move the window. Does anybody know what could cause this? I&#39;d like to have a Windows port so this is fairly important. Hopefully somebody has had this problem and fixed it...?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (James Stanley)</author>
		<pubDate>Mon, 20 Nov 2006 19:31:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>No idea, but I would help if you provide versions of everything (Allegro, static? dynamic?, compiler, compiler command, etc.) <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Marco Radaelli)</author>
		<pubDate>Mon, 20 Nov 2006 19:36:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Allegro 4.2.0 Static linked<br />Windows XP<br />Mingw32 (Dev-C++)<br />Compiler: -DALLEGRO_STATICLINK<br />C++ Compiler: -DALLEGRO_STATICLINK<br />Linker: -lalleg_s -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lole32 -ldinput -lddraw -ldxguid -lwinmm -ldsound</p><p>EDIT:<br />Also it&#39;s written in C and has no other libraries. I don&#39;t have super user privileges, but it works sometimes so this might not be the problem.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (James Stanley)</author>
		<pubDate>Mon, 20 Nov 2006 19:42:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If it sometimes draws to the screen and sometimes doesn&#39;t and almost seems to be random then my best guess is you&#39;re not drawing to the screen properly. I know, since it probably works on the other OS you&#39;re designing for that may not seem right, but Windows does some strange things when it comes to the screen and as a result, your code which works in one OS may not work in Windows.</p><p>Could you post a segment of your code showing just a little before the actual draw to the screen and just a little after?</p><p>I&#39;m going to guess that you&#39;re doing something like this:</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">do</span> <span class="k2">{</span>
  <a href="http://www.allegro.cc/manual/clear_bitmap" target="_blank"><span class="a">clear_bitmap</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a><span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.allegro.cc/manual/vsync" target="_blank"><span class="a">vsync</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>

  <span class="c">// Game Code Goes Here</span>

  <a href="http://www.allegro.cc/manual/blit" target="_blank"><span class="a">blit</span></a><span class="k2">(</span>back_buffer,<a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>,<span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span>,screen-&gt;w,screen-&gt;h<span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span> <span class="k1">while</span> <span class="k2">(</span>gameloop_active<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

--- Kris Asick (Gemini)<br />--- <a href="http://www.pixelships.com">http://www.pixelships.com</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kris Asick)</author>
		<pubDate>Mon, 20 Nov 2006 19:45:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code snippet"><div class="inner"><pre><span class="k1">while</span><span class="k2">(</span><span class="k3">!</span>quit<span class="k2">)</span> <span class="k2">{</span>
  <span class="k1">if</span><span class="k2">(</span>counter <span class="k3">&gt;</span><span class="k3">=</span> <span class="n">5</span><span class="k2">)</span> <span class="k2">{</span>  <span class="c">//Simple timing ;)</span>
    <span class="c">//Game</span>
    counter <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span>
    <a href="http://www.allegro.cc/manual/draw_sprite" target="_blank"><span class="a">draw_sprite</span></a><span class="k2">(</span>canvas, cursor<span class="k2">[</span>pointer<span class="k2">]</span>, <a href="http://www.allegro.cc/manual/mouse_x" target="_blank"><span class="a">mouse_x</span></a>, <a href="http://www.allegro.cc/manual/mouse_y" target="_blank"><span class="a">mouse_y</span></a><span class="k2">)</span><span class="k2">;</span>
    <a href="http://www.allegro.cc/manual/draw_sprite" target="_blank"><span class="a">draw_sprite</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>, canvas, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
    <a href="http://www.allegro.cc/manual/clear_bitmap" target="_blank"><span class="a">clear_bitmap</span></a><span class="k2">(</span>canvas<span class="k2">)</span><span class="k2">;</span>
  <span class="k2">}</span>
<span class="k2">}</span>
</pre></div></div><p>

I have a timer callback, before you ask <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (James Stanley)</author>
		<pubDate>Mon, 20 Nov 2006 19:50:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Why do people insist on using draw_sprite to draw to the screen? I never get that myself. <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BAF)</author>
		<pubDate>Mon, 20 Nov 2006 20:16:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I read something about making sure you use acquire_screen() and release_screen() functions before and after drawing to the screen? </p><p>Well I use it for window programs in Allegro</p><p><img src="http://www.allegro.cc/forums/smileys/cool.gif" alt="8-)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (asamsharaz)</author>
		<pubDate>Mon, 20 Nov 2006 20:48:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I read something about making sure you use acquire_screen() and release_screen() functions before and after drawing to the screen?
</p></div></div><p>

You don&#39;t need these functions, but they can help speed up drawing.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Mon, 20 Nov 2006 20:49:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I had a problem like this on a really crappy laptop once. Try it on another computer, I&#39;m quite sure that it will work. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Michael Faerber)</author>
		<pubDate>Mon, 20 Nov 2006 21:11:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
First check if the allegro examples or other allegro programs have the same problem.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Mon, 20 Nov 2006 21:26:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>BAF, sorry if it offended you <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /><br />Asam, I&#39;ll try that, thanks.<br />Michael, No. I am coding away and keep testing it, then one time I test it and it never works for the rest of the day. It happens on all of them. Although, they are all the same, I don&#39;t have access to any other Windows computers since my Dad installed Debian.<br />Richard, I will.</p><p>EDIT:<br />On a related note, if acquire_bitmap() and release_bitmap() speed up drawing, shouldn&#39;t blit() and draw_sprite() call them automatically?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (James Stanley)</author>
		<pubDate>Mon, 20 Nov 2006 22:39:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>They do. acquire/release are almost never needed, even to speed things up.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Mon, 20 Nov 2006 23:01:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So what&#39;s the point in me calling them?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (James Stanley)</author>
		<pubDate>Mon, 20 Nov 2006 23:16:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>When you draw to the same bitmap multiple times in a row.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Mon, 20 Nov 2006 23:22:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Oh. OK.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (James Stanley)</author>
		<pubDate>Mon, 20 Nov 2006 23:28:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Is canvas a memory bitmap, made with create_bitmap(), or a video bitmap made with create_video_bitmap()?</p><p>If the later, then what&#39;s happening is canvas and screen are ending up using the SAME memory! Thus when you clear canvas, you clear the screen, and the pause between due to your timing routine is making the screen show up clear. Simply use create_bitmap() on your canvas object instead of create_video_bitmap().</p><p>And if you only ever make one draw to the screen, there&#39;s no point calling the acquire and release commands because Allegro will do it for you. You only need to call them if you plan to do multiple video-bitmap operations in one go.</p><p>--- Kris Asick (Gemini)<br />--- <a href="http://www.pixelships.com">http://www.pixelships.com</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kris Asick)</author>
		<pubDate>Mon, 20 Nov 2006 23:35:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Just a normal memory bitmap, I&#39;ve never really got the hang of video bitmaps <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (James Stanley)</author>
		<pubDate>Mon, 20 Nov 2006 23:36:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Waitaminute...</p><p>You say it only updates the picture when you move the window. Does that mean the previous frame is still shown when you stop moving the window?</p><p>--- Kris Asick (Gemini)<br />--- <a href="http://www.pixelships.com">http://www.pixelships.com</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kris Asick)</author>
		<pubDate>Mon, 20 Nov 2006 23:50:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yeah. I guess I should have been more specific.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (James Stanley)</author>
		<pubDate>Mon, 20 Nov 2006 23:52:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Three more questions to narrow this issue down:</p><ul><li><p>Between window moves, does the game actually update and simply not draw to the screen, or does the game pause until the next time you move the window?</p><br /></li><li><p>If you click and hold down the mouse button to move the window, then move the window, then stop moving the window without releasing the mouse button, does the game keep updating properly or not?</p><br /></li><li><p>Does the game run fine full-screen?</p></li></ul><p>I recommend you try running some other Allegro-driven games from the <a href="http://www.allegro.cc/depot">depot</a> to see if the problem is limited to your own code or not. If other Allegro games are causing problems, it&#39;s likely nothing to do with your code and everything to do with your system configuration. (IE: Outdated drivers, background applications sucking resources dry, etc.)</p><p>--- Kris Asick (Gemini)<br />--- <a href="http://www.pixelships.com">http://www.pixelships.com</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kris Asick)</author>
		<pubDate>Tue, 21 Nov 2006 01:14:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>1.) It updates but doesn&#39;t draw<br />2.) I don&#39;t remember, I&#39;ll find out tomorrow<br />3.) No, I have a thing that checks whether full screen is available. It uses full screen if it is and windowed if it isn&#39;t. It never runs full screen and it <u>sometimes</u> has the window problem. For some reason, after I&#39;ve had the window problem once it doesn&#39;t work on that computer for the rest of the day (I say day because I don&#39;t know if it&#39;s while I&#39;m logged on, before it is rebooted, or anything else)</p><p>I&#39;ll try some other allegro stuff. I can&#39;t do anything about drivers though, they&#39;re schools computers.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (James Stanley)</author>
		<pubDate>Tue, 21 Nov 2006 01:17:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If it&#39;s not running full-screen when you&#39;re telling it to then you&#39;re probably requesting a video mode that isn&#39;t standard, either because of a bad resolution or a colour depth the video card can&#39;t handle. Good resolutions that work on just about any computer are 320x200, 640x480 and 800x600. 8-bit colour depth will work on anything, 16 and 32 bit will work on most things, but not really old systems, and 15 and 24 bit are fairly uncommon and sporadically work on some systems and not on others.</p><p>Start with trying to use a more normal resolution and see if that helps run full-screen. If you are... well...</p><p>Depending on the school, especially if we&#39;re talking pre-college level, the computers there could be EXTREMELY outdated and would not make a good development or testing platform. You really ought to find a more personal locale to do your programming, either at home, a friend&#39;s house, somewhere where the computer can be kept up to date.</p><p>--- Kris Asick (Gemini)<br />--- <a href="http://www.pixelships.com">http://www.pixelships.com</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kris Asick)</author>
		<pubDate>Tue, 21 Nov 2006 01:26:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>640x480x24. The 24 might be the problem. I&#39;ll change it to 32 and see what happens. It is pre-college but the computers are fairly new (they upgrade about once every two to three years), but I&#39;ll see how it runs on friends computers.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (James Stanley)</author>
		<pubDate>Tue, 21 Nov 2006 01:29:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Add checks to try 24 bit if 32 bit fails (and to use 15 bit if 16 bit fails).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Tue, 21 Nov 2006 01:34:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>OK. I&#39;ll do that now.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (James Stanley)</author>
		<pubDate>Tue, 21 Nov 2006 01:36:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I had this exact problem with some college computers.  It was interesting trying to play the game, whilst keeping one hand on the mouse moving the window around.  The program worked fine on everything else but those computers.  They updated the drivers and everythig worked fine after that.  <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Onewing)</author>
		<pubDate>Tue, 21 Nov 2006 01:37:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve had the same problem with Windows. Never thought to move the window around, though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Tue, 21 Nov 2006 01:40:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Onewing, That&#39;s probably my problem then. I&#39;ll ask Michael to update the video drivers - Michael is the &#39;IT Technician&#39;. He spends his time playing Roller Coaster Tycoon and writing the website for his fair (a merry-go-round) <a href="http://www.mikeyjsfunfair.co.uk">http://www.mikeyjsfunfair.co.uk</a></p><p>EDIT:<br />CGames, I only did by accident <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (James Stanley)</author>
		<pubDate>Tue, 21 Nov 2006 01:42:08 +0000</pubDate>
	</item>
</rss>
