Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » ALLEGRO_OPENGL issue.

This thread is locked; no one can reply to it. rss feed Print
ALLEGRO_OPENGL issue.
albert69
Member #17,055
March 2019

Hi

When I use the ALLEGRO_OPENGL option when using al_set_new_display_flags it causes an issue with scrolling performance - like some minor jittering in the scrolling sprites. fps is still running fine at 60fps, just with worse looking sprite movement.

Only happens in ALLEGRO_FULLSCREEN mode though.
Scrolling is super smooth when in ALLEGRO_WINDOW mode.

Do not believe it is anything to do with ALLEGRO_VSYNC as have tested all combos.
It is just the ALLEGRO_OPENGL | ALLEGRO_FULLSCREEN combo that is an issue.

Any ideas why this may be happening?

Thank You.

amarillion
Member #940
January 2001
avatar

Do you get exactly the same resolution when in ALLEGRO_FULLSCREEN / ALLEGRO_WINDOW? If the resolution changes, maybe that explains it?

albert69
Member #17,055
March 2019

Hi

Game settings are 1280x720.

Even if my monitor is set to same display setting of 1280x720, when I run the program in windowed version, everything is smooth.

But ran in fullscreen at 1280x720 is a little jittery, even though they are the same size on my monitor.

Both run versions (fullscreen and windowed) even match my monitor resolution. (lowered from 1920x1080 to test)

Edit: But when I remove the ALLEGRO_OPENGL flag, fullscreen is smooth.

Thank You.

Dizzy Egg
Member #10,824
March 2009
avatar

I have the same problem albert69, it runs fine in DirectX (default), but OpenGL stutters when scrolling. It's definitely an Allegro bug, because when I create an OpenGL program without Allegro, I don't get the same problem.

I believe it's down to the Allegro timer/events, but I haven't been able to fix it yet.

----------------------------------------------------
Please check out my songs:
https://soundcloud.com/dont-rob-the-machina

albert69
Member #17,055
March 2019

Hi

Thanks for that info Dizzy Egg.

Yes, DIRECTX mode is fine with me also.

Annoying, as need OPENGL for my GLSL shaders.
Not used DIRECTX HLSL versions.

Thank You.

Dizzy Egg
Member #10,824
March 2009
avatar

We're in exactly the same position!

I only really use GLSL with Allegro because it allows far more calculations than HLSL. For that reason I continue to use OpenGL.

I did improve performance by not calling al_flip_display() but by calling glSwapBuffers() and some calls to glDrawBuffer().

It didn't fix it completely, but made it more tolerable.

----------------------------------------------------
Please check out my songs:
https://soundcloud.com/dont-rob-the-machina

Elias
Member #358
May 2000

There is a weird glFlush() call in the WGL al_flip_display:

https://github.com/liballeg/allegro5/blob/master/src/win/wgl_disp.c#L1315

I doubt it's the cause for this but if not harmful it certainly is superfluous.

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

Go to: