Encapsualting graphics state changes #273
Labels
Area: Graphics
Issues related to graphics/rendering.
Type: Feature Request
Improvements that could be made to the code/documentation.
Summary
aka: why did my GUI library just yeet my transform matrix
One thing I've noticed as I've been writing some games/libraries with Tetra, is that it's quite hard to build rendering abstractions that don't leak into the global rendering state.
It would be good to add something to the API that would let you push/pop graphics state changes. There's a similar API in a lot of engines I've used (most notably Love2D), and it ends up being pretty convenient.
In the past I've said I wouldn't implement this because it's possible to do in user-space, but that doesn't take into account the fact that code you don't control (e.g. third party libraries) can't benefit from that.
Motivation/Examples
Alternatives Considered
The text was updated successfully, but these errors were encountered: