tags:

views:

1792

answers:

3

Are there huge differences in OpenGL 3.x vs 2.x? Is it waste of time learning OpenGL 2.x or are they both following the same concept? I think i read somewhere that 2.x was state based and that 3.x was not, is that correct?

+1  A: 

Learn whatever has the most learning materials written about it. NeHe's tutorials are a good place to start.

I did a little OpenGL work a few months ago, and while I don't remember the version I was programming to, I can tell you that it's the concepts that are the most important. This is especially true when you're just beginning and not dealing with shaders and whatnot.

Andrew Keeton
I consider this advice dangerous: Not dealing with shaders results in learning the deprecated fixed function pipeline. The subset you apparently began with is not available in OpenGL 3 anymore.
Malte Clasen
+2  A: 

They're almost entirely backwards compatible, so anything you learn with an older version is going to apply to the later versions just fine. If you have to 'aim' somewhere in particular, 2.0 is probably a good choice. If you look at the OpenGL Wikipedia page, you can see what was added to the various versions, and decide for yourself which features you think you'll need.

Jay Kominek
Man, people keep down voting me. Suck it up. I'll stand by this advice, particularly when there still isn't anyone whose popped up with GL 3 specific resources. You can learn shaders just fine working with 2.x, and if the method by which you feed geometry to GL even a small part of your task's difficulty, I wish I were in your shoes.
Jay Kominek
+10  A: 

Be careful. OpenGL 3 deprecates a lot of functions, especially those of the early days of OpenGL. If you start with outdated tutorials (like most of NeHe), you will most probably become accustomed an outdated style of OpenGL 2.

There is no fixed function pipeline in OpenGL 3 (if you don't use the backward compatibility features). You have to use shaders. There is no glBegin/glEnd anymore. You have to use vertex buffers. Both are already available in OpenGL 2, but most tutorials start with glBegin/glEnd and setting OpenGL color properties. This is a very important difference.

OpenGL 2 provides countless ways to put something on the screen, each of which is covered in at least one popular tutorial. OpenGL 3 drops many of them, including the "beginners' subset" of OpenGL 2 (fixed function glBegin/glEnd). So if you want to target OpenGL 3 in the long term, go for it right from the start. There's nothing more demotivating than being stuck in a dead end.

Malte Clasen
OpenGL 3 doesn't drop anything. Deprecation means that it will be dropped in the future, not that it has been dropped. So long as one uses a full context, everything you're worrying about is still there.I seriously doubt drivers will drop support for the fixed function pipeline for a very long time, considering how much existing software uses it.
Jay Kominek
With OpenGL 3, in meant the whole 3.x family, and the recently released 3.2 actually drops deprecated functions. See "What's New in OpenGL 3.2", http://www.opengl.org/documentation/current_version/ : "OpenGL 3.2 and the companion OpenGL Shading Language 1.50 add many new features, while simultaneously simplifying the API and shading language by removing legacy fixed-functionality interfaces deprecated in OpenGL 3.0."
Malte Clasen
Thanx MalteThis is what i was worried about. And even if something is still there i want to learn the best way of doing things and the glBegin/End stuff does not seem to be that. So do you know where to find any opengl 3.x tutorials that does not start with the deperecated stuff?
Per Arneng
I afraid I don't. However, I can recommend the great OpenGL community at http://www.opengl.org/discussion_boards/ubbthreads.php . Probably some people in the beginners' forum know more about 3.x learning resources. And keep a copy of the official specification handy. Although it doesn't replace a tutorial, its well written and invaluable for corner cases.
Malte Clasen