Allegro.cc - Online Community
Post Reply

Allegro.cc Forums » Allegro Development » Display settings cause many windows to open and close upon display creation

rss feed Print
Display settings cause many windows to open and close upon display creation
CerealK
Member #17,934
July 2020

I am making a program that uses the Primitives Addon and I wanted some antialiasing.

I set the display options, as shown in the Allegro Vivace tutorial (the file I attached is the source code at the start of the Input section of the tutorial):

#SelectExpand
1al_set_new_display_option(ALLEGRO_SAMPLE_BUFFERS, 1, ALLEGRO_SUGGEST); 2al_set_new_display_option(ALLEGRO_SAMPLES, 8, ALLEGRO_SUGGEST); 3al_set_new_bitmap_flags(ALLEGRO_MIN_LINEAR | ALLEGRO_MAG_LINEAR);

Everything compiles fine, but when I run the resulting file, the screen flashes rapidly and the taskbar shows a lot of windows being opened and closed, before it stops and the program then functions normally.

If I remove the display options, everything is normal and the screen doesn't flash. I have not been able to find any report of a similar issue online.

Edit: I have found a solution. Replacing the '8' in
al_set_new_display_option(ALLEGRO_SAMPLES, 8, ALLEGRO_SUGGEST);
to '3', making
al_set_new_display_option(ALLEGRO_SAMPLES, 3, ALLEGRO_SUGGEST);
This fixes the issue. I arrived at this solution by checking what the value of the ALLEGRO_SAMPLES option was after I set it.

I still don't completely understand why changing that fixed it, but it works so I guess that's okay.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

CerealK, it's a known bug with anti-aliasing and multi-sampling. The window flickers because it doesn't get fully created and it happens multiple times.

I have to submit a fix. Might as well open a bug report too so I don't forget about it.

https://github.com/liballeg/allegro5/issues/1153

Comment there if you feel the need. I will look at my old fix for this.

Post Reply
Go to: