Nathan Wride Nathan Wride - 9 months ago 69
C++ Question

OpenGL glBegin ... glEnd

I wanted to know how badly my games will be affected by using

glBegin
and whatnot instead of GLSL and VBOs and VAOs and all that. They just look so difficult and ridiculous to achieve what I can do easier. What will the effect of my choices be?

Answer Source

Badly.

The direct mode API with glBegin() and glEnd() is deprecated, largely for performance reasons. It doesn’t really support data parallelism, and relies heavily on the CPU—requiring at least one function call per vertex. That adds up quickly.

The direct mode API might be simpler and more pleasant for you to use in small projects, but using VBOs scales better, both in terms of performance and maintainability. It’s much easier to manage data than it is to manage state.

Also, learning the new API means you’re up to date on how OpenGL is and should be used in the real world. If you’re looking to work in the games industry, for example, that’s just plain useful knowledge.

Some useful learning materials: