I wasn't happy with existing frameworks so I quickly rolled my own. I'm posting this here in the hopes of someone finding it useful.
https://github.com/TheComet93/ontology
Feature highlights are:
- Unique filtering ability. Systems can declare what components they support, making sure they only receive entities that actually have those components.
- Compact and comprehensive method for creating components and systems.
- Doxygen documented code.
The top-level interface can look like this:
int main()
{
// The world holds everything together
Ontology::World world;
// register various systems with the world
world.getSystemManager()
.addSystem(new MovementSystem,
Ontology::SupportsComponents<
Position,
Velocity
>())
.addSystem(new RenderSystem,
Ontology::SupportsComponents<
Position,
Sprite
>())
.addSystem(new InputSystem)
.addSystem(new MainLoop,
Ontology::SupportsComponents<
Ontology::None
>())
.initialise()
;
// create an entity in the world
world.getEntityManager().createEntity("Player")
.addComponent(new Position(0, 0))
.addComponent(new Velocity(0, 0))
.addComponent(new Sprite("res/player.png"))
;
// run game
world.getSystem<MainLoop>().execute();
return 0;
} The syntax is very boost-esque.