Commit Graph

8877 Commits

Author SHA1 Message Date
Hajime Hoshi
e2f26b9dac internal/gamepad: ignore the very first MotionEvent with 0 value for Android
On Android, MotionEvent with 0 values might come for axes when connecting
a gamepad, even though a user didn't touch any axes. This is problematic
especially for tirgger axes, where the default value should be -1.

This change fixes the issue by adding a new state `axesReady` to check
if an axis is really touched or not. If an axis is not touched yet,
a button value for a standard (trigger) button always returns 0.

This change also removes an old hack to initialize axis values for
triggers.

Closes #2598
2024-03-21 22:48:33 +09:00
Hajime Hoshi
4f1dc6a0f4 .github/workflows: test Go 1.22 2024-02-10 15:27:51 +09:00
Hajime Hoshi
ef29a1a3c4 all: bug fix: update purego to v0.6.0
PureGo 0.5 didn't work with Go 1.22 on Intel macOS.

Closes #2908
2024-02-10 15:11:41 +09:00
Hajime Hoshi
aedc12ae5c internal/graphicsdriver/directx: bug fix: Go 1.22 + 32bit Windows + DirectX 12 didn't work well
Apparently, a pseudo padding was needed for D3D12_RESOURCE_DESC,
but this is still mysterious.

This change also add Go 1.22 to the GitHub Actions.

Closes #2867
2024-01-27 18:13:14 +09:00
Hajime Hoshi
256d40363b internal/ui: bug fix: need to sleep when swapping buffers is skipped
Closes #2890
2024-01-24 12:21:08 +09:00
Hajime Hoshi
3be6c78e85 cmd/ebitenmobile: bug fix: failed to resolve dependencies
Something was changed by updating gomobile (76ac6878050a2eef81867f2c6c21108e59919e8f),
and an additional go-mod-tidy is now required.

Closes #2887
2024-01-20 15:25:30 +09:00
Hajime Hoshi
2c967dd24e internal/shader: bug fix: variables in an index should be marked as used
Closes #2848
2023-11-19 15:19:48 +09:00
Hajime Hoshi
96d58bb138 ebiten: bug fix: wrong screenshot file names
Closes #2844
2023-11-16 23:00:51 +09:00
Hajime Hoshi
9cd7f827f4 internal/shaderir: bug fix: constants must be truncated correctly in an array
Closes #2840
2023-11-15 00:43:30 +09:00
Hajime Hoshi
a7123fed90 internal/graphicscommand: bug fix: Flush didn't return error when sync=false
Updates #2840
2023-11-15 00:14:42 +09:00
Hajime Hoshi
c8c8b2b17a internal/buffered: bug fix: enable TestGC again
The logic should be called in a game's Update explicitly.

Updates #2805
Closes #2806
2023-10-10 03:29:20 +09:00
Hajime Hoshi
1ad9667440 internal/buffered: skip a flaky test
Updates #2805
2023-10-10 02:22:30 +09:00
Hajime Hoshi
531f463a19 internal/buffered: bug fix: images created in init() were not GCed
Closes #2805
2023-10-10 00:33:27 +09:00
Nathan Levett
a27e3b6f34 .github/workflows: dynamic Go versions in vuln workflow (#2800)
Swap from hard coded versions of go to dynamically acquiring
the latest stable versions from https://go.dev/dl/?mode=json

Closes #2573
2023-10-03 03:09:14 +09:00
Hajime Hoshi
561de574dd internal/ui: add a comment
Updates #2796
2023-09-30 02:55:18 +09:00
Hajime Hoshi
b24bcb9382 internal/ui: bug fix: SetWindowIcon(nil) didn't reset the window icon
Closes #2796
2023-09-30 02:51:23 +09:00
Hajime Hoshi
ff64920b73 internal/ui: fix wrong panic messages 2023-09-29 15:37:06 +09:00
Hajime Hoshi
ee68b46a9a .github/workflows: reenable tests on branches
This is necessary for stable branches.
2023-09-29 13:00:32 +09:00
Hajime Hoshi
e1fb389dc0 internal/ui: bug fix: wrong monitor initialization on macOS
* `currentMouseLocation()` returned a position in the macOS native
coordinate. This means the Y axis is upward, while the Y axis is
downward in the GLFW coordinate. This change adjusts the Y position.
* `(*monitors).monitorFromGLFWMonitor` always returned nil at least
on macOS. This change fixes the implementation of this.

Updates #807
Closes #2794
2023-09-29 12:46:33 +09:00
Hajime Hoshi
ecb55e0fdd update dependencies 2023-09-24 23:40:27 +09:00
Hajime Hoshi
a76c1f7efc internal/graphicsdriver/metal/mtl: bug fix: fail to resolve Metal.framework path with Xcode 15
Updates #2732
Closes #2784
2023-09-24 16:16:45 +09:00
Hajime Hoshi
92424319a2 internal/ui: refactoring: (*monitors).update must be called from the main thread
In the current implementation, (*monitors).update is not called
from other threads, but the current code is fragile.
2023-09-24 01:37:58 +09:00
Hajime Hoshi
e40268c3ca internal/ui: bug fix: needed to wait before entering into fullscreen
Just after moving a window to another monitor, waiting a little while
was required before entering into fullscreen.

Closes #2778
2023-09-23 19:03:31 +09:00
Hajime Hoshi
b7a105409d internal/ui: bug fix: wrong calculation of the initial window position
Updates #2778
2023-09-23 18:52:55 +09:00
Hajime Hoshi
0170598a82 ebiten: remove (*Monitor).Bounds()
Now the unit of Bounds is device-dependent pixels, and this is useless
and Ebitengine API always treat device-independent pixels. Rather,
this might confuse users.

Until we find a good solution, let's remove Bounds() for v2.6.
MonitorType itself is still useful to specify a monitor to show a
window.

Closes #2780
2023-09-23 18:25:47 +09:00
Hajime Hoshi
4da27902f4 ebiten: change the unit of (*Monitor).Bounds
Monitors can have different device scale factors, and in this case,
it doesn't make sense to use device-independent pixels as unit for
monitor positions and sizes.

Updates #2778
2023-09-23 18:01:32 +09:00
Hajime Hoshi
7118057e4f internal/ui: bug fix: GetVideoMode must not be called from othere threads
Now setInitMonitor can be called from any other threads than the main
thread. Do not call this.

This change fixes the issue by using *Monitor instead of *glfw.Monitor.
2023-09-23 17:30:55 +09:00
Hajime Hoshi
4a0201e3b2 internal/ui: bug fix: replace initWindowMonitor usages with initMonitor
There were two similar member variables internalWindowMonitor and
initMonitor, and when SetMonitor is called, probably there were
some inconsitency between them.

This change fixes the issue by not using initWindowMonitor.

Closes #2779
2023-09-23 17:18:38 +09:00
Hajime Hoshi
713285e499 examples/monitor: use DebugPrint to simplify the sample 2023-09-23 15:57:11 +09:00
Hajime Hoshi
3c5697ff44 update dependencies 2023-09-23 15:36:37 +09:00
Hajime Hoshi
d4f4854f72 internal/processtest: suppress issue2475 test for Windows
The result seems flaky unfortunately.
2023-09-23 00:19:12 +09:00
Hajime Hoshi
220bf5140e all: update Oto and PureGo for an iOS 17 issue
Closes #2773
2023-09-23 00:02:58 +09:00
Hajime Hoshi
f315b70257 all: bug fix: update gomobile for an Xcode 15 issue
Closes #2772
2023-09-22 23:45:16 +09:00
Hajime Hoshi
ad192213cf internal/shader: bug fix: spaces around a compiler directive should be allowed
Closes #2771
2023-09-22 01:45:26 +09:00
Hajime Hoshi
dd69387e15 cmd/ebitenmobile: bug fix: accessing a view property caused deadlock on iOS
This change delays the initialization of the view until viewDidLoad is
called AND mobile.SetGame is called.

Closes #2768
2023-09-21 19:37:39 +09:00
Hajime Hoshi
0898906dfb examples/textinput: add a log message about environments
Updates #2735
Updates #2736
2023-09-20 22:25:45 +09:00
Hajime Hoshi
bc8917768f update dependencies 2023-09-19 08:02:11 +09:00
Hajime Hoshi
2c8a2a584f internal/gamepaddb: update the database
This adopts the commit e72ff9cb76

Closes #2766
2023-09-18 21:20:10 +09:00
Hajime Hoshi
0dcfa5f54b Revert "internal/gamepaddb: update the database"
This reverts commit 4375fffcbe.

Reason: test failures
2023-09-18 19:23:45 +09:00
Hajime Hoshi
4375fffcbe internal/gamepaddb: update the database
This adopts the commit 8adb15e0a2
2023-09-18 19:07:01 +09:00
Hajime Hoshi
14f2ee198e ebiten: add SetWindowMousePassthrough and IsWindowMousePassthrough
Closes #2511
2023-09-18 18:31:22 +09:00
Hajime Hoshi
c8d38f7f25 internal/glfw, interna/cglfw, internal/goglfw: add MousePassthrough
Work in progress

Updates #2511
2023-09-18 18:31:22 +09:00
Hajime Hoshi
777c575638 internal/goglfw: typo
Fortunately, this function is actually not called.
2023-09-18 18:30:43 +09:00
Hajime Hoshi
6f41a05264 Revert "internal/graphicsdriver/directx: remove tearing"
This reverts commit 78d3e4273b.

Reason: tearing is potentially risky but needed for maximizing FPS.
Also, tearing is officially recommended by Microsoft (see [1])

Closes #2697

[1] https://github.com/microsoft/DirectX-Graphics-Samples/blob/master/Samples/Desktop/D3D12Raytracing/src/D3D12RaytracingHelloWorld/DeviceResources.cpp#L520
2023-09-18 03:30:34 +09:00
Hajime Hoshi
8a0aba45f5 internal/ui: update touches after the layout is determined on mobiles
Closes #2763
2023-09-17 21:56:26 +09:00
Hajime Hoshi
07d2706e63 internal/processtest: bug fix: allow some numerical errors for cursor positions
Updates #2475
2023-09-17 19:58:30 +09:00
Hajime Hoshi
fd689467c5 internal/processtest: add a test for capturing cursor and fullscreen
Updates #2475
2023-09-17 19:41:56 +09:00
Hajime Hoshi
02fd8cfb07 internal/ui: bug fix: preserve a captured cursor positions for toggling fullscreening for browsers
Closes #2475
2023-09-17 18:38:00 +09:00
Hajime Hoshi
a5aa721bda internal/ui: update mouse and touch cursors after the layout is determined on browsers
Updates #2763
2023-09-17 16:30:47 +09:00
Hajime Hoshi
6ab509f221 internal/ui: reland: bug fix: preserve cursor positions for toggling fullscreening for desktops
Updates #2475
2023-09-17 15:54:39 +09:00