3 ms·
OpenGL isn't hard, but it's API is outdated and full of surprises. Error reporting is bad (glGetError), debug context works somewhat better (error callbacks), b
by skocznymroczny 6y ago
OpenGL isn't hard, but it's API is outdated and full of surprises. Error reporting is bad (glGetError), debug context works somewhat better (error callbacks), but I had errors that reproduce on debug context only. C API is very weakly typed, so it's easy to pass GL_RGBA to a function which expects GL_RGBA8. But the worst part of OpenGL is the state machine. OpenGL is the only graphical API still remaining that has the concept of state machine, and it causes a lot of trouble when rendering. You basically have to abstract the entire state machine on your side of code, or defensively back out all state changes that you do. Modern APIs are more stateless, and state object is passed along with the drawcall, more or less, without affecting any other drawcalls in the commandbuffer.
- jfkebwjsbx 6y agoLegacy OpenGL is a pain not because of the state machine, but the many ways of doing things, some of which are slow. The weird function names don't help either. WebGL is better than that because it is only the useful, fast subset, and provides some objects too. Plus JavaScript is easier to work with than C, too. Anyway modern APIs are not stateless, having an object that contains the state is the same. In the end, it is still all about bind this, bind that, do this, do that.