Hi,

I am trying to run osgWindows example on Debian 6.0.7 (squeeze) with OSG 
version 3.0.1. I am using Eclipse 3.7 (indigo) as IDE. The problem is that this 
example runs fine on windows but its crashing on linux for me. Many times it 
terminates by itself and other times it gives following callstack


Code:

std::string::find() at 0x7ffff4236d18   
osg::isGLExtensionOrVersionSupported() at GLExtensions.cpp:227 0x7ffff7942444   
osg::isGLExtensionSupported() at GLExtensions.cpp:90 0x7ffff7941aa3     
osg::FragmentProgram::Extensions::setupGLExtensions() at 
FragmentProgram.cpp:263 0x7ffff78e122e 
Extensions() at FragmentProgram.cpp:234 0x7ffff78e1021  
osg::FragmentProgram::getExtensions() at FragmentProgram.cpp:223 0x7ffff78e0ee3 
osg::FragmentProgram::flushDeletedFragmentProgramObjects() at 
FragmentProgram.cpp:59 0x7ffff78dfc48     
osg::flushDeletedGLObjects() at GLObjects.cpp:31 0x7ffff794c2cf 
osgUtil::SceneView::flushDeletedGLObjects() at SceneView.cpp:1,038 
0x7ffff7240c0b       
osgUtil::SceneView::draw() at SceneView.cpp:1,064 0x7ffff7240d8e        
osgViewer::Renderer::draw() at Renderer.cpp:725 0x7ffff63f18d2  
osgViewer::Renderer::operator() at Renderer.cpp:892 0x7ffff63f2b8a      
osg::GraphicsContext::runOperations() at GraphicsContext.cpp:756 0x7ffff79553bf 
osg::RunOperations::operator() at GraphicsThread.cpp:137 0x7ffff795fa9c 
osg::GraphicsOperation::operator() at GraphicsThread.cpp:53 0x7ffff795f38a      
osg::OperationThread::run() at OperationThread.cpp:426 0x7ffff79c676d   
osg::GraphicsThread::run() at GraphicsThread.cpp:38 0x7ffff795f2f0      
OpenThreads::ThreadPrivateActions::StartThread() at PThread.cpp:181 
0x7ffff5b96806      
start_thread() at pthread_create.c:300 0x7ffff377f8ca   
clone() at clone.S:112 0x7ffff3a64b6d   
0x0     





I checked with single slave cameras. It works fine with both individual slave 
cameras but when I un-comment both cameras it gives me crash. Here is  code for 
reference


Code:

#include <osgDB/ReadFile>
#include <osgUtil/Optimizer>
#include <osgViewer/Viewer>


#include <iostream>

int main( int argc, char **argv )
{
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);

// read the scene from the list of file specified commandline args.
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);

// if not loaded assume no arguments passed in, try use default mode instead.
if (!loadedModel) loadedModel = osgDB::readNodeFile("cow.osgt");

// if no model has been successfully loaded report failure.
if (!loadedModel) 
{
std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl;
return 1;
}

// construct the viewer.
osgViewer::Viewer viewer;

int xoffset = 40;
int yoffset = 40;

// left window + left slave camera
{
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new 
osg::GraphicsContext::Traits;
traits->x = xoffset + 0;
traits->y = yoffset + 0;
traits->width = 600;
traits->height = 480;
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;

osg::ref_ptr<osg::GraphicsContext> gc = 
osg::GraphicsContext::createGraphicsContext(traits.get());

osg::ref_ptr<osg::Camera> camera = new osg::Camera;
camera->setGraphicsContext(gc.get());
camera->setViewport(new osg::Viewport(0,0, traits->width, traits->height));
GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT;
camera->setDrawBuffer(buffer);
camera->setReadBuffer(buffer);

// add this slave camera to the viewer, with a shift left of the projection 
matrix
viewer.addSlave(camera.get(), osg::Matrixd::translate(1.0,0.0,0.0), 
osg::Matrixd());
}

// right window + right slave camera
{
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new 
osg::GraphicsContext::Traits;
traits->x = xoffset + 600;
traits->y = yoffset + 0;
traits->width = 600;
traits->height = 480;
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;

osg::ref_ptr<osg::GraphicsContext> gc = 
osg::GraphicsContext::createGraphicsContext(traits.get());

osg::ref_ptr<osg::Camera> camera = new osg::Camera;
camera->setGraphicsContext(gc.get());
camera->setViewport(new osg::Viewport(0,0, traits->width, traits->height));
GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT;
camera->setDrawBuffer(buffer);
camera->setReadBuffer(buffer);

// add this slave camera to the viewer, with a shift right of the projection 
matrix
viewer.addSlave(camera.get(), osg::Matrixd::translate(-1.0,0.0,0.0), 
osg::Matrixd());
}


// optimize the scene graph, remove rendundent nodes and state etc.
osgUtil::Optimizer optimizer;
optimizer.optimize(loadedModel.get());

// set the scene to render
viewer.setSceneData(loadedModel.get());

return viewer.run();
}





... 

Thank you!

Cheers,
Abhishek

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=54186#54186





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to