Re: [gtk-list] Re: Using Mesa (openGL) with GTK



I wrote a gtk_gl_drawing_area widget for some of my GL test programs,
and possibly a program I may or may not finish in the future.  One
just sends it the attribute list when creating the widget:

gldarea = gtk_gl_drawing_area_new(attribList);

The above call uses glXChooseVisual and glXCreateContext.  Also, it
has methods for gtk_gl_drawing_area_make_current and
gtk_gl_drawing_area_swap_buffers (which just calls glXSwapBuffers).
It's not done really since I've not tested it out on many things yet,
but it works on my test programs so far, but it does make things a bit
cleaner at least for my programs.

I've also written a gtk_dbe_drawing_area widget which utilizes the
X/Windows double buffering extension for something else I want to
write, but this is another story...

--
Regards,
Andrew Veliath
veliaa@frontiernet.net, veliaa@rpi.edu

>>>>> Ivo Clarysse writes:

    Ivo> On Tue, 4 Nov 1997, Ivo Clarysse wrote:
    >> On Sun, 19 Oct 1997, Bj|rn Augustsson wrote:
    >> 
    >> > Juergen A. Erhard (jae@laden.ilk.de) wrote: > >It works for
    >> me after changing dbuf in gui_init to start with GL_RGBA > >and
    >> put the GLX_DOUBLEBUFFER at the end. Took me a couple minutes,
    >> and > >comparing with glxdemo.c in Mesa 2.3...  > > I also
    >> inserted GLX_RGBA, but doing just that that doesn't work well
    >> at > all, since the toplevel widget gets the default visual (In
    >> my case > PseudoColor 8), and then the program tries to attach
    >> the TrueColor 24 > visualled glarea widget to it.  > > The
    >> results are some pretty nasty kernel messages about failed
    >> asserts > and the GL rendering seems to be in black&white. (not
    >> grayscale, B&W) > > This should really be possible to do, as it
    >> seems there is an OpenGL > widget for motif that can do it. (As
    >> seen in Mark Kilgards excellent > article from the X Journal,
    >> which can be found at >
    >> http://www.sgi.com/Technology/openGL/mjk.motif/ ) > I don't
    >> know how though.

    Ivo> OK, I played around a bit, and I think I've got it.  The
    Ivo> following code works both on my Linux box (8-bit display)
    Ivo> using Mesa, as on a SGI box with 32-bit display and true
    Ivo> OpenGL.  It only uses a TrueColor visual for the OpenGL
    Ivo> stuff, the rest is in whatever visual GTK decides it wants.
    Ivo> (I must say, the gtk_widget_{push|pop}_visual semantics are
    Ivo> not very intuitive, it doesn't really 'push' the argument,
    Ivo> but pushes the current value and replaces it with the
    Ivo> argument).



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