You said that "The glGetDouble is not in thread that has the current graphics context as will produce undefined results if not a crash..."
But which thread actually has the current graphics context? I see that my program has only one thread in Windows task manager. I created the opengl context in the only thread but later on the thread could not have the current context? Does OSG induce some hidden threads which take over the current context from my thread?
Yanling
On 5/16/06, Robert Osfield <[EMAIL PROTECTED]> wrote:
HI Yanling,I am not quite sure when you are saying the current context. Are you talking about osg's current context or OpenGL's context? I am sure I have used glGet* methods in the current OpenGL context. Also I have tried to use glGet* in osgHud examples like this:
while( !viewer.done() )
{
// wait for all cull and draw threads to complete.
viewer.sync();
// update the scene by traversing it with the the update visitor which will
// call all node update callbacks and animations.
viewer.update();
double proj[16];
glGetDoublev(GL_PROJECTION_MATRIX, proj);
//after get I output the projection matrix using std::cout
//std::cout<<proj[0]<<" "<<proj[1]<<" ".....
// fire off the cull and draw traversals of the scene.
viewer.frame();
}Use the Viewer's (subclassed from Producer::CameraGroup) setLens/getLens and getViewMatrix.
The glGetDouble is not in thread that has the current graphics context as will produce undefined results if not a crash...
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
