Commit Graph

4856 Commits

Author SHA1 Message Date
Hajime Hoshi
c9a973c6c1 internal/ui: bug fix: needed to focus the window at launch
Updates #2725
Closes #2924
2024-03-10 12:44:28 +09:00
Hajime Hoshi
9a7dcb1077 internal/shader: bug fix: failed to return an array in HLSL
Closes #2923
2024-03-10 11:59:50 +09:00
Hajime Hoshi
927e025982 internal/shader: bug fix: wrong type conversion for min, max, and clamp
Closes #2922
2024-03-10 11:30:06 +09:00
Hajime Hoshi
c0d9954b3e exp/textinput: use native pixels for a candidate window position 2024-03-03 23:35:34 +09:00
Hajime Hoshi
3e4c47eb70 internal/ui: refactoring 2024-03-03 23:27:02 +09:00
Hajime Hoshi
cc3db584f2 internal/shader: allow integer types for clamp
Closes #2788
2024-02-25 21:21:27 +09:00
Hajime Hoshi
4b9508c523 internal/shader: bug fix: wrong type checks on min/max
Updates #2788
2024-02-25 21:17:54 +09:00
Hajime Hoshi
e8cdf885c0 internal/shader: allow integer types for min and max
Updates #2788
2024-02-25 20:18:19 +09:00
Hajime Hoshi
face5fd870 internal/shader: allow integer types for abs and sign
Updates #2788
2024-02-25 18:16:44 +09:00
Mykhailo Lohachov
012fe52b6f
internal/atlas: use bit manipulation for function power of 2 -like functions (#2915)
Closes #2914
2024-02-25 02:06:52 +09:00
Hajime Hoshi
64cb6cf8a9 internal/atlas: reduce test flakiness 2024-02-24 23:03:12 +09:00
Hajime Hoshi
732eedf2e0 all: use github.com/ebitengine/gomobile instead of golang.org/x/mobile
Closes #2748
Closes #2899
2024-02-24 22:07:27 +09:00
Hajime Hoshi
40f3cbe1e3 internal/ui: bug fix: DeviceScaleFactor should be initialized asap on Android
Closes #2913
2024-02-24 19:48:20 +09:00
Hajime Hoshi
df68cbfc5b internal/gamepaddb: update the database 2024-02-21 20:36:46 +09:00
TotallyGamerJet
e6a17e58c9
internal/glfw: rewrite cocoa_time_darwin.c and posix_thread_unix.c into Go-ish (#2912)
Updates #1162
2024-02-20 22:37:13 +09:00
Hajime Hoshi
24256af624 internal/atlas: bug fix: test flakiness due to GC 2024-02-15 03:00:49 +09:00
Hajime Hoshi
820c996329 internal/shader: bug fix: wrong lhs in an assignment
Closes #2910
2024-02-15 02:29:21 +09:00
Hajime Hoshi
6d898d752e ebiten: add (*Monitor).DeviceScaleFactor()
This replaces ebiten.DeviceScaleFactor().

Updates #2795
2024-02-12 17:09:03 +09:00
Hajime Hoshi
67d947d37a internal/ui: remove Bounds 2024-02-12 15:24:00 +09:00
Hajime Hoshi
fca8ebb9af internal/shader: bug fix: non-name on the left side of :=
Closes #2891
2024-02-11 21:21:16 +09:00
Hajime Hoshi
75103f39dd internal/shader: bug fix: error on a function name in a function call
Updates #2891
2024-02-11 21:09:49 +09:00
Hajime Hoshi
60725eba86 ebiten: add RunGameOptions.X11ClassName and X11InstanceName
Closes #2904
2024-02-11 19:31:29 +09:00
Hajime Hoshi
0adc1ad681 internal/ui: make virtual keyboard keys work at least on Android
Updates #2898
2024-02-03 21:11:54 +09:00
Hajime Hoshi
7dd22fdc61 internal/ui: refactoring: rename uiKeyToJSKey to uiKeyToJSCode 2024-02-03 15:13:12 +09:00
Hajime Hoshi
872ffc148d internal/atlas: add TestGCShader
Updates #2897
2024-01-29 23:14:33 +09:00
Hajime Hoshi
f74d66e89a internal/atlas: bug fix: fix GC tests
Updates #2897
2024-01-29 21:01:58 +09:00
Hajime Hoshi
d2a9e5b1e8 internal/atlas: bug fix: fix tests
Updates #2897
2024-01-29 20:52:43 +09:00
Hajime Hoshi
f37ebe549b internal/atlas: bug fix: fix tests
Updates #2897
2024-01-29 20:52:02 +09:00
Hajime Hoshi
9a8dde6503 internal/atlas: bug fix: a finalizer was never called
As the finalizer function had a reference to the target image, the
image's reference count never became 0. Then, the image was never
finalized.

This change fixes this issue by using a member function pointer instead
of an anonymous function.

Closes #2897
2024-01-29 20:39:44 +09:00
Hajime Hoshi
6736bb56ec internal/ui: make a separate package to hide a console
Updates #2896
2024-01-28 22:42:58 +09:00
Hajime Hoshi
373e61d054 internal/ui: call hideConsole at init 2024-01-28 22:05:47 +09:00
Hajime Hoshi
11394d246f internal/ui: bug fix: check the error of TimeBeginPeriod 2024-01-28 14:25:17 +09:00
Hajime Hoshi
7e4cdf5211 internal/ui: use a more precise timer for Windows
When SetScreenClearedEveryFalse(false) and SetVsyncEnabled(false),
Draw might not be called as often as expected on Windows due to its
timer precision. This change improves the situation.

Updates #2889
2024-01-28 14:15:20 +09:00
Hajime Hoshi
770fcff4c2 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:06:53 +09:00
Pedro Tiple
6fafe734da
internal/graphicscommand: refactoring: remove a hard-coded part for ShaderImageCount (#2895)
This change allows increasing ShaderImageCount without breaking the image display.
Simply made the uniform processing dynamic based on ShaderImageCount.
2024-01-26 13:03:04 +09:00
Hajime Hoshi
8551cd350f internal/ui: bug fix: need to sleep when swapping buffers is skipped
Closes #2890
2024-01-24 12:20:30 +09:00
Hajime Hoshi
006f14ac19 internal/graphicsdriver/playstation5: bug fix: link error 2024-01-22 00:14:00 +09:00
Hajime Hoshi
52e0f10ff7 internal/graphicsdriver/playstation5: bug fix: compile error 2024-01-22 00:05:02 +09:00
Hajime Hoshi
f0509096f8 internal/graphicsdriver/playstation5: add ebitengine_IsErrorNil 2024-01-21 23:54:02 +09:00
Hajime Hoshi
e0ccd013ac internal/graphicsdriver/directx: bug fix: depth should be passed by math.Float32bits
As depth was always 0, there was not an actual problem.
2024-01-21 21:43:09 +09:00
Hajime Hoshi
5887142da7 internal/grpahicsdriver/metal/mtl: use 3 drawings for fullscreen
Hajime found that renderings were delayed with 2 drawing in fullscreen
though FPS might be lowered. This is mysterious but there is no other
good solution.

Updates #2883
2024-01-19 18:29:47 +09:00
Hajime Hoshi
f27402ee44 internal/mipmap: use a better image size
Unnecessarily big images were used since 4 years go
(f8956941b7). Use a better small image
for mipmaps.
2024-01-18 16:10:15 +09:00
Hajime Hoshi
e39c50c296 internal/graphicsdriver/metal: add comments
Updates #2880
Updates #2883
2024-01-17 20:51:32 +09:00
Hajime Hoshi
055db234a1 internal/graphicsdriver/metal: bug fix: use 2 as a drawable count for Arm Mac
Closes #2883
2024-01-17 18:57:50 +09:00
Hajime Hoshi
2ec5c788ab internal/buffered: fix comments 2024-01-17 04:19:07 +09:00
Hajime Hoshi
cef272f638 internal/buffered: refactoring 2024-01-17 00:20:12 +09:00
Hajime Hoshi
3cbc1870bf internal/buffered: update pixels instead of dotsBuffer when possible 2024-01-17 00:18:06 +09:00
Hajime Hoshi
26e2748732 internal/buffered: bug fix: check errors from ReadPixels 2024-01-16 13:26:31 +09:00
Hajime Hoshi
2f894cb311 internal/buffered: move tests to internal/beforemaintest
Also, this change moves TestUnsyncedPixels to buffered_test.
2024-01-16 13:07:10 +09:00
Hajime Hoshi
7b3eae3dcb internal/ui: reland: move dotsBuffer from internal/ui.Image to internal/buffered.Image
This is a reland of fb426cd0dd.

This is a refactoring as 'caching' things should be in internal/buffered,
but also this is a performance optimization to make pixels and dotsBuffer
work well together.
2024-01-16 12:45:43 +09:00
Hajime Hoshi
b2759b66f9 Revert "internal/ui: move dotsBuffer from internal/ui.Image to internal/buffered.Image"
This reverts commit fb426cd0dd.

Reason: processtest (TestPrograms/issue2089) failed (flaky)
2024-01-16 02:56:24 +09:00
Hajime Hoshi
fb426cd0dd internal/ui: move dotsBuffer from internal/ui.Image to internal/buffered.Image
This is a refactoring as 'caching' things should be in internal/buffered,
but also this is a performance optimization to make pixels and dotsBuffer
work well together.
2024-01-16 02:08:41 +09:00
Hajime Hoshi
a0cb0d0568 internal/graphicsdriver/playstation5: use message to detect errors 2024-01-14 22:18:12 +09:00
Hajime Hoshi
00e67b8419 internal/graphicsdriver/playstation5: improve error handlings
Updates #2799
2024-01-14 00:42:13 +09:00
Hajime Hoshi
7f396f72de all: remove the comments about restorable 2024-01-13 20:00:01 +09:00
Hajime Hoshi
c404b448aa internal/restorable: integrate the implementation into internal/atlas
Closes #805
2024-01-13 19:59:57 +09:00
Hajime Hoshi
812cd494de internal/restorable: remove Image
Updates #805
2024-01-13 19:33:04 +09:00
Hajime Hoshi
59896e4447 internal/restorable: integrate Image functions into internal/atlas
Updates #805
2024-01-13 19:27:14 +09:00
Hajime Hoshi
6151fd313f internal/restorable: integrate Image.Extend into internal/atlas
Updates #805
2024-01-13 19:15:47 +09:00
Hajime Hoshi
6cc8150185 internal/restorable: integrate Image.WritePixels into internal/atlas
Updates #805
2024-01-13 19:05:19 +09:00
Hajime Hoshi
3ee905bc4d internal/restorable: integrate Image.DrawTriangles into internal/atlas
Updates #805
2024-01-13 18:52:06 +09:00
Hajime Hoshi
bfa2c460a2 internal/restorable: integrate Shader.Dispose into internal/atlas
Updates #805
2024-01-13 18:40:31 +09:00
Hajime Hoshi
2a465c2d0b internal/atlas: bug fix: do not pass nil to WritePixels 2024-01-13 18:33:02 +09:00
Hajime Hoshi
81e1104613 internal/restorable: refactoring
Updates #805
2024-01-13 18:19:48 +09:00
Hajime Hoshi
e804f9e58c internal/restorable: integrate ReadPixels into internal/atlas
Updates #805
2024-01-13 18:19:43 +09:00
Hajime Hoshi
c5d0ec3de7 internal/restorable: integrate some functions into internal/atlas
Updates #805
2024-01-13 18:05:42 +09:00
Hajime Hoshi
21ef462c37 internal/restorable: remove ImageType
Updates #805
2024-01-13 18:03:39 +09:00
Hajime Hoshi
d906dc3a21 internal/packing: rename a function 2024-01-13 17:42:51 +09:00
Hajime Hoshi
3651d73e0b internal/atlas: move some functions in internal/restorable to internal/atlas
Updates #805
2024-01-13 14:05:24 +09:00
Hajime Hoshi
f610cb5724 internal/restorable: move SwapBuffers to internal/atlas
Updates #805
2024-01-09 04:55:26 +09:00
Hajime Hoshi
7c9266d8b6 internal/restorable: move DumpImages to internal/atlas
Updates #805
2024-01-09 04:50:22 +09:00
Hajime Hoshi
fdf36026ae internal/atlas: add special backends to theBackends for consistency 2024-01-09 04:39:15 +09:00
Hajime Hoshi
fe0b33db58 internal/atlas: improve deallocation 2024-01-09 04:31:23 +09:00
Hajime Hoshi
8c2d4e1408 internal/restorable: remove ImageTypeRestorable
Updates #805
2024-01-09 03:35:32 +09:00
Hajime Hoshi
4f3e00ec3a internal/restorable: remove unnecessary functions and variables around shaders
Updates #805
2024-01-09 03:23:13 +09:00
Hajime Hoshi
8169253a57 internal/restorable: remove unused functions and variables
Updates #805
2024-01-09 02:56:15 +09:00
Hajime Hoshi
f3206721a3 internal/restorable: remove alwaysReadPixelsFromGPU
Updates #805
2024-01-09 02:43:09 +09:00
Hajime Hoshi
afe3f7a8ff internal/restorable: remove drawTrianglesHistoryItem
Updates #805
2024-01-09 02:40:27 +09:00
Hajime Hoshi
5a36b4bb48 internal/graphicsdriver/opengl/gl: remove IsTexture
Updates #805
2024-01-09 02:35:30 +09:00
Hajime Hoshi
48e3c766f7 internal/graphicsdriver: remove Image.IsInvalidated
Updates #805
2024-01-09 00:30:21 +09:00
Hajime Hoshi
a19f079da8 internal/graphicsdriver/playstation5: remove NeedsRestoring 2024-01-09 00:26:01 +09:00
Hajime Hoshi
c08a2193a9 internal/restorable: remove the case when the restoring is needed
Updates #805
2024-01-09 00:20:35 +09:00
Hajime Hoshi
771e5685f8 internal/graphicsdriver: remove NeedsRestoring()
Updates #805
2024-01-08 23:27:28 +09:00
Hajime Hoshi
a30f075896 cmd/ebitenmobile: use setPreserveEGLContextOnPause(true)
setPreserveEGLContextOnPause(true) suppresses context losts, and
basically we will no longer need our restoring logic.

Updates #805
2024-01-08 20:13:13 +09:00
Hajime Hoshi
9539a87b17 all: drop the support of gomobile-build
Closes #2741
2024-01-08 00:43:26 +09:00
Hajime Hoshi
a4abc4472b internal/shaderir/msl: always use the same function names 2024-01-07 18:54:15 +09:00
Hajime Hoshi
87fe7bfd99 internal/graphicsdriver/metal: refactoring 2024-01-02 23:42:50 +09:00
Hajime Hoshi
fd63820139 internal/graphicsdriver/metal: bug fix: always use 3 drawables
Updates #2822
Closes #2880
2024-01-02 22:50:46 +09:00
Hajime Hoshi
ec9613dd94 Revert "internal/graphicsdriver/metal: bug fix: use 3 drawables for fullscreen"
This reverts commit 3c7bcf3035.

Reason: the window unexpectedly blinks when exiting from fullscreen

Updates #2880
2024-01-02 22:47:09 +09:00
Hajime Hoshi
3c7bcf3035 internal/graphicsdriver/metal: bug fix: use 3 drawables for fullscreen
Closes #2880
2024-01-02 22:33:05 +09:00
Hajime Hoshi
dddfb7317b internal/cocoa: integrate internal/graphicsdriver/metal/ns and internal/cocoa 2024-01-02 22:22:19 +09:00
Hajime Hoshi
2da56c00c8 internal/ui: remove renderThread
Updates #2714
2024-01-02 17:14:38 +09:00
theinternetftw
5774cf808f
internal/ui: show window after first draw on glfw (#2875)
Fixes #2725 by avoiding the flash in the first place. Showing the
window this way was already default on macOS; This makes it default
for all glfw platforms.

Closes #2725
2023-12-29 14:16:54 +09:00
Hajime Hoshi
338b8957e8 internal/graphicscommand: add Terminate
This change reduces a render thread usage in internal/ui.

Updates #2714
2023-12-27 02:28:55 +09:00
Hajime Hoshi
22715cd2d5 internal/gamepaddb: refactoring 2023-12-24 23:41:44 +09:00
Hajime Hoshi
4a2c8212fb internal/shaderir: fix comments 2023-12-24 23:10:41 +09:00
Hajime Hoshi
c48fc05132 internal/graphicsdriver/metal: use %w instead of %v for errors 2023-12-24 22:29:53 +09:00
Hajime Hoshi
2e363cc19b internal/thread: fix comments 2023-12-23 23:23:52 +09:00
Hajime Hoshi
4895ae7f93 internal/graphicsdriver/opengl: refactoring: move some functions from internal/ui
Updates #2714
2023-12-23 22:30:13 +09:00
Hajime Hoshi
ee2ca6d20c internal/graphicsdriver/opengl: refactoring 2023-12-23 19:28:41 +09:00