# SDL Joystick Test 2
========================

A simple tool to test joysticks, powered by SDL2(https://www.libsdl.org).

Author
--------
DarkRanger (http://darkranger.no-ip.org)

Version
--------
20161112

License
--------
GNU General Public License.

Building
--------
The package come with a CMakeLists.txt. To build this tool via CMake on Fedora Linux, you need to have these packages installed:
```bash
sudo dnf install SDL2 SDL2-devel cmake gcc gcc-c++
```

Then go to the project folder, and do the following procedure:
```bash
mkdir build 
cd build
cmake ..
make
```

Since the code is really small enough, the alternative way to compile the code is use GCC directly:
```bash
gcc -o sdljoy2 sdljoy2.c -lSDL2
```

Although I didn't test this tool on Windows, but at least the Windows executable can be built successfully....on Linux. You need to have these packages installed, for the cross-compile procedure:
```bash
sudo dnf install mingw32-SDL2 mingw32-SDL2-devel mingw32-gcc mingw32-gcc-c++
```

Then use `mingw32-cmake ..` instead of the usual `cmake ..`. After the compilation, don't forget to download a 32bit SDL2.dll from the official SDL site, and put the dll and the compiled executable in the same directory to execute.

Running
--------
Connect the joystick, and simply execute `./sdljoy2`.

