Hi Chris,

The code where things are crashing is very old as you have observed.
The fact is is crashing suggests that the static TextureGLModeSet
s_textureGLModeSet isn't getting constructed for some reason.

Try putting a stop point in the TextureGLModeSet constructor (its at
the top of StateSet.cpp) to see if ts being contructed before the
StateSet setup.

Would could just remove this code, as it was originally written to
catch usage of the OSG during the period that I added support for
multitexturing, helping users spot usage that was no longer valid.

However, this might just get you over this hurdle and on to the next
one.. static initialization may well be a wider problem.  In this
instance perhaps using a static method getTextureGLModeSet() would a
may of ensuring that it get constructed on first use in a similiar way
to way the singletons work.

I doubt this problem is related to the addition of an optional
RenderBin::StateSet.

Robert.



On 8/1/06, Chris Hanson <[EMAIL PROTECTED]> wrote:
Chris Hanson wrote:
>   I've been trying to migrate my app over to OSG 1.1 as a prelude for
> doing some new work.
>
>   I checked out and rebuilt OpenThreads, Producer and OSG last week. (I
> build everything with static linking.) Now, when I rebuild and recompile
> my app, it crashes during startup, before it even hits main().


   More data:

   I commented out the doofus-error checking in StateSet::setMode():

void StateSet::setMode(StateAttribute::GLMode mode, StateAttribute::GLModeValue 
value)
{
     //if (!s_textureGLModeSet.isTextureMode(mode))
     if(1)
     {
         setMode(_modeList,mode,value);
     }
     else
     {
         notify(NOTICE)<<"Warning: texture mode '"<<mode<<"'passed to 
setMode(mode,value),
"<<std::endl;
         notify(NOTICE)<<"         assuming setTextureMode(unit=0,mode,value)
instead."<<std::endl;
         notify(NOTICE)<<"         please change calling code to use appropriate
call."<<std::endl;

         setTextureMode(0,mode,value);
     }
}


   And everything works great now. But I still don't understand why it was 
failing before.
It appears that this is all very old code (StateSet.cpp annotate shows it as 
"1.23 (robert
   23-Jul-02)"). But, I notice in the CVS graph for StateSet.cpp:

Revision : 1.59
Date : 2006/6/29 15:57:23
Author : 'robert'
State : 'Exp'
Lines : +1 -1
Description :
Added support for RenderBin's have a local top level StateSet.  This is now
used by default in the depth sorted bin.

   This sounds like it's possibly related to the problem, and I think it 
occurred during
the interval in question. The changes in StateSet.cpp weren't all that 
significant, but
I'm guessing there were other related changes in the same checkin that might 
have been
what provoked it.

   Robert, do you have any insight on this?

   I'm linking OSG statically on Windows under VC++8/2005 if that matters. 
Possibly it has
something to do with initialization of some global relating to the sorted 
RenderBins?

--
Chris 'Xenon' Hanson aka Eric Hammil | http://www.3DNature.com/ eric at logrus
  "I set the wheels in motion, turn up all the machines, activate the programs,
   and run behind the scenes. I set the clouds in motion, turn up light and 
sound,
   activate the window, and watch the world go 'round." -Prime Mover, Rush.
_______________________________________________
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/

Reply via email to