Hi Dirk,

Dirk Reiners schrieb:

        Hi Oliver,

On Tue, 2005-08-09 at 01:20 +0200, Oliver Kutter wrote:
I was just trying, but I wouldn't have thought, that these begin/endEdits are so much important. I think I have to go on and fix the whole project a little bit... Now it works really fine.
Cool! Yes, those are important. Essentially all the other sets/gets just
change variables, but to fix dependent data and to make everything
consistent the begin/endEdits are needed.
I have a new problem. :-(
I have set up my viewport with all the stuff its needs. I have begin/endEdits included. I have set up my PolygonForeground with a Material and the positions and texcoords. The material has normally a SHLChunk and a TextureChunk, but now only a TextureChunk. This TextureChunk is my problem. My particles have a size of 2^n, because of the 2D textures. When I change the number of my particles, I have to resize the viewport to sqrt(size_of_particles). That works fine, but I have to renew the image for the TextureChunk. And this is the problem. The new image has a different size. That's why I set the new image to the TextureChunk. (By the way, what does happen to the old image? Is there something like a garbage collector, or will it be overwritten?) But after changing the size 2-3 times, it crashed. It doesn't crash when I clear the following lines:

// this is the size of the particles
_iVpSize = (int)sqrt((double)_mgr.getParticles().getNumber());

// change the texture chunk
beginEditCP (_tcInput, TextureChunk::ImageFieldMask); {
   if (_iVpSize == 8)  _tcInput->setImage(_imIndices[0]);
   if (_iVpSize == 16) _tcInput->setImage(_imIndices[1]);
   if (_iVpSize == 32) _tcInput->setImage(_imIndices[2]);
   if (_iVpSize == 64) _tcInput->setImage(_imIndices[3]);
_tcInput[1]->imageContentChanged(); // I wonder if this is necessary?!
} endEditCP (_tcInput, TextureChunk::ImageFieldMask);

Do I have to change anything else?

The funny thing is, when I debug my program, I get different reasons why it crashed. Here is the first one, my debugger just hang up and I cancelled (and this is the most frequently one):

Program received signal SIGINT, Interrupt.
[Switching to Thread 1105657152 (LWP 7483)]
0x406ad107 in osg::TextureChunk::handleTexture () from /usr/local/lib/libOSGSystem.so
(gdb) backtrace
#0 0x406ad107 in osg::TextureChunk::handleTexture () from /usr/local/lib/libOSGSystem.so #1 0x406afb66 in osg::TextureChunk::handleGL () from /usr/local/lib/libOSGSystem.so #2 0x406b2292 in osg::TypedStoredObjectVoidFunctor2<osg::CPtrRefCallArg<osg::FCPtr<osg::FCPtr<osg::AttachmentPtr, osg::StateChunk>, osg::TextureChunk> >, osg::PtrCallArg<osg::Window>, osg::ArgsCollector<unsigned int>, osg::DefaultFunctorSizeTraits>::call () from /usr/local/lib/libOSGSystem.so #3 0x4070fd77 in osg::Window::validateGLObject () from /usr/local/lib/libOSGSystem.so #4 0x406b0f80 in osg::TextureChunk::activate () from /usr/local/lib/libOSGSystem.so #5 0x40699b38 in osg::State::activate () from /usr/local/lib/libOSGSystem.so #6 0x406e1018 in osg::PolygonForeground::draw () from /usr/local/lib/libOSGSystem.so #7 0x40708486 in osg::Viewport::render () from /usr/local/lib/libOSGSystem.so #8 0x4070ef96 in osg::Window::renderAllViewports () from /usr/local/lib/libOSGSystem.so
#9  0x4070de64 in osg::Window::render () from /usr/local/lib/libOSGSystem.so
#10 0x080cd73b in OSGTerrainVisualization::displayWorld (this=0x8386b78) at OSGFieldContainerPtrImpl.inl:799 #11 0x080cdfb9 in OSGTerrainVisualization::display (this=0x8386b78) at OSGTerrainVisualization.cpp:1332
#12 0x0808d24a in display () at OSGMain.cpp:225
#13 0x40fb7936 in glutMainLoop () from /usr/lib/libglut.so.3
#14 0x0808dd54 in main (argc=1, argv=0xbffff0e4) at OSGMain.cpp:421

And this one is also very famous:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1105657152 (LWP 7509)]
osg::FieldContainerPtrBase::deleteContainers (this=Variable "this" is not available.
) at OSGFieldContainerPtrImpl.inl:406
406         _containerSize = 0;
(gdb) backtrace
#0 osg::FieldContainerPtrBase::deleteContainers (this=Variable "this" is not available.
) at OSGFieldContainerPtrImpl.inl:406
#1 0x080bca13 in osg::TextureChunk::setImage (this=Variable "this" is not available.
) at OSGFieldContainerPtrDepImpl.inl:131
#2 0x080b969c in OSGParticleShader::updateVpSize (this=0x838726c) at OSGFieldContainerPtrImpl.inl:799 #3 0x080d394d in OSGTerrainVisualization::key (this=0x8386b78, key=43 '+', x=519, y=492) at OSGTerrainVisualization.cpp:764
#4  0x0808d2f6 in key (key=43 '+', x=519, y=492) at OSGMain.cpp:278
#5  0x40fb72f6 in glutMainLoopEvent () from /usr/lib/libglut.so.3
#6  0x40fb78c5 in glutMainLoop () from /usr/lib/libglut.so.3
#7  0x0808dd54 in main (argc=1, argv=0xbffff0e4) at OSGMain.cpp:421

Oh ohhhh, while I was trying, there came this new one:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1105657152 (LWP 7516)]
0x404327ba in osg::Node::~Node () from /usr/local/lib/libOSGSystem.so
(gdb) backtrace
#0  0x404327ba in osg::Node::~Node () from /usr/local/lib/libOSGSystem.so
#1 0x0806a9db in osg::FieldContainerPtrBase::deleteContainers (this=Variable "this" is not available.
) at OSGFieldContainerPtrDepImpl.inl:112
#2 0x080bca13 in osg::TextureChunk::setImage (this=Variable "this" is not available.
) at OSGFieldContainerPtrDepImpl.inl:131
#3 0x080b965c in OSGParticleShader::updateVpSize (this=0x838726c) at OSGFieldContainerPtrImpl.inl:799 #4 0x080d399d in OSGTerrainVisualization::key (this=0x8386b78, key=45 '-', x=517, y=329) at OSGTerrainVisualization.cpp:779
#5  0x0808d2f6 in key (key=45 '-', x=517, y=329) at OSGMain.cpp:278
#6  0x40fb72f6 in glutMainLoopEvent () from /usr/lib/libglut.so.3
#7  0x40fb78c5 in glutMainLoop () from /usr/lib/libglut.so.3
#8  0x0808dd54 in main (argc=1, argv=0xbffff0e4) at OSGMain.cpp:421

I have got many ????

Oliver



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to