Hello Guest

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

  • 4 Replies
  • 203 Views
I'm sorry if this is obvious, but I can't find what the difference between
Code: [Select]
org.lwjgl.opengl.GL15C.glGenBuffers versus
Code: [Select]
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?

*

Offline spasi

  • *****
  • 2127
    • WebHotelier
Re: What is the difference between the GL* and GL*C classes?
« Reply #1 on: April 27, 2019, 17:21:08 »
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).

Re: What is the difference between the GL* and GL*C classes?
« Reply #2 on: April 27, 2019, 17:35:59 »
Is it recommended to stick to the GL*C packages whenever possible?

*

Offline KaiHH

  • ***
  • 181
Re: What is the difference between the GL* and GL*C classes?
« Reply #3 on: April 27, 2019, 17:43:45 »
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).

Re: What is the difference between the GL* and GL*C classes?
« Reply #4 on: April 27, 2019, 17:47:15 »
Got it, thanks!