LWJGL and OpenGL package contents

Started by kraytul, February 16, 2012, 04:23:31

Previous topic - Next topic

kraytul

So, I've been trying to learn OpenGL for a project I have using LWJGL and I wanted to confirm a thing that's been killing me with regard to reading manpages and running into errors in netbeans.

if I import the package org.lwjgl.opengl.GL33, rather than getting the complete implementation of the GL3.3 core, this just implements the /new/ things that were added from openGL3.3, meaning that I cannot call GL33.glTexImage2D(...) because the GL33 package doesn't contain mappings for that function.

So... this is actually pretty annoying, because there isn't a way to simply say "I want the openGL3.3 mappings" and just derive them all from a GL33 object...  I don't have any problem with the function being the same as in oGL1.1, none at all, it just makes it very difficult to try and wade through which one of these versions a specific function may have been implemented in, just to find out whether I can use it or not.  Is there any way to perform a union of all the openGL functionality up to a given version (say 3.3) and be able to derive the functions from that union?  It doesn't seem useful to need to know which version a function was implemented in if I just want to use it, I don't care which version it came about in, and it makes the code /much/ less readable to keep switching around core versions every time I want to use functionality that is older or more recent...  If the classes are strictly independent of eachother to avoid overlap, then overlapping shouldn't break anything at all right?

It all refers to the same oGL pipeline as far as I can see...

tldr;
is org.lwjgl.opengl.GL11.glTexImage2D() is 100% functionally equivalent to the openGL 3.3 glTexImage2D()

is there a way in lwjgl to unify org.lwjgl.opengl.GL11 through org.lwjgl.opengl.GLX.X to make a single class to derive openGL functionality from?

Mickelukas

You could do a static import of the package where the GL classes are and then it doesn't matter if the function is from GL11 or GL30. I don't recommend it though as it's good to know where a function is from if you for example want to make sure that the gfx card can use the functionality before you try to use it.

Mike