<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>ALLEGRO_DISPLAY_MODE - Format Variable</title>
		<link>http://www.allegro.cc/forums/view/607971</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 30 Jul 2011 05:22:50 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m writing a function for my game that, if the game is played in fullscreen mode, automatically tries to find the best available display mode. I&#39;m using al_get_display_mode() for this. However, I don&#39;t know what the &quot;format&quot; variable of the ALLEGRO_DISPLAY_MODE structure does. I assumed it refers to the bit depth, in which case I had been looking for 32-Bit display modes. However, I have written some code to print the content of some randomly selected display modes and all of them had either &quot;23&quot; or &quot;13&quot; for their format. Now I&#39;m confused, because I can&#39;t really get any sense into that variable. The documentation doesn&#39;t say anything about it and I couldn&#39;t find anything in the source code. Does anyone know what it&#39;s used for? If it does refer to the bit depth, what value represents &quot;32-Bit&quot;?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (RPG Hacker)</author>
		<pubDate>Sat, 30 Jul 2011 04:49:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It represents a pixel format. See al_set_new_bitmap_format for a list of them. There is a al_get_pixel_format_size function that&#39;ll return 32, 16 or whatever if you pass it that format you get from al_get_display_mode.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sat, 30 Jul 2011 04:51:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ah, thanks! How did I miss that function?</p><p>Anyways, that&#39;s all I wanted to know.</p><p><b>EDIT:</b><br />Another related question: Is the order of display modes always the same on all systems or is it hardware dependant? On my system, for example, the display modes are ordered like this:</p><p>640x480 32-Bit 85 FPS<br />640x480 32-Bit 75 FPS<br />640x480 32-Bit 60 FPS</p><p>etc.</p><p>In my game I want the search function to automatically select the display mode with the highest refresh rate, if the other requirements are met. If the display modes have the same order on any system, I can just select the first display mode that meets the requirements. However, if they don&#39;t, I have to search for the display mode with the highest FPS manually.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (RPG Hacker)</author>
		<pubDate>Sat, 30 Jul 2011 05:08:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>My bad, the function is <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_pixel_size"><span class="a">al_get_pixel_size</span></a></span> and it returns size in bytes. So 32 would be 4 and so on.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sat, 30 Jul 2011 05:11:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yeah, I just used al_get_pixel_format_bits() instead, which returns 32 or 16.</p><p>Anywas, there is another question in the EDIT in my last post.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (RPG Hacker)</author>
		<pubDate>Sat, 30 Jul 2011 05:17:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t believe you can rely on the order there. It <u>might</u> be in that order all the time, but it would be bad to assume that&#39;s the case unless you can find some documentation on MSDN that says so.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sat, 30 Jul 2011 05:20:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Alright. I&#39;ll just have to do two search runs then (or find another solution). Thanks again!</p><p>Actually, I think I already got an idea that lets me do it in one run.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (RPG Hacker)</author>
		<pubDate>Sat, 30 Jul 2011 05:22:50 +0000</pubDate>
	</item>
</rss>
