Hi Carsten,
some time has passed and after some workload I'm again trying to solve that
issue. I tried to follow your approach and tried to attach a parameter specific
callback function to our SHLChunks. I expected that this function will be
called each frame, but its never called. Here's the code that tries to discover
each created SHLChunk and attaches the two callbacks:
UInt32 numFC =
FieldContainerFactory::the()->getFieldContainerStore()->size();
// Loop over all newly created field container instances
for(UInt32 i = this->_prevNumFC; i < numFC; ++i)
{
FieldContainerPtr fc = FieldContainerFactory::the()->getContainer(i);
if(fc != osg::NullFC &&
fc->getType().isDerivedFrom(osg::SHLChunk::getClassType()))
{
SHLChunkPtr shl = SHLChunkPtr::dcast(fc);
if( shl != NullFC )
{
beginEditCP(shl);
shl->addParameterCallback("VDTSystemTime", updateP);
shl->addParameterCallback("VDTSystemTime", updateU);
endEditCP(shl);
}
cout << "Found shl chunk " << endl;
}
}
this->_prevNumFC = numFC;
The callback functions look like this:
static void updateP(const ShaderParameterPtr ¶meter, DrawActionBase
*action, GLuint program)
{
cout << "Update Parameter P" << parameter->getName() << endl;
}
static void updateU(SHLChunk::OSGGLGETUNIFORMLOCATIONARBPROC
getUniformLocation, DrawActionBase *action, GLuint program)
{
cout << "Update Parameter U" << endl;
}
Am I doing something wrong?
One additional thing I have discovered. If I try to attach the callbacks to the
very first SHLChunk I discover, I get an AccessViolation. Furthermore I haven't
created that SHLCHunk. Is it something like a prototype? Can I somehow find out
if its a prototype or something special?
Thanks,
Michael
--
Schon gehört? GMX hat einen genialen Phishing-Filter in die
Toolbar eingebaut! http://www.gmx.net/de/go/toolbar
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users