Commit Graph

85 Commits

Author SHA1 Message Date
Hajime Hoshi
8a7d860632 all: unify Windows error handlings for Windows HANDLE
Updates #2366
2022-10-02 02:22:06 +09:00
Hajime Hoshi
cd9477491d internal/gamepad: refactoring 2022-09-18 20:09:10 +09:00
Hajime Hoshi
963eb2756a all: fix TODO comments 2022-09-16 02:02:02 +09:00
Hajime Hoshi
b13fa2817c internal/gamepad: clean up codes for Darwin
* Removes redundant assignments.
* Fixes types for the Apple libraries.

Updates #1162
2022-09-16 00:25:51 +09:00
TotallyGamerJet
4a569be6f6
internal/gamepad: remove Cgo on darwin (#2330)
Updates #1162
2022-09-16 00:11:59 +09:00
Hajime Hoshi
5404e4d68a all: replace io/ioutil with io and os
Closes #1770
2022-09-15 02:54:25 +09:00
Hajime Hoshi
655cd4bf68 all: remove the build tag
Updates #1415
2022-09-15 00:23:40 +09:00
Hajime Hoshi
7d6ee39c15 internal/gamepad: bug fix: a wireless Xbox controller didn't work correctly on macOS
The button and hat values must be adjusted by their minimum values.
See also GLFW's implementation.

Closes #266
2022-09-12 01:55:05 +09:00
Hajime Hoshi
89598df520 internal/gamepad: refactoring
Updates #2311
2022-09-11 22:44:06 +09:00
Hajime Hoshi
4629306f4b internal/gamepad: bug fix: wrong SDL ID on iOS
The gamepad database already worked well with this fix.

Closes #2311
2022-09-11 22:29:38 +09:00
Hajime Hoshi
b5acb1e53d internal/gamepad: remove .errcheck_excludes_windows
Updates #2287
2022-09-10 02:11:08 +09:00
Terra Brown
a1cc44833d
add errcheck static analysis (#2293)
Closes #2287
2022-09-10 01:52:46 +09:00
Hajime Hoshi
4c76356803 internal/gamepad: refactoring 2022-09-09 22:31:47 +09:00
Hajime Hoshi
47558d20c5 internal/gamepaddb: enable the database for Android
Before this fix, the button and axis IDs are from the OS. These
didn't match with the SDL game controller databaes unfortunately.

This fix changes the assignments of the buttons and the axes to match
with the database.

Closes #2312
2022-09-09 22:20:39 +09:00
Hajime Hoshi
d66c599938 cmd/ebitenmobile: remove counting buttons and use a constant instead
Updates #2309
2022-09-07 15:43:11 +09:00
Hajime Hoshi
db1255cdf8 internal/gamepad: rename ButtonNum -> ButtonCount 2022-09-07 15:40:52 +09:00
divVerent
34a500c305
internal/gamepad: ignore EPERM when opening gamepads (#2308)
This seems required for the Snap sandbox when probing a non-gamepad device node.

Closes #2307
2022-09-06 21:29:32 +09:00
divVerent
9bc571af5e
internal/gamepad: fix a typo that caused oddly cut off gamepad names. (#2300)
This change allows gamepad names up to 256 characters, which is usually
enough. Before, names were cut off after 7 characters, matching the string
"Unknown" that is used if querying the name fails.

Closes #2300
2022-09-03 20:44:03 +09:00
Hajime Hoshi
8081d0636a internal/cbackend: rename to nintendosdk
Updates #2242
2022-08-12 17:19:37 +09:00
Hajime Hoshi
e7c0a121c4 all: remove the build tag 'ebitencbackend'
This also automatically enables 'egl' when 'nintendosdk' is specified.

Updates #2242
2022-08-12 13:15:39 +09:00
Hajime Hoshi
dac6548c0c all: rename ebitenginecbackend to nintendosdk
Updates #2242
2022-08-12 02:05:29 +09:00
Hajime Hoshi
094726915b
ebiten: add IsStandardGamepadAxisAvailable and IsStandardGamepadButtonAvailable (#2241)
Closes #2040
2022-08-11 12:35:20 +09:00
Hajime Hoshi
72d5002e72 remove go2cpp support
Closes #2126
2022-08-07 22:17:53 +09:00
Hajime Hoshi
abcacc26d8 internal/glfwwin: update for GLFW v3.3.8
Closes #2214
2022-08-07 15:03:33 +09:00
mattn
2bacecca24
fix typos (#2227) 2022-08-03 22:40:39 +09:00
Hajime Hoshi
356c625601 internal/gamepad: improve resetting vibrations 2022-07-16 02:44:54 +09:00
Hajime Hoshi
9e1a2bcb30 internal/gamepad: reorder function implements 2022-07-15 21:52:26 +09:00
Hajime Hoshi
d6547f12c6 internal/gamepad: implement gamepad vibrations for Xbox
Updates #2084
2022-07-15 21:33:23 +09:00
Hajime Hoshi
d231a35d3b internal/gamepad: bug fix: release IDirectInputDevice8W on disconnecting
Closes #2205
2022-07-15 15:44:40 +09:00
Hajime Hoshi
520a30f3c7 internal/gamepad: bug fix: memory leak on Xbox
Updates #2084
2022-07-15 15:12:56 +09:00
Hajime Hoshi
c14403f195 internal/gamepad: bug fix: Y axis values are opposite on Xbox
Updates #2084
2022-07-15 14:55:38 +09:00
Hajime Hoshi
428b1263d9 add ebitenginecbackend build tag besides ebitencbackend
Updates #2111
Updates #2190
2022-07-09 15:23:52 +09:00
Hajime Hoshi
ac5c48f575 internal/gamepad: support Xbox
Updates #2084
2022-07-02 01:02:24 +09:00
Hajime Hoshi
a6f6fdbfb7 internal/gamepad: update for Xbox
Updates #2084
2022-07-01 20:43:49 +09:00
Hajime Hoshi
97039ff714 internal/gamepad: implement gamepad detection callbacks for Xbox
Updates #2084
2022-07-01 17:15:11 +09:00
Hajime Hoshi
bf27f25e26 internal/gamepad: bug fix: build failures on FreeBSD 2022-06-25 01:36:13 +09:00
Hajime Hoshi
2d23168aca iinternal/gamepad: start implementation for Xbox
Updates #2084
2022-06-25 00:02:12 +09:00
Hajime Hoshi
3fb3997160 internal/gamepad: separate the Xbox part
Updates #2084
2022-06-24 22:49:37 +09:00
Hajime Hoshi
847c4f067a internal/gamepad: make nativeGamepad(s) interfaces
This is a preparation to switch the gamepad implementation for Xbox.

Updates #2084
2022-06-24 21:52:48 +09:00
Hajime Hoshi
0cd43bd081 internal/gamepad: stop embedding a member into a struct
This is a preparation to switch the gamepad implementation for Xbox.

Updates #2084
2022-06-24 19:01:50 +09:00
Hajime Hoshi
51fe48fb76 internal/gamepad: bug fix: wrong offset especially on 32bit Linux
Closes #2122
2022-06-05 12:48:47 +09:00
Hajime Hoshi
8e4e3d67c4 internal/gamepad: refactoring 2022-06-03 19:00:21 +09:00
Hajime Hoshi
2eb4ef1a94 internal/gamepad: give a window from another package instead of GetActiveWindow
GetActiveWindow doesn't work on Xbox.

Updates #2084
2022-06-03 18:42:54 +09:00
Hajime Hoshi
1580e92dfc internal/gamepad: refactoring 2022-06-03 18:06:54 +09:00
Hajime Hoshi
90d26305e7 internal/gamepad: unify the naming convention for Win32API with other packages 2022-06-03 16:59:44 +09:00
Hajime Hoshi
124f233de0 internal/gamepad: cast returning values to uint32 2022-06-03 16:52:49 +09:00
Hajime Hoshi
4a684c4195 treat Windows error values as uint32 instead of windows.Handle
The error value are defined as windows.Handle (64bit) in
golang.org/x/sys/windows, but an actual type should be HRESULT (32bit).
This causes an issue that a returning value from a Windows API was
recognized as a non-zero error value though the value was not an error,
when the value's lower 32-bits are all zero.

See also https://github.com/golang/go/issues/48736#issuecomment-1143993096

Updates #2113
2022-06-02 12:10:21 +09:00
Hajime Hoshi
1202e66114 internal/gamepad: bug fix: out of range at hatState on Windows
Closes #2103
2022-05-25 11:44:46 +09:00
Hajime Hoshi
0577a28aed all: add struct members for go-vet
Updates #1306
2022-05-22 22:05:40 +09:00
Hajime Hoshi
8d3de6207b internal/gamepad: add a warning message when getGamepads is not available
Updates #2100
2022-05-21 23:25:56 +09:00