Re: best way to handle expose events with GL canvases

Steve Lamont (spl@szechuan.ucsd.edu)
Mon, 3 Feb 97 10:59:54 PST

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

> I've got a program that uses server gl canvases, and redrawing them for each
> expose event is rather slow. What is the best way to avoid re-rendering the
> canvases? Should I draw into a pixmap and make it the background pixmap? Is
> there some double buffering thing I can use?

If you're using Mesa, then you can draw to an offscreen Pixmap or
XImage. You can then get the XID of the Pixmap or a pointer to the
XImage using one of the Mesa extensions.

Background Pixmaps won't work (at least under Mesa) because the
background is overlayed immediately (at least that's my recollection
when I played with the idea). Under real OpenGL things might work
differently, though.

> Also, is there any way to use data from different gl canvases together?
> I'd like to add two canvases up in the accumulation buffer, but it seems
> like each canvas is totally seperate as far as gl is concerned.

Offhand I'd say you're stuck but I don't have my reference manuals
here at the lab at the moment, so I won't swear to it.

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