Re: XForms: OpenGL colortable

Steve Lamont (spl@szechuan.ucsd.edu)
Mon, 5 Jan 98 05:52:13 PST

To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> The glcanvas seems to have the wrong colortable on linux systems.
> While simple graphics using only red/green/blue like the gl demos
> in the forms distribution work, scenes with more colors (especially
> when lighting is used) look like they are based on a wrong colortable.
> I looked around in the gl.c file coming with the library and found
> out that removing the fl_set_canvas_colormap statement (l.182 in
> V0.88) solves the problem (whatever this means?).

It means you're using the default Colormap instead of the one which
gl.c creates for you. This, in the general case, is what you want.

I've modified gl.c as follows:

[...]

/* change canvas defaults */
fl_set_canvas_visual(ob, vi->visual);
fl_set_canvas_depth(ob, vi->depth);

screen_number = DefaultScreen( fl_get_display() );
default_visual = DefaultVisual( fl_get_display(), screen_number );
if ( default_visual->class != vi->visual->class )
fl_set_canvas_colormap(ob, fl_create_colormap(vi, 1));
else
fl_set_canvas_colormap( ob,
DefaultColormap( fl_get_display(),
screen_number ) );
[...]

with declarations as appropriate.

This seems to work better for me.

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bloch.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/