Testhaptic - Periodic effects require direction to be set

Hi,
On testing SDL2 with Linux and the it’s new ffmemless-next code I noticed
that the periodic effect requires that the direction is set when it is
uploaded. Testhaptic code does not do this, and as a result produces no
movement for Sine/SawUp/etc.

Attached is a corrected version of testhaptic, which also adds tests for
additional effects.

Tested with G27 and WiiWheel, with SDL 2.0.3 on Linux 3.15rc3 + MLNX.

Also it appears the the ‘SQUARE’ effect is no longer supported (replaced
by LEFT_RIGHT). The documentation should probably be updated.

Cheers,
Simon.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: testhaptic.c
Type: application/binary
Size: 14279 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20140430/3cf673cd/attachment.bin

I tested it, and it produces a Segmentation Fault.
Fix it by changing:
SDL_HapticEffect efx[8];
int id[8];
to:
SDL_HapticEffect efx[9];
int id[9];

EliasOn Thu, May 1, 2014 at 4:51 AM, wrote:

Attached is a corrected version of testhaptic, which also adds tests for
additional effects.

1 Like