Hi Carsten, Once again thank you for your ideas. Unfortunately I'm still struggling with this problem...
Carsten Neumann schrieb: [snip] >>> has strange effects. A popular (although from what I understand not 100% >>> correct way) is to make the variable volatile (or at least the reads >>> from it). >>> >>> >> I tried it with volatile, which seems to be the better choice for >> variables like this one anyway. That didn't solve the problem though. >> From what I can see in the Visual Studio debugger and how the app >> behaves I think the syncing is working but there is a problem with the >> renderaction probably? >> > Using a variable in this way to communicate between threads sometimes > > One other thing you might want to double check: pointers are normally > only valid for the aspect they were created in, so you can not pass > around pointers between threads on different aspects and they > automatically point to the right aspect copy. If you need this kind of > behaviour, use MTRefPtr, they can be dereferenced from every aspect [1] > and will point to the right aspect copy of the pointed-to container. > > Hope it helps, > Carsten > > [1] The small catch here is that there must have been at least one sync > from the aspect the object was created in to the current aspect before > the MTRefPtr can point to something meaningful. > > I'm using MT pointers where I think this is needed. Non-MT pointers are initialized within the gui thread (aspect 1) used for rendering, so this should not be a problem. I tried to hunt down the problem, but on every direction I take the result is it looks like it should work. Hm. I recently wondered if anybody has ever used aspect 1 for rendering instead of 0? And if, did it work out? I posted some more screens on ImageShack to show you what makes me think that it probably is a problem rendering on aspect 0. On [1] you can see the tie model loaded. In the console you can see the transform of the cart printed by a listener on every change. As you can see, the model loaded and the viewAll() method placed the cart in a proper place. If I move the camera around I get two other views of the tie as seen in [3] and [4]. These make me think something goes wrong on rendering. On [2] you can see the Beethoven model loaded, the cart has been placed to a proper place again without closing the application [1] http://img179.imageshack.us/my.php?image=86943759wt7.jpg [2] http://img293.imageshack.us/my.php?image=42651386jg7.jpg [3] http://img293.imageshack.us/my.php?image=87264610ci9.jpg [4] http://img179.imageshack.us/my.php?image=97502959xc6.jpg Cheers, Christoph ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
