Open acdemiralp opened 7 years ago
Two implementation options:
Since this functionality is auxiliary and the library is intended to be a thin wrapper, I would rather not pollute the existing global state functions with state tracking code, and go with the first approach.
State leaking is a common problem in OpenGL. Many free functions set a global state which often has to be unset at the end of render calls. Find a way to "track" this state and unset it on scope exits, perhaps similar to a
std::lock_guard
.Example: