<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>A5 question about display adapters</title>
		<link>http://www.allegro.cc/forums/view/605811</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 17 Dec 2010 15:17:35 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
hi,</p><p> I get 84 different display adapters with ALLEGRO_OPENGL as the display flags.</p><p>On all of them the format is 2686584.</p><p>Is this expected ?</p><p>What does it mean ?</p><p>EDIT : also : is there any way to get the dimensions of the screen ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (William Labbett)</author>
		<pubDate>Tue, 14 Dec 2010 03:58:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>to get the display size I do:</p><div class="source-code snippet"><div class="inner"><pre>AguiSize AguiAllegro5GraphicsManager::getDisplaySize<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/al_get_current_display"><span class="a">al_get_current_display</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span>
  <span class="k1">return</span> AguiSize<span class="k2">(</span><a href="http://www.allegro.cc/manual/al_get_display_width"><span class="a">al_get_display_width</span></a><span class="k2">(</span>
    <a href="http://www.allegro.cc/manual/al_get_current_display"><span class="a">al_get_current_display</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span>,
    <a href="http://www.allegro.cc/manual/al_get_display_height"><span class="a">al_get_display_height</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_get_current_display"><span class="a">al_get_current_display</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
  <span class="k1">else</span>
    <span class="k1">return</span> AguiSize<span class="k2">(</span><span class="n">0</span>,<span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>

Not sure about the formats though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Tue, 14 Dec 2010 04:46:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>thanks.</p><p>The thing is an actual monitor has a certain size : aspect ratio. So you could have a widescreen monitor or something else other than 3 : 4 and still set a 3 : 4 fullscreen display eg 640 : 480 etc..</p><p>The code you show wouldn&#39;t actually give the size of the physical screen.</p><p>The reason I&#39;m bothered about this is because I&#39;ve written my game at 640 by 480 but on a screen which isn&#39;t in these proportions, the graphics will all get stretched.</p><p>This could be avoided by drawing black rectangles on the left and right of the screen and resizing the 640 480 bitmap to fit in the middle but I need to know what the proportions of the screen are to do this.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (William Labbett)</author>
		<pubDate>Tue, 14 Dec 2010 04:52:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Does the <a href="http://www.allegro.cc/files/attachment/602863">example program</a> not work?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Tue, 14 Dec 2010 05:01:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/605811/894540#target">William Labbett</a> said:</div><div class="quote"><p>This could be avoided by drawing black rectangles on the left and right of the screen and resizing the 640 480 bitmap to fit in the middle but I need to know what the proportions of the screen are to do this.</p></div></div><p>

<span class="source-code">width <span class="k3">/</span> height</span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 14 Dec 2010 05:01:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I see so you want the desktop resolution. Do this through <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_monitor_info"><span class="a">al_get_monitor_info</span></a></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Tue, 14 Dec 2010 05:04:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think he&#39;s looking for the equivalent of A4&#39;s get desktop resolution, where you could then (sort of) know what the native resolution is.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Tue, 14 Dec 2010 05:19:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
What I really want is the screen resolution.</p><p>As an example of the problem. here&#39;s what I get for the monitor info&#39;s on my card :</p><p> i 0 width 640, height 480. format 2686584, refresh rate 59<br /> i 1 width 640, height 480. format 2686584, refresh rate 60<br /> i 2 width 640, height 480. format 2686584, refresh rate 66<br /> i 3 width 640, height 480. format 2686584, refresh rate 73<br /> i 4 width 640, height 480. format 2686584, refresh rate 75<br /> i 5 width 640, height 480. format 2686584, refresh rate 59<br /> i 6 width 640, height 480. format 2686584, refresh rate 60<br /> i 7 width 640, height 480. format 2686584, refresh rate 66<br /> i 8 width 640, height 480. format 2686584, refresh rate 73<br /> i 9 width 640, height 480. format 2686584, refresh rate 75<br /> i 10 width 640, height 480. format 2686584, refresh rate 59<br /> i 11 width 640, height 480. format 2686584, refresh rate 60<br /> i 12 width 640, height 480. format 2686584, refresh rate 66<br /> i 13 width 640, height 480. format 2686584, refresh rate 73<br /> i 14 width 640, height 480. format 2686584, refresh rate 75<br /> i 15 width 800, height 600. format 2686584, refresh rate 56<br /> i 16 width 800, height 600. format 2686584, refresh rate 60<br /> i 17 width 800, height 600. format 2686584, refresh rate 70<br /> i 18 width 800, height 600. format 2686584, refresh rate 72<br /> i 19 width 800, height 600. format 2686584, refresh rate 75<br /> i 20 width 800, height 600. format 2686584, refresh rate 56<br /> i 21 width 800, height 600. format 2686584, refresh rate 60<br /> i 22 width 800, height 600. format 2686584, refresh rate 70<br /> i 23 width 800, height 600. format 2686584, refresh rate 72<br /> i 24 width 800, height 600. format 2686584, refresh rate 75<br /> i 25 width 800, height 600. format 2686584, refresh rate 56<br /> i 26 width 800, height 600. format 2686584, refresh rate 60<br /> i 27 width 800, height 600. format 2686584, refresh rate 70<br /> i 28 width 800, height 600. format 2686584, refresh rate 72<br /> i 29 width 800, height 600. format 2686584, refresh rate 75<br /> i 30 width 1024, height 768. format 2686584, refresh rate 60<br /> i 31 width 1024, height 768. format 2686584, refresh rate 66<br /> i 32 width 1024, height 768. format 2686584, refresh rate 70<br /> i 33 width 1024, height 768. format 2686584, refresh rate 72<br /> i 34 width 1024, height 768. format 2686584, refresh rate 75<br /> i 35 width 1024, height 768. format 2686584, refresh rate 60<br /> i 36 width 1024, height 768. format 2686584, refresh rate 66<br /> i 37 width 1024, height 768. format 2686584, refresh rate 70<br /> i 38 width 1024, height 768. format 2686584, refresh rate 72<br /> i 39 width 1024, height 768. format 2686584, refresh rate 75<br /> i 40 width 1024, height 768. format 2686584, refresh rate 60<br /> i 41 width 1024, height 768. format 2686584, refresh rate 66<br /> i 42 width 1024, height 768. format 2686584, refresh rate 70<br /> i 43 width 1024, height 768. format 2686584, refresh rate 72<br /> i 44 width 1024, height 768. format 2686584, refresh rate 75<br /> i 45 width 1152, height 864. format 2686584, refresh rate 60<br /> i 46 width 1152, height 864. format 2686584, refresh rate 70<br /> i 47 width 1152, height 864. format 2686584, refresh rate 75<br /> i 48 width 1152, height 864. format 2686584, refresh rate 60<br /> i 49 width 1152, height 864. format 2686584, refresh rate 70<br /> i 50 width 1152, height 864. format 2686584, refresh rate 75<br /> i 51 width 1152, height 864. format 2686584, refresh rate 60<br /> i 52 width 1152, height 864. format 2686584, refresh rate 70<br /> i 53 width 1152, height 864. format 2686584, refresh rate 75<br /> i 54 width 1280, height 768. format 2686584, refresh rate 75<br /> i 55 width 1280, height 768. format 2686584, refresh rate 75<br /> i 56 width 1280, height 768. format 2686584, refresh rate 75<br /> i 57 width 1280, height 960. format 2686584, refresh rate 60<br /> i 58 width 1280, height 960. format 2686584, refresh rate 70<br /> i 59 width 1280, height 960. format 2686584, refresh rate 72<br /> i 60 width 1280, height 960. format 2686584, refresh rate 75<br /> i 61 width 1280, height 960. format 2686584, refresh rate 60<br /> i 62 width 1280, height 960. format 2686584, refresh rate 70<br /> i 63 width 1280, height 960. format 2686584, refresh rate 72<br /> i 64 width 1280, height 960. format 2686584, refresh rate 75<br /> i 65 width 1280, height 960. format 2686584, refresh rate 60<br /> i 66 width 1280, height 960. format 2686584, refresh rate 70<br /> i 67 width 1280, height 960. format 2686584, refresh rate 72<br /> i 68 width 1280, height 960. format 2686584, refresh rate 75<br /> i 69 width 1280, height 1024. format 2686584, refresh rate 60<br /> i 70 width 1280, height 1024. format 2686584, refresh rate 70<br /> i 71 width 1280, height 1024. format 2686584, refresh rate 75<br /> i 72 width 1280, height 1024. format 2686584, refresh rate 60<br /> i 73 width 1280, height 1024. format 2686584, refresh rate 70<br /> i 74 width 1280, height 1024. format 2686584, refresh rate 75<br /> i 75 width 1280, height 1024. format 2686584, refresh rate 60<br /> i 76 width 1280, height 1024. format 2686584, refresh rate 70<br /> i 77 width 1280, height 1024. format 2686584, refresh rate 75<br /> i 78 width 1440, height 900. format 2686584, refresh rate 60<br /> i 79 width 1440, height 900. format 2686584, refresh rate 75<br /> i 80 width 1440, height 900. format 2686584, refresh rate 60<br /> i 81 width 1440, height 900. format 2686584, refresh rate 75<br /> i 82 width 1440, height 900. format 2686584, refresh rate 60<br /> i 83 width 1440, height 900. format 2686584, refresh rate 75</p><p>Now from this information can the screen resolution be worked out ?</p><p>Can anyone guess what my screen resolution is ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (William Labbett)</author>
		<pubDate>Tue, 14 Dec 2010 05:20:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>In each line, &quot;width&quot; and &quot;height&quot; refer to the resolution of that particular screen mode, not how many pixels your monitor is capable of.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Tue, 14 Dec 2010 05:23:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/605811/894550#target">Arthur Kalliokoski</a> said:</div><div class="quote"><p>
not how many pixels your monitor is capable of.</p></div></div><p>

but that&#39;s what I want to know, because for all those options which are fullscreen any that aren&#39;t the same ratio as my screen res will mean my buffer will get stretched.</p><p>Sorry to be a bore but it really matters to me.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (William Labbett)</author>
		<pubDate>Tue, 14 Dec 2010 05:28:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So what you want is the monitor&#39;s native resolution, not the one that is necessarily currently set?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Tue, 14 Dec 2010 05:35:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;d suppose that everybody runs their desktop at the native resolution, so I&#39;d guess passing ALLEGRO_FULLSCREEN_WINDOW to a screen mode set, then using al_get_display_height() and al_get_display_width(), then setting the actual open gl mode you want would work.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Tue, 14 Dec 2010 05:36:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Then why doesn&#39;t monitor info work? If x1 || y1 != 0, then just subtract x1 from x2 and subtract y2 from y1 to get the desktop res right?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Tue, 14 Dec 2010 05:39:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t think he understands that you are suggesting this:
</p><div class="source-code snippet"><div class="inner"><pre>    <a href="http://www.allegro.cc/manual/ALLEGRO_MONITOR_INFO"><span class="a">ALLEGRO_MONITOR_INFO</span></a> monitor<span class="k2">;</span>
    <a href="http://www.allegro.cc/manual/al_get_monitor_info"><span class="a">al_get_monitor_info</span></a><span class="k2">(</span><span class="n">0</span>, <span class="k3">&amp;</span>monitor<span class="k2">)</span><span class="k2">;</span>

    <span class="k1">int</span> w <span class="k3">=</span> monitor.x2 <span class="k3">-</span> monitor.x1<span class="k2">;</span>
    <span class="k1">int</span> h <span class="k3">=</span> monitor.y2 <span class="k3">-</span> monitor.y1<span class="k2">;</span>
</pre></div></div><p>

This is the same thing as <span class="source-code"><a href="http://www.allegro.cc/manual/get_desktop_resolution"><span class="a">get_desktop_resolution</span></a><span class="k2">(</span><span class="k2">)</span></span> on A4. It&#39;s not guaranteed to be the monitor&#39;s native resolution, but it&#39;s what the user has set. So that&#39;s probably just as good.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Tue, 14 Dec 2010 05:39:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Alrighty.</p><p>So that&#39;s what I should I do and say in the readme to make sure your desktop res is set the native one for the display/monitor.</p><p>But just out of interest : would it be possible to hold a database of display&#39;s and all the makes and relevant data and then somehow find out which one it is by poking around the OS ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (William Labbett)</author>
		<pubDate>Tue, 14 Dec 2010 06:24:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yea I imagine it is possible. You can get the vendor id and device id from the OS and then compare that to a database to know which one it is. However making this cross platform might require some work.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Tue, 14 Dec 2010 06:33:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Right.</p><p>Thanks j
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (William Labbett)</author>
		<pubDate>Tue, 14 Dec 2010 07:40:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Glad to help <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Tue, 14 Dec 2010 08:01:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That&#39;s certainly not in the scope of something Allegro would do... and I suspect there are probably ways to find an lcds native resolution without a giant database. Seems probably, but I don&#39;t know. I think a database is extreme overkill in any case, and you&#39;d never get every monitor into it so it wouldn&#39;t be any better than the guesses you can make already, IMO.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Tue, 14 Dec 2010 08:54:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks Trent.</p><p>just need to work out what 2686584 means for the pixel format.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (William Labbett)</author>
		<pubDate>Tue, 14 Dec 2010 09:04:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes. Are you using an example included with Allegro to get that output, and if so which one? If not, can you upload your code? I&#39;ll try it out on Windows/OpenGL.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Tue, 14 Dec 2010 09:20:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I isolated the code down to a simple program and now all the values are 21 which makes sense. Not sure why I&#39;m getting that value in my game code. I&#39;ll keep fiddling and see if I can reproduce it without posting my entire project.</p><p>Okay. This code reproduces the problem :</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><span class="p">#include &lt;stdio.h&gt;</span>
<span class="number">   2</span><span class="p">#include &lt;allegro5/allegro.h&gt;</span>
<span class="number">   3</span><span class="p">#include &lt;allegro5/allegro_image.h&gt;</span>
<span class="number">   4</span><span class="p">#include &lt;allegro5/allegro_font.h&gt;</span>
<span class="number">   5</span>
<span class="number">   6</span>
<span class="number">   7</span>
<span class="number">   8</span>
<span class="number">   9</span><span class="k1">static</span> <span class="k1">void</span> initialise_game<span class="k2">(</span><span class="k1">void</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  10</span>
<span class="number">  11</span>
<span class="number">  12</span>
<span class="number">  13</span><span class="k1">int</span> main<span class="k2">(</span><span class="k2">)</span>
<span class="number">  14</span><span class="k2">{</span>
<span class="number">  15</span>  
<span class="number">  16</span>  
<span class="number">  17</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"calling initialise game.\n"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  18</span>   
<span class="number">  19</span>   initialise_game<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  20</span>   
<span class="number">  21</span>   <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="number">  22</span><span class="k2">}</span>
<span class="number">  23</span>
<span class="number">  24</span>
<span class="number">  25</span>
<span class="number">  26</span>
<span class="number">  27</span>
<span class="number">  28</span><span class="k1">static</span> <span class="k1">void</span> initialise_game<span class="k2">(</span><span class="k1">void</span><span class="k2">)</span>
<span class="number">  29</span><span class="k2">{</span>
<span class="number">  30</span>   <span class="k1">int</span> x, y<span class="k2">;</span>
<span class="number">  31</span>
<span class="number">  32</span>   
<span class="number">  33</span>   <span class="k1">int</span> num_display_modes<span class="k2">;</span>
<span class="number">  34</span>
<span class="number">  35</span>   <a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY_MODE"><span class="a">ALLEGRO_DISPLAY_MODE</span></a> mode<span class="k2">;</span>
<span class="number">  36</span>
<span class="number">  37</span>   <span class="k1">int</span> i<span class="k2">;</span>
<span class="number">  38</span>
<span class="number">  39</span>
<span class="number">  40</span>   <span class="k1">if</span> <span class="k2">(</span> <span class="k3">!</span><a href="http://www.allegro.cc/manual/al_init"><span class="a">al_init</span></a><span class="k2">(</span><span class="k2">)</span> <span class="k2">)</span>
<span class="number">  41</span>   <span class="k2">{</span>
<span class="number">  42</span>      <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"Could not init Allegro.\n"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  43</span>      <a href="http://www.delorie.com/djgpp/doc/libc/libc_298.html" target="_blank">exit</a><span class="k2">(</span><span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  44</span>   <span class="k2">}</span>
<span class="number">  45</span>
<span class="number">  46</span>
<span class="number">  47</span>   <span class="k1">if</span><span class="k2">(</span><span class="k3">!</span><a href="http://www.allegro.cc/manual/al_init_image_addon"><span class="a">al_init_image_addon</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span>
<span class="number">  48</span>   <span class="k2">{</span>
<span class="number">  49</span>      <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"Couldn't initialise image addon.\n"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  50</span>      <a href="http://www.delorie.com/djgpp/doc/libc/libc_298.html" target="_blank">exit</a><span class="k2">(</span><span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  51</span>   <span class="k2">}</span>
<span class="number">  52</span>
<span class="number">  53</span>   <span class="k1">if</span><span class="k2">(</span><span class="k3">!</span><a href="http://www.allegro.cc/manual/al_init_primitives_addon"><span class="a">al_init_primitives_addon</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span>
<span class="number">  54</span>   <span class="k2">{</span>
<span class="number">  55</span>       <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"couldn't init primitives addon.\n"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  56</span>   <span class="k2">}</span>
<span class="number">  57</span>
<span class="number">  58</span>
<span class="number">  59</span>
<span class="number">  60</span>   <a href="http://www.allegro.cc/manual/al_set_new_bitmap_format"><span class="a">al_set_new_bitmap_format</span></a><span class="k2">(</span>ALLEGRO_PIXEL_FORMAT_ANY_32_WITH_ALPHA<span class="k2">)</span><span class="k2">;</span>
<span class="number">  61</span>
<span class="number">  62</span>   <a href="http://www.allegro.cc/manual/al_init_font_addon"><span class="a">al_init_font_addon</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  63</span>
<span class="number">  64</span>
<span class="number">  65</span>   <span class="k1">if</span><span class="k2">(</span><span class="k3">!</span><a href="http://www.allegro.cc/manual/al_init_ttf_addon"><span class="a">al_init_ttf_addon</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span>
<span class="number">  66</span>   <span class="k2">{</span>
<span class="number">  67</span>       <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">" couldn't init ttf_addon.\n"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  68</span>       <a href="http://www.delorie.com/djgpp/doc/libc/libc_298.html" target="_blank">exit</a><span class="k2">(</span><span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  69</span>   <span class="k2">}</span>
<span class="number">  70</span>
<span class="number">  71</span>   <a href="http://www.allegro.cc/manual/al_inhibit_screensaver"><span class="a">al_inhibit_screensaver</span></a><span class="k2">(</span><span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  72</span>
<span class="number">  73</span>
<span class="number">  74</span>   <a href="http://www.allegro.cc/manual/al_install_keyboard"><span class="a">al_install_keyboard</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  75</span>
<span class="number">  76</span>   
<span class="number">  77</span>
<span class="number">  78</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_739.html" target="_blank">srand</a><span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_821.html" target="_blank">time</a><span class="k2">(</span><span class="n">0</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  79</span>
<span class="number">  80</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_OPENGL<span class="k2">)</span><span class="k2">;</span>
<span class="number">  81</span>
<span class="number">  82</span>    
<span class="number">  83</span>
<span class="number">  84</span>   FILE <span class="k3">*</span>modes <span class="k3">=</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_337.html" target="_blank">fopen</a><span class="k2">(</span><span class="s">"modes.txt"</span>, <span class="s">"w"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  85</span>
<span class="number">  86</span>   num_display_modes <span class="k3">=</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="k2">;</span>
<span class="number">  87</span>   
<span class="number">  88</span>   
<span class="number">  89</span>   <span class="k1">for</span><span class="k2">(</span>i <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span> i <span class="k3">&lt;</span> num_display_modes<span class="k2">;</span> <span class="k3">+</span><span class="k3">+</span>i<span class="k2">)</span>
<span class="number">  90</span>   <span class="k2">{</span>
<span class="number">  91</span>     
<span class="number">  92</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>i, <span class="k3">&amp;</span>mode<span class="k2">)</span><span class="k2">;</span>
<span class="number">  93</span>     
<span class="number">  94</span>     <a href="http://www.delorie.com/djgpp/doc/libc/libc_345.html" target="_blank">fprintf</a><span class="k2">(</span>modes, <span class="s">" i %d width %d, height %d. format %d, refresh rate %d\n"</span>, i, mode.width, mode.height, mode.format, mode.refresh_rate<span class="k2">)</span><span class="k2">;</span>
<span class="number">  95</span>   <span class="k2">}</span>
<span class="number">  96</span>   
<span class="number">  97</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_308.html" target="_blank">fclose</a><span class="k2">(</span>modes<span class="k2">)</span><span class="k2">;</span>
<span class="number">  98</span>   
<span class="number">  99</span>   
<span class="number"> 100</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"num display modes = %d.\n"</span>, num_display_modes<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 101</span>   
<span class="number"> 102</span><span class="k2">}</span>
</div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (William Labbett)</author>
		<pubDate>Tue, 14 Dec 2010 10:40:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>hmm this sort of reminded me that with OpenGL you can&#39;t actually set or get a specific pixel format, which means the &quot;format&quot; field is meaningless. If that&#39;s the case then it should just be removed. When I run that program I get &quot;0&quot; for each of them. Could just be uninitialized memory, which happens to be some strange value for you but 0 is pretty likely...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Tue, 14 Dec 2010 11:26:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/605811/894557#target">Arthur Kalliokoski</a> said:</div><div class="quote"><p>
I&#39;d suppose that everybody runs their desktop at the native resolution, so I&#39;d guess passing ALLEGRO_FULLSCREEN_WINDOW to a screen mode set, then using al_get_display_height() and al_get_display_width(), then setting the actual open gl mode you want would work.
</p></div></div><p>

I&#39;d suggest that solution as well. The desktop usually will be set to the native size so there&#39;s little reason not to use it. Best is probably to make it a user option though so someone with a very low-end system could configure the game to use a lower resolution.</p><p>[edit: in code]
</p><div class="source-code snippet"><div class="inner"><pre><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_OPENGL <span class="k3">|</span> ALLEGRO_FULLSCREEN_WINDOW<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_create_display"><span class="a">al_create_display</span></a><span class="k2">(</span><span class="n">640</span>, <span class="n">480</span><span class="k2">)</span><span class="k2">;</span> <span class="c">/* size given here is ignored */</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Tue, 14 Dec 2010 18:38:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/605811/894662#target">Elias</a> said:</div><div class="quote"><p> I&#39;d suggest that solution as well
</p></div></div><p>I don&#39;t think William wants to set the exact desktop mode, but just one that matches the aspect ratio.</p><p>So you might have two main resolutions, one for 4:3 and another for widescreen. This is more convenient for tile/sprite based games than trying to support any resolution.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Tue, 14 Dec 2010 22:23:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code snippet"><div class="inner"><pre><span class="k1">bool</span> al_get_display_resolution<span class="k2">(</span> <span class="k1">int</span> <span class="k3">&amp;</span>w, <span class="k1">int</span> <span class="k3">&amp;</span>h <span class="k2">)</span>
<span class="k2">{</span>
   <a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a> <span class="k3">*</span>display <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_current_display"><span class="a">al_get_current_display</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
   <span class="k1">if</span> <span class="k2">(</span> <span class="k3">!</span>display <span class="k2">)</span>
      <span class="k1">return</span> <span class="k1">false</span><span class="k2">;</span>
   w <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_display_width"><span class="a">al_get_display_width</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k2">;</span>
   h <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_display_height"><span class="a">al_get_display_height</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k2">;</span>
   <span class="k1">return</span> <span class="k1">true</span><span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Don Freeman)</author>
		<pubDate>Fri, 17 Dec 2010 00:20:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>He doesn&#39;t want the current resolution. He wants the resolution before setting the display.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Fri, 17 Dec 2010 01:34:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Shouldn&#39;t the native resolution typically be the maximum resolution supported by the display?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Fri, 17 Dec 2010 05:40:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/605811/895152#target">Evert</a> said:</div><div class="quote"><p> Shouldn&#39;t the native resolution typically be the maximum resolution supported by the display?<br /> </p></div></div><p>

Not always with CRTs, but for LCDs &amp;&amp; LEDs I&#39;d say so. But theres always that small bunch that still use CRTs <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><p>Because with CRTs sometimes higher resolutions were supported at a cost of a headache-causing 60 Hz refresh rate.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Fri, 17 Dec 2010 06:45:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/605811/895158#target">jmasterx</a> said:</div><div class="quote"><p>Because with CRTs sometimes higher resolutions were supported at a cost of a headache-causing 60 Hz refresh rate.</p></div></div><p>Indeed, if you were trying to set a decent mode on a CRT, you&#39;d want to skip any of the modes that only show up as 60hz, unless ALL of the modes are only 60hz... That&#39;d be one crappy CRT.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 17 Dec 2010 10:05:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I thought the limit on refresh rate was to keep down the clock rates for pixel sets?  If the low res refresh rates were the same as the high res rates, the clocks per pixel would be much lower, so you could boost the refresh rate without making it impossible for the transistorized circuits to change color from one pixel to the next.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Fri, 17 Dec 2010 10:10:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/605811/895183#target">Arthur Kalliokoski</a> said:</div><div class="quote"><p>I thought the limit on refresh rate was to keep down the clock rates for pixel sets?</p></div></div><p>I don&#39;t know about you, but if I set a CRT to 60hz, it gives me awful headaches. The flickering is just too much.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 17 Dec 2010 10:22:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Back in the day, 60hz was fine, because that&#39;s all you had!  Never had an EGA monitor?  n00bs!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Fri, 17 Dec 2010 10:25:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/605811/895190#target">Arthur Kalliokoski</a> said:</div><div class="quote"><p>Back in the day, 60hz was fine, because that&#39;s all you had!</p></div></div><p>
For lower resolution modes, it was ok. For higher resolutions, not so much.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Fri, 17 Dec 2010 12:33:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/605811/895203#target">Evert</a> said:</div><div class="quote"><p>For lower resolution modes, it was ok. For higher resolutions, not so much.</p></div></div><p>I guess it depends on what you mean by &quot;lower resolutions&quot;. My old 15&quot; CRT back in the day gave me insane headaches at 1024x768.</p><p>My newer 20&quot;+ CRTs all do modes higher than 1600x1200, but I dare not set them, for there madness lies.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 17 Dec 2010 13:37:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/605811/895205#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p>I guess it depends on what you mean by &quot;lower resolutions&quot;. My old 15&quot; CRT back in the day gave me insane headaches at 1024x768.</p></div></div><p>
640x480 or 800x600 is what I was thinking of when I said that, which is what my CRT could do at &gt;60Hz in the mid to late 90s. My last one did 1024x768 at 85Hz or something like that, which was also fine.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Fri, 17 Dec 2010 15:17:35 +0000</pubDate>
	</item>
</rss>
