-
Notifications
You must be signed in to change notification settings - Fork 363
Description
As a 2D games library, Arcade needs a way to order draw calls independently of their order found in on_draw. The naive solution is to provide easy framebuffers, but this is wasteful on memory and GPU cycles and is a blending nightmare. The ideal solution is to prevent the immediate draw calls from occurring until they have all been defined and then finally dispatch them in order based on their layer. This ensures that proper blending occurs, and we don't waste memory on excess framebuffers.
The exact implementation details can be fleshed out later, but the idea passed around by @einarf @DigiDuncan and me [@DragonMoffon] is to use a decorator called layer_catchable which adds the functionality of passing the decorated method into the currently active layer's queue.
Depending on the performance cost, we may not provide this level of complexity, but a tool to help ordering draw calls is very useful