What is the difference between the GL* and GL*C classes?

Started by WeBeJammin, April 27, 2019, 17:05:00

Previous topic - Next topic

WeBeJammin

I'm sorry if this is obvious, but I can't find what the difference between
org.lwjgl.opengl.GL15C.glGenBuffers
versus
org.lwjgl.opengl.GL15.glGenBuffers
. The documentation seems to be identical, but I'm clueless as to when I should use the C versus not. What is the purpose of the GL*C packages?

spasi

The GL*C classes contain only functions & tokens that are present in the OpenGL Core profile. Whereas GL* classes contain everything, including deprecated functionality (the OpenGL Compatibility profile).

WeBeJammin

Is it recommended to stick to the GL*C packages whenever possible?

KaiHH

It depends on what you target as baseline OpenGL version for your application.
When you only plan to use OpenGL <= 2.1 functions/constants and hence do not make/want a distinction between core and compatibility profile, then it does not matter and in fact I'd use the classes without the 'C' suffix as that will give you access to all functions and constants (even though they may have become deprecated in OpenGL 3.2 core). You would still be able to use the fixed-function pipeline, if you wanted.
If you want to make sure that your application is portable to newer OpenGL versions once you choose to do so, then you should use non-deprecated OpenGL functions and therefore the classes with the 'C' suffix. That also means no fixed-function pipeline stuff since in newer OpenGL versions (starting with 3.2) you won't be able to use deprecated features with some OpenGL driver vendors anymore (e.g. Intel and Nvidia/AMD drivers on Mac OS - they only support forward-compatible core profiles starting with OpenGL 3.2).