2
\$\begingroup\$

I'm just starting to learn the fundamentals of OpenGL via LWJGL. Every OpenGL function is implemented as a method on a GLxx class. The xx corresponds to the version of the spec when that function was introduced, such as GL20 for functions added in OpenGL 2.0. So far, so good.

The difficulty comes when following tutorials or looking at code that is written against the C API. I'm finding myself having to either guess or Google the version for every single function that I want to use. This is quite time consuming.

Is there a quick way of finding out which version of OpenGL any given feature was introduced? (Or any other way of figuring out the right LWJGL class for a function?).

\$\endgroup\$
0
\$\begingroup\$

The reference material on the OpenGL website is a good source for this. The function reference pages there have a "Version Support" section that details which version of the API the function in question is available in. Here's the page for glDrawElementsBaseVertex, for example.

A machine-readable form of this data is available via the API XML, which would allow you to write a parser for the supported attributes if you were so inclined, and thus build a summary page. It's a bit of work though, you may want to start from an existing tool that can parse this information. Personally I'd stick to site-restricted searches against opengl.org for the functions you are interested in. Since you know the mechanical transformation used to go from version to LWJGL scope, you should be good to go; it's a little tedious, unfortunately, but it's not the end of the world.

\$\endgroup\$
0
\$\begingroup\$

For me the fastest way has been "Find in files" feature of the IDE / text editor. Recursively searching for the function name from either LWJGL API documentation or source folder quickly reveals the correct class name. This is just a few key presses compared to switching to a web browser and searching from the reference pages.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.