3 ms·
(Based a bit on older OGL usage) > I really don't understand this. Why the need for relentless abstraction? Just learn the ways that OpenGL is weird and use it
by dwaite 3y ago
(Based a bit on older OGL usage)
> I really don't understand this. Why the need for relentless abstraction? Just learn the ways that OpenGL is weird and use it anyway. Most people who work on these things will need to understand OpenGL anyway.
OpenGL/WebGL have a global state that affects drawing and which introduces side effects. Direct-written drawing code tends to make assumptions, which then makes it blow up when drawing code next to it makes different assumptions.
The API abstraction means you don't really know how expensive it is to make state changes.
So you tend to have either a thin abstraction that manages to set states appropriately for all your drawing code before use, flushing prior state, or you build a full local state manager that understands the 'delta' between old and new state.