Hi Sean,
I had similar problems in the past as you and Chuck. My fix was to make sure the project-settings for osg and my own project where the same and set to FALSE: Symbols hidden by default (GCC_SYMBOLS_PRIVATE_EXTERN): FALSE and eventually Inline hidden methods (GCC_INLINES_ARE_PRIVATE_EXTERN): FALSE Cheers, Stephan Am 27.01.12 18:11, schrieb Sean Sullivan: > Hey guys, > > I'm trying to pass an osgViewer::GraphicsWindowCocoa::WindowData to my traits > object with CreateOnlyView specified. For some reason whenever my WindowData > is dynamic_cast in GraphicsWindowCocoa.mm it just returns 0. If I switch them > to static_cast they work. > > Here's my code: > > > Code: > // OSGWindow.h > osgViewer::GraphicsWindowCocoa::WindowData* windowData; > > // OSGWindow.cpp > windowData = new osgViewer::GraphicsWindowCocoa::WindowData > (osgViewer::GraphicsWindowCocoa::WindowData::CreateOnlyView); > > osg::ref_ptr<osg::GraphicsContext::Traits> traits = new > osg::GraphicsContext::Traits(); > > traits->x = 100; > traits->y = 100; > traits->width = 1280; > traits->height = 720; > traits->red = 8; > traits->blue = 8; > traits->green = 8; > traits->alpha = 8; > traits->depth = 24; > traits->windowDecoration = false; > traits->doubleBuffer = true; > traits->vsync = false; > traits->stencil = 1; > traits->samples = 8; > traits->sampleBuffers = 1; > traits->inheritedWindowData = windowData; > > osg::ref_ptr<osg::GraphicsContext> context = > osg::GraphicsContext::createGraphicsContext (traits.get()); > > > > This is what's in GraphicsWindowCocoa.mm that returns 0: > > > Code: > GraphicsWindowCocoa::WindowData* windowData = traits->inheritedWindowData ? > dynamic_cast<GraphicsWindowCocoa::WindowData*>(traits->inheritedWindowData.get()) > : NULL; > > > > I tried expanding it into if statements and the traits->inheritedWindowData > returns true. I also tried copying and pasting this line into my file where I > create my traits object and it returns properly. > > Any ideas? > > Cheers, > Sean > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=45082#45082 > > > > > > _______________________________________________ > 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

