Hi Robert -- I'm working with an older app that deals directly with
SceneView. It effectively creates its own window and manages its own
graphics contexts.
I've found this app doesn't work with osgOQ. osgOQ uses a Camera post draw
callback to retrieve the query results, and therefore needs the abstract
unsigned int contextID. To get this, it uses the following code:
camera.getGraphicsContext()->getState()->getContextID().
The only problem is that the app never set up a GraphicsContext on the
SceneView's Camera. SceneView doesn't do this itself (of course -- it's
ignorant of contexts).
Note that osgOQ can get the contextID just fine in other parts of the code,
such as in a CullVisitor traverse() call, or in a draw callback or
drawImplementation(). The contextID is readily available from
RenderInfo::getState(). It's just the Camera post draw callback that is the
problem, because I must go through the Camera's (non-existent)
GraphicsContext to get State.
It seems like, somewhere, there should be a mapping of actual platform
rendering context IDs to OSG's abstract unsigned int contextID, such that,
if a context is actually current, code should be able to look up the
abstract unsigned int contextID in a map somewhere. I've been unable to
locate any such construct in OSG.
I'm certain you'll recommend porting to osgViewer, but telling my client
that the previously-supported OSG interface they coded to is incompatible
with osgOQ isn't really an option. So, if there's no way for me to get a
contextID from a Camera that doesn't have a GraphicsContext, then I'll have
to look into alternate implementations for osgOQ.
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com <http://www.skew-matrix.com/>
303 859 9466
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org