lordmauve / wasabi2d

Cutting-edge 2D game framework for Python

Home Page:https://wasabi2d.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refactor: global dirty list

lordmauve opened this issue · comments

Various objects track their own dirty state. Then before drawing the engine crawls a reference tree to update all the things that need to be updated.

This is inefficient and also adds complexity. We could just maintain a global(ish) "dirty list" - probably actually a WeakSet - that objects add themselves to when they are dirty.

There needs to be some ordering involved in this: objects that are dirty in system memory need to get updated before buffers that are dirty get copied to the GPU.