Re: XForms: OpenGL colortable

Steve Lamont (spl@szechuan.ucsd.edu)
Wed, 7 Jan 98 06:59:52 PST

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

> as a user of a Sun Workstation with 8-bit graphics using twm or similar
> (and I'm certainly not the only one out there) I strongly support this motion.
> How about it TC?

I've put my mildly hacked version of gl.c in

ftp://ncmir.ucsd.edu/pub/xforms_hacks/gl.c

It has the color table mods as well as a couple of other modifications
which I found necessary or useful. First off, it handles finding an
appropriate Visual in a little different manner. Second, it adds
three new callback options: glcanvas_init_callback,
glcanvas_activate_callback, and glcanvas_cleanup_callback. The
callbacks may be called at init, activate, and cleanup, respectively.
The funcitons to set them are

void fl_set_glcanvas_init_callback( FL_OBJECT *ob,
void (*callback)( FL_OBJECT *ob ) )
void fl_set_glcanvas_activate_callback( FL_OBJECT *ob,
void (*callback)( FL_OBJECT *ob ) )
void fl_set_glcanvas_cleanup_callback( FL_OBJECT *ob,
void (*callback)( FL_OBJECT *ob ) )

and the function called is of the form

void glcanvas_callback( FL_OBJECT *ob )

[There probably should be a `void *data' parameter there but I didn't
have need for it at the time I added them].

Finally, error conditions are handled though a user supplied function,
abend() [yes, my old IBM mainframe roots are showing]. In this case,
it can be as simple as

void abend( char *message )

{

fprintf( stderr, "%s\n", message );
exit( 1 );

}

[my own private library version is somewhat more elaborate, taking
varargs arguments and acting more like fprintf()].

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/