Hello Rene,
Rene Weller wrote:
>>> - Can OpenSG handle threads that are not created by OpenSGs own
>>> multithreading architecture?
>> yes, but you have to tell OpenSG about the threads so that it can
>> associate them with an OpenSG aspect.
>> You can use this to register an external thread (call it from the
>> thread): UInt32 aspectId = 0;
>> ExternalThread::get(0)->initialize(aspectId);
>
> This solves my problem and works fine. However, I just have another question
> because the pointer that is returned by ExternalThread::get(0) seems to
> change at every call.
yes, you can pass in a name as the argument to ExternalThread::get() to
get the same ExternalThread object; passing in NULL always creates a new
one. Note that you can not use one ExternalThread object with multiple
non-OpenSG threads, so if you create a new (non-OpenSG) thread you also
need to create a new ExternalThread object.
> Is there any memory allocated (that must be released)
> when calling this function? In my current implementation I have to call this
> function at every frame.
yes, there is memory allocated, you can release the ExternalThread
object by calling its subRef() member function, or better yet store it
with an ExternalThreadRefPtr (OpenSG 2 only) and that will take care of
this at scope exit.
Cheers,
Carsten
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users