X11 and OpenGL drawing together in one window
X11 and OpenGL drawing together in one window
- Subject: X11 and OpenGL drawing together in one window
- From: Robert Cox <email@hidden>
- Date: Wed, 2 Jul 2003 14:08:15 -0400
We have an brain surface visualization program that uses OpenGL to
render the surfaces. The user can draw a region-of-interest (ROI) on
the projected surface. During the mouse movement part of the drawing,
the program just draws (with XDrawLines) over the user's trace. When
the user releases the mouse button, then the surface is re-rendered
with the ROI properly shaded, colored, etc. This dual method is for
speed - we can't render the surface fast enough to keep up with mouse
movements (about 300,000 triangles - takes about 0.25 s to redraw on my
iMac, 0.20 on my PowerBook).
This works fine on Linux and SGI, where the OpenGL driver is integrated
into the X11 server. However, on the Mac, the XDrawLines stuff doesn't
appear in the OpenGL window. The program otherwise works fine - keeps
track of the mouse movements and re-renders correctly when the mouse
click is released. Furthermore, the X11 drawing commands are "there"
in some sense - if I do an XGetImage on the OpenGL window, then I don't
get the surface rendering but do get the drawn lines, even though they
don't appear in the original window.
Is this "invisibility of X11 drawing in OpenGL windows" effect due to
the rendering of OpenGL by Aqua, and never the twain shall meet? It is
a little unnerving to try to draw a precise shape with no immediate
visual feedback - not impossible, but trickier.
Also, will it be possible to XGetImage an OpenGL drawing someday? On
Linux, this is how we are making animations - XGetImage each new frame,
save it, convert the sequence to MPEG later. Pretty painless for the
user and for the programmer alike. For a sample, see
http://afni.nimh.nih.gov/afni/suma_both_1.mpg .
thanks -- Bob Cox
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/x11-users
X11 for Mac OS X FAQ: http://developer.apple.com/qa/qa2001/qa1232.html
Report issues, request features, feedback: http://developer.apple.com/bugreporter
Do not post admin requests to the list. They will be ignored.