AnnexGameDev / Annex

A 2D game development framework
MIT License
3 stars 0 forks source link

BatchTextureContext #24

Closed MatthewChrobak closed 1 year ago

MatthewChrobak commented 4 years ago

Create a renderable context in the Annex implementation that (in a single Draw call) supports rendering a single texture in several locations in arbitrary sizes.

var positions = new (int, int)[] {
    (0, 0), (32, 32), (64, 64), ... , (256, 256)
};
var sizes = new (int, int)[] {
    (32, 32)
};
var ctx = new BatchTextureContext("tile.png", positions, sizes);
canvas.Draw(ctx);