Allegro 5 fails to "assert mutex" when doing image = al_create_bitmap(x, x);
I'm trying to create a bitmap.
std::cout << "Loading " <<
220 //some code
image = al_create_bitmap(
222 //some code
std::cout << "Loaded " <<
Somehow, as it does image = al_create_bitmap(1, 1);, it gives Assertion failed: mutex, file C:\dev\allegro_winpkg\universal\allegro\src\threads.c, line 310
This used to work before, but somehow changing something out both out of this function and out of tile has caused this.
We're going to need more context than that! You're even assigning to a variable that is outside the scope of the function (member variable (Or global )).
Of course this code in itself is 100% fine, but a lot more can go wrong before the call to al_create_bitmap.
How do you init allegro? Is Allegro initialized with hardware acceleration support?
Does creating a 64x64 bitmap work?
Copy pasting the code somewhere else to see if that works?
Are you doing crazy multithreaded rendering / was Allegro initialized on another thread?
Are you running out of memory?
Could you have caused memory or heap corruption elsewhere?
If you're really up for an adventure, crack open the Allegro source code and find out how that mutex can be NULL.
My guess is you're using a global Tile object, and it's trying to create the bitmap before allegro has been initialized.
But it could be a lot of things. I can't tell you where in the source code that is, because GIT has diverged from 5.2.2 and the sources don't match up anymore.
Thread #616952. Printed from Allegro.cc
The only reason a mutex wouldn't be valid is because you haven't called al_init first.