<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Suggested change to the DirectX mode setting code</title>
		<link>http://www.allegro.cc/forums/view/555412</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 26 Dec 2005 08:03:40 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I apologise that I probabily will not able to create this patch myself, but I am primarily an OS X user nowadays and I have always favoured MSVC on Windows. I will endeavour to get a working GCC compiler under Windows and have a go at creating the patch I describe, but this may not be for some while.</p><p>I note in src/win/wddmode.c line 395 that the Windows/DirectX response to a request_refresh_rate is that if the exact rate requested isn&#39;t available, then Allegro just allows Windows to provide the default. Conversely under OS X, XDGA and VESA 3.0, if the exact rate isn&#39;t requested then the closest available is used.</p><p>I therefore think it would be more consistent, and more useful to the end user, if IDirectDraw2::EnumDisplayModes was used to find the closest available refresh rate - in a manner broadly analogous to the existing DGA implementation.</p><p>Out of curiousity, why does the DGA implementation only accept a refresh rate that is at least what the user requested? If they ask for, e.g. 71, wouldn&#39;t they rather have 70 than 85?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Harte)</author>
		<pubDate>Sat, 24 Dec 2005 20:57:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The DX change makes sense to me.</p><p>I wonder if we also should extend get_gfx_mode_list to include the refresh rate.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Sat, 24 Dec 2005 21:09:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;d prefer to be able to know when its been changed to something i did not request.</p><p>Having it set a rate i did not request will appear to be a bug to some people.<br />Is there a way to set a flag or something like  <br />set_refresh_rate(75,ONLY);  and  <br />set_refresh_rate(75,CLOSEST_MATCH);
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (A J)</author>
		<pubDate>Sun, 25 Dec 2005 13:23:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I can&#39;t think of many situations where you&#39;d need a specific refresh rate. The user can have their system set to only run in a specific refresh, and it&#39;d cause set_gfx_mode to fail if something else is set (especially applicable in windowed modes, where you can&#39;t change the refresh, AFAIK). Once you get past 60hz, the smoothness of motion becomes a very small issue (though screen flickering/headaches may). Even if your game is running in 85hz @ 100fps (fairly badly mis-matched), any vsync-caused jitter is barely going to be noticeable (if at all) since a proper timing method will keep the speed self-adjusted.</p><p>And, if you need to know if you got the refresh you wanted, you can use:
</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/request_refresh_rate" target="_blank"><span class="a">request_refresh_rate</span></a><span class="k2">(</span>blah<span class="k2">)</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>...<span class="k2">)</span><span class="k2">;</span>
<span class="k1">if</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/get_refresh_rate" target="_blank"><span class="a">get_refresh_rate</span></a><span class="k2">(</span><span class="k2">)</span> <span class="k3">!</span><span class="k3">=</span> blah<span class="k2">)</span>
  <span class="c">/* improper refresh detected */</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Sun, 25 Dec 2005 14:57:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, adding support for it to get_gfx_mode_list would solve this as well..
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Sun, 25 Dec 2005 18:50:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Well, adding support for it to get_gfx_mode_list would solve this as well..
</p></div></div><p>
In my opinion, get_gfx_mode_list remains completely useless while there is no get_gfx_driver_list. I guess it&#39;s intended for people who are aware that Allegro is a cross platform library but have no interest in writing platform neutral code.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Harte)</author>
		<pubDate>Sun, 25 Dec 2005 22:11:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Oh, I see.. you have to pass a specific driver. Does indeed not make much sense at all. I had assumed in my previous posts you can pass GFX_AUTODETECT.</p><p>I wonder if it makes sense to change this for 4.2.1 (either add a get_gfx_driver_list function, or allow GFX_AUTODETECT). 4.3 already does/will do it in a sane way.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Sun, 25 Dec 2005 22:25:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, wouldn&#39;t having a refresh rate explicitly set make it easier to get smoother animation/no tearing? </p><p>Saying that, if you are using paging then it waits for a refresh anyway and on double buffering you&#39;d have to rely on vsync working anyway. I guess the best setting a refresh would do would allow you to have a more tightly coupled fps limiting loop without waste.</p><p>Either way, it makes sense what Thomas is saying, in that if this is cross-platform then the least it can do is be consistent in it&#39;s approach to the most fundamental things.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Mon, 26 Dec 2005 05:10:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I use allegro to output to video projectors, that have a specifc refresh rate.<br />I&#39;ve like to be able to explicitly set a refresh rate, without allegro guessing it and/or changing it to whatever it likes.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (A J)</author>
		<pubDate>Mon, 26 Dec 2005 08:03:40 +0000</pubDate>
	</item>
</rss>
