If you are interested in interfacing custom USB devices (HID) to control games written by Orx (or any other C++ application), this article will show you the easiest way to compile hidapi along with your Windows-based Orx project.
This is not a very wide use case for many projects, but one example of this is the Virtual Pinball tables at the Alien Abduction Unit. These use a PIC microcontroller-based USB device as the controller for the pinball launch and paddles.
The hidapi library can be compiled many ways, but getting it set up can be a minefield using their github set up page.
This following method is the easiest, and this article will be covering version 0.12.0.
hidapi/windows/hid.cfile to your project
Of course, the paths above can be relative rather than absolute if you plan to keep hidapi relative to your orx project.
hidapi.h is included in the
#include "orx.h" #include "hidapi.h"
There are no special linker libraries or paths required. That should be enough to compile and run.
Code for testing a USB device within the Orx application is beyond the scope of this article but you can learn how to use it looking at their test application, and you can also get usage tips in the Reload Bar Pinball source code.