Commit Graph

3370 Commits

Author SHA1 Message Date
Hajime Hoshi
f80f73d502 internal/ui: bug fix: do not register a framebuffer-size callback on macOS
When a decorating state is switched, a framebuffer-size callback was
invoked but with wrong parameters on macOS.

This callback was originally implemented for i3 window manager, and
was not needed for macOS. Then, let's not use this on macOS. Probably
we can also skip this registering on Windows.

Updates #1960
Closes #2257
2022-08-20 19:13:19 +09:00
Hajime Hoshi
bcb020627d internal/gamepad: bug fix: release IDirectInputDevice8W on disconnecting
Closes #2205
2022-07-15 15:47:05 +09:00
Hajime Hoshi
4d93e6248d internal/graphicsdriver/directx: bug fix: too many constant buffers could be allocated
Closes #2204
2022-07-15 03:46:11 +09:00
Hajime Hoshi
d4beacf27e Revert "internal/graphicsdriver/directx: unmap constant buffers appropriately"
This reverts commit 085e6fe994.

Reason: compile error
2022-07-15 03:46:11 +09:00
Hajime Hoshi
085e6fe994 internal/graphicsdriver/directx: unmap constant buffers appropriately
Updates #2198
Updates #2202
2022-07-14 21:47:24 +09:00
Hajime Hoshi
742503ae68 internal/graphicsdriver/directx: bug fix: need to reset command allocators
Closes #2202
2022-07-14 21:30:08 +09:00
Hajime Hoshi
4a17f6159a internal/graphicsdriver/directx: bug fix: wrong offsets
* Wrong offsets were speicified when creating a constant buffer view and
  a shader resource view.
* Wrong root descriptor tables were speicified. For one draw command,
  one descriptor table for a constant buffer and textures should be used.

Updates #2198
Closes #2201
2022-07-14 12:33:33 +09:00
Hajime Hoshi
e488486d97 internal/ui: better fix for initialMonitorByOS
Updates #2179
2022-07-04 14:43:05 +09:00
Hajime Hoshi
29b41fd07f internal/graphicsdriver/directx: bug fix: ignore DXGI_STATUS_OCCLUDED
When a screen is locked, an Ebitengine application crashed as the
swap chain's Present returned DXGI_STATUS_OCCLUDED.

Let's ignore the error and continue to run the applications. In the
ideal world, an application should stop running during the screen lock,
so let's revisit this later.

This fix also fixes the issue that a Win32API GetCursorPos returned
an error ERROR_ACCESS_DENIED when the screen was locked.

Closes #2179
2022-07-04 13:00:12 +09:00
Hajime Hoshi
fc0a5d42b6 Revert "internal/graphicscommand: bug fix: using an image just after ReplacePixels might fail on Metal"
This reverts commit 7d998d8203.

Reason: This didn't fix the issue.

Updates #2154
2022-07-04 12:05:20 +09:00
Hajime Hoshi
f3a40ed38e internal/jsutil: bug fix: unnecessary allocations of temporary ArrayBuffers
Closes #2156
2022-07-03 21:34:55 +09:00
Hajime Hoshi
7d998d8203 internal/graphicscommand: bug fix: using an image just after ReplacePixels might fail on Metal
Inserting a dummy rendering command after ReplacePixels and before
DrawTriangles solved the issue. This is a very dirty hack, but
there seems no other better way.

Closes #2154
2022-07-03 16:00:39 +09:00
Hajime Hoshi
cca32077c4 Revert "internal/graphicsdriver/metal: bug fix: need to commit replace-pixels commands at DrawTriangles"
This reverts commit ac802cf0d0.

Reason: This caused flickerings, and didn't solve #2154

Updates #2154
Closes #2174
2022-07-03 12:18:56 +09:00
Hajime Hoshi
ddef7351c1 internal/graphicsdriver/directx: bug fix: clear constant buffers at the end of DrawTriangles
Constant buffers should not be reset while a stencil buffer is used.

Closes #2138
2022-06-19 17:19:31 +09:00
Hajime Hoshi
0d0bf0abdb internal/graphicsdriver/metal: bug fix: need to commit replace-pixels commands at DrawTriangles
Closes #2154
2022-06-19 15:39:39 +09:00
Hajime Hoshi
7a6cbcaea6 internal/graphicsdriver/directx: bug fix: wrong state transitions at screen images
This change fixes the following issues:
 * There should be two resource states for presenting targets, so an image
   for the screen must have two resource states, though it had only one
   in the current implementation.
 * At removeImage, the screen image was removed unexpectedly.

Updates #2081
Closes #2151
2022-06-18 19:06:39 +09:00
Hajime Hoshi
b176867d07 internal/ui: bug fix: MaximizeWindow before Run caused an unexpected error on Windows
Closes #2137
2022-06-13 12:29:17 +09:00
Hajime Hoshi
c82371dfcb internal/graphicsdriver/directx: bug fix: disable fullscreen by Alt+Enter
By default, DirectX 12 tries to make the window fullscreen by Alt+Enter.
This caused application crashes. Let's disable this feature.

Closes #2123
2022-06-05 16:18:30 +09:00
Hajime Hoshi
2a6b53d96b internal/gamepad: bug fix: wrong offset especially on 32bit Linux
Closes #2122
2022-06-05 12:49:23 +09:00
Hajime Hoshi
b3ddeb6456 Revert "internal/graphicsdriver/directx: bug fix: ID3D12Resource::Map sometimes needs retrying"
This reverts commit a9afacc8c6.

Reason: The true culprit was #2117. #2116 was not a bug.

Updates #2116
Updates #2117
2022-06-04 01:12:35 +09:00
Hajime Hoshi
a9afacc8c6 internal/graphicsdriver/directx: bug fix: ID3D12Resource::Map sometimes needs retrying
Updates #2113
Closes #2116
2022-06-03 22:04:18 +09:00
Hajime Hoshi
dbb8067761 internal/graphicsdriver/directx: bug fix: ID3D12Resource::Unmap does not return an value
Updates #2113
Closes #2115
2022-06-02 12:56:48 +09:00
Hajime Hoshi
331dbfd899 internal/gamepad: bug fix: out of range at hatState on Windows
Closes #2103
2022-05-25 11:45:04 +09:00
Hajime Hoshi
8024f70ba8 internal/processtest/testdata: add a test case for #2089
Updates #2089
2022-05-08 23:45:39 +09:00
Hajime Hoshi
39a4343116 internal/atlas: bug fix: wrong logic to create a new mask with edges
* Fixed wrong operator orders
 * Cleared an allocated region explicitlly

Closes #2089
2022-05-08 23:09:40 +09:00
Hajime Hoshi
ea4dffbc71 internal/graphicsdriver/metal/mtl: bug fix: specify the language version explicitly
Updates #2086
2022-05-05 23:56:40 +09:00
Hajime Hoshi
9d9439751f internal/graphicsdriver/directx: bug fix: the screen image can be nil when resizing the window
Closes #2081
2022-04-26 11:21:49 +09:00
Hajime Hoshi
45929e04e1 internal/ui: bug fix: deadlock at Layout with Ebiten's image functions called
Closes #2079
2022-04-26 01:14:40 +09:00
Hajime Hoshi
3b97d09772 internal/gamepaddb: bug fix: crash at addAndroidDefaultMappings
Closes #2076
2022-04-19 23:38:14 +09:00
Hajime Hoshi
b37962e4ff internal/atlas: potential bug fix: restore images before other image manipulations
From the reported stack trace, there could be a potential issue in
atlas.BeginFrame: images were manipulated before the images are restored.
Restoring images assumes that all images are not stale, but manipulating
images like putOnAtlas might cause other images stale in ReplacePixels.

Though we failed to reproduce the case, this fix should make sense.

Updates #2075
2022-04-18 02:45:41 +09:00
Hajime Hoshi
2a5b5b4823 internal/ui: avoid a busy loop in restoreWindow
Updates #1826
2022-04-10 17:55:39 +09:00
Hajime Hoshi
3fe1df8b3b internal/ui: bug fix: ebiten.WindowSize() returned (1,1) when iconified 2022-04-10 16:50:47 +09:00
Hajime Hoshi
aae866350a internal/ui: bug fix: (*glfw.Window).GetSize() returns (0,0) when iconified
Closes #2066
2022-04-10 16:43:03 +09:00
Hajime Hoshi
d3b83dd4ea internal/ui: refactoring 2022-04-09 18:23:56 +09:00
Hajime Hoshi
fcb7df0a59 internal/ui: bug fix: checking fullscreen on Safari was wrong 2022-04-09 17:25:19 +09:00
Hajime Hoshi
a69be34001 internal/ui: update the error message for fullscreen 2022-04-09 16:55:09 +09:00
Hajime Hoshi
853d94c3ef internal/shader: implement strict type checks when calling a function
Closes #2032
2022-04-09 00:32:27 +09:00
Hajime Hoshi
15fe7158fd internal/shader: implement strict type checks in assignments
Closes #1972
2022-04-09 00:02:20 +09:00
Hajime Hoshi
93b4c0d9b1 internal/ui: add comments
Updates #1590
2022-04-08 18:40:13 +09:00
Hajime Hoshi
2008916261 internal/ui: bug fix: use the native unit for origWindowPosByOS 2022-04-08 16:43:13 +09:00
Hajime Hoshi
90070c09fe internal/ui: rename origPos -> origWindowPos 2022-04-08 15:59:16 +09:00
Hajime Hoshi
352d332097 internal/ui: remove redundant comments 2022-04-08 15:51:56 +09:00
Hajime Hoshi
ee124baf60 internal/ui: bug fix: WindowSize returned a wrong value on fullscreen on macOS
Closes #2062
2022-04-08 14:57:51 +09:00
Hajime Hoshi
ad66c3d90b internal/png: clean up files before generating 2022-04-06 11:48:46 +09:00
Hajime Hoshi
20beb9d2b8 internal/gamepaddb: update the database
Updates #1902
2022-04-06 11:41:05 +09:00
Hajime Hoshi
6e19c793f6 internal/png: update for Go 1.18 2022-04-06 11:32:48 +09:00
Hajime Hoshi
32de5ec2d0 internal/graphics: refactoring 2022-04-05 11:12:25 +09:00
Hajime Hoshi
c6e5582c56 Revert "internal/graphics: refactoring"
This reverts commit b6cc164e96.

Reason: wrong shader program
2022-04-04 14:31:37 +09:00
Hajime Hoshi
b6cc164e96 internal/graphics: refactoring 2022-04-04 14:30:51 +09:00
Hajime Hoshi
c56665b23c internal/processtest: bug fix: shadernomain is no longer a valid test
Updates #2035
2022-04-04 03:12:34 +09:00