OpenGL 2.1 and glBegin()/glEnd()

1k views Asked by At

there are lots of OpenGL tutorials out there - I think more than 90% of them make use of glBegin()/glEnd() with vertices set between these two calls. Now I found some people telling me these functions are deprecated and no longer available in newer versions of OpenGL.

So: is this correct?

In my application I have to be compatible with OpenGL 2.1.

2

There are 2 answers

4
Ramil Kudashev On

Yes, glBegin()/glEnd() methods are deprecated. glDrawArrays is a modern approach and it is available in OpenGL 2.1. Here is related question on SO.

Also, I doubt about this 90% value.

0
Fabrice NEYRET On

The answer is yes and no. The spirit of OpenGL 2 and more is to no longer use immediate mode and fixed pipeline. From OpenGL 3, these are "deprecated". But fortunately at the same time was recognize "Legacy OpenGL" And ARB compatibility extension. So you do can use still use them (modulo some variations between OS about what is inside or not).