kyle-emmerich / blueshift-engine

High performance C++ game engine in early development
https://noxastra.com/engine
BSD 3-Clause "New" or "Revised" License
9 stars 1 forks source link

Event system #17

Closed kyle-emmerich closed 8 years ago

kyle-emmerich commented 8 years ago

There is an experimental class under Experiments/EventStream that can store event objects for another system to read. Right now, it supports basic synchronization in that it can only read OR write; not both.

Features:

Since this will be a very core concept for Blueshift, it needs to be very fast and must avoid cache misses when possible. Much of this is dependent on user code though; slow event processing will lead to a lot of thread preemption by the operating system and will thrash the cache.

kyle-emmerich commented 8 years ago

Also need to think about how this will interact with Lua. The Lua API needs to be able to recreate the delegate system. Perhaps multiple event queues can be used, and events not handled by C++ may be left in another queue for Lua to handle.

On second thought, maybe no delegate system on the C++ side. The system processing events should be able to handle delegation as it sees fit.

kyle-emmerich commented 8 years ago

One last thing: some examples should be written up for using an event queue. Should help guide the creation of its API if some use-cases are known.