THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/09/2010 at 09:55, xxxxxxxx wrote:
Cinema 4D Version: R12
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
I'm working on a plugin to support an external 3D controller, and would like to know how I should best interface to OS-specific libraries. For example, on MacOSX, I need to interface to the IOKit library, while on Windows I have a host of different possibilities (WM_INPUT, using Windows message-passing, or direct interfacing to the HID.DLL device driver). The documentation gives no clue whatsoever, except that it discourages using OS-specific calls and external libraries. In that case, I definitely need to interface to the OS.
As the different methods (IOKit, WM_INPUT) spawn different threads in order to receive events from the hardware, I would also like to know which locking primitives I should best use. Should I stay with OS-specific locking (mutexes on windows, pthreads on macosx), or should I use the C4D locking/threads? The actual movement data is passed using a queue, so that the actual interfacing code is pretty much completely independent from C4D. This data is then received and passed to camera/active object/etc...
Any help would be very much appreciated.