Dewey Anderson (dewey++at++evt.com)
Mon, 4 Dec 1995 19:32:31 -0800
Currently, in my init_performer function at initialization time, I pass
in the display, window and pfGLContext of that window and assign them
with pfPipeWindow::setWSWindow and pfPipeWindow::setGLCxt:
init_performer(Display *dpy, Window xwin, pfGLContext cx)
{
/* Initialize Performer */
pfInit();
pfMultiprocess(PFMP_APPCULLDRAW);
pfConfig();
/* Configure and open GL window */
pfPipe *p = pfGetPipe(0);
pw = new pfPipeWindow(p);
pw->setWSWindow(dpy,pwin);
pw->setGLCxt(cx);
pw->open();
......
}
The first problem is that at this stage, the old stuff can no longer
draw in that window. At least we don't see it.
Then, depending on user input, the program can call a function to build
a performer scene, followed by an animation loop that modifies a dcs
and calls pfFrame.
In this situation, the Performer animation CAN run repeatedly
(rebuilding the scene and looping) and be seen UNTIL we do something
that causes an expose event in the original stuff. That stuff calls
glXMakeCurrent with the same graphics context, does its drawing and
then calls glXMakeCurrent(dpy,0,0) to clear the context. Once that
stuff has been called, subsequent attempts to run the Performer
animation generates a Performer error message:
PF Warning/Internal: pfGetVClock: failed with GLX error 0x5.
(We believe this is due to the fact that the original code has done
a glXMakeCurrent(dpy,0,0) removing the current context.)
If we put a call to glXMakeCurrent at the beginning of the scene build,
we can run the Performer animation ONCE and subsequent calls (to rebuild
and loop) only result in a flicker of the last two frames, apparently
as the buffers are swapped. It would appear that no new drawing is
being done. This makes it look like the SECOND (and later) calls to
glXMakeCurrent are hosing things.
So the question is: In the same thread, how can we get multiple contexts
to peacefully coexist? Or are we getting into trouble by trying to
get Performer to live in an OpenGL program as opposed to getting
OpenGL to live in a Performer program?
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:06 PDT