Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 10 of 10

Thread: OpenGL fixed/programmable confusion

  1. #1
    Intern Newbie
    Join Date
    Oct 2011
    Posts
    46

    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....

    Thanks a lot in advance!

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    985
    Quote Originally Posted by Aliii View Post
    -How can I install a newer GL version?
    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

    Quote Originally Posted by Aliii View Post
    -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.

    Quote Originally Posted by Aliii View Post
    -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.

    Quote Originally Posted by Aliii View Post
    -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/

  3. #3
    Intern Newbie
    Join Date
    Oct 2011
    Posts
    46
    Thanks a lot! I would have a few more questions...

    "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)

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    985
    Quote Originally Posted by Aliii View Post
    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.

    Quote Originally Posted by Aliii View Post
    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).

    Quote Originally Posted by Aliii View Post
    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).

    Quote Originally Posted by Aliii View Post
    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/

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,097
    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).
    Clearly you have not supported production code

  6. #6
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    985
    Quote Originally Posted by tonyo_au View Post
    Clearly you have not supported production code
    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 10: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/

  7. #7
    Intern Newbie
    Join Date
    Oct 2011
    Posts
    46
    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

  8. #8
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    Is the Dark Side stronger?

    No! No. Quicker. Easier, more seductive.
    You can learn fast, or you can learn right. Which is more important, I'll leave to you to decide.

  9. #9
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,097
    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

  10. #10
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    985
    Quote Originally Posted by tonyo_au View Post
    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/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •