allegroflare / allegro_flare

Application toolkit for Allegro 5
https://clubcatt.com/allegroflare
MIT License
36 stars 6 forks source link

Add MultiMesh #235

Closed MarkOates closed 2 years ago

MarkOates commented 2 years ago

Multimesh

Multimesh is just a name I came up with for a simple concept - a vertex buffer that manages rectangular elements for maximum efficient drawing.

Multimesh essentially allows you to have a large number of rectangular "items" all stored in a vertex buffer, and upon drawing, will only render the rectangular items that are present, very efficiently with a single draw call on a vertex buffer object.

Two points

Still Missing

append and append_raw need to return the added item's integer index. Will add that as a fast-follow after merging.

Anicdotes

The class can probably be renamed. It also includes MultiMeshUV and MultiMeshUVAtlas. The atlas is basically an int-indexed list of uv coordinates for a texture. That list is used by the MultiMesh to simplify building the items.

Also

Implicitly, this branch also included an update to Network2/Message 🤷‍♂️. It sets some constant properties to constexpr, now that that feature is available.