Hi Robert,
I quickly hacked the --QOSGWidget mode in order to work around the
"invalid pixel format" error (forcing
traits->setInheritedWindowPixelFormat = true;) and the result is the
same : trashed scene on the second run.
I tried adding the piece of code you suggested but it does not change
anything.
By the way the crash you were experiencing running with --QOSGWidget is
actually due to osg::ArgumentParser modifying argv, thus on the second
run argc remains unchanged but all arguments have actually been eaten up
from argv.
I am now using this code to run the application twice :
int main( int argc, char **argv )
{
char** tmp = (char**)malloc( argc * sizeof( char*) );
memcpy( tmp, argv, argc * sizeof( char* ) );
run( argc, argv );
run( argc, tmp );
}
MAT.
Robert Osfield wrote:
Hi Mathieu,
The error with -QOSGWidget looks to be a bug in this code, but its a
totally different path that the default path which uses
GraphicsWindowEmbedded to adapt the Viewer. QOSGWidget is the most
flexible path for integration and long term I'd like this to be the
default route under Qt. My own time is rather stretched out so I
can't address all these things at once.
The issues you are seeing with the default path is very unlikely to be
related to transparency, most likely is issues with display lists or
texture objects being reused inappropriately. In theory the viewer
should be release OpenGL objects when the context is destroyed, but
with GraphicsWindowEmbedded not all the standard functionality for
managing OpenGL objects is available, so perhaps this step is not
being executed appropriately.
One thing you could try is a
viewer->getSceneData()->releaseGLObjects();
osg::GLObjects::discardAllDeletedGLObjects(0);
In between the viewer allocations.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org