Re: [gtk-list] Re: Using Mesa (openGL) with GTK
- From: Ivo Clarysse <soggie riv be>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: Using Mesa (openGL) with GTK
- Date: Tue, 4 Nov 1997 07:48:58 +0100 (MET)
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.
>
> The fix I've found is to force the entire app to use the best visual it
> can find. That works on my system (Sparc Solaris 2.5.1, OpenGL 1.0) at
> least. What I did to the posted code was:
>
> 1: Add GLX_RGBA to the dbuf[] array.
>
> 2: Add
>
> gtk_widget_set_default_visual (gtk_preview_get_visual ());
> gtk_widget_set_default_colormap (gtk_preview_get_cmap ());
>
> just after the call to gtk_init().
This still doesn't work on SGI boxes with SGI's OpenGL and 24-bit gfx
cards. ("**ERROR** : BadMatch")
The Mark Kilgard OpenGL articles mention a problem with having windows
with just one contained widget in a different visual than the rest of
the window, due to the fact that libXt has limited facilities for
this.
http://www.sgi.com/Technology/openGL/mjk.motif/section3_2.html :
"The Motif drawing area widget would seem a natural widget for OpenGL
rendering. Unfortunately, the X Toolkit's design (upon which Motif relies)
allows programmers to specify a widget's visual only if its class
is derived from the shell widget class. Shell widgets are often called
``top level'' widgets because they are designed to communicate with the
window manager and act as containers for other widgets. Non-shell
widgets inherit the depth and visual of their parent widget. [...]"
Does GTK+ suffer from this Xt limitation as well ?
Soggie.
-----------------------------------------------------------------------
Ivo Clarysse <soggie@riv.be>, Riverland Research Group
Research Assistant http://www.riv.be/research/
Excelsiorlaan 42
http://www.riv.be/~soggie/me/ B-1930 Zaventem, Belgium
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]