General direction question: OpenGL/Qt Quick
-
Good morning,
I need some general guidance about working with OpenGL and Qt Quick. I'd like to avoid heading down roads that lead to dead ends but my vision doesn't extend very far and my crystal ball is in the shop. (The last time I was fortune telling the client got mad and threw it at me).I'm interested in combining a 3d graphics library with Qt Quick. The graphics library is written so you can abstract the drawing to your own rendering classes. It already has an OpenGL renderer plugin but it does NOT play well with Qt Quick. So the idea is to rewrite the OpenGL renderer so it will work (with Qt5.1)
I'm an OpenGL noob. Any pointers to OpenGL knowledge would be appreciated. I know c++/c/assembler but not OpenGL.
So far my understanding is:
- video cards support some subset of OpenGL functionality depending on the manufacturer's whim.
- Some of what they support may be buggy/not implemented well.
- You obtain function pointers at run time which allow you to call desired functions
My questions:
-
Examining Qt5 context classes it appears the functions available are linked to the version requested in the context. Can I mix function calls from different OpenGL versions? If I find that on a specific card a specific function is broken can I replace that single function call with a one from a different OpenGL version?
-
Can I can get pointers to ALL OpenGL functions through the getProcAddress() name resolution?
-
I see there are ARB versions, non ARB versions, EXT versions, and vendor add ons. Can you mix and match function calls or do you have to investigate each one separately?
-
Is there a good place to find information about which cards/versions/functions are broken?
-
I see "Qt5 has the QOpenGLFunctions":http://www.kdab.com/opengl-in-qt-5-1-part-1 class that has members for each function/version of OpenGL. I can't see how this is supposed to work. There doesn't seem to be a non abstract base class so I can't write code that will work against any version of OpenGL. I could write giant switch statements but that doesn't seem any better than just calling through function pointers. If there are buggy functions it would be impossible to change the resolution of a single function.
Thanks for your time,
Jay
-
Hi,
[quote author="jsprenkle" date="1381503943"]Can I mix function calls from different OpenGL versions?[/quote]
Yes, you can. OpenGL versions are like CSS: the last version contains all functions of the previous versions. So, if you're using OpenGL 4.3, you can use all functions of the 4.3 version and lesser. In the other hand, the latest versions declare some functions as deprecated: the profile is the point here. If you're using a compatibility profile, you will be allowed to use deprecated functions; a core profile will forbid you to use deprecated functions.
[quote author="jsprenkle" date="1381503943"]If I find that on a specific card a specific function is broken can I replace that single function call with a one from a different OpenGL version?[/quote]
[quote author="jsprenkle" date="1381503943"]I see there are ARB versions, non ARB versions, EXT versions, and vendor add ons. Can you mix and match function calls or do you have to investigate each one separately?[/quote]ARB, EXT, and vendor addons are OpenGL extensions, i.e. functions that aren't yet added to an "official" version. In other words, all OpenGL functions were extensions one day. So, if you find that, on a specific card, a function isn't available (meaning your OpenGL version isn't big enough), you can try to load the extension version instead. And yes, you can mix different extensions.
[quote author="jsprenkle" date="1381503943"]Can I get pointers to ALL OpenGL functions through the getProcAddress() name resolution?[/quote]
You can, but Qt classes already do that for you.
[quote author="jsprenkle" date="1381503943"]Is there a good place to find information about which cards/versions/functions are broken?
[/quote]"OpenGL wiki":http://www.opengl.org/wiki/Main_Page is a good place.
Remember that QtOpenGL objects (QOpenGLShader, QOpenGLVertexArrayObject, etc.) allow you to use OpenGL without to have to load the functions by hand.