[A5] Dual monitors issue
Raidho36

First off, some background data:
I'm using MinGW and A-5.0.7 under Windows 7 64-bit, with two monitors with different resolution each plugged into a single video card that has two separate output ports.

I have a following issues:

The big issue #1 is that whenever I change the monitor resolution when going fullscreen, all I get is a blank screen with no output but black rectangle all over the surface. Not a single drawing function produces any output. Fullscreen without resolution change and windowed mode, both works just fine. It confirmed that regular games that use fullscreen mode and change monitor resolution works OK. That alone isn't so bad, but combined with next ones it's just plain disturbing.

The big issue #2 is that as far as I can see there is no way to obtain current display mode or at least get resolution to estimate it right. There is some hack that allows to get the screen boundaries and when magically adjusted it sort of works good enough. But it doesn't really helps either, because of the next issue.

The big issue #3 is that screen number and display number doesn't match. That renders guessing display mode by screen dimensions completely useless. That's apart from such simple thing that screen dimensions aren't attached to the actual monitor dimensions and could be smaller or bigger or both, which makes such estimation really rough and likely to crash entire program.

My question is:
What am I doing wrong, or do I need to make some workaround?

It wouldn't be a problem at all if screen mode 0 was current mode, for example, or if there was a function that returns current mode ID.

Please disregard my silly avatar.

This works:

#SelectExpand
1al_set_new_display_adapter ( 0 ); 2al_set_new_display_flags ( ALLEGRO_FULLSCREEN ); 3/* my monitor #1 actual resolution */ 4display = al_create_display ( 1280, 1024 ); 5/* draw something, wait and terminate program */ 6/* output is whatever been drawn */

This does not:

#SelectExpand
1al_set_new_display_adapter ( 0 ); 2al_get_monitor_info ( 0, moninfo ); 3al_set_new_display_flags ( ALLEGRO_FULLSCREEN ); 4/* even though used same display ID (0), this sets resolution to another 5 * monitor's current resolution; best luck if it doesn't crash */ 6display = al_create_display ( 7 moninfo->x2 - moninfo->x1, moninfo->y2 - moninfo->y1 ); 8/* draw something, wait and terminate program */ 9/* output is black screen, no matter what */

Not posting snippets with obtaining video modes (they work as expected), because obviously it's a plain guessing game and you can't even tell if anything was actually changed anyway. I've seen some example with al_get_num_video_adapters ( ) - 1 thing, which is supposed to give highest possible resolution, but that's not true for my monitor (it has resolutions sorted descending and frequencies ascending), and, obviously, current resolution might not be highest available, which is to say my case with monitor #2 (CRT): it's capable of displaying 1280x1024 picture, but that's above CRT grill resolution and the image gets all blurry and only support 50 hz, so I use 800x600.

EDIT:
It seems like it's either nobody knows what to do or nobody cares to point it out. Either way, I am stick to ALLEGRO_FULLSCREEN_WINDOW and submitting bug report and feature request.

Thread #611244. Printed from Allegro.cc