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?
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.
Description. The glBegin and glEnd subroutines delimit the vertices that define a primitive or group of like primitives. The glBegin subroutine accepts a single argument that specifies which of 10 ways the vertices will be interpreted.
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:
An Intro to Modern OpenGL
Learning Modern 3D Graphics Programming
OpenGL Tutorials for OpenGL ≥3.3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With