OpenGL in GTK applications

Ars Technica is running an article on Mirco Müller's talk at FOSSCamp where he suggests that people use OpenGL to make desktop applications richer.

From the article: "Core GTK people haven't decided how they want to approach OpenGL integration yet," said Müller during the session. "It's still in the experimental phase."

This would pose a problem for many developers who, naturally, would want a stable foundation for their user interfaces.

The article also reads: "GTK application developers can use the GTK/GLExt bindings, which are very effective despite not yet being an official part of GTK."

What the article does not mention is that GTK/GLExt is not maintained. In particular, it does not support the GL_ARB_multisample which provides a convenient anti-aliasing standard which is universally implemented. Developers could go around this problem by implementing anti-aliasing through some other scheme, for example using the accumulation buffer or through some Cairo hackery.

Although I appreciate that Müller would like to see nicer looking graphical interfaces, I think it is at best impractical, and at worst impossible for many developers to employ OpenGL directly. For any of this to get some more mainstream momentum, the GTK core people will have to devise a better way to integrate OpenGL with GTK.

And the above completely ignores the can of worms a developer opens when he dives into OpenGL, which is in a world of its own. OpenGL is not multi-threaded, so a developer must devise a bullet proof context switching design (or limit drawing to a single thread). Furthermore, a GTK user would find himself having to deal with OpenGL implementation incompatibilities, which will depend heavy on the graphics chip available.

In a perfect world, Cairo would have a nice OpenGL accelerated backend, so a developer would be able to focus on his program's main purpose rather than endlessly hack on the graphical user interface. But this perfect world is not as far off as you might think: Glitz is the OpenGL backend for Cairo. But, unfortunately, it is both experimental and unmaintained.