I reworked the object system, then had to rework everything else.
Instead of storing the type in the object handler, I had to store the type in the object.
That meant, I couldn't just add a ALLEGRO_BITMAP to my handler.
So, I made a base object class with a single variable (int type).
And a derived wrapper sub class for Allegro objects.
Any custom objects are also derived from the main object class.
I also modified the manifest file. Display is still required, but the rest (timer, queue) I add in the background.
It's reworked and running great.
//Everying is loaded and/or created in the manifest parser
if (Parser::parseManifest(manifest_file) < 0)
// draw code
bool Game::OnRender(Allegro::Display& display)
al_clear_to_color(al_map_rgb(0, 0, 255));
Allegro::Font* font = static_cast<Allegro::Font*>(Object::getRegistry()->at("@font/main"));
al_draw_text(font->get(), al_map_rgb(255, 255, 255), 40, 40, 0, "Hello World!");