Hello Guest

using later GL standards without depricated older standards

  • 6 Replies
  • 4673 Views
using later GL standards without depricated older standards
« on: November 22, 2014, 09:43:08 »
I like the way the tests statically import GL1.1 however the structure of the bindings seems to be there is no way to use say *just* GL3.3 without importing some deprecated bits of GL1.1 (I could be wrong!)

If I want use say GL3.3 and I want to use GL_TRUE etc I seem to need to import GL1.1 as well.

However it would be quite possible for me to then use some deprecated function of GL1.1 and end up with a not really GL3.3 application...

Do bleeding edge cards even know about glVertex (for example) ? can they even run in GL1.1 mode ?

Is it quite possible to accidentally make an app that might work on one card but baulk at some post deprecated function ?

Am I missing something here ?

*

Offline Cornix

  • *****
  • 488
Re: using later GL standards without depricated older standards
« Reply #1 on: November 22, 2014, 10:06:23 »
It is not like GL11 contains only deprecated functionality. Rather GL11 contains all functionality that was present at OpenGL version 1.1.
Methods like GL11.glEnable(param) are still used even in OpenGL Version 4.X.

OpenGL is also downwardly compatible. Newer cards can still use OpenGL 1.1 functionality, in the worst case it will be done by the software driver that will translate it to newer methods for the graphics card.

Re: using later GL standards without depricated older standards
« Reply #2 on: November 22, 2014, 10:12:00 »
I kinda suspected that would be the case, I don't doubt you at all, but out of curiosity can you cite an official source for this backwards compatibility? (you never know I might learn something!)

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: using later GL standards without depricated older standards
« Reply #3 on: November 22, 2014, 13:52:01 »
You can use the forward compatibility flag when creating the OpenGL context. With GLFW, this means:

Code: [Select]
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);This will be detected by LWJGL and it will not load function pointers for any deprecated OpenGL function. This will work with either Core or Compatibility profile contexts, which is important, because using the Core profile often means additional driver overhead. Note this will only work with functions, LWJGL cannot do anything about deprecated constants. You can use a Core profile context to be absolutely sure:

Code: [Select]
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // requires OpenGL 3.2 or laterFor more information, see Core and Compatibility in Contexts.

On legacy functionality, modern GPUs indeed have no hardware dedicated to obsolete OpenGL features. They're emulated with shaders managed by the driver.

Re: using later GL standards without depricated older standards
« Reply #4 on: November 23, 2014, 14:57:14 »
I had to also add
Code: [Select]
        glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); // Use OpenGL Core v3.2
        glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
or am I doing something wrong?

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: using later GL standards without depricated older standards
« Reply #5 on: November 23, 2014, 16:05:48 »
GLFW_OPENGL_FORWARD_COMPAT requires OpenGL 3.0+ and GLFW_OPENGL_PROFILE requires OpenGL 3.2+.

*

Offline ra4king

  • **
  • 58
  • I'm the King!
    • Roi's Website
Re: using later GL standards without depricated older standards
« Reply #6 on: November 23, 2014, 23:46:09 »
Is reading really that difficult? ???
-Roi