Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » The program crashes when drawing primitives

This thread is locked; no one can reply to it. rss feed Print
The program crashes when drawing primitives
Alexander Zhirov
Member #17,695
May 2020
avatar

Hello!
For the first time in my life, I wrote a simple game in pure C. I wrote for the Linux system. The game is compiled, everything works fine! I tried to port the code to Windows. On Windows I use MinGW with the MSYS2 libraries. Under Windows, everything compiles successfully. Faced a problem that when drawing primitives my program crashes. Through debugging, I saw that the problem is in the mutex. The debugger stops at the empty mutex address and returns an error.
As soon as I commented on the drawing of primitives, my program stopped crashing. But as soon as the drawing process arises, the program crashes again.
I think, here the creators of the library can help me figure it out. What to do?

Here is a demonstration of the problem
Simplified his huge code and posted on github - here is the source code

I don’t understand why this is happening.
I beg for help.

pmprog
Member #11,579
January 2010
avatar

You aren't calling "al_init_primitives_addon" in your init routine. So I'm surprised it worked on any other platform.

But try adding that to cl_load_allegro_resources()

Mark Oates
Member #1,146
March 2001
avatar

You need to call al_init_primitives_addon. You've already included the primitives header it in your common.c, but it's not initialized with the rest of the services.

Alexander Zhirov
Member #17,695
May 2020
avatar

Yes indeed. How I did not see a mistake. My head is already cooking poorly. Thank you very much, added initialization and it worked for me. ::)

Go to: