Cross platform development

Post questions, comments and feedback to our 3Dconnexion Mac Development Team.

Moderator: Moderators

Post Reply
mcc
Posts: 6
Joined: Sun Dec 03, 2017 10:30 pm

Cross platform development

Post by mcc »

I am attempting to port a piece of software that uses SpaceMouse from Windows to Mac. I did not write the Windows code. (If it matters, it is this https://github.com/ParcelRot/SpaceNav3D and it is open source a plugin for Unreal Editor). I started by opening the code on Mac and compiling it. What I was surprised to discover was that the interface the Windows code used appeared to be entirely absent on mac. The Windows code used something called "siact.lib". The 3DconnexionClient.framework that the SDK installed on my computer and is described in the SDK PDF exposes a bunch of functions like "RegisterConnexionClient" whereas the Windows code is using functions with a "Si" tag like "SiGetEventWinInit".

There is not a lot of code so I can just rewrite it. However, what I would like to know is what is the Best Practice here for someone writing a piece of software that supports spacemouse on all platforms. If I write code that uses 3DconnexionClient.framework/RegisterConnexionClient will it be possible to get that code working on Windows, or will the Windows and Mac code forever just be different? Also, what does Linux use, does it use "siact" or does it use the interface of 3DconnexionClient.framework or does it have its own third thing altogether?
crobl
Moderator
Moderator
Posts: 138
Joined: Mon Feb 26, 2007 8:34 am
Location: Freiham, Germany

Re: Cross platform development

Post by crobl »

Hello mcc,

I understand, that you're interested in a uniform way of development, but when you support different platforms and OSes you generally/usually need to deal with their different APIs.

Best practice in terms of support for multiple platforms is to abstracting at a certain (useful) level and generate a layer (your code), which can be common to both (all of your) supported platforms.

And to answer your question on Unix/Linux:
3DxWareUNIX uses ClientMessages that are passed to application Windows. The sample (xapp.c) provided in our SDK shows (almost) the minimal functionality that is necessary to implement 3D Mouse support on Unix/Linux.

Regards,

Christian Robl
Post Reply