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 - [PATCH] port testjoystick to the SDL 2 API
Summary: [PATCH] port testjoystick to the SDL 2 API
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P2 minor
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-13 18:05 UTC by Ondra Hošek
Modified: 2012-08-15 18:02 UTC (History)
1 user (show)

See Also:


Attachments
patch porting testjoystick to SDL 2 (7.34 KB, patch)
2012-08-13 18:05 UTC, Ondra Hošek
Details | Diff
patch porting testjoystick to SDL 2 and drawing hat status (5.44 KB, patch)
2012-08-14 09:15 UTC, Ondra Hošek
Details | Diff
patch porting testjoystick to SDL 2 (renderer API) and drawing hat status (5.81 KB, patch)
2012-08-14 17:30 UTC, Ondra Hošek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.