New user of LWJGL looking for help/clarification

Started by pyraetos, December 28, 2012, 01:44:47

Previous topic - Next topic

pyraetos

Well, I'm a bit confused by the way the OpenGL API is set up.

I've used Java quite a bit, but have never tried programming with OpenGL until now.

From the basic LWJGL tutorials, I believe that each API class (GL11 - GL43) contains the methods added in that specific version of OpenGL. As a newbie, it's difficult to use online OpenGL docs to find the function I need when I don't know which version class to use. I was asking myself: why isn't there just one class with all the functions?

Another problem is that those tutorials and examples only use GL11, which seems to be outdated? The official OpenGL API docs (http://www.opengl.org/wiki_132/index.php?title=Category:Core_API_Reference&pagefrom=GetTransformFeedbackVarying%0AGLAPI%2FglGetTransformFeedbackVarying#mw-pages) don't even describe any of the functions used in those examples. :(

I'd like to know which functions aren't outdated and which classes in org.lwjgl.opengl to use. It would also be nice to know a place online that will describe every function I need to know :)

Thank you for your patience!

Update:
I believe I've answered most of my questions, having found this section of the OpenGL wiki (http://www.opengl.org/wiki/Legacy_OpenGL)

I've also learned to just static import every GL class so I don't have to worry about which I need to use.

If anyone would still like to add anything to help me, feel free!

quew8

Welcome,
Your first problem: is it that you don't know which class to look for methods? If so then a topic on these forums you might enjoy http://lwjgl.org/forum/index.php/topic,4841.msg25997.html#msg25997. I have not tried it myself but it seems to be the sort of thing your looking for. The reason for separating up the versions is to allow you to target a particular version of opengl. Can you imagine how long it would take to look up the version each method was introduced in to ensure it isn't above your target?

As for which versions methods to use, I would advise using opengl 3+. GL11 is certainly outdated and there was even talk of removing it from LWJGL in the 3.0 release. The LWJGL wiki has some excellent tutorials on the more advanced 1-2 range (under legacy opengl) as well as 3.2. I advise you give them a read http://www.lwjgl.org/wiki/index.php?title=Main_Page. If you think they are a bit too advanced for you atm, then using GL11 is a good way of learning the basics. (I didn't have a hope of understanding vbos until using GL11 for a few months).

spasi

Quote from: pyraetos on December 28, 2012, 01:44:47I've also learned to just static import every GL class so I don't have to worry about which I need to use.

Just make sure that you've checked that whatever it is you've statically imported is available in the current context (using GLContext.getCapabilities()). Here's a nice summary of OpenGL features supported across different vendors: OpenGL matrix 2012-12.

pyraetos

Quote from: quew8 on December 28, 2012, 14:37:22
Welcome,
Your first problem: is it that you don't know which class to look for methods? If so then a topic on these forums you might enjoy http://lwjgl.org/forum/index.php/topic,4841.msg25997.html#msg25997. I have not tried it myself but it seems to be the sort of thing your looking for. The reason for separating up the versions is to allow you to target a particular version of opengl. Can you imagine how long it would take to look up the version each method was introduced in to ensure it isn't above your target?

As for which versions methods to use, I would advise using opengl 3+. GL11 is certainly outdated and there was even talk of removing it from LWJGL in the 3.0 release. The LWJGL wiki has some excellent tutorials on the more advanced 1-2 range (under legacy opengl) as well as 3.2. I advise you give them a read http://www.lwjgl.org/wiki/index.php?title=Main_Page. If you think they are a bit too advanced for you atm, then using GL11 is a good way of learning the basics. (I didn't have a hope of understanding vbos until using GL11 for a few months).

Ah okay, thank you for the help and links.

I didn't realize GL11 was outdated since the basic tutorials on the wiki use it exclusively. I've since learned how to use buffer objects instead of those outdated functions though. I think I'm getting used to it. :)

spasi

Not all of GL11 is deprecated. There are more than 50 functions in GL11 that exist in the Core profile and are not going away.