Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » [Linux] Can't turn Allegro vsync off?

This thread is locked; no one can reply to it. rss feed Print
[Linux] Can't turn Allegro vsync off?
Chris Katko
Member #1,881
January 2002
avatar

I'm using DAllegro.

const int ALLEGRO_VSYNC = 26; // Missing from my header file... 
// got value from include/allegro5/display.h

al_set_new_display_option(ALLEGRO_REQUIRE, ALLEGRO_VSYNC, 2);
g.display = al_create_display(g.SCREEN_W, g.SCREEN_H);

I still can't get above 60 FPS on my Chromebook (running Ubuntu 16.04.3 LTS). Allegro 5 is fairly recent at 5.1.11.

[edit] I am using 2, not 0. Which per docs is force off. (0 also doesn't work)

[edit] NEVERMIND. In Linux set:

export vblank_mode=0

And then run your program. That works on my Intel HD onboard. For nVidia there's some other command you can run that may help:

https://stackoverflow.com/questions/17196117/disable-vertical-sync-for-glxgears

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

I still can't get above 60 FPS on my Chromebook (running Ubuntu 16.04.3 LTS). Allegro 5 is fairly recent at 5.1.11.

That is super old. 5.1 is the old 5.2 development branch. 5.2.3 is the most recent version of allegro. Compile allegro yourself, please.

SiegeLord
Member #7,827
October 2006
avatar

There's also a PPA with more up-to-date versions: https://wiki.allegro.cc/index.php?title=Install_Allegro_from_Ubuntu_PPAs

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Chris Katko
Member #1,881
January 2002
avatar

[edit]

Look at all this compile junk and I stilll can't get it to link:

go_ldc2.sh

~/Downloads/ldc2-1.7.0-beta1-linux-x86_64/bin/ldc2 -w -ofmain main.d  -g -\
d-debug=3 -O0 -de  \
-I/home/novous/Downloads/DAllegro5/  \
-I/home/novous/Downloads/allegro-5.1.11/lib/  \
-I/home/novous/Downloads/DAllegro5/allegro5/  \
-I/usr/local/lib  \
-I/home/novous/Desktop/dev6/dplane   \
-L-L/home/novous/Downloads/DAllegro5/ \
-L-L/home/novous/Downloads/allegro-5.1.11/lib/ \
-L-L/home/novous/Downloads/allegro-5.1.11/lib/libdallegro5.a

Output

novous@saturn:~/Desktop/dev6/dplane$ ./go_ldc2.sh 
main.o: In function `_D4main7water_t4drawMFffZv':
/home/novous/Desktop/dev6/dplane/main.d:160: undefined reference to `_D8allegro55color10al_map_rgbFhhhZSQBhQBb13ALLEGRO_COLOR'
/home/novous/Desktop/dev6/dplane/main.d:167: undefined reference to `_D8allegro55color11al_map_rgbaFhhhhZSQBjQBd13ALLEGRO_COLOR'
/home/novous/Desktop/dev6/dplane/main.d:174: undefined reference to `_D8allegro55color11al_map_rgbaFhhhhZSQBjQBd13ALLEGRO_COLOR'
main.o: In function `_D4main7world_t10draw_radarMFffZv':
/home/novous/Desktop/dev6/dplane/main.d:220: undefined reference to `_D8allegro55color11al_map_rgbaFhhhhZSQBjQBd13ALLEGRO_COLOR'
/home/novous/Desktop/dev6/dplane/main.d:227: undefined reference to `_D8allegro55color10al_map_rgbFhhhZSQBhQBb13ALLEGRO_COLOR'
/home/novous/Desktop/dev6/dplane/main.d:254: undefined reference to `_D8allegro55color11al_map_rgbaFhhhhZSQBjQBd13ALLEGRO_COLOR'
main.o: In function `_D4main8object_t4drawMFffZv':
main.o:/home/novous/Desktop/dev6/dplane/main.d:1790: more undefined references to `_D8allegro55color10al_map_rgbFhhhZSQBhQBb13ALLEGRO_COLOR' follow
collect2: error: ld returned 1 exit status
Error: /usr/bin/gcc failed with status: 1

Any ideas? Do I have to ensure Allegro is recompiled with the exact version of Clang/LLVM/whatever? Could that be why maybe the symbols are mangled in a way the new LDC can't understand/doesn't expect? T\hose mangles "look" like D, as in DAllegro is where it fails.

[edit] It WAS DAllegro! I had to rebuild it... making sure to use the new version of LDC. Except it says now:

The system Allegro version (5.1.11.1) does not match the version of this binding (5.2.0.0)

Which means somewhere on my system I should have 5.2.0.0 after all... hmm...

[edit] Okay, got newest git and compiled. It's all working. Woooo!

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Go to: