Re: OpenGL support in GTK+

Josh Beam wrote:

On Wed, Sep 17, 2003 at 04:38:37PM -0400, Havoc Pennington wrote:
GtkGLExt might be what you're thinking of. But, like Owen said in
Bug 119189, it doesn't really fit into the GTK+ model very well.
This is untrue. GtkGLExt does fit in with the GTK+ 2.0 model. Having just written a C++ binding for GtkGLExt I'm familiar with it's structure. GtkGLExt is implemented as the interface class, GdkGLDrawable, that derives from GTypeInterface, and two classes that derive from GObject, GdkGLConfig and GdkGLContext. Then there are several functions that extend the GTK+ API. There are two Pango font functions, three GDK init functions, three GTK init functions, and there are numerous GdkPixmap, GL query, GDK drawing, GdkWindow and GtkWidget functions. That's it. The only thing missing from GtkGLext is GtkGLDrawingArea. Currently this is left as a repeditive coding exercise for the programmer.

It shouldn't be too hard to move GtkGLExt into GTK+. I think it would best to put it into a separate namespace, gdk-gl, like gdk-pixbuf. GdkGLDrawable, GdkGLConfig and GdkGLContext fit would right in with the existing GObject system. This leaves:

1. Dealing with the GDK and GTK init functions.

2. How best to incorporate the extension API for Pango fonts, GdkPixmap, GL query, GDK drawing, GdkWindow and GtkWidget functions.

3. There also needs to be a GtkGLDrawingArea widget that derives GtkDrawingArea.

The advantage of GtkGLExt over something like GtkGLArea is that GtkGLExt is primarily an interface that can be implemented by any widget, making it Open-GL capable. Though most of the time you would only need to use a widget like GtkGLDrawingArea, but the flexability is there.

Jeff Franks.

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