Really confused with all the OpenGL version

Hey guys!
I am looking forward to develop a 2d game, but I really want to use the OpenGL library, I will probably use the LWJGL as a wrapper.
My main problem is that I don’t know what version I should learn… I have learned the basics of 1.1 and did a simple game and painted few cubes on the screen.
I want my game to be able to run almost on every computer(something in the zone of minecraft) and when I mention every computer, I also mean OS because I’ve understood that only few versions of OpenGL can run on mac.
So my question is simply, what version should I learn for my needs?
If you can, please provide me a few good resources, books are acceptable too.

Thank you very much in advance :slight_smile:

There is no such thing as which version should I learn. It really depends.

First off all lets take versions 1.1 for example. It contains more than just rendering method. It also contains some other methods which are like a must for your application. So even if you’re making a game with higher versions, you will need to use lower versions.

You should be asking what rendering method you want to use. There are few rendering methods available, however only 1 is supported by modern OpenGL. All the rest are deprecated. Here are the modes: (I might not even know all of them)
-Immediate mode - very slow, but very easy to use.
-Display Lists - very fast, easy to use, but cannot modify the data after you send it to GPU.
-Vertex Arrays - I think it is like display lists, but you can modify the data after sending it to GPU. It is easy to use.
-Vertex Buffer Objects (VBOs) - not the fastest, hard to use(for beginners), can modify the data. I don’t really know the difference between VBO and Vertex Array, but I think VBO is better. This is the only rendering mode that is supported by modern OpenGL.

If you’re just starting out in OpenGL, you should just go with Immediate rendering mode, which is all contained in OpenGL version 1.1

Hope this helps ! :stuck_out_tongue:

PS

Check out some of these youtubers, they make pretty awesome LWJGL tutorials for beginners!
-thecodinguniverse - http://www.youtube.com/user/thebennybox
-thebennybox - http://www.youtube.com/user/TheCodingUniverse

As long as you stick to 2.x and lower you should be fine. Unless you’re doing anything fancy with shaders or framebuffers, you can probably get by with OGL 1.x. Mac supports up to 2.x (or 3.2, but in that case you’ll lose backwards compatibility with deprecated functions).

As advised above, do start out with old OpenGL (immediate mode, display lists etc…) But don’t get hung up on it like I did. I spend nearly a year messing around with immediate mode when I could have been learning more about shaders. Shaders are possibly the single most useful thing ever, and I still barely understand them because I spent so much time learning deprecated code and not new OpenGL. I would recommend that as soon as you’re comfortable with immediate mode and all the other 1.1 functions, to move up to VBOs and shaders. Watch theCodingUniverse and try to modify his code so that it uses modern OpenGL instead of old, it’s a really great way to learn!

Edit: People will tell you everyday that you shouldn’t be using immediate mode/display lists. While they’re right, ignore them for now. Everyone tries to pressure you into the hard stuff first, which I’ve never understood. Just stay persistent and don’t give in to their pressure unless you’re ready to learn the new stuff!

Good luck! :slight_smile:

Thank you very much guys! Very helpful information, so your saying I should be based on version 2.1?

When you feel like you’re ready, yes, you should learn 2.1+ versions. Don’t just sit at 2.xx versions though, keep learning more modern OpenGL. The other thing is, you’ll need to learn matrices if you ever want to completely get rid of the old fixed function pipeline. Just something to consider!

The problem with opengl on macs is that apple ships with it’s own drivers, it won’t let developers to work with low level hardware directly. This is the main cause for the lower versions of opengl on macs. A good news is that Osx Maverics supports opengl version 4.1

Can you recommend me any good book? or a tutorials?

I already did in my first post :stuck_out_tongue:

Yes saw that, but are they teaching 2.1?

@SHC I don’t believe OP stated he has a Mac?
theBennyBox uses strictly above 2.0 code I believe, maybe even 3.x, however theCodingUniverse doesn’t.

@opiop65

I didn’t say that OP mentioned he has a mac. I posted that news since he mentioned the maximum OpenGL version that macs have.

Yes, I know, it just seemed odd that you would mention a Mac, sorry :stuck_out_tongue: Didn’t mean to be rude!

You are welcome. I didn’t take your comment seriously by the way, I didn’t see anything that seemed rude in it.

You might check out the stats for Minecraft itself, on its users:

http://www.java-gaming.org/topics/mojang-hardward-stats/26377/msg/231108/view.html#msg231108

The post is from May, 2012. I don’t know if the stats have been updated or not.