![]() |
|
Fullscreen window on OS X not visible |
dthompson
Member #5,749
April 2005
![]() |
When I run the following on OS X with Allegro 5.0.11, I can't see any window - yet the process appears in the dock and the menu bar (see attached). I can still successfully quit it using the escape key, as expected. If I remove al_set_new_display_flags(ALLEGRO_FULLSCREEN);, I get a solid black window, again as expected. My native resolution is 1440x900. Any ideas? 1#include <allegro5/allegro5.h>
2#include <stdio.h>
3#include <stdlib.h>
4
5int main()
6{
7 ALLEGRO_DISPLAY *d;
8 ALLEGRO_EVENT_QUEUE *q;
9 ALLEGRO_EVENT e;
10 bool done = false;
11
12 al_init();
13 al_install_keyboard();
14
15 al_set_new_display_flags(ALLEGRO_FULLSCREEN);
16 d = al_create_display(1440, 900);
17
18 q = al_create_event_queue();
19 al_register_event_source(q, al_get_keyboard_event_source());
20
21 al_clear_to_color(al_map_rgb(0, 0, 0));
22
23 while(!done)
24 {
25 al_wait_for_event(q, &e);
26
27 if(e.type == ALLEGRO_EVENT_KEY_DOWN)
28 {
29 if(e.keyboard.keycode == ALLEGRO_KEY_ESCAPE)
30 done = true;
31 }
32 }
33
34
35 al_destroy_display(d);
36 al_destroy_event_queue(q);
37
38 return 0;
39}
______________________________________________________ |
Elias
Member #358
May 2000
|
Try ALLEGRO_FULLSCREEN_WINDOW - the normal FULLSCREEN did not work with 5.0.11. -- |
dthompson
Member #5,749
April 2005
![]() |
Huh, works like a charm! Thanks very much. ______________________________________________________ |
amarillion
Member #940
January 2001
![]() |
The normal FULLSCREEN works on Linux and Windows with 5.0.11, so yes, it seems to be OS X related. But I started to use FULLSCREEN_WINDOW everywhere too now, it works better in most situations. -- |
Peter Hull
Member #1,136
March 2001
|
The original OS X fullscreen used low-level calls to capture the screen entirely, and change the horizontal/vertical resolution. This was fine and appropriate for CRTs but doesn't really work for LCD panels so it was 'emulated' by the OS. That method has been deprecated since at least 10.6 and I suppose now Apple have got round to disabling it entirely. The current advice from Apple is to do a fullscreen window, and if you want a resolution that's not native, draw to a back-buffer and upscale it. I think Allegro 5 does this for you automatically (not certain though)
|
amarillion
Member #940
January 2001
![]() |
Maybe in that case FULLSCREEN should simply do the same thing as FULLSCREEN_WINDOW on a mac? There is still some situations where people might prefer FULLSCREEN, and it would be good if that code worked on a mac too even if it's simulated. -- |
Bruce Pascoe
Member #15,931
April 2015
![]() |
Hm, not sure that's a good idea. FULLSCREEN_WINDOW implies scaling (and usually, bilinear filtering) if the requested res doesn't match the native one; users requesting FULLSCREEN probably won't expect that. Better would be to simply fail creating the display, allowing the user to fall back on FULLSCREEN_WINDOW if that's suitable.
|
dthompson
Member #5,749
April 2005
![]() |
On this subject - in the past I've wondered whether it'd be useful for Allegro to include something along the lines of a FULLSCREEN_WINDOW_LETTERBOX mode, which would scale up the requested display resolution to the highest multiple that would fit within the fullscreen dimensions, and then use nearest-neighbour. Would be useful for games with few pixels - but might be too high-level. ______________________________________________________ |
Bruce Pascoe
Member #15,931
April 2015
![]() |
I've often wished for a letterbox/pillarbox mode myself--currently FULLSCREEN_WINDOW will always stretch the picture to use the full screen, completely ignoring the aspect ratio of the original image.
|
dthompson
Member #5,749
April 2005
![]() |
Any chance there'd be room for this in 5.2? ______________________________________________________ |
|