Re: [GtkGLExt] What about GTK+-3.0 support?



On Wed, 2011-07-27 at 17:17 +0200, Remco wrote:
> For inspiration, take a look at Java's OpenGL bindings, which
> introduce the concept of 'profiles'. They are very easy to use:
> http://michael-bien.com/mbien/entry/jogl_2_opengl_profiles_explained

Hmm...  that approach makes sense for JOGL, but I don't think it makes
as much sense for GtkGLExt.

JOGL's approach means that you're limited to the profiles that the
library explicitly supports.  When OpenGL 5 is released, you can't use
it with JOGL until a new version of JOGL is released too.  And that's
OK, because JOGL acts as the interface to all of OpenGL; a new version
of JOGL is needed anyway, to add Java methods corresponding to the new
GL functions.

The situation is different for GtkGLExt because it doesn't wrap the
OpenGL API, it just wraps GLX/WGL/CGL for creating contexts.  When
OpenGL 5 is released, GtkGLExt doesn't need to *do* anything to support
it, besides pass the number 5 to glXCreateContextAttribsARB() or its
WGL/CGL equivalent.  That shouldn't necessitate an upgrade of the
GtkGLExt library itself.

I like the design of glXCreateContextAttribsARB() because it's
future-compatible: it supports an unbounded set of OpenGL versions, not
just the ones that are known today.  For a library whose main purpose is
to wrap GLX, I think that's a good design to follow.

(I think it'd be useful, though, if apps could optionally bypass
GtkGLExt's context creation entirely and provide their *own* context to
be attached to a GTK widget.)
-- 
Mike Paul <mike wyzardry net>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]