Reworked the 3DConnexion interfacing code to run the device

enumeration / connect / disconnect and read out at the background
thread only.
This commit is contained in:
bubnikv 2020-03-04 11:36:36 +01:00
parent a87ba5d6a6
commit 0b96855c2e
8 changed files with 603 additions and 593 deletions

View file

@ -2145,6 +2145,10 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
// updates camera type from .ini file
camera.set_type(get_config("use_perspective_camera"));
// Load the 3DConnexion device database.
mouse3d_controller.load_config(*wxGetApp().app_config);
// Start the background thread to detect and connect to a HID device (Windows and Linux).
// Connect to a 3DConnextion driver (OSX).
mouse3d_controller.init();
// Initialize the Undo / Redo stack with a first snapshot.
@ -2156,8 +2160,6 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
Plater::priv::~priv()
{
mouse3d_controller.shutdown();
if (config != nullptr)
delete config;
}