Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Display (fullscreen window) and window dimensions

This thread is locked; no one can reply to it. rss feed Print
Display (fullscreen window) and window dimensions
Bluebird
Member #15,421
December 2013

Ok, so somewhere between a previous version of A5 and the current (5.2.8.0), something changed in regard to display dimensions immediately after creating a display.

Previously, I could create a display with ALLEGRO_FULLSCREEN_WINDOW, then do al_create_display(800, 600), and the dimensions DIRECTLY after display creation would be the dimensions of my desktop. I could then cache these dimensions and update them only when receiving a ALLEGRO_EVENT_DISPLAY_RESIZE, thus avoiding having to constantly poll with al_get_display_width, etc.

However, now when I create my display, the display immediately fills the desktop monitor, but calling al_get_display_width immediately after creating the display returns 800! And I never get a ALLEGRO_EVENT_DISPLAY_RESIZE to represent the fact that the window changed size to fill the screen.

Should I just give up trying to cache the display dimensions and poll al_get_display_width, etc. on every frame?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Bluebird
Member #15,421
December 2013

It's not that I particularly need to know whether I'm fullscreen or not, it's just that I don't get an ALLEGRO_EVENT_DISPLAY_RESIZE to signal the switch.

Anyway I'm polling at the beginning of every frame now, in addition to handling ALLEGRO_EVENT_DISPLAY_RESIZE, and everything works now.

For reference I also posted at https://github.com/liballeg/allegro5/issues/1500. I had also added more info there in a followup.

Go to: