Re: [AD] [ alleg-Bugs-3102940 ] Broken on Vista |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 4 Nov 2010, at 21:04 , Michał Cichoń wrote:
> I can commit patch, which should solve the issue. Details were
> discussed there http://www.allegro.cc/forums/thread/605265
>
> In result two new functions will be added:
> int al_get_main_adapter();
> int al_get_active_adapter();
>
> It is actually bug fix, but changes hit public API.
>
> Before I send something I need your confirmation Peter.
The patch won't work on OS X.
I just said the following on a.cc (expanded here):
[NSScreen mainScreen] returns an NSScreen, not the index in the screens array corresponding to the currently active display, which is what the function should return.
I still think there needs to be a magic "-1" to indicate that "we don't care" and let the OS pick whatever it thinks the default screen should be, rather than explicitly asking for the default and setting that. This to accomodate situations where that information is not readily available. It's probably also slightly more error-safe, since it may not be valid to assume that between Allegro initialising the default value of the current display and the user creating the display that the main display number we retrieved before is still valid.
In other words, "al_set_new_display_adapter(-1)" would do the same thing as "al_set_new_display_adapter(al_get_active_display_adapter())" as far as the user is concerned except we don't need to query what the current active adapter is explicitly. Of course, it may need to do that internally (eg, on Windows).
Evert