Third game made: TBD

Engine Core

This engine core handles the basic stuff such as input and messaging. Several resources, such as message pools, are initialized by the engine core. At start up time, the core initializes DirectX resources as needed. It then creates a set of message pools - one pool per message type. At run time, the core's main responsibilities are translating input states to messages as well as dispatching messages to other components.

The message system is implemented with a simple observer pattern. Per game loop, the message system dispatches each message to all interested parties. The message internally keeps a reference count, which is incremented each time its dispatched. In the past, I've had the message system copied messages to multiple subscribers, and that just doesn't work too well. Especially with a physics system that generates upward of 2000 messages per frame (we had this "bug" where objects collided and penetrated each other and thousands of collision messages would get sent out ... that's pretty crazy ... that's a lot of memory just for sending messages around..)

 

Contact Me

Hosted by www.Geocities.ws

1