<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Extreme slow down on Windows</title>
		<link>http://www.allegro.cc/forums/view/613329</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 02 Oct 2013 01:41:41 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello,<br />I am developing my game on Linux, where Allegro runs without any problems and I am trying to port it to Windows. Game is 2D, draws about 2000 bitmaps every frame and on Linux I have 60 fps. When I try to run it on Windows it&#39;s about 200x slower, one frame is drawn cca. every two seconds and the slow down is caused by drawing. I tried it on multiple Windows PCs and the game never runs normally. On Windows it was compiled by Visual Studio 2010 and 2008 and the OS was Windows 7.</p><p>This is how I am creating display.
</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><a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY_MODE"><span class="a">ALLEGRO_DISPLAY_MODE</span></a> <span class="k3">*</span>display_mode <span class="k3">=</span> <span class="k1">new</span> <a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY_MODE"><span class="a">ALLEGRO_DISPLAY_MODE</span></a><span class="k2">;</span>
<span class="number">  2</span>
<span class="number">  3</span>  <span class="k1">if</span><span class="k2">(</span>game_info::fullscreen<span class="k2">)</span>
<span class="number">  4</span>  <span class="k2">{</span>
<span class="number">  5</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_FULLSCREEN_WINDOW<span class="k2">)</span><span class="k2">;</span>
<span class="number">  6</span>    <a href="http://www.allegro.cc/manual/al_get_display_mode"><span class="a">al_get_display_mode</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_get_num_display_modes"><span class="a">al_get_num_display_modes</span></a><span class="k2">(</span><span class="k2">)</span><span class="k3">-</span><span class="n">1</span>, display_mode<span class="k2">)</span><span class="k2">;</span>
<span class="number">  7</span>    display_width <span class="k3">=</span> display_mode-&gt;width<span class="k2">;</span>
<span class="number">  8</span>    display_height <span class="k3">=</span> display_mode-&gt;height<span class="k2">;</span>
<span class="number">  9</span>  <span class="k2">}</span>
<span class="number"> 10</span>  <span class="k1">else</span>
<span class="number"> 11</span>  <span class="k2">{</span>
<span class="number"> 12</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"> 13</span>  <span class="k2">}</span>
<span class="number"> 14</span>
<span class="number"> 15</span>  <a href="http://www.allegro.cc/manual/al_set_new_window_position"><span class="a">al_set_new_window_position</span></a><span class="k2">(</span><span class="n">10</span>, <span class="n">10</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 16</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>display_width, display_height<span class="k2">)</span><span class="k2">;</span>
</div></div><p>
I tried adding ALLEGRO_OPENGL flag but it didn&#39;t help. </p><p>Also someone else has encountered <a href="https://www.allegro.cc/forums/thread/613209"> this </a> bug with my game which was solved by adding al_set_new_window_position(10, 10) and on one computer I have encountered <a href="https://www.allegro.cc/forums/thread/606002"> this </a> one with my game and also with the same code as the guy in the thread. I dont want to solve these problems in this thread, just maybe you should know.  </p><p>PS. Sorry for my English, it&#39;s not my native language.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (kyborg)</author>
		<pubDate>Wed, 02 Oct 2013 01:06:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Since you say you encountered that second bug, does that mean you&#39;re running under a VM? Many VMs don&#39;t have very good or any hardware acceleration so if that&#39;s what you&#39;re doing I&#39;m not surprised it runs slow.</p><p>If you&#39;re not running in a VM, post your drawing routine, or better yet, a complete example that demonstrates the problem.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Wed, 02 Oct 2013 01:41:41 +0000</pubDate>
	</item>
</rss>
