XForms: Still no multiple gl canvases...

Steve Lamont (Daniel.Weiss@phys.uni-goettingen.de)
Sat, 28 Nov 1998 20:40:41 +0100 (MET)

# To subscribers of the xforms list from <Daniel.Weiss@phys.uni-goettingen.de> :

>
> # To subscribers of the xforms list from Humberto Cervantes Cuevas <hcc@hp9000a1.uam.mx> :
>
> Hi!
>
> Recently I had a similar problem with using multiple glCanvases.
>
> What I did was this:
>
> inside of the Expose function:
>
> int Expose(FL_OBJECT *ob,Window win,int w,int h,XEvent *xev,void *ud)
> {
> glXMakeCurrend(fl_display,win,form->FIRST_CANVAS->u_vdata);
>
> // draw things for canvas 1
> .
> .
> .
>
> glXMakeCurrent(fl_display,win,form->SECOND_CANVAS->u_vdata);
>
> // draw things for canvas 2
> .
> .
> .
>
> }

<SNIP>

Thanks for the replies! But that doesn't seem to work for me.
Mr Lamont suggested using fl_activate_glcanvas(FL_OBJECT *ob)
(which I did use in my original expose handler), and which, as far
as I understand, takes care of getting the context and making it
current, so one shouldn't need either glXMakeCurrent()
or fl_get_glcanvas_context(). Quote from the manual:

>In case of multiple canvases, the canvas driver takes
>care of setting the proper context before invoking the
>expose handler. In some cases, the application may
>want to draw into canvases actively. In this case,
>explicit drawing context switching may be required. To
>this end, use the following routine
> void fl_activate_glcanvas(FL_OBJECT *ob)
>before drawing into glcanvas ob.

Now does this mean that I need no context switching in my expose handler,
since "the canvas driver takes care of setting the proper context
_before_ invoking the expose handler"?
Anyway, I'm also interested in the "draw into canvases actively" bit.
And for me, using fl_activate_glcanvas() on anything but the primary
canvas results in the aforementionned X error

X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 143 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 16632
Current serial number in output stream: 16632

This is Xforms 0.88 on Irix 6.4. The error occurs on first call to
fl_activate_glcanvas() with the secondary canvas (this is on another form)
as argument; I can use it on the primary canvas without problems, but that
doesn't help a lot.
Is there something essentially lacking in the approach "add another canvas
to one of your forms, and when you need to, fl_activate_glcanvas() it and
draw to it"? With no other tricks?

Thanks, Dennis
_________________________________________________
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://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/