OpenGL fixed/programmable confusion

Ive been using OpenGL 1 for a few years and now I want to move on to the programmable pipeline.
There are a few things I would like to know:
-How can I install a newer GL version?
-I dont understand how the GL versions, libraries, DLLs, functions work, ...how are they compiled. I guess they are not just compiled into machine code. ...like my PC supports openGL 4, but Im writing my apps in 1.5. ...but its said that above 3.0 the deprecated functions no longer work.
-Is there such thing that I write an app in a newer GL version and it wont run on an older machine?(or vica versa)
-How hard will it be to switch to the programmable pipeline? I used GLES2 last year, I liked it, but Im so used to the glBegin(GL_LINES) kind of functions....

You don't install OpenGL, you install your graphics driver which comes with the hardware vendor's implementation of OpenGL which can be any version that your hardware/driver supports. Any not so old card (after 2006) should support at least OpenGL 3.x, but more recent ones support OpenGL 4.x

Originally Posted by Aliii

-I dont understand how the GL versions, libraries, DLLs, functions work, ...how are they compiled. I guess they are not just compiled into machine code. ...like my PC supports openGL 4, but Im writing my apps in 1.5. ...but its said that above 3.0 the deprecated functions no longer work.

Deprecation doesn't mean anything in practice. You have everything in OpenGL 4.x, including the old immedate mode stuff (i.e. glBegin), but if you want to do things properly, forget about that **** and just use buffer objects and vertex arrays.

Originally Posted by Aliii

-Is there such thing that I write an app in a newer GL version and it wont run on an older machine?(or vica versa)

Sure there is. If someone has an older hardware it is very likely that it doesn't have hardware support for certain features in OpenGL 3.x or 4.x, but even a hardware that might be able to support something it has to have recent drivers installed, and even then there is no 100% guarantee as some GPUs aren't any more supported by the hardware vendors thus drivers are not updated with newer features either.

Originally Posted by Aliii

-How hard will it be to switch to the programmable pipeline? I used GLES2 last year, I liked it, but Im so used to the glBegin(GL_LINES) kind of functions....

If you did use GLES2 then you should know how hard it is, as GLES2 doesn't have glBegin and fixed function either. Practically, that's how hard it is, like switching from GL 1 to GLES2.

Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
Technical Blog: http://www.rastergrid.com/blog/

"Deprecation doesn't mean anything in practice. You have everything in OpenGL 4.x, including the old immedate mode stuff (i.e. glBegin), but if you want to do things properly, forget about that **** and just use buffer objects and vertex arrays."

So if I have a hardware that supports GL3.x and I have the drivers installed ...then It can execute all the GL commands from 1.0 to 3.x? Can I use all those commands in my code too? Shouldn I change the headers or lib files? If yes then how come that with the new ones I can still use glBegin, while its said that in 3.1 those were all removed?
Are any of the GL libraries statically linked or will the program look for the installed ones on the machine Im running it on?
(These are not clear to me at all)

So if I have a hardware that supports GL3.x and I have the drivers installed ...then It can execute all the GL commands from 1.0 to 3.x? Can I use all those commands in my code too?

Yes, and yes.

Originally Posted by Aliii

Shouldn I change the headers or lib files?

You might need an up-to-date version of the glext.h header that is available in OpenGL extensions registry. You might also need an extension loader library like GLEW (or you can write your own ones), as every entry point that is beyond OpenGL 1.1 is usually acquired through xxxGetProcAddress (at least if you work on Windows).

Originally Posted by Aliii

If yes then how come that with the new ones I can still use glBegin, while its said that in 3.1 those were all removed?

Once again, nothing has been removed.
OpenGL 3.0 deprecated glBegin and fixed function stuff.
OpenGL 3.1 removed them, but actually reintroduced it through the ARB_compatibility extension (which all vendors support as far as I can say).
OpenGL 3.2 introduced two separate profiles: core (which does have glBegin and fixed funciton removed) and compatibility. But in compatibility profile you have everything and a compatibility profile is the default you get.

Vendors can decide that from OpenGL 3.2 if they only want to support core profile only (that's what Apple did and what should have been to proper way to do it), but most drivers do support the compatibility profile, thus you can use all that old non-sense glBegin stuff and fixed function even in OpenGL 4.3 (unfortunately).

Originally Posted by Aliii

Are any of the GL libraries statically linked or will the program look for the installed ones on the machine Im running it on?

I've never seen a single platform where OpenGL was statically linked. It is at least usually a dynamic library (DLL on Windows, SO on Linux). But why does that matter for you at all? Nothing changes regarding that from OpenGL 1.x to 4.x.

Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
Technical Blog: http://www.rastergrid.com/blog/

Vendors can decide that from OpenGL 3.2 if they only want to support core profile only (that's what Apple did and what should have been to proper way to do it), but most drivers do support the compatibility profile, thus you can use all that old non-sense glBegin stuff and fixed function even in OpenGL 4.3 (unfortunately).

Believe me, I did (even if not OpenGL code), and actually that's one more reason for saying that, as once production code reaches its level when it is not maintainable properly anymore, there is need for a clean cut.

Also, I don't really understand why it would be necessary to have e.g. transform feedback or image load/store when using immediate mode. You'd probably better of doing the whole thing on the CPU instead, as with immediate mode you'll never really use your GPU effectively enough to even justify installing one.

What I'm saying is that GL 3.x+ features will only ever really benefit only people who use VBOs and shaders anyways.

Last edited by aqnuep; 01-13-2013 at 09:09 PM.

Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
Technical Blog: http://www.rastergrid.com/blog/

Thanks a lot! Its clear now.
I think the immediate stuff is not a bad thing. Many people start to learn opengl cause its relatively easy, it gives you results fast. At least they dont end up with DirectX

What I'm saying is that GL 3.x+ features will only ever really benefit only people who use VBOs and shaders anyways.

Fortunately I have convinced my current benefactors of this and I have spent the last couple of years completely redeveloping a system that is currently all immediate mode and other ods and ends and more that 15 years old.. My previous benefactors were not so wise

Fortunately I have convinced my current benefactors of this and I have spent the last couple of years completely redeveloping a system that is currently all immediate mode and other ods and ends and more that 15 years old.. My previous benefactors were not so wise

So at the end, you do agree with me

Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
Technical Blog: http://www.rastergrid.com/blog/