Dear Robert (and OSG community), Happy New Year!! :-)
I have recently started a new project and taken the latest copy of OSG from the servers. Thanks. I have a very efficient, but quite complex piece of OpenGL code which used to run under SDL in OS X. I am trying to put the entire thing inside the OSG viewer to take advantage of a lot of the features of OSG, but keep the smooth and streamlined raw OpenGL engine for some of the view I have already. I have done this the other way around before. i.e. Put OSG inside an OpenGL app and it was very easy. I do know that what I am trying to do now should also work, but is not as trivial. This is complicated by the fact the OpenGL code is quite complex and uses multiple frame-buffers, textures, shaders etc. I am casting around for any help, or suggestions with a crash I have... I wouldn't ask, as I know this is going to seem like a vague problem to some, but I really wonder if I am missing something simple to do with threading, or the order of things with the latest OSG release... Is there anything glaringly obvious that I have missed? Unfortunately this crash is so serious that when I run the app in XCode it will take down the entire machine quite often. Typically with the thread talking to the graphics card crashing. Nasty! If I step through it it will crash at various different points, but most notably when I do my first glGenFramebuffersEXT, or in fact any Frame Buffer operations. The 'crash' is a general EXC_BAD_ACCESS, but before you ask, yes I can use those extensions on this machine, and the exact same project with OSG commented out works fine. If I am playing with Frame Buffers do I have to do anything to accommodate OSG, as I am relying on it to finish drawing and swap buffers etc. ? It will also (sometimes) render both the OpenGL view and the OSG view together for a frame or two, but only when stepped through slowly. So I know that it is basically working.. just fatally flawed at the moment. I do get OpenGL errors after a few frames, so obviously something is getting corrupted or out of order somewhere. Is there an easy way to track these down and get more info from OSG or OpenGL? One thing I noticed is that OSG has a much simplified main loop now. i.e. You simply call viewer.frame() now. And the kind of crash I am getting is very bad when the code runs at full speed, but less likely to occur when I run in trace, or slow the code down.. So to my spidey sense it seems like a threading / resource conflict of some sort.. My OpenGL code is not multithreaded btw. In the old days OSG had points at which you could do stuff with the graphics pipeline, and times when you could not. In the main loop you could then layout any manipulation so that it is done when OSG is not busy with graphic objects, or the OpenGL pipeline.. Is there anything I should be aware of? Should I manually handle the calls inside viewer.frame() ? I did try that, but did notice that the calls that that single call now covers are deprecated. Any help / pointers / articles really appreciated. Kind regards, Stephen Northcott _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

