Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Fullscreen window on OS X not visible

This thread is locked; no one can reply to it. rss feed Print
Fullscreen window on OS X not visible
dthompson
Member #5,749
April 2005
avatar

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?

#SelectExpand
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}

______________________________________________________
Website | Where my website used to be
This isn't a game!

Elias
Member #358
May 2000

Try ALLEGRO_FULLSCREEN_WINDOW - the normal FULLSCREEN did not work with 5.0.11.

--
"Either help out or stop whining" - Evert

dthompson
Member #5,749
April 2005
avatar

Huh, works like a charm! Thanks very much. :) Do you know whether this is isolated to OS X?

______________________________________________________
Website | Where my website used to be
This isn't a game!

amarillion
Member #940
January 2001
avatar

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.

--
Martijn van Iersel | My Blog | Sin & Cos | Tegel tilemap editor | TINS 2017

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
avatar

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.

--
Martijn van Iersel | My Blog | Sin & Cos | Tegel tilemap editor | TINS 2017

Bruce Pascoe
Member #15,931
April 2015
avatar

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
avatar

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. :)

______________________________________________________
Website | Where my website used to be
This isn't a game!

Bruce Pascoe
Member #15,931
April 2015
avatar

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
avatar

Any chance there'd be room for this in 5.2?

______________________________________________________
Website | Where my website used to be
This isn't a game!

Go to: