Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » al_draw_text doesn´t work

This thread is locked; no one can reply to it. rss feed Print
al_draw_text doesn´t work
Sven Gallin
Member #14,497
August 2012

hi folks,

i have tried to get al_draw_text working but it wont work.
an the end, to minimize my coding-faults, i have compiled the example code from

http://wiki.allegro.cc/index.php?title=Allegro_5_Tutorial/Addons/Fonts

1:1 (with download of the pirulen.ttf font) and if i run the .exe he still crashes. gdb says:
Starting program: M:\test.exe
[New Thread 1284.0x890]
[New Thread 1284.0xf74]
[New Thread 1284.0xcd8]
[New Thread 1284.0x544]

Program received signal SIGSEGV, Segmentation fault.
0x6428de49 in al_draw_ustr () from M:\allegro-5.0.7-monolith-mt.dll

compiler is gcc 4.7.0(mingw), allego 5.0.7 monolith-mt, os: win7 64.
what can i do to fix this?

thanks.

AleX-G Squadron
Member #13,593
October 2011
avatar

Have you tried to change the pirulen.ttf to arial.ttf?

www.anothergames.com

J-Gamer
Member #12,491
January 2011
avatar

Have you checked the return value when you load the font? ie: the font isn't NULL?

" There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo
"If your body was a business, thought would be like micro-management and emotions would be like macro-management. If you primarily live your life with emotions, then you are prone to error on the details. If you over-think things all the time you tend to lose scope of priorities." - Mark Oates

Sven Gallin
Member #14,497
August 2012

yes, have tried arial also and the return value of al_load_ttf_font
is already tested in the example code:
if (!font){
fprintf(stderr, "Could not load 'pirulen.ttf'.\n");
return -1;
}

Arthur Kalliokoski
Second in Command
February 2005
avatar

The example you pointed to doesn't use al_draw_ustr(), is that the only line of code you changed? Could you post it?

They all watch too much MSNBC... they get ideas.

Sven Gallin
Member #14,497
August 2012

>The example you pointed to doesn't use al_draw_ustr(), is that the only line of code you changed?

i haven´t change any piece of the code. but gdb gives me this error.

Matthew Leverton
Supreme Loser
January 1999
avatar

I don't think the binaries are compatible with gcc 4.7. If your code is correct, that is probably your problem.

Sven Gallin
Member #14,497
August 2012

>I don't think the binaries are compatible with gcc 4.7. If your code is correct, that is probably your problem.

yes, that was it. have downloaded 4.6.2 and now it works.
thank you:
D.

Go to: