<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Patch for _al_d3d_get_display_mode</title>
		<link>http://www.allegro.cc/forums/view/611378</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 18 Nov 2012 14:55:40 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I suggest a patch for <span class="source-code">_al_d3d_get_display_mode</span> that would retreive current settings when -1 is passed (which works that way with OpenGL on Windows natively):
</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"> 2862</span>    <span class="k1">int</span> adapter <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_new_display_adapter"><span class="a">al_get_new_display_adapter</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 2863</span>    <span class="k1">if</span> <span class="k2">(</span>adapter <span class="k3">&lt;</span> <span class="n">0</span><span class="k2">)</span>
<span class="number"> 2864</span>        adapter <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 2865</span>
<span class="number"> 2866</span>    <span class="c">/* Obtain current settings */</span>
<span class="number"> 2867</span>    <span class="k1">if</span> <span class="k2">(</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_470.html" target="_blank">index</a> <span class="k3">=</span><span class="k3">=</span> <span class="k3">-</span><span class="n">1</span> <span class="k2">)</span>
<span class="number"> 2868</span>    <span class="k2">{</span>
<span class="number"> 2869</span>        <span class="k1">if</span> <span class="k2">(</span> _al_d3d-&gt;GetAdapterDisplayMode <span class="k2">(</span> adapter, <span class="k3">&amp;</span>display_mode <span class="k2">)</span> <span class="k3">!</span><span class="k3">=</span> D3D_OK <span class="k2">)</span>
<span class="number"> 2870</span>            <span class="k1">return</span> NULL<span class="k2">;</span>
<span class="number"> 2871</span>        mode-&gt;width <span class="k3">=</span> display_mode.Width<span class="k2">;</span>
<span class="number"> 2872</span>        mode-&gt;height <span class="k3">=</span> display_mode.Height<span class="k2">;</span>
<span class="number"> 2873</span>        mode-&gt;format <span class="k3">=</span> <span class="c">/* display_mode.Format */</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 2874</span>        mode-&gt;refresh_rate <span class="k3">=</span> display_mode.RefreshRate<span class="k2">;</span>
<span class="number"> 2875</span>        <span class="k1">return</span> mode<span class="k2">;</span>
<span class="number"> 2876</span>    <span class="k2">}</span>
</div></div><p>
I&#39;m havinga trouble with figuring relation between <span class="source-code">d3d_formats</span> and  <span class="source-code">allegro_formats</span> to set up <span class="source-code">format</span> field properly though, so it needs to be replaced with something meaningful.</p><p>. . .</p><p>Is this even the place to post it?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Raidho36)</author>
		<pubDate>Sun, 04 Nov 2012 18:25:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you&#39;ve already created a display, you can get all of this information from al_get_display_width/height/format/refresh_rate. Or is this supposed to get the desktop mode? If so, are you sure you can do that this way? Looks fishy to me. Have you tried it?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sun, 04 Nov 2012 19:33:28 +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/611378/969529#target">Trent Gamblin</a> said:</div><div class="quote"><p> If you&#39;ve already created a display
</p></div></div><p>Well, that&#39;s exactly the reason why I suggest this patch: you can&#39;t get current monitor settings without creating a window first, and even if you create one you submit width and height in advance of creating it which renders obtaining current mode meaningless - it is the one you just set up. In fullscreen mode best luck if it doesn&#39;t crash, which is quite possible. </p><p>Once again, I want to know monitor current resolution in advance of creating a fullscreen display, so I could create it without changing monitor settings in real fullscreen mode.</p><p>The reason for that is very odd, specifically I run a videocapture software that would halt receiving frames if monitor mode has changed in any fashion. Apart from being inconveinence itself, I have software&#39;s viewport on another (dedicated) monitor specifically to be always monitored, but when monitor mode changes it halts receiving new frames from device and the picture freezes and it have to be manually restarted.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> Looks fishy to me.<br /> Have you tried it?
</p></div></div><p>According to D3D manual it&#39;s perfectly fine. Though no, I had not. I don&#39;t work with D3D without big reasons to. Plus, I would need massive amount of work to get Allegro to compile because I don&#39;t have most of required tools.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Raidho36)</author>
		<pubDate>Mon, 05 Nov 2012 22:47: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/611378/969578#target">Raidho36</a> said:</div><div class="quote"><p> Once again, I want to know monitor current resolution in advance of creating a fullscreen display, so I could create it without changing monitor settings in real fullscreen mode.</p></div></div><p>Lots of games have a little dialog box thing on startup to ask which mode etc.  It&#39;s not that hard to switch from a generic 640x480 window to a specific fullscreen mode, is it?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Mon, 05 Nov 2012 22:58:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You don&#39;t seem to get the idea. I don&#39;t want this to set up manually. I want this to be obtained from OS or video driver or whatever.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Raidho36)</author>
		<pubDate>Mon, 05 Nov 2012 23:06:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;d be rather miffed if a program went to a fullscreen mode right off the bat with no way to change it.  Right now I&#39;m watching a movie in a <i>window</i> so I can see when a new post shows up here.  Earlier today I was playing a game in a window for the same reason.  And I have several games that can set fullscreen modes that the monitor won&#39;t display.  I have to admit I&#39;m using an cheap SVGA cable instead of an HDMI cable.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Mon, 05 Nov 2012 23:15:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What you need is ALLEGRO_FULLSCREEN_WINDOW then.</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>some_other_flags <span class="k3">|</span> ALLEGRO_FULLSCREEN_WINDOW<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>d <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><span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

Now you have a fullscreen mode the same as the current monitor resolution. You can get the size after this by:</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">int</span> width <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>d<span class="k2">)</span><span class="k2">;</span>
<span class="k1">int</span> height <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>d<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

If that&#39;s not good enough, we need a new function, as the one you&#39;re modifying is internal and for D3D only.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Tue, 06 Nov 2012 02:53:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So an API like:</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">enum</span> <span class="k2">{</span> ALLEGRO_DEFAULT_MONITOR <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span> <span class="k2">}</span>
<span class="k1">int</span> al_get_monitor_width<span class="k2">(</span><span class="k1">int</span> monitor_id<span class="k2">)</span><span class="k2">;</span>
<span class="k1">int</span> al_get_monitor_height<span class="k2">(</span><span class="k1">int</span> monitor_id<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

?</p><p>EDIT: I also hate anything that goes to fullscreen by default, BTW.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Luiji99)</author>
		<pubDate>Tue, 06 Nov 2012 05:46:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Have you tried:</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> info<span class="k2">;</span>

<span class="k1">for</span><span class="k2">(</span><span class="k1">int</span> i <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span> i <span class="k3">&lt;</span> <a href="http://www.allegro.cc/manual/al_get_num_video_adapters"><span class="a">al_get_num_video_adapters</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span> i<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span> <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>i, <span class="k3">&amp;</span>info<span class="k2">)</span><span class="k2">;</span>
   <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"monitor[%i]: %ix%i"</span>, info.x2 <span class="k3">-</span> info.x1, info.y2 <span class="k3">-</span> info.y1<span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 06 Nov 2012 06:14:52 +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/611378/969610#target">Luiji99</a> said:</div><div class="quote"><p>
So an API like:
</p></div></div><p>

Something like that but may not be able to use an enum, but an integer instead. It may have to take a struct pointer and return values in that so you could get various different things like refresh rate and color depth.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Tue, 06 Nov 2012 06:46:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Fjellstrom&#39;s API should work. Also, my use of enum was really just defining constant. I prefer those over <span class="source-code"><span class="p">#define</span></span> and <span class="source-code"><span class="k1">const</span> <span class="k1">int</span></span> directives. Enumerating displays wouldn&#39;t make sense.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Luiji99)</author>
		<pubDate>Tue, 06 Nov 2012 08:33:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>&quot;Thomas&#39;s api&quot; already exists but it won&#39;t tell you the current resolution, just all of the supported ones. You can guess the biggest one but I&#39;d rather not guess. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Tue, 06 Nov 2012 09:17:43 +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/611378/969638#target">Trent Gamblin</a> said:</div><div class="quote"><p>&quot;Thomas&#39;s api&quot; already exists but it won&#39;t tell you the current resolution, just all of the supported ones. You can guess the biggest one but I&#39;d rather not guess. </p></div></div><p>Nope. That api tells you the current monitor geometry/geometries. Gives you the rectangle of each plugged in monitor in its current mode. The mode stuff gives you lists of modes.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 06 Nov 2012 09:25:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Oops, I had them mixed up.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Tue, 06 Nov 2012 09:28: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/611378/969582#target">Arthur Kalliokoski</a> said:</div><div class="quote"><p> I&#39;d be rather miffed if a program went to a fullscreen mode right off the bat with no way to change it.
</p></div></div><p>You don&#39;t get it. This feature is handy by itself. Speaking of utilizing it, I don&#39;t force fullscreen whatsoever, instead I want there to be &quot;fullscreen&quot; button that would take you to the (real) fullscreen mode right away without changing monitor settings. See, I don&#39;t want player to get into monitor settings stuff. I want it to be &quot;just works&quot;. Also I assume that current monitor settings are optimal and player don&#39;t normally want to change them to play the game. Either way, I don&#39;t need to change monitor settings because to my games exact monitor resolution is irrelevant: ones use something about 256x224 resolution which is not supported by any monitor whatsoever therefore needs to be emulated, and others scale smoothly that only noticeable difference is smaller or bigger pixels. 
</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/611378/969595#target">Trent Gamblin</a> said:</div><div class="quote"><p> What you need is ALLEGRO_FULLSCREEN_WINDOW then.
</p></div></div><p>No. I want real fullscreen mode, not a somewhat similar replacement of it.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> we need a new function
</p></div></div><p>No, we practically don&#39;t. It is enough to build in a feature of using <span class="source-code"><span class="k3">-</span><span class="n">1</span></span> to get current settings. In another thread I described as I figured out that with OpenGL under Windows you can fetch current settings by passing <span class="source-code"><span class="k3">-</span><span class="n">1</span></span> as mode index number. Obviously that&#39;s not enough to even think of actually using it because only OpenGL+Windows would handle that. This is why I suggest a patch that would make D3D behave similar way. To make it entirely usable there&#39;s still need to make it also work with Mac (which I&#39;m not familiar with) and Linux (which unit&#39;s code is real a mess, I can barely comprehend one third of it, once again comments are only exist by name). I&#39;m not confident, but I&#39;m pretty sure that it is entirely possible to get current monitor settings on any OS. <br />Well, maybe having a separate function for that is kind of more straightforward than using specific keys to make function do specific and not really related job.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> So an API like</p><p> Have you tried
</p></div></div><p>I can&#39;t really tell if that&#39;s getting desktop dimensions related to specified monitor or real monitor dimensions. Chances are that they&#39;re different, but they still present. For some machines, this is default. I.e. when monitor size is 800x480 but desktop is 800x600 and viewport slides across the desktop following the mouse. Obviously, setting 800x600 mode on such monitor will crash the program. Either way, monitor number and device number don&#39;t have to match, which renders this whole approach useless on multi-monitor machines. That&#39;s exactly the reason why I even started this whole thing in the first place.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Raidho36)</author>
		<pubDate>Tue, 06 Nov 2012 12:50:26 +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/611378/969655#target">Raidho36</a> said:</div><div class="quote"><p>I can&#39;t really tell if that&#39;s getting desktop dimensions related to specified monitor or real monitor dimensions. </p></div></div><p>Its not in mm <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /> so its the resolution of the monitor as it currently is.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>when monitor size is 800x480 but desktop is 800x600 and viewport slides across the desktop following the mouse.</p></div></div><p>I don&#39;t know that we care to support viewport modes.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Obviously, setting 800x600 mode on such monitor will crash the program.</p></div></div><p>Only if you don&#39;t check to see if the display creation failed before using the display.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Either way, monitor number and device number don&#39;t have to match, which renders this whole approach useless on multi-monitor machines. </p></div></div><p>Yes they do. The api is a bit funnily named, but monitors are equivalent to adapters in A5.</p><p>I had a hand in the multi-monitor support, it was somewhat of a priority for me since I have a dual monitor setup.</p><p>append: If you look at the <span class="source-code"><a href="http://www.allegro.cc/manual/ALLEGRO_MONITOR_INFO"><span class="a">ALLEGRO_MONITOR_INFO</span></a></span> struct, it returns the <i>rectangle</i> of each monitor. Meaning you can get both offset, and size of each monitor in relation to the larger viewport. This can be important with multi monitor.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 06 Nov 2012 13: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/611378/969661#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p> so its the resolution of the monitor as it currently is
</p></div></div><p>Can you point out precisely at the (possibly all 6) function that perform such measurement for certain (possibly all 6) video driver? Because as I said, it is entirely possible that it would be desktop dimensions rather than monitor dimensions and it is also entirely possible that those two doesn&#39;t match.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> Only if you don&#39;t check to see if the display creation failed before using the display.
</p></div></div><p>It crashes before display creation function returns.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> Yes they do.
</p></div></div><p>No they don&#39;t. My monitor #0 is connected to device #1 and monitor #1 connected to device #0. Only because I have two devices, because they could&#39;ve been, like, four of them if I had 2 GPUs. That&#39;s the reason why I have even discovered the fact that they don&#39;t have to match in the first place. I&#39;m very confident about the fact that 0 doesn&#39;t match 1. 
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> I have a dual monitor setup
</p></div></div><p>Let me guess, they&#39;re both same dimensions? Well, even if you have complicated setup that involves one regular monitor and another being supermegahd-portrait monitor and all works fine for you, it doesn&#39;t work that way for me, so you can&#39;t assume it works correctly. It&#39;s just you being lucky to have it works.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> append
</p></div></div><p>Yes, thanks. I was aware of it, though I would not use it because I only use single-display layout. Mostly because this is default setup. For some games having another screen to display some current data would be really handy, but due to mentioned earlier reason I shouldn&#39;t implement that.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Raidho36)</author>
		<pubDate>Tue, 06 Nov 2012 14:37:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>On my tablet, so I&#39;m skipping the inline quoting.</p><p>The monitor info <i>should</i> give you the current rectangle of the queried monitor. Yes it might be possible that the desktop and monitor modes don&#39;t mach but that is very unlikely, and I somewhat doubt the code returns the desktop size. I know it doesn&#39;t on X as I wrote that code.</p><p>Mode sets shouldn&#39;t crash. That&#39;s a bug and should be fixed.</p><p>When allegro talks about monitors and adapters, its its own index based on the order it probes or gets them from the OS. This process is inherently platform specific, and neigh impossible to make perfectly logical. I&#39;ve had a setup where screen 1 was left of screen 0. Meaning screen 1 actually has a negative offset Allegro really can&#39;t do anything about that. The Allegro <i>adapter</i> and <i>monitor</i> APIs use (or should use) the same index to mean the same physical display. To allegro they are the same thing. An adapter in allegro is just a unique output, not some kind of identifier for an individual graphics card that may have <i>many</i> separate displays attached.</p><p>I&#39;ve had a few different multi-monitor setups. My oldest one used a 17&quot; LCD @ 1280x1024, and a 21&quot; CRT @ 1600x1200. Left lots of unused/unviewable space. But currently yes, I have 2 monitors of the same dimension. What the monitor info should give you in either case is the physical rectangle of each monitor based on its mode and position in the larger combined screen space. If the functions in the monitor section of the display docs <i>don&#39;t</i> agree on what their index arg means, its a bug and needs to be fixed. What I&#39;m not sure of right now is if the display mode functions act on the &#39;new display adapter&#39; setting or not. If they do, then it&#39;s index should also be consistent with the monitor functions. Something makes me think they need a current display set though.</p><p>If there are no serious bugs in the multi-monitor support, then there is no reason not to support using multiple monitors in your game/app. You will absolutely need to make that configurable though, many things can make your screens be detected in a different order, ie: The GPU driver, if the os supports parallel device probing (ie: Linux), and maybe if the moon is full. One person&#39;s monitor/adapter 0 may well be someone else&#39;s monitor/adapter 4. And there is no way to solve this as far as I&#39;m aware.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 06 Nov 2012 16:00: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/611378/969667#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p> On my tablet, so I&#39;m skipping the inline quoting.
</p></div></div><p>It forbids you from using right angle brackets? Or it deliberately hides them beneath dozen of sub-menus just to be inconvenient? Well sorry about that. <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /> 
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> <i>should</i>
</p></div></div><p>Exactly. It <i>should</i>. But it&#39;s not guaranteed. And on top of that, when you create a window you specify device, not a monitor, which, as I already estabilished, don&#39;t have to match. You can&#39;t create a window on specific <i>monitor</i> not <i>device</i> anyway.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> but that is very unlikely
</p></div></div><p>Doesn&#39;t mean that such minor inconvenience to developer should be big inconvenience to end user.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> Mode sets shouldn&#39;t crash. That&#39;s a bug and should be fixed.
</p></div></div><p>Well, okay, but it is unrelated to ability to obtain current monitor settings.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> as I wrote that code
</p></div></div><p>Can you please explain how that hell&#39;s clockwork performs? I can&#39;t track it any further than down to getting system driver object set up function, which being completely opaque to me.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> its its own index based on the order it probes or gets them from the OS
</p></div></div><p>Well, obviously. And OS enumerates them in order the hardware provides. And for some reason, the OS I use (W7) doesn&#39;t think it&#39;s convenient for monitor number to match output device number. And something is giving me big hints that monitor #0 is the &quot;current&quot; in terms of which one has focused desktop.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> I&#39;m not sure of right now is if the display mode functions act on the &#39;new display adapter&#39; setting or not. 
</p></div></div><p>I have tested it and it&#39;s not relevant.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> If there are no serious bugs in the multi-monitor support, then there is no reason not to support using multiple monitors in your game/app.
</p></div></div><p>There&#39;s a serious bug with Linux multimonitor support that completely forbids using more than one monitor. At least the manual says so. Plus none of mobile devices can possibly have any more than just one monitor. 
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> there is no way to solve this as far as I&#39;m aware
</p></div></div><p>There is. With using of obtaining current monitor mode by passing device number, which is (I am fairly sure of) entirely possible with any OS.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Raidho36)</author>
		<pubDate>Tue, 06 Nov 2012 16:51:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Isn&#39;t it possible to get multi-monitor support on iOS via Apple TV?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Luiji99)</author>
		<pubDate>Tue, 06 Nov 2012 21:07:19 +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/611378/969668#target">Raidho36</a> said:</div><div class="quote"><p>It forbids you from using right angle brackets? Or it deliberately hides them beneath dozen of sub-menus just to be inconvenient? Well sorry about that. </p></div></div><p>The right angle brackets aren&#39;t <i>too</i> bad, but add that to the copy and paste mechinism being annoying as well, and I didn&#39;t want to spend the time on it.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Exactly. It should. But it&#39;s not guaranteed.</p></div></div><p>It is, or its a bug.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>And on top of that, when you create a window you specify device, not a monitor, which, as I already estabilished, don&#39;t have to match. You can&#39;t create a window on specific monitor not device anyway.</p></div></div><p>They mean the same thing to allegro. If they didn&#39;t it would be horribly broken. Again allegro has NO concept of &quot;GPU&quot;. The &quot;Device&quot; you&#39;re talking about is the monitor.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Doesn&#39;t mean that such minor inconvenience to developer should be big inconvenience to end user.</p></div></div><p>Games and apps have system requirements. One of allegro&#39;s is to not use panning modes <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /> Well, not really. Just I don&#39;t think its been tested, and I don&#39;t think any of the devs give a rats-<span class="cuss"><span>ass</span></span> about it. I sure don&#39;t.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Can you please explain how that hell&#39;s clockwork performs? I can&#39;t track it any further than down to getting system driver object set up function, which being completely opaque to me.</p></div></div><p>I didn&#39;t write all of the X code. But if you&#39;re looking for the multi monitor and fullscreen support code, its in the xrandr.c and xfullscreen.c files under src/x of the source release. Both the xrandr and xinerama code will hand you the absolute rectangle of the given monitor, regardless if its panning or not (at least I&#39;m about 90% sure on that, again I haven&#39;t tested panning and I don&#39;t want to either).</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Well, obviously. And OS enumerates them in order the hardware provides. And for some reason, the OS I use (W7) doesn&#39;t think it&#39;s convenient for monitor number to match output device number. And something is giving me big hints that monitor #0 is the &quot;current&quot; in terms of which one has focused desktop.</p></div></div><p>Now try swapping your monitors. And tell windows that the now #1 monitor is on the left (or where ever you put your primary monitor) and it is the primary monitor. Now your #1 is actually the primary and the one you might expect to be #0 but isn&#39;t.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>There&#39;s a serious bug with Linux multimonitor support that completely forbids using more than one monitor.</p></div></div><p>Bullcrap. Last I checked it worked fine. And I can&#39;t see where in the <a href="http://docs.liballeg.org">docs</a> that is written. I and Peter Wang have tested it pretty extensively, or at the very least, he&#39;s done a fair bit of work on that code as well. If it doesn&#39;t work, this is the first I&#39;ve heard of it. Certain WMs like to make things hard, but we can&#39;t really do anything about broken WMs.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Plus none of mobile devices can possibly have any more than just one monitor.</p></div></div><p>iOS has AirPlay, which I think trentg has working with one of his games. I&#39;m not sure that code is stable atm, I recall someone having issues with it recently. Android currently doesn&#39;t have a built in api to support multiple displays, but some devices come with their own SDK which we could probably add support for if someone wanted to do the leg work.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>here is. With using of obtaining current monitor mode by passing device number, which is (I am fairly sure of) entirely possible with any OS.</p></div></div><p>This is not what I was talking about. The problem that isn&#39;t solvable (as far as I&#39;m concerned) is making complete sense out of the order and positions of the monitors the OS gives you. You just can&#39;t expect #0 to be the primary, &quot;in your face&quot; monitor.</p><p>I should note (again), that the index retrieved from <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_new_display_adapter"><span class="a">al_get_new_display_adapter</span></a></span> is the same index you pass to <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>. There is no need to extend <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_display_mode"><span class="a">al_get_display_mode</span></a></span> since <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> does the exact same thing, with the exact same data.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 06 Nov 2012 23:17:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>First:</p><p>Thomas, there&#39;s an indication of &quot; Fix multi monitor support once NVidia&#39;s driver isn&#39;t horribly broken&quot; in the X11 paragraph of the Allegro5 TODO list you link in your sig.</p><p>I think that&#39;s terribly outdated but still...</p><p>Second:<br />Don&#39;t wan&#39;t to derail the thread in OTverse but....is there a way to get on WHICH adapter your display is being created/is currently shown?</p><p>Not that I am anywhere close to test it, but in the docs I wasn&#39;t able to find info on that (prolly my bad eh) and this thread is vaguely related...</p><p>EDIT: of course it was my bad, i guess <tt>al_get_new_display_adapter()</tt> does it, right?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (pkrcel)</author>
		<pubDate>Wed, 07 Nov 2012 17:05:05 +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/611378/969753#target">pkrcel</a> said:</div><div class="quote"><p>Thomas, there&#39;s an indication of &quot; Fix multi monitor support once NVidia&#39;s driver isn&#39;t horribly broken&quot; in the X11 paragraph of the Allegro5 TODO list you link in your sig.</p></div></div><p>Pretty much, the NVidia binary driver recently got proper XRandR support, and the ability to control each screen attached, rather than the old BigDesktop <span class="cuss"><span>bull<span class="cuss"><span>shit</span></span></span></span> they claimed was the only way they could possibly do it under linux without certain patches to the linux kernel, that haven&#39;t quite happened yet.</p><p>The nice thing about the way we put together the multimon X code, was that it was made to default to XRandR if it can, with some heuristics that tell the XRandR code to fail to initialize if it detected settings it didn&#39;t like. Like if the Xinerama an XRandR settings don&#39;t match (ie: with the older NV binary drivers, you&#39;d get one big XRandR screen, and more than one Xinerama screen in the Big Desktop style setup). With the old NV driver, you get dumb Xinerama support, and no way to set modes (because in NV&#39;s big desktop mode, there is no way to change modes on individual monitors, can only change both at the same time using the combined mode of all monitors, its a mess). With the new NV drivers, you get full XRandR support with full mode setting capabilities on all attached screens <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> With no stupid &quot;if driver == nvidia&quot; hacks that have to be removed. woot.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Don&#39;t wan&#39;t to derail the thread in OTverse but....is there a way to get on WHICH adapter your display is being created/is currently shown?</p></div></div><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>EDIT: of course it was my bad, i guess al_get_new_display_adapter() does it, right?</p></div></div><p>Yup. That will tell you which &quot;adapter&quot; or monitor your display will be created on. That said, the default is probably -1 or something, which means Allegro will try to intelligently guess at which is the best default or primary monitor. The X code actually tries some really odd looking code to try and guess at it. It&#39;s a pain, but now that XRandR seems to be widely enough supported, we may be able to never have to run much of the evil multi-mon X code ever again \o/ And XRandR I think has a way to tell which is the primary screen (not 100% sure atm, but I think so). Though I&#39;m not entirely sure that XRandR&#39;s primary is the same thing as your Desktop Environment&#39;s Primary. If it isn&#39;t, well we&#39;ll have to figure out some way of asking the DE for this info, rather than the crude hacks I put in.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Wed, 07 Nov 2012 22:04:02 +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/611378/969664#target">Raidho36</a> said:</div><div class="quote"><p>
It crashes before display creation function returns.
</p></div></div><p>
I guess <a href="http://www.allegro.cc/forums/thread/607885">this bug</a> hasn&#39;t been fixed yet <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Oscar Giner)</author>
		<pubDate>Wed, 07 Nov 2012 22:31:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sorry for continuing my OT, but I was looking around A5 implementation (just out of curiosity)<br />About the 2nd part of my question, how to determine the adapter on which the Display is currently shown...I&#39;ve found that under D3D you can do this cast (thou ALLEGRO_DISPLAY_WIN is inaccessible through the Allegro5 API, is it?)<br />      <br /><span class="source-code">ALLEGRO_DISPLAY_WIN <span class="k3">*</span>win_display <span class="k3">=</span> <span class="k2">(</span>ALLEGRO_DISPLAY_WIN <span class="k3">*</span><span class="k2">)</span>display<span class="k2">;</span></span></p><p>I guess this means the adapter is being stored in the DISPLAY_WIN superstruct upon creation....haven&#39;t checked...but is it UPDATED by the sytem interface if moved onto another monitor? </p><p>I suspect not, but still this info is not exposed by the API anyway....so I tought that the only way to check the monitor in which the display is currently shown is by comparing the window position (got thorugh <tt>al_get_window_position</tt> ) to the x-y coordinates you get from <tt>al_get_monitor_info</tt> and storing the corresponding adapter index.</p><p>Is that it, or am I missing/misreading something?</p><p>BTW, having looked a bit into it it seems that a function that wraps it up and returns the current desktop mode could come in handy, but I haven&#39;t understood if A5 supports (meaning &quot;detects&quot; prolly) viewportmodes or not.</p><p>EDIT: fixed horrible typos. <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (pkrcel)</author>
		<pubDate>Thu, 08 Nov 2012 05:24:22 +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/611378/969694#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p> Now try swapping your monitors.
</p></div></div><p>No. I don&#39;t want to change my hardware configuration just to play a game unless it&#39;s a game that I want to play really bad. If that&#39;s about requirements then they should be adequate. Having monitors plugged in specific way does not qualifies as such. As for &quot;monitor&quot; number, you can&#39;t rely on such data under Windows, because it does whatever the hell it wants with it. I would&#39;ve provided an evidence, but all of the sudden linker started to miss <span class="source-code">_al_set_new_display_flags</span> and complain about it, which makes for an obvious conclusion that the reason is because Allegro&#39;s binaries are for 4.6.2. and I have 4.7.2, so I tried to install an appropriate version which killed my compiler at all and after several futile attempts to get it to work right I just have quit that and because without that specific function it works fine, I just install newest version and use it, and each installation takes long to accomplish which is why I couldn&#39;t even start anything for many hours, but now that it is installed and <i>oh come on you&#39;ve got to be kidding</i>, the freaking thing requires C++ libraries to run while being written in C so I assume it only requires C-only compiler installation which I have, but just because it has (precisely) three C++ files I can&#39;t get freaking thing to run because there&#39;s a bunch of C++ libraries missing, which then turned out to be the reason why compiler even complained in the first place (Allegro&#39;s build compiler version is irrelevant unless there&#39;s static linking, good ideas come late) that made me go through all this, what the hell? Figures that this is because GDI+ and D3D doesn&#39;t have C interface, so all files working with them must be C++. I know that Microsoft had never followed any standards whatsoever, but forcing people to use specific things? Any library ever must have C interface, period. It might also have loads of other interfaces, but C interface is mandatory. This is ridiculous. Come to think of forcing, Microsoft does that since forever and right now the scale is ultra-massive, so that should&#39;ve not surprised me at all.<br />Anyway, would you kindly upload A5 build for mingw-4.7.2 plox, because this GCC version is default now. 
</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/611378/969759#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p> Bullcrap. <br /> NVidia binary driver recently got proper XRandR support
</p></div></div><p>Well, good to know that. One problem less. But I clearly remember that I have read it somewhere, and it&#39;s either manual or sources.
</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/611378/969694#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p> iOS has AirPlay
</p></div></div><p>Oh I didn&#39;t knew that. I don&#39;t follow Apple products.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> I should note (again), that the index retrieved from al_get_new_display_adapter is the same index you pass to al_get_monitor_info.
</p></div></div><p>The only problem, as I mentioned earlier, is that Windows disagrees with you about that. Either way, it is true that you cannot assume physical locations of monitors. But all OS has something like &quot;default device&quot;. It is the one which has login screen, for example. It is safe to assume that this device is the best place to put your window on, or to occupy it&#39;s entire space for a fullscreen mode. 
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> There is no need to extend <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_display_mode"><span class="a">al_get_display_mode</span></a></span> since <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> does the exact same thing, with the exact same data.
</p></div></div><p>No. Prior fetches all data related to an output device (with D3D also fetches color mode), while latter only fetches desktop rectangle, which is not even guaranteed to have valid dimensions.
</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/611378/969661#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p> The api is a bit funnily named
</p></div></div><p>You got point. It should be renamed to &quot;desktop&quot; rather than &quot;monitor&quot; in future releases.</p><p>Once again, it&#39;s only a couple of lines of code. Maybe some more for Linux, but it&#39;s still not like someone would need to write a whole subsystem from scratch. And it&#39;s not like &quot;there you go my idea go do it&quot;, I&#39;m trying to contribute with thatever I can supply. As I said, this feature is handy by itself, so all of this <b>DUNNEADIT</b> attitude does not apply.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Raidho36)</author>
		<pubDate>Thu, 08 Nov 2012 10:59:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve finally gotta ask. What game is it that your creating that uses more than one desktop?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Luiji99)</author>
		<pubDate>Thu, 08 Nov 2012 11:07:28 +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/611378/969801#target">Raidho36</a> said:</div><div class="quote"><p>No. I don&#39;t want to change my hardware configuration just to play a game unless it&#39;s a game that I want to play really bad. </p></div></div><p>Dude... That wasn&#39;t what I was saying. I was trying to explain how hard/impossible it is to properly number screens.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>As for &quot;monitor&quot; number, you can&#39;t rely on such data under Windows, because it does whatever the hell it wants with it.</p></div></div><p>Indeed, and thats what I&#39;ve been saying all along.</p><p>What we have is what you get. You can query the attached+enabled screens, and get their geometry. What more do you need?</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>The only problem, as I mentioned earlier, is that Windows disagrees with you about that.</p></div></div><p>If that&#39;s the case, then in my opinion, that&#39;s a bug in allegro&#39;s windows code.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>But all OS has something like &quot;default device&quot;. It is the one which has login screen, for example. It is safe to assume that this device is the best place to put your window on, or to occupy it&#39;s entire space for a fullscreen mode.</p></div></div><p>I agree. That&#39;s a bit of an oversight in allegro&#39;s code imo. The default of -1 for the current adapter should create the display on the primary monitor. That&#39;s about the only thing that makes sense to me.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>No. Prior fetches all data related to an output device (with D3D also fetches color mode),</p></div></div><p>What exactly would you need that for <i>before</i> you create your display? Allegro will happily default to the current colordepth iirc, which is generally the best one to use.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> while latter only fetches desktop rectangle, which is not even guaranteed to have valid dimensions.</p></div></div><p>It should fetch the screen&#39;s actual size/mode, not the desktop size. 99% of the time these are the same. If they aren&#39;t... well, that sucks.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> As I said, this feature is handy by itself, so all of this DUNNEADIT attitude does not apply.</p></div></div><p>I don&#39;t see the point of it myself. It&#39;s also extending an already defined function to doing something it wasn&#39;t meant to do.</p><p>Maybe a <span class="source-code">al_get_monitor_mode</span> function would make sense, if you absolutely need all of the extra info that <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> doesn&#39;t include. But then, you can always just get that info after you create a display. Sooo. Yeah. I personally need some more convincing. I have my doubts as to Peter thinking this patch is a good idea in its current form.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Thu, 08 Nov 2012 11:14:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Concerning this:</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/611378/969804#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p>This is not what I was talking about. The problem that isn&#39;t solvable (as far as I&#39;m concerned) is making complete sense out of the order and positions of the monitors the OS gives you. You just can&#39;t expect #0 to be the primary, &quot;in your face&quot; monitor.</p></div></div><p>

I did a little experiment with in my office setup (Win7 Laptop with attached an external 16:9 Philips 17&quot; LCD - Allegro 5.1.4 binary precompiled).</p><p>Once you have more than 1 monitor plugged in, windows 7 lets you setup your &quot;primary&quot; monitor at will with a checkbox &quot;This is my primary monitor&quot; and this has (to my limited observations) the following effetcs:</p><p>   - places the taskbar on that monitor<br />   - top-left corner of that monitor becomes the orgin of the viewport axes (0,0)</p><p>Launcing allegro in these conditions has the first index [0] adapter to be always the &quot;This is my primary monitor&quot; checked display. </p><p>Independent on how the OS enumerates them, or so it seems: they are numbered &quot;1&quot; and &quot;2&quot;, and when &quot;2&quot; is the OS primary monitor, it is the index [0] adapter in Allegro.</p><p>Seems to me that when querying the OS, Allegro receives the adapters in order starting from primary display and then the others following.<br />I can&#39;t say in which order from there, but I suspect that it is related to geometry (i.e. &quot;anti-clockwise starting from (0,0)&quot;)..too bad I haven&#39;t a 9 monitors setup handy <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>On a related note:</p><p>     - <tt>ALLEGRO_DISPLAY_WIN::adapter</tt> does NOT change when dragging the window across monitors...seems it stores only the adapter into which display is created. </p><p>     - seems to me that <tt><b>al_get_num_display_modes </b></tt> returns the display modes of the <i>al_get_new_display_adapter</i> adapter only....If I want modes for EACH adapter I need to cycle through them calling <tt>al_set_new_display_adapter</tt>...is that correct?</p><p>Hope this is not all that much OT.....;D
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (pkrcel)</author>
		<pubDate>Thu, 08 Nov 2012 18:52:24 +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/611378/969811#target">pkrcel</a> said:</div><div class="quote"><p>Launcing allegro in these conditions has the first index [0] adapter to be always the &quot;This is my primary monitor&quot; checked display.</p></div></div><p>Are you sure about that? If you place the other monitor, say on the left of your primary, is it before or after the primary?</p><p>I suppose it would make sense that the primary is always first, but I&#39;m not sure we can count on that.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>ALLEGRO_DISPLAY_WIN::adapter does NOT change when dragging the window across monitors...seems it stores only the adapter into which display is created.</p></div></div><p>Yeah, thats a bit harder to get right. I was thinking of managing that for X, but it was a bit too much of a headache from what I remember.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>seems to me that al_get_num_display_modes returns the display modes of the al_get_new_display_adapter adapter only....If I want modes for EACH adapter I need to cycle through them calling al_set_new_display_adapter...is that correct?</p></div></div><p>Yes indeed.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Thu, 08 Nov 2012 21:56:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thinking about that, I&#39;m only sure that the default display adapter is the checked one (both num_modes is consistent and new displays are created there), but since I had to stop abruptly I could not check that adapter index is &quot;0&quot;.....I had that for given but I should check in the debugger.</p><p>Maybe tonite...maybe tomorrow <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /></p><p>BTW: is there a way to retrieve the current display_mode index? (Guess not, otherwise it would also be possible to query the current mode itself....)</p><p>EDIT PS: I tried putting the secondary display LEFT, RIGHT and on TOP of the primary in both cases. Each time the &quot;default&quot; adapter is the checked one.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (pkrcel)</author>
		<pubDate>Fri, 09 Nov 2012 00:10:38 +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/611378/969821#target">pkrcel</a> said:</div><div class="quote"><p>BTW: is there a way to retrieve the current display_mode index? (Guess not, otherwise it would also be possible to query the current mode itself....)</p></div></div><p>Modes are currently tied to a display. That is you need a current display for the mode functions to work, afaik. And it&#39;ll grab the modes from the monitor that display is on. (at least I think thats how it works, I can&#39;t remember)</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>EDIT PS: I tried putting the secondary display LEFT, RIGHT and on TOP of the primary in both cases. Each time the &quot;default&quot; adapter is the checked one.</p></div></div><p>But is that mapped to allegro&#39;s adapter 0?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 09 Nov 2012 00:59:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Not sure, as I said....have to check but cannot right now, not even sure this matters if I didn&#39;t get it horribly wrong and what I wrote does not stand.</p><p>The more I think about it, the more I feel that something is indeed missing:</p><p>I can fetch the current adapter geometry,  but I need to know the index<br />I can fetch ALL the display modes for the current adapter AND the index.</p><p>Getting the current default adapter geometry BEFORE creating the first display smmes indeed possible with the current API:</p><p> - Initialize allegro <tt><b>al_init</b></tt> ( sys interface gets filled, default adapter index  is stored)<br /> - get current adapter index with <tt><b>al_get_new_display_adapter</b></tt><br /> - use that to fetch current geometry with <tt><b>al_get_monitor_info</b></tt></p><p>Given that for allegro <span class="source-code">adapter <span class="k3">!</span><span class="k3">=</span> viewport</span> (needs confirmation!!!) one should safely assume that can go fullscreen effectively maintaing current mode.</p><p>As usual, am I missing something? (Of course! me moron)</p><p>Found the gotcha...the current display adapter index defaults to &quot;-1&quot; and <tt><b>al_get_new_display_adapter</b></tt> returns that, even after creation of the first display.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (pkrcel)</author>
		<pubDate>Fri, 09 Nov 2012 03:44:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;d say to scan all modes for all adapters/monitors you&#39;d need to do something like this (untested)</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="k1">void</span> scan_all_adapter_modes<span class="k2">(</span><span class="k2">)</span>  <span class="k2">{</span>
<span class="number">  2</span>  <span class="k1">int</span> mode, adapter, modes, adapters<span class="k2">;</span>
<span class="number">  3</span>  adapters <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_num_video_adapters"><span class="a">al_get_num_video_adapters</span></a><span class="k2">(</span><span class="k1">void</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  4</span>  <span class="k1">for</span> <span class="k2">(</span>adapter <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span> adapter <span class="k3">&lt;</span> adapters <span class="k2">;</span> adapter<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number">  5</span>     <a href="http://www.allegro.cc/manual/ALLEGRO_MONITOR_INFO"><span class="a">ALLEGRO_MONITOR_INFO</span></a> monitor_info<span class="k2">;</span>
<span class="number">  6</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>adapter, <span class="k3">&amp;</span>monitor_info<span class="k2">)</span>
<span class="number">  7</span>       <span class="c">/** Do something here with the adapter info. */</span>
<span class="number">  8</span>     <a href="http://www.allegro.cc/manual/al_set_new_display_adapter"><span class="a">al_set_new_display_adapter</span></a><span class="k2">(</span>adapter<span class="k2">)</span><span class="k2">;</span>
<span class="number">  9</span>     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"> 10</span>     <span class="k1">for</span> <span class="k2">(</span>mode <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span> mode <span class="k3">&lt;</span> modes <span class="k2">;</span> mode<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 11</span>       <a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY_MODE"><span class="a">ALLEGRO_DISPLAY_MODE</span></a> mode_info<span class="k2">;</span>
<span class="number"> 12</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>mode, <span class="k3">&amp;</span>mode_info<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 13</span>       <span class="c">/** Do something here with the mode info */</span>
<span class="number"> 14</span>     <span class="k2">}</span>
<span class="number"> 15</span>  <span class="k2">}</span>
<span class="number"> 16</span><span class="k2">}</span>
</div></div><p>

As for the original question, giving -1 a special meaning seems like a hack. If we need to know the current display mode it should also be possible to get and set that using a new api so it matches the index of al_get_display_mode.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (beoran)</author>
		<pubDate>Sat, 10 Nov 2012 04:22:15 +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/611378/969830#target">pkrcel</a> said:</div><div class="quote"><p>Found the gotcha...the current display adapter index defaults to &quot;-1&quot; and al_get_new_display_adapter returns that, even after creation of the first display.</p></div></div><p>`al_get_new_display_adapter` just says what adapter/monitor to create the next <span class="source-code"><a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a></span> on, and <span class="source-code"><span class="k3">-</span><span class="n">1</span></span> is a stand in for &quot;Default&quot; or &quot;Primary&quot;, so you don&#39;t have to figure it out yourself.</p><p>In some cases, <span class="source-code"><span class="k3">-</span><span class="n">1</span></span> will also allow allegro to guestimate which monitor you want the display on, based on which monitor/adapter is active (has input focus, or a selected/focused window). You don&#39;t always want your window to pop up on the primary screen. If you had a shortcut to your app on your non primary monitor, would you expect the window to open up on the primary? I wouldn&#39;t. And this is something that is incredibly hard for the user to figure out without us providing an api for it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sat, 10 Nov 2012 06:29:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Okay, now that I&#39;ve seen some other point, I need to clearify one bit:</p><p>Desktop geometry is generally irrelevant to a game because it&#39;s very arbitrary matter. Say, if you have two monitors, you could&#39;ve use them as two viewports - one to the left and one to the right, if they had their rectangles touching (for the lack of better term). Or one might be on top of another for that matter. My setup includes secondary monitor being at bottom-right edge of main monitor. But physically it is located far above main monitor. Bottom-left locating is just for the sake of convenience: the only point on the monitor where my mouse could leave main screen is bottom-right-most corner, which I never use, while in &quot;natural&quot; placement my mouse would skip to secondary monitor whenever I throw my mouse to the &quot;x&quot; button; you know, having to aim with mouse is really an inconvenience, especially if a software does not designed with keyboard use in mind. This is why desktop geometry is highly irrelevant, instead what should be relevant is display geometry. I already suggested one way to do that, in the original post. There might be a specific function, too. But the point is that there needs to be a way to get current <b>monitor</b> geometry with allegro, <i>I REPEAT: <b>MONITOR</b> GEOMETRY</i>, making stress on the &quot;<b>monitor</b>&quot; word, not &quot;desktop&quot; or &quot;viewport&quot; or whatever, specifically <b>monitor</b>, because this is entirely possible on any OS. I mean it&#39;s not like there&#39;s an X-Box supported platform where you don&#39;t get to know target resolution; be it PC or Mac or iPhone it is always possible to query monitor geometry (and color mode).</p><p>Now that I think of it, why request (with suggestion of possible solution) to having possibility to obtain current monitor mode even raised any necessarity questions? Like &quot;oh why even bother if here we have this it&#39;s not what you need but it&#39;s almost the same and will probably work all right&quot;.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Raidho36)</author>
		<pubDate>Sat, 10 Nov 2012 10:18:07 +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/611378/969916#target">Raidho36</a> said:</div><div class="quote"><p>But the point is that there needs to be a way to get current monitor geometry with allegro, I REPEAT: MONITOR GEOMETRY, making stress on the &quot;monitor&quot; word, not &quot;desktop&quot; or &quot;viewport&quot; or whatever, specifically monitor, because this is entirely possible on any OS</p></div></div><p>I&#39;m not sure of what you mean here. What you get from <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> is the info we get from the OS about the geometry of your attached monitors. That is the intent of the api, if a given platform doesn&#39;t actually do that, its a bug in allegro and should be fixed.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Like &quot;oh why even bother if here we have this it&#39;s not what you need but it&#39;s almost the same and will probably work all right&quot;.</p></div></div><p>Thats just it, it IS what you need, and works exactly as you need (if it doesn&#39;t that&#39;s a bug in allegro and needs to be fixed).</p><p>Another option is to just give up on getting the current res, and use <span class="source-code">ALLEGRO_FULLSCREEN_WINDOW</span> and let allegro do it for you. It will create a window that covers the entire screen with which it was created on, and you don&#39;t have to pass in a valid width and height, it ignores those parameters of <span class="source-code"><a href="http://www.allegro.cc/manual/al_create_display"><span class="a">al_create_display</span></a></span>.</p><p>Seriously though, <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> is <i>supposed</i> <span class="ref"><sup>[<a href="#">1</a>]</sup></span> to give you the current size (ie: mode geometry) of each attached monitor. Period. Full Stop. End of story.</p><p>The reason we give the offset&#39;s as well, is well, so people can tell where the screens are in relation to each other, say for a multi-monitor config setup in a game or app, or you want to programmatically move a window to a given screen, you want to know its origin and size, not just its size. So the function returns more data than you may care about, not a big deal.
</p><div class="ref-block"><h2>References</h2><ol><li>and as I mentioned above, if it <i>doesn&#39;t</i> do so, its a bug in allegro which needs to be fixed</li></ol></div></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sat, 10 Nov 2012 10:41:45 +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/611378/969919#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p> Thats just it, it IS what you need
</p></div></div><p>No. I want to get current device display mode. Also known as monitor mode. This includes frequency, color mode and dimensions. Size of a desktop and it&#39;s relative position against the default one is not related here for obvious reasons, and specifically, it has it&#39;s own function.</p><p>There is getting device display mode by number. Why isn&#39;t there getting device display mode by default, being first obvious extension to prior? And why the <span class="cuss"><span>fuck</span></span> would you argue that it&#39;s not needed? This is what I completely don&#39;t get. I can almost draw a parallel to a supermegaartist-retards who claim their projects to be ultimately perfect as is. Unfortunately, I had to deal with these. Sorry for breaking my attitude down like this, but that&#39;s just what your attitude about that matter makes to me.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> The reason we give the offset&#39;s as well
</p></div></div><p>The reason is because OS provides a rectangle instead of just X:Y pair and throwing out the other two coordinates would&#39;ve been a waste.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> So the function returns more data than you may care about, not a big deal.
</p></div></div><p>It returns less data than I may care about, and it can also return invalid data by specific occasions.</p><p>Speaking of invalid data. Windows&#39; OpenGL implementation would only return modes of default screen and will not return color mode whatsoever (though with PC it&#39;s narrowed down to RGB565 and XRGB32 so can be deduced), and D3D implementation returns <span class="cuss"><span><span class="cuss"><span>shit</span></span></span></span>loads of impossible modes among couple of those that can actually work.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Raidho36)</author>
		<pubDate>Sat, 10 Nov 2012 19:46:58 +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/611378/969944#target">Raidho36</a> said:</div><div class="quote"><p>And why the <span class="cuss"><span>fuck</span></span> would you argue that it&#39;s not needed?</p></div></div><p>I don&#39;t see the point myself. Why do you need anything more than the size/mode of the monitor? Once the display is created, you can then get the modes, if you needed to display them.</p><p>Give me a good reason you need that information, and maybe we can add an api to grab display modes <i>before</i> a display is created. Maybe.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sat, 10 Nov 2012 23:19:54 +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/611378/969959#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p> Give me a good reason you need that information, and maybe we can add an api to grab display modes before a display is created. Maybe.
</p></div></div><p>Oh, if you don&#39;t feel to bother over writing something about 100, maybe more, lines of code, then how about I do that on my own? I just need to get all tools set up so I could fetch nightly Allegro and modify it and build it and test it, because right now all I have but Allegro is MinGW C and C++ installation. Though it will probably won&#39;t happen until a month later for a very specific reason, but I can <i>suggest</i> patches (without proper testing, i.e. based on the manual) even right now. The one that I have already suggested should work fine. There you go another one, for Windows&#39; OpenGL implementation, it should work perfectly fine too:
</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"> 1619</span><span class="k1">int</span> adapter <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_new_display_adapter"><span class="a">al_get_new_display_adapter</span></a> <span class="k2">(</span> <span class="k2">)</span><span class="k2">;</span>
<span class="number"> 1620</span><span class="k1">if</span> <span class="k2">(</span> adapter <span class="k3">&lt;</span> <span class="n">0</span> <span class="k2">)</span>
<span class="number"> 1621</span>    adapter <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 1622</span><span class="k1">if</span> <span class="k2">(</span><span class="k3">!</span>EnumDisplaySettings<span class="k2">(</span>adapter, <a href="http://www.delorie.com/djgpp/doc/libc/libc_470.html" target="_blank">index</a>, <span class="k3">&amp;</span>dm<span class="k2">)</span><span class="k2">)</span>
</div></div><p>
A function to get current mode is made as easy as replacing <span class="source-code"><a href="http://www.delorie.com/djgpp/doc/libc/libc_470.html" target="_blank">index</a></span> with <span class="source-code"><span class="k3">-</span><span class="n">1</span></span> (and cutting out bunch of things).</p><p>The reason why I would <i>suggest</i> without testing is because my style of programming does not involves testing much, I&#39;d rather said hardly involves at all, and things turn out to work perfectly well, unless there&#39;s bunch of pitfalls in libraries. Unless there&#39;s a pitfall in <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_new_display_adapter"><span class="a">al_get_new_display_adapter</span></a></span> it should work perfectly.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Raidho36)</author>
		<pubDate>Sat, 10 Nov 2012 23:49:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I have to admit I derped on saying that the get mode stuff requires a display.</p><p>The current X code treats the -1 default from <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_new_display_adapter"><span class="a">al_get_new_display_adapter</span></a></span> as a standin for the &quot;default&quot; monitor, which currently means whatever screen/adapter the current active window&#39;s center is located on. Which I think is more correct than always picking the primary monitor. That can be changed however, or at least we can provide a &quot;get_primary_adapter&quot; function to help with picking the primary.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/611378/969961#target">Raidho36</a> said:</div><div class="quote"><p>Oh, if you don&#39;t feel to bother over writing something about 100, maybe more, lines of code, then how about I do that on my own?</p></div></div><p>That isn&#39;t the problem. The problem is I don&#39;t care about this feature. I don&#39;t personally see why you&#39;d want that information. And you haven&#39;t provided me with a good reason, like I&#39;ve been asking for over and over. I can&#39;t really think of one.</p><p>Not that I&#39;m 100% against it. After looking at the x code, it&#39;d be pretty easy to return the current display mode if passed -1 into get_display_mode.</p><p>Also:</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">if</span> <span class="k2">(</span> adapter <span class="k3">&lt;</span> <span class="n">0</span> <span class="k2">)</span>
   adapter <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span>
</pre></div></div><p>

May not be the ideal solution.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 11 Nov 2012 00:12:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>OK, Raidho36, now understand what you want. Now, we have a API to get the real hardware resolution of all the available MONITORs (adapters). And for each of these adapters&#39; we can get all available modes that can be set. The fact that with some drivers some modes that are reported as available cannot actually be set is a separate issue. But what you want is a way to see, for every monitor, what mode it is set to NOW, before opening the allegro window. </p><p>SDL 2 seems to support this support this with SDL_GetCurrentDisplayMode<br />(<a href="http://wiki.libsdl.org/moin.cgi/SDL_GetCurrentDisplayMode">http://wiki.libsdl.org/moin.cgi/SDL_GetCurrentDisplayMode</a>) or SDL_GetDesktopDisplayMode (<a href="http://wiki.libsdl.org/moin.cgi/SDL_GetDesktopDisplayMode">http://wiki.libsdl.org/moin.cgi/SDL_GetDesktopDisplayMode</a>), the docs aren&#39;t completely clear. So I&#39;d say that such a function could be useful. At last the the SDL developers seemed to think it was.  Something like </p><div class="source-code snippet"><div class="inner"><pre><span class="k1">int</span> al_get_desktop_display_mode<span class="k2">(</span><span class="k1">int</span> adapter, <a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY_MODE"><span class="a">ALLEGRO_DISPLAY_MODE</span></a> <span class="k3">*</span>mode<span class="k2">)</span>
OR
<span class="k1">int</span> al_get_current_display_mode<span class="k2">(</span><span class="k1">int</span> adapter, <a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY_MODE"><span class="a">ALLEGRO_DISPLAY_MODE</span></a> <span class="k3">*</span>mode<span class="k2">)</span>
</pre></div></div><p>
It returns he index of the current display mode (as per the al_get_display_mode), or negative on error, and fill in mode with the details of that mode.</p><p>Of course, personally, I wouldn&#39;t use such functionality, since I just greedily switch to the mode I want, and don&#39;t care about whatever mode was used before I started my program. But I could see why it could be useful, for example, for utility programs like Aseprite, etc, to pick a mode that corresponds well with the one the user was using when starting the program.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (beoran)</author>
		<pubDate>Sun, 11 Nov 2012 02:06:45 +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/611378/969963#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p> I can&#39;t really think of one.
</p></div></div><p>Isn&#39;t the suggested function itself proclaims the reason to have it? To obtain current display mode? Just because you can&#39;t think of using this data doesn&#39;t mean nobody ever needs it. It&#39;s like having &quot;peek&quot; function in the stacks. I can&#39;t think of using it whatsoever (except for cases of misusing), but it doesn&#39;t mean it shouldn&#39;t be there: maybe someone needs to know stacks&#39; top value without clearing it out. If you haven&#39;t get the answer yet, I need it because I want real fullscreen mode, and I want to have it without having to perform voodooistic rituals to make sure the data supplied by other functions is even valid and I can use it. All I want is to fetch current mode and make my fullscreen mode to use it rather than substitute it&#39;s own.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> May not be the ideal solution.
</p></div></div><p>That&#39;s what I have found in D3D code, so I just reused it as is. Not my fault if there&#39;s something wrong with it.
</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/611378/969975#target">beoran</a> said:</div><div class="quote"><p> SDL 2 seems to support this support this with SDL_GetCurrentDisplayMode
</p></div></div><p>Yes, exactly. Allegro should have it, too.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> or SDL_GetDesktopDisplayMode
</p></div></div><p>Now note that there&#39;s a difference. Monitor functions should fetch specifically monitors&#39; data. Just because desktop would typically match monitor doesn&#39;t mean that it&#39;s always work that way on all OSes and all machines.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Raidho36)</author>
		<pubDate>Sun, 11 Nov 2012 12:54:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, then, please implement al_get_desktop_display_mode and al_get_current_display_mode. You could borrow the code for X Windows and OS X, etc, from SDL 2 since that&#39;s now also ZLIB license. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> In other words let&#39;s not change old API&#39;s in iffy ways, but work on add new ones for missing functionality. I&#39;m willing to test this for you if you implement it.</p><p>In other words, if you say this functionality should exist, then make it so. Please don&#39;t complain, but code! <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (beoran)</author>
		<pubDate>Sun, 11 Nov 2012 19:52:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well that&#39;s constructive, I&#39;m for! </p><p>It was actually what I have started with, but whatever, the result is what matters, right?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Raidho36)</author>
		<pubDate>Sun, 11 Nov 2012 20:14:21 +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/611378/969824#target">Thomas</a> said:</div><div class="quote"><p>But is that mapped to allegro&#39;s adapter 0?
</p></div></div><p>

I come back to answer this: NO, I had the chance to check today (as I got a 18.5&quot; widescreen LCD to attach to my Laptop yay) and actually the Adapters are numbered in the same order as in the OS, [0] is what windows identifies with a big 1 and [1] is the one with the big 2 on it. Consistently.</p><p>Either one, when being the primary has (0,0) top-left coords.</p><p>The rest of my observations stand, meaning that the &quot;checked&quot; primary display in windows is the one on which new <span class="source-code"><a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a></span>s are created, <span class="source-code">ALLEGRO_DISPLAY_WIN::adapter</span> does not automatically update (even thou a way to peek into this struct field by the API woudl be nice I think)</p><p>(Un)related question: </p><p>Following a convoluted callstack, I see that calling the <span class="source-code"><a href="http://www.allegro.cc/manual/al_create_display"><span class="a">al_create_display</span></a></span> ends eventually through:</p><div class="source-code"><div class="toolbar"><span class="name">wwindow.c</span><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"> 1237</span><span class="k1">int</span> _al_win_determine_adapter<span class="k2">(</span><span class="k1">void</span><span class="k2">)</span>
<span class="number"> 1238</span><span class="k2">{</span>
<span class="number"> 1239</span>   <span class="k1">int</span> a <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_new_display_adapter"><span class="a">al_get_new_display_adapter</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 1240</span>   <span class="k1">if</span> <span class="k2">(</span>a <span class="k3">=</span><span class="k3">=</span> <span class="k3">-</span><span class="n">1</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 1241</span>      <span class="k1">int</span> num_screens <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_num_video_adapters"><span class="a">al_get_num_video_adapters</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 1242</span>      <span class="k1">int</span> cScreen <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 1243</span>      <a href="http://www.allegro.cc/manual/ALLEGRO_MONITOR_INFO"><span class="a">ALLEGRO_MONITOR_INFO</span></a> temp_info<span class="k2">;</span>
<span class="number"> 1244</span>      <span class="k1">for</span> <span class="k2">(</span>cScreen <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span> cScreen <span class="k3">&lt;</span> num_screens<span class="k2">;</span> cScreen<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 1245</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>cScreen, <span class="k3">&amp;</span>temp_info<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 1246</span>         <span class="k1">if</span> <span class="k2">(</span>temp_info.x1 <span class="k3">=</span><span class="k3">=</span> <span class="n">0</span> <span class="k3">&amp;</span><span class="k3">&amp;</span> temp_info.y1 <span class="k3">=</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span> <span class="k2">{</span> <span class="c">// ..probably found primary display</span>
<div class="highlight"><span class="number"> 1247</span>            <span class="k1">return</span> cScreen<span class="k2">;</span></div><span class="number"> 1248</span>         <span class="k2">}</span>
<span class="number"> 1249</span>      <span class="k2">}</span>
<span class="number"> 1250</span>      <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span> <span class="c">// safety measure, probably not necessary</span>
<span class="number"> 1251</span>   <span class="k2">}</span>
<span class="number"> 1252</span>   <span class="k1">return</span> a<span class="k2">;</span>
<span class="number"> 1253</span><span class="k2">}</span>
</div></div><p>

why isn&#39;t that &#39;cScreen&#39; stored somewhere? To my understanding this is ran through each time a display is created (or maybe manipulated in some way?) iif one never ever sets the new display adapter via <span class="source-code"><a href="http://www.allegro.cc/manual/al_set_new_display_adapter"><span class="a">al_set_new_display_adapter</span></a></span>.</p><p>This anyway answers my question about determining the primary display, even thou if I want to do it in my code I basically have to rewrite this function. I guess this is heavily platform-dependent? <img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (pkrcel)</author>
		<pubDate>Fri, 16 Nov 2012 18:45:05 +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/611378/970345#target">pkrcel</a> said:</div><div class="quote"><p>why isn&#39;t that &#39;cScreen&#39; stored somewhere? To my understanding this is ran through each time a display is created (or maybe manipulated in some way?) iif one never ever sets the new display adapter via al_set_new_display_adapter.</p></div></div><p>The primary screen can be changed in between calls to that function.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>This anyway answers my question about determining the primary display, even thou if I want to do it in my code I basically have to rewrite this function. I guess this is heavily platform-dependent? </p></div></div><p>I think so. But I&#39;d have to check to make sure. I don&#39;t know if the new xrandr stuff on X lets the desktop tell xrandr what monitor is primary, or if the &quot;primary&quot; monitor is just a desktop level thing.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sat, 17 Nov 2012 02:37:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Right out of the aforementioned function, wouldn&#39;t something like this be platform-independent? (indentation may be a bit off due to copypaste, sorry for that)</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">int</span> pk_determine_prolly_prim_adapter<span class="k2">(</span><span class="k1">void</span><span class="k2">)</span>
<span class="k2">{</span>
   <span class="k1">int</span> a <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span>
   <span class="k1">int</span> num_screens <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_num_video_adapters"><span class="a">al_get_num_video_adapters</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
   <span class="k1">int</span> cScreen <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span>
   <a href="http://www.allegro.cc/manual/ALLEGRO_MONITOR_INFO"><span class="a">ALLEGRO_MONITOR_INFO</span></a> temp_info<span class="k2">;</span>
   <span class="k1">for</span> <span class="k2">(</span>cScreen <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span> cScreen <span class="k3">&lt;</span> num_screens<span class="k2">;</span> cScreen<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span> <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>cScreen, <span class="k3">&amp;</span>temp_info<span class="k2">)</span><span class="k2">;</span>
      <span class="k1">if</span> <span class="k2">(</span>temp_info.x1 <span class="k3">=</span><span class="k3">=</span> <span class="n">0</span> <span class="k3">&amp;</span><span class="k3">&amp;</span> temp_info.y1 <span class="k3">=</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span> <span class="k2">{</span> <span class="c">// prolly primary display?</span>
            <span class="k1">return</span> cScreen<span class="k2">;</span>         <span class="k2">}</span>
      <span class="k2">}</span>
   <span class="k1">return</span> a<span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>

Could do for me right now.... <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (pkrcel)</author>
		<pubDate>Sun, 18 Nov 2012 03:21:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I was just saying that 0x0 may not mean the monitor is the primary monitor. I&#39;d have to check. And I&#39;m far too lazy at the moment <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 18 Nov 2012 03:32:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ah ok, I got it wrong <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /> ...anyway on Win7 seems to invariably mean that ...you get the login screen on whichever dispaly has (0,0) origin. </p><p>&quot;Primary&quot; is way subjective matter anyway (when I reguraly had two LCDs, I worked &quot;primarily&quot; on the right one, on which i DID NOT (purposedly) have the taskbar... <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (pkrcel)</author>
		<pubDate>Sun, 18 Nov 2012 14:55:40 +0000</pubDate>
	</item>
</rss>
