The program crashes when drawing primitives
Alexander Zhirov

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.


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

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

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. ::)

Thread #618165. Printed from