[Development] QtCS: OpenGL session notes
sean.harmer at kdab.com
Tue Jun 26 11:16:44 CEST 2012
On Monday 25 June 2012 11:44:09 Girish Ramakrishnan wrote:
> OpenGL session notes (pasted from
> so you can comment inline.
Sorry I could not attend this year but the QtCS clashed with my family
> Thanks to Samuel for leading the session and taking the notes!
> Future plans
> - Desktop OpenGL 3+ support, ES 3 support
I have started work on this (desktop for now until ES 3 is released). The
general idea is to make it as simple as possible to get up and running with
OpenGL and Qt without having to resort to manually resolving entry points or
trying to mix in GLEW or similar.
I have written a small parser for the OpenGL spec files. The idea is to use
the parsed information along with a code generator to create a family of
classes (API still being determined) similar to QOpenGLFunctions.
These classes will contain functions for each OpenGL version and profile.
QOpenGLContext could be modified to return a pointer to the class appropriate
for the requested context.
This has the advantage of having access to OpenGL functions per context (entry
point addresses can change between contexts on some platforms) and providing
compile-time errors if you try to use functions not present in a given version
and profile (e.g. glBegin() with an OpenGL 3 Core Profile context).
Aspects that still require some thought are how to incorporate OpenGL
extension entry points and higher level "is feature X available". For the
latter, a given feature may be provided either by the core functionality in
some versions of OpenGL or by extensions in earlier versions. This kind of
query is needed to re-enable support for Geometry shaders and to introduce
support for Tessellation shaders in QtGui.
I also have some ideas (and some code cooking) for other "enabler" classes
> - QOpenGLWindow
Yes this would be a useful convenience class to have.
> - Shared cross process graphics buffer APIs
> - copy to texture
> - bind to texture
Along these lines it would be nice to have OpenGL texture formats as storage
formats in QImage. There is also no replacement in QtGui for
QGLWidget::convertToGLFormat() as yet.
More information about the Development