Skip to content

Layer functionality for arcade #2202

@DragonMoffon

Description

@DragonMoffon

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions