Ok, I made a cleanup on the OSWindow joystick support. I also added the OSWindowGenericRenderer interface which is implemented by a thin wrapper around the SDL2 renderer interface. I have tested this on Linux using a XBox 360 controller (using SDL2 GameController interface) and a PS2 controller via an USB adapter (using SDL2 Joystick interface). Later I will test it on Windows and Mac.
=============================
Here is the demo:
https://www.youtube.com/watch?v=lABfEmToHLQ&feature=youtu.beOSWindowJoystickExample new open.
Xbox 360/mapped controls
Left stick: move character
X button: shoot
Start: reset
=============================
I also added a simple examples using the OSWindowGenericRenderer:
OSWindowGenericRendererDrawingExample new open.
=============================
I also modified the OSSDL2Driver >> #isSuitable method to not call the hasPlugin method. The plugin seems to be unnecessary according to several posts, and I am too lazy for fixing it. I guess that this should be eventually integrated into Pharo 5 after some reviewing. Before that, the latest version of OSWindow should be loaded manually. For that, the packages should be loaded in the following order:
OSWindow-Core
OSWindow-SDL2
OSWindow-SDL2-Examples
After that, the following doIt is required in a playground to start receiving events:
SDL2Constants initialize.