We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1570

Summary: [PATCH] port testjoystick to the SDL 2 API
Product: SDL Reporter: Ondra Hošek <ondra.hosek>
Component: joystickAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2 CC: icculus
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   
Attachments: patch porting testjoystick to SDL 2
patch porting testjoystick to SDL 2 and drawing hat status
patch porting testjoystick to SDL 2 (renderer API) and drawing hat status

Description Ondra Hošek 2012-08-13 18:05:33 UTC
Created attachment 925 [details]
patch porting testjoystick to SDL 2

Attached is a patch to port testjoystick to the SDL 2 API.

The following changes have been made:
* Port from SetVideoMode to window management functions.
* Use SDL_MapRGB to ensure surface format independence.
* Make the "draw" variable per-axis. Fixes trails for e.g. the Logitech Rumblepad.
Comment 1 Ondra Hošek 2012-08-14 09:15:41 UTC
Created attachment 926 [details]
patch porting testjoystick to SDL 2 and drawing hat status

New version of the patch attached, adds support for drawing the status of hats.
Comment 2 Ondra Hošek 2012-08-14 17:30:50 UTC
Created attachment 927 [details]
patch porting testjoystick to SDL 2 (renderer API) and drawing hat status

New version! Since the window-surface stuff is more or less obsolete, I have updated the patch to use the Renderer API instead.
Comment 3 Ryan C. Gordon 2012-08-15 18:02:24 UTC
Your patch is now hg changeset efdf44f20799. I cleaned up some things and added color in c294faf5fce5.

Thanks!

--ryan.