<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Frame rates.</title>
		<link>http://www.allegro.cc/forums/view/590912</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 11 Apr 2007 00:39:14 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
</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">long</span> <span class="k1">volatile</span> t568<span class="k3">=</span><span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">2</td><td>&#160;</td></tr><tr><td class="number">3</td><td><span class="k1">void</span> timer_ms<span class="k2">(</span><span class="k1">void</span><span class="k2">)</span></td></tr><tr><td class="number">4</td><td>  <span class="k2">{</span></td></tr><tr><td class="number">5</td><td>  t568<span class="k3">+</span><span class="k3">+</span><span class="k2">;</span></td></tr><tr><td class="number">6</td><td>  <span class="k2">}</span></td></tr><tr><td class="number">7</td><td><a href="http://www.allegro.cc/manual/END_OF_FUNCTION" target="_blank"><span class="a">END_OF_FUNCTION</span></a><span class="k2">(</span>timer_ms<span class="k2">)</span>  </td></tr><tr><td class="number">8</td><td>&#160;</td></tr><tr><td class="number">9</td><td>        <span class="k1">if</span><span class="k2">(</span>settings-&gt;show_fps<span class="k2">)</span></td></tr><tr><td class="number">10</td><td>    <span class="k2">{</span></td></tr><tr><td class="number">11</td><td>    <span class="k1">if</span><span class="k2">(</span><span class="k2">(</span>settings-&gt;cnt<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span>%DiSPLAY_FPS<span class="k3">=</span><span class="k3">=</span><span class="n">0</span><span class="k2">)</span></td></tr><tr><td class="number">12</td><td>      <span class="k2">{</span></td></tr><tr><td class="number">13</td><td>      settings-&gt;current<span class="k3">=</span>settings-&gt;current1<span class="k3">/</span>DiSPLAY_FPS<span class="k2">;</span>  </td></tr><tr><td class="number">14</td><td>      settings-&gt;current1<span class="k3">=</span><span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">15</td><td>      <span class="k2">}</span></td></tr><tr><td class="number">16</td><td>    <span class="k1">if</span><span class="k2">(</span><span class="k2">(</span><span class="k3">*</span>t-settings-&gt;fps<span class="k2">)</span><span class="k3">&gt;</span><span class="n">0</span><span class="k2">)</span></td></tr><tr><td class="number">17</td><td>      <span class="k2">{</span></td></tr><tr><td class="number">18</td><td>      settings-&gt;current1<span class="k3">+</span><span class="k3">=</span><span class="n">1000</span><span class="k3">/</span><span class="k2">(</span><span class="k3">*</span>t-settings-&gt;fps<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">19</td><td>      settings-&gt;fps<span class="k3">=</span><span class="k2">(</span><span class="k3">*</span>t<span class="k2">)</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>    <a href="http://www.allegro.cc/manual/textprintf_ex" target="_blank"><span class="a">textprintf_ex</span></a><span class="k2">(</span>settings-&gt;sc_component,<a href="http://www.allegro.cc/manual/font" target="_blank"><span class="a">font</span></a>,<span class="n">1</span>,<span class="n">1</span>,<a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span>FPSR,FPSG,FPSB<span class="k2">)</span>,<span class="n">0</span>,<span class="s">"FPS %d"</span>,settings-&gt;current<span class="k2">)</span><span class="k2">;</span>  </td></tr><tr><td class="number">22</td><td>    <span class="k2">}</span></td></tr></tbody></table></div></div><p>
This code counts fps.. The weird things are:</p><p>When I remove the function rest, fps drops. (from 63, to 44) Also, on another PC (much faster, Intel Core duo 6600 compared to Intel P-4 2.4Ghz) It had 128 fps, after some changes in the program it again dropped to 63. After increasing the process&#39;s priority in Windows Task manager, FPS dropped to 33, while the game decently performed at the same, or higher speed.</p><p>Are there any functions that control the Process priority? Or force the OS to give more CPU time to my program? </p><p>Can some one explain me what is going on with my project?(and/or my PC/mind)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (type568)</author>
		<pubDate>Sun, 08 Apr 2007 11:07:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Edit your post to use <a href="http://www.allegro.cc/mockup.html">code tags</a> and we&#39;ll help right away. It&#39;s just too much work deciphering code without them.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Sun, 08 Apr 2007 12:41:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It is done. Help please?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (type568)</author>
		<pubDate>Sun, 08 Apr 2007 12:56:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>First of all, if your program is prioritized too high, DirectX will not be able to do its thing properly and thus your framerate will suffer. (Especially if you go up into the real-time range of 15+.)</p><p>As per the framerate dropping when you remove rest() or Sleep() statements, it likely has everything to do with how you&#39;ve coded your game loop and nothing to do with the code you&#39;ve provided.</p><p>Plus, it would be good to tell us if the FPS is actually being accurate or not. (IE: If FPS drops, has the framerate also dropped, or is the FPS simply showing an incorrect value?)</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>Sun, 08 Apr 2007 21:21:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t know.. In some cases the FPS seems to be correct, while in some decently not.. (when I increase the priority, the game can&#39;t run slower :/).</p><p>Here is all my project..
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (type568)</author>
		<pubDate>Mon, 09 Apr 2007 06:37:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>... your project seems to lack any kind of working timing whatsoever. Separate logic and drawing, <a href="http://alleg.sourceforge.net/stabledocs/en/faq.html#How_can_I_make_my_game_run_at_the_same_speed_on_any_computer_">implement proper timing</a>, and then come back.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Mon, 09 Apr 2007 12:20:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sorry.. my case is different. I want FPS to improove, if possible. I have made some changes, and it had become more reasonible. 400+ (Intel core duo 6600) Though the problem now, is to adjust the game speed itself. </p><p>But thanks.. the code looks nice. (example you linked me to..)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (type568)</author>
		<pubDate>Tue, 10 Apr 2007 19:39:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Sorry.. my case is different. I want FPS to improove, if possible.
</p></div></div><p>

I&#39;m dumbstruck.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kibiz0r)</author>
		<pubDate>Tue, 10 Apr 2007 21:29:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m in a rush, especially since the forum logged me out before I could finish my reply to you... anyways, here&#39;s some things I noticed after looking over and testing your code:</p><p>1. I experience none of your framerate or CPU problems. You may want to try updating your drivers or trying your program on another system.</p><p>2. On my system I get roughly 100-110 FPS... which is well above the 60 my monitor can display at 1280x1024. You gotta keep in mind, FPS as high as 400 is completely unreasonable without hardware acceleration, especially at extremely high resolutions. Go download AllegroGL or OpenLayer if that&#39;s what you want.</p><p>3. Combining 32-bit colour, 1280x1024, and software rendering will <i>kill</i> the FPS on any system. For what you&#39;re doing, 8-bit colour should be all you need, and 1280x1024 isn&#39;t widely supported. You should design around 1024x768 and make it up-scalable.</p><p>4. You&#39;re calling LOCK_VARIABLE on the wrong variable in your main section. That might be part of your problem.</p><p>5. Your calls to acquire_bitmap() are doing nothing because you don&#39;t need to call that on regular bitmaps, only video bitmaps which you plan to call more than one drawing operation to in a frame.</p><p>6. You&#39;re calling acquire_screen() twice in your About section. I think you mean to call acquire_screen() then release_screen(). And again, you only need to do that if you plan to draw more than once to the screen in one frame.</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, 10 Apr 2007 21:47:11 +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;m in a rush, especially since the forum logged me out before I could finish my reply to you
</p></div></div><p>
After you&#39;ve re-logged in, use the back button to go to the page <i>after</i> the &#39;new post&#39; page where you typed your original post.  Its the page that says &quot;You must be logged in to do this&quot;.</p><p>Refresh this page.  You should be prompted if you want to repost your data or resubmit it or something (depending on your browser).  Select yes.</p><p>If you&#39;re too lazy to figure that out, install the allegro.cc <a href="http://www.allegro.cc/forums/thread/590508">Post Recovery</a> Add-on.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ImLeftFooted)</author>
		<pubDate>Wed, 11 Apr 2007 00:39:14 +0000</pubDate>
	</item>
</rss>
