Hello All,
I'm new to OpenSceneGraph, so please bear with me.
I'm attempting to write a Mac OS X native (cocoa) application that uses
OpenSceneGraph, and I'm having some difficulty.
I created an XCode project to build OpenSceneGraph as a set of frameworks
(Using CMake), and I think I was mostly successful at that.
Now, I'm trying to use those frameworks within my own application, and having
some difficulty.
I've created a class (OSGView) along the lines of the OSGViewerCocoa OSGViewer
class - simplified, and modified for ARC. That class doesn't populate the
scene data, and when the application runs, a view filled with blue is
displayed - so good, so far.
Next, I tried to create a triangle mesh to populate the scene data with, and
that's where my problem occurs - when one of the array objects I created is
deleted, the application crashes.
I can simplify the problem down to the following:
- (void) test
{
osg::ref_ptr<osg::Vec3Array> theVertices = new osg::Vec3Array(0);
}
When the Vec3Array is deleted, it crashes at the end of Object::~Object(), with
the code
Thread 1: EXC_BAD_ACCESS (code=1, address= 0xfffffffffffffff8)
I then thought I'd go back to basics, and build the OSGViewerCocoa example, to
see how it works, but when I build it, all I get is a unix executable
(OSGViewerCocoad), which doesn't run because it isn't assembled as a complete
Mac application.
I suspect that the problem I'm having is caused by a mix of build environments
- CMake for OpenSceneGraph, and XCode (LLVM) for my application, but I've got
no idea how to resolve that since CMake doesn't appear to be able to create
complete applications.
So, does anyone have a suggestion?
TIA,
Ron Aldrich
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org