Wade Olsen (wade++at++slack.shoreline-studios.com)
Wed, 5 Nov 1997 19:22:46 -0800
After about a week I've finally got it wrestled to the ground. Thanks
to everyone who responded with helpful hints. They were invaluable.
In case your interested in what happened, here's the details:
Why am I using pbuffers?
Well, because of the "unique" architecture of the O2, applications
that want to draw OpenGL destined to the video output AND do so in an
efficient manner have to render into a pbuffer that has been created
as digital media buffer. Out programs needs to render into a pbuffer
or a glx window, dynamically decided at runtime.
What finally worked?
What finally worked was to create the display connection, framebuffer
configuration, drawable, and graphics context using X, motif, and GLX
calls for a pbuffer and for a regular glx window. And then just set
all this stuff in the Performer pfPipeWindow using the display,
visual, drawable, and context for the regular window only so that the
pfPipeWindow won't create it's own versions. Sadly, this can't be done
using the pbuffer drawable as performer will cause X to "crap out" by
calling XGetWindowAttributes on the pbuffer.
Here's the sleazy part. Then, in the Performer channel draw callback,
if we're in live-video-out-mode-so-we-gotta-render-into-the-pbuffer
mode I just re-bind the same context to the pbuffer drawable before
drawing the scene.
We've been using Performer 2.1 and apparently some of the stuff I
tried first would have worked on later versions of performer.
Pitfalls that I fell into (often and deeply):
You can't bind a graphics context using a different display pointer
than the one the graphics context was made with.
You can't bind a graphics context to a drawable created with a
different framebuffer configuration than the one the context was
created with UNLESS the context is created as being shared with
another context that WAS created with the new drawable's
configuration. (you may have to read that sentence several times). I
had to create another context that served no other purpose than this.
All the pbuffer configs on the O2 are single buffered. If you don't set
glDrawBuffer(GL_FRONT) before drawing in the pbuffer, your glClear's
are ignored.
Lessons learned:
Combining Performer, Motif, and Digital Media libraries is not a task
to be undertaken lightly.
Thanks again,
Wade
--
-----------------------------
Wade Olsen, Shoreline Studios
e-mail: wade++at++shoreline-studios.com
phone: 650-969-7896
fax: 650-969-7864
www: http://www.shoreline-studios.com
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:56:13 PDT