Hi Jordi,

Sorry I was skipping this information while reading ;-)
So my best guess is wrong linkage too.

Hi Sebastian and Kevin,

If the model is cessna.osg it shouldn't be to big ;). So check you are not mixing debug/release libraries.

Cheers.


2013/9/17 Sebastian Messerschmidt <[email protected] <mailto:[email protected]>>

    Hi Kevin,

    The exception bad_alloc usually is thrown if your memory is depleted.
    So maybe try a smaller model first, to see if your deploy is
    correct (VisualStudio debug/release mixing is very dangerous ;-))

    If this works, you might want to enable sharing. This is a bit hidden:

    
osgDB::Registry::instance()->getOrCreateSharedStateManager()->setShareMode(osgDB::SharedStateManager::SHARE_STATESETS
    | osgDB::SharedStateManager::SHARE_TEXTURES);
    _    osgDB::ReaderWriter::Options* opt =
    osgDB::Registry::instance()->getOptions();_
    
opt->setObjectCacheHint(static_cast<osgDB::Options::CacheHintOptions>(osgDB::Options::CACHE_IMAGE
    |osgDB::Options::CACHE_NODES));
        osgDB::Registry::instance()->setOptions(opt);


    This will help if your file has externals and a lot shared
    geometry/textures.

    cheers
    Sebastian
    Hi,

    I try to start a very simple programm on Win7 with VS10. but everytime it 
crashes. What did I do wrong?


    Code:

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

    int main(int argc, char *argv[])
    {
         osgViewer::Viewer *viewer = new osgViewer::Viewer;

          // add model to viewer.
         osg::ref_ptr<osg::Node> model = 
osgDB::readNodeFile("D:/osg/samples/cessna.osg");

          viewer->setSceneData( model );
        
         return viewer->run();
    }



    The stack:


    Code:
    test2.exe!mainCRTStartup()  Zeile 371 C
    kernel32.dll!75dd336a()     
    ntdll.dll!77719f72()        
    ntdll.dll!77719f45()        




    And last the exception:


    Code:
    Eine Ausnahme (erste Chance) bei 0x7519c41f in test2.exe: Microsoft 
C++-Ausnahme: std::bad_alloc an Speicherposition 0x0035f50c..
    Eine Ausnahme (erste Chance) bei 0x7519c41f in test2.exe: Microsoft 
C++-Ausnahme: std::bad_alloc an Speicherposition 0x0035ecec..
    Eine Ausnahme (erste Chance) bei 0x7519c41f in test2.exe: Microsoft 
C++-Ausnahme: [rethrow] an Speicherposition 0x00000000..



    Thank you!

    Cheers,
    Kevin

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





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


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




--
Jordi Torres




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

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

Reply via email to