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
Hajime Hoshi
01a4e29c5b
internal/graphicsdriver/opengl/gl: add a build tag for PS5
2023-12-23 19:01:36 +09:00
Hajime Hoshi
b73d63da29
internal/glfw: change the default client API to No-API
2023-12-21 04:05:13 +09:00
Hajime Hoshi
037a818601
internal/graphicsdriver/opengl: bug fix: go-vet failed
2023-12-20 03:06:58 +09:00
Hajime Hoshi
4ef7b5c166
internal/graphicsdriver/opengl: refactoring: hide SetGLFWClientAPI
...
Updates #2714
2023-12-20 02:47:19 +09:00
Hajime Hoshi
f6f0cf05e6
internal/ui: refactoring: move updateVsyncOnRenderThread to the OpenGL driver
...
Updates #2714
2023-12-20 02:38:20 +09:00
Hajime Hoshi
12ae411d15
internal/graphicsdriver/opengl, internal/graphicsdriver/opengl/gl: refactoring
2023-12-20 02:19:33 +09:00
Hajime Hoshi
6fd18150d8
internal/graphicsdriver/opengl: move egl
to the package opengl
...
Updates #2714
2023-12-19 23:41:14 +09:00
Hajime Hoshi
425b4dd99a
internal/graphicsdriver/opengl: fix a wrong comment
...
Updates #2517
2023-12-18 01:44:27 +09:00
bsski
b8df1217c3
all: fix typos ( #2864 )
2023-12-17 22:42:34 +09:00
Hajime Hoshi
d7ebc19d04
internal/ui: refactoring: reduce usages of renderThread
...
Updates #2714
2023-12-17 16:21:07 +09:00
Hajime Hoshi
3b1684978b
internal/ui: typo
2023-12-06 23:00:58 +09:00
Hajime Hoshi
d91455c0a7
internal/graphicscommand: add Shader.id
2023-12-01 21:31:50 +09:00
Hajime Hoshi
c45e9d0c00
internal/processtest: remove an empty line
2023-11-19 17:01:00 +09:00
Hajime Hoshi
af6b8dcd1c
internal/processtest: use text/v2
...
Updates #2454
2023-11-19 16:55:03 +09:00
Hajime Hoshi
9b9384baa0
internal/shader: bug fix: variables in an index should be marked as used
...
Closes #2848
2023-11-19 14:50:43 +09:00
Hajime Hoshi
acd317bf91
internal/ui: bug fix: wrong for-loop condition
...
Closes #2847
2023-11-18 20:01:24 +09:00
Hajime Hoshi
1e78c2e6b0
internal/shaderir: bug fix: constants must be truncated correctly in an array
...
Closes #2840
2023-11-15 00:40:20 +09:00
Hajime Hoshi
3ca6184294
ebiten: add a new FillRule: NonZero
...
Closes #2782
2023-11-06 12:11:38 +09:00
Hajime Hoshi
358106bdc0
internal/graphicsdriver/playstation5: bug fix: compile failure
2023-11-05 21:45:40 +09:00
Hajime Hoshi
95fcbb1e51
internal/graphicsdriver/playstation5: add a binding
...
Updates #2799
2023-11-05 21:27:30 +09:00
Hajime Hoshi
3df2ffebd1
internal/ui: refactoring: integrate Run except for mobiles
2023-11-05 00:49:53 +09:00
Hajime Hoshi
563bbda615
internal/ui: bug fix: build failure on mobiles
2023-11-05 00:43:02 +09:00
Hajime Hoshi
2db10b1e9c
ebiten: add RunGameOptions.SingleThread and deprecate ebitenginesinglethread
build tag
...
Closes #2830
2023-11-05 00:01:44 +09:00
Hajime Hoshi
4d8bb1a5dd
internal/graphicsdriver/playstation5: bug fix: build failure
2023-11-04 19:45:45 +09:00
Hajime Hoshi
4e93efa5ac
internal/graphicsdriver: reland: add FillRule and replace boolean values with this
...
Updates #2782
2023-11-04 19:09:50 +09:00
Hajime Hoshi
f695df5924
Revert "internal/graphicsdriver: add FillRule and replace boolean values with this"
...
This reverts commit 38cf964a3b
.
Reason: build failure on Windows
2023-11-04 19:02:40 +09:00
Hajime Hoshi
38cf964a3b
internal/graphicsdriver: add FillRule and replace boolean values with this
...
Updates #2782
2023-11-04 18:57:31 +09:00
Hajime Hoshi
0cbcf7e493
internal/atlas: refactoring: remove unused arguments
2023-11-04 18:31:22 +09:00
Hajime Hoshi
3fa8e6ac52
internal/graphics: refactoring: move some constants to internal/graphicscommand
2023-11-04 16:33:30 +09:00
Hajime Hoshi
d862a75fb3
internal/graphics: rename constants
...
Closes #2828
2023-11-04 16:06:35 +09:00
Hajime Hoshi
1f95c98969
internal/graphics: reland: change the definition of MaxVerticesCount
...
Updates #2612
2023-11-04 16:02:22 +09:00
Hajime Hoshi
3a632be0c7
Revert "internal/graphics: change the definition of MaxVerticesCount"
...
This reverts commit 3047ad202a
.
Reason: Failed to build for 32bit architectures
Updates #2612
2023-11-04 15:10:31 +09:00
Hajime Hoshi
3047ad202a
internal/graphics: change the definition of MaxVerticesCount
...
Updates #2612
2023-11-04 14:38:34 +09:00
Hajime Hoshi
f2544a1bd9
internal/graphicsdriver: use []uint32 instead of []uint16 for indices
...
Updates #2612
2023-11-04 04:39:17 +09:00
Hajime Hoshi
ba93794a72
internal/atlas: images were not collected by GC
2023-11-04 04:37:40 +09:00
Hajime Hoshi
c01ceeaa6a
ebiten: replace (*Image).Dispose with Deallocate
...
Closes #2808
2023-11-03 17:45:39 +09:00
Hajime Hoshi
8a44ef4f6c
internal/atlas: bug fix: (*Image).Deallocate (*Shader).Deallocate were not concurrent-safe
...
Updates #2162
2023-11-03 17:12:04 +09:00
Hajime Hoshi
bdd8916bb1
ebiten: replace (*ebiten.Shader).Dispose with Deallocate
...
Updates #2808
2023-11-03 16:25:18 +09:00
Hajime Hoshi
97d1e073e2
internal/atlas: refactoring
2023-11-03 14:52:19 +09:00
Hajime Hoshi
258f0fd941
internal/atlas: remvoe 'disposed' state
...
Updates #2808
2023-11-03 14:35:57 +09:00
Hajime Hoshi
d72c4ec90b
internal/atlas: refactoring
2023-11-03 14:19:59 +09:00
Hajime Hoshi
4a00891960
internal/glfw: refactoring
2023-10-31 22:43:40 +09:00
Hajime Hoshi
5da80ef3a7
internal/graphicsdriver: add playstation5
...
Updates #2799
2023-10-29 22:16:58 +09:00
Hajime Hoshi
27bc3e2487
internal/ui: refactoring: remove duplicated member variables
2023-10-29 19:25:02 +09:00
Hajime Hoshi
accb777f51
internal/ui: refactoring: remove unused functions
2023-10-29 19:16:11 +09:00
Hajime Hoshi
ae1ea3ba05
internal/ui: bug fix: compile failure
2023-10-29 19:14:24 +09:00
Hajime Hoshi
c4ce1b3503
internal/ui: start implementing UserInterface for PS5
...
Updates #2799
2023-10-29 19:13:08 +09:00
Hajime Hoshi
5fe8c29b4c
internal/ui: refactoring: integrate (*UserInterface).run
2023-10-29 18:57:10 +09:00
Hajime Hoshi
ea842495cf
internal/ui: refactoring
2023-10-29 18:29:41 +09:00
Hajime Hoshi
1db0abc4ee
internal/graphicsdriver/directx: add comments
2023-10-29 00:19:36 +09:00
Hajime Hoshi
6339872da8
internal/graphicscommand: disable asynchronous rendering when vsync is on
...
Asynchronouse rendering was introduced at #2664 , but apparently this
caused a delay between a game's update and its rendering.
Disable this when vsync is on. When vsync is off, we should not have
to care the delay since new renderings keep to come. Rather,
asynchronous renderings improves FPS.
Updates #2664
Updates #2822
2023-10-28 14:59:25 +09:00
Hajime Hoshi
98f2798b07
internal/ui: call a graphics driver's SetFPSMode only when necessary
...
It was odd to call this in the swapBufferForGL function.
2023-10-28 14:50:40 +09:00
Hajime Hoshi
61498e899a
internal/graphicsdriver/metal: typo
2023-10-28 02:43:57 +09:00
Hajime Hoshi
d91f328083
internal/graphicsdriver/metal: bug fix: use 3 for drawable count when vsync is off
...
Updates #2822
2023-10-28 02:39:47 +09:00
Hajime Hoshi
80301eb29e
internal/graphicsdriver/metal: change the maximum drawable count to 2
...
Updates #2822
2023-10-28 02:15:02 +09:00
Hajime Hoshi
457f6bb964
Revert "internal/ui: bug fix: panic at ReadPixels before running"
...
This reverts commit 2f6df3d4d6
.
Reason: regression by calling (*ebiten.Image).At from a different goroutine
Updates #2820
2023-10-27 14:29:41 +09:00
Hajime Hoshi
2f6df3d4d6
internal/ui: bug fix: panic at ReadPixels before running
...
Closes #2820
2023-10-27 12:18:34 +09:00
Hajime Hoshi
4eb9b3a152
internal/ui: remove unused members
2023-10-27 10:49:45 +09:00
Hajime Hoshi
55702a7c28
internal/atlas: refactoring: ensure ReadPixels to be processed in a frame
...
This enables to call (*Image).At from HandleInput, which might be
called outside of a frame.
Updates #1704
2023-10-25 00:48:09 +09:00
Hajime Hoshi
a3ba83c5da
internal/ui: bug fix: an error was ignored
2023-10-24 14:44:53 +09:00
Hajime Hoshi
f2acc3d9f7
internal/ui: refactoring
2023-10-24 14:38:23 +09:00
Hajime Hoshi
2eca476054
internal/ui: bug fix: EndFrame was not called when layoutGame returned 0s
2023-10-24 02:31:05 +09:00
Hajime Hoshi
b94c3fa9bb
internal/atlas: split EndFrame into EndFrame and SwapBuffers
...
This enables to do something asynchronously while executing SwapBuffers
in a different goroutine.
This is a preparation for HandleInput.
Updates #1704
2023-10-24 00:22:04 +09:00
Hajime Hoshi
c2ad36bdce
internal/ui: use BlendSourceOver at Fill when possible
...
Closes #2817
2023-10-21 01:24:49 +09:00
Hajime Hoshi
39688dd27d
internal/processtest: improve test issue2815
...
WritePixels for 1x1 image is optimized at internal/ui, and Ebitengine
doesn't read pixels from GPU in this case. Enlarge the tested image,
and use DrawImage to ensure to invalidate the internal cache.
Updates #2815
2023-10-20 02:48:21 +09:00
Hajime Hoshi
e80e981bf5
internal/atlas: let callers retry ReadPixels instead of blocking
...
This is a preparation to implement HandleInput, which might call
(*Image).At in its callback.
Updates #1704
2023-10-20 02:30:32 +09:00
Hajime Hoshi
913824beba
internal/atlas: close channels on the sender side just in case
2023-10-19 12:14:54 +09:00
Hajime Hoshi
ad51e22252
internal/atlas: bug fix: ReadPixels crashed when inFrame was false
...
This change fixes the issue by letting ReadPixels return a channel
and executing this asynchronously when needed.
Closes #2815
2023-10-19 03:56:54 +09:00
Hajime Hoshi
7a921e03da
internal/atlas: bug fix: inFrame was not correctly updated
...
Updates #2814
2023-10-19 02:08:28 +09:00
Hajime Hoshi
7d517bfb63
internal/buffered: move buffering to internal/atlas
...
Closes #2814
2023-10-19 01:56:18 +09:00
Hajime Hoshi
da979a3ab2
internal/buffer, internal/mipmap: remove Shader
2023-10-19 00:52:32 +09:00
Hajime Hoshi
19ee79e2cb
internal/buffered: remove unnecessary deferred functions for shaders
2023-10-18 23:36:41 +09:00
Hajime Hoshi
3f1b7e78b8
internal/buffered: remove unnecessary deferred functions
2023-10-18 23:20:02 +09:00
Hajime Hoshi
58847e023d
internal/buffered: refactoring
2023-10-18 23:03:05 +09:00
Hajime Hoshi
b0f88bce7d
internal/buffered: remove unnecessary deferred functions
2023-10-18 22:30:01 +09:00
Hajime Hoshi
315450474a
internal/atlas: add comments
2023-10-18 01:01:21 +09:00
Hajime Hoshi
630789757f
all: add files for PlayStation 5
...
The implementation is WIP.
Updates #2799
2023-10-16 00:54:08 +09:00
Hajime Hoshi
bdd68ca01a
internal/ui: reland: use errors.New instead of fmt.Errorf
2023-10-16 00:25:51 +09:00
Hajime Hoshi
565e944691
Revert "internal/ui: use errors.New instead of fmt.Errorf"
...
This reverts commit ed49d8cc9a
.
Reason: compile error
2023-10-16 00:24:41 +09:00
Hajime Hoshi
ed49d8cc9a
internal/ui: use errors.New instead of fmt.Errorf
2023-10-16 00:23:37 +09:00
Hajime Hoshi
e1f18b53f5
internal/ui: refactoring
2023-10-16 00:02:25 +09:00
Hajime Hoshi
47e70f2544
internal/ui: use errors.New instead of fmt.Errorf
2023-10-15 23:27:04 +09:00
Hajime Hoshi
742f3a6dac
internal/ui: refactoring: reduce functions
2023-10-15 20:14:23 +09:00
Hajime Hoshi
18714e22a1
internal/ui: reland: return errors when getting a graphics driver fails
2023-10-15 18:34:08 +09:00
Hajime Hoshi
bd10f19567
Revert "internal/ui: return errors when getting a graphics driver fails"
...
This reverts commit d4e31aedd6
.
Reason: compile error with -tags=nintendosdk
2023-10-15 18:32:47 +09:00
Hajime Hoshi
d4e31aedd6
internal/ui: return errors when getting a graphics driver fails
2023-10-15 18:26:13 +09:00
Hajime Hoshi
8274b32301
internal/graphicslibrary: refactoring: remove IsGL and IsDirectX
2023-10-15 17:30:16 +09:00
Hajime Hoshi
0378230b3e
internal/ui: refactoring: reduce theUI
2023-10-15 17:02:15 +09:00
Hajime Hoshi
83a4133577
internal/ui: refactoring: remove globalState
2023-10-15 16:51:16 +09:00
Hajime Hoshi
a16a03c9db
internal/ui: refactoring
2023-10-15 16:38:05 +09:00
Hajime Hoshi
a89aaa0756
internal/ui: refactoring: remove fpsMode from globalState
2023-10-15 16:19:41 +09:00
Hajime Hoshi
beabe9c6ee
internal/ui: bug fix: compile failure with -tags=nintendosdk
2023-10-15 03:58:29 +09:00
Hajime Hoshi
27fd10595b
internal/ui: refactoring: reduce global functions and prefer Get()
2023-10-15 03:40:48 +09:00
Hajime Hoshi
69f1fa5f29
internal/ui: unify the receivers for UI
2023-10-15 02:51:23 +09:00
Hajime Hoshi
77bdbac244
Revert "internal/ui: remove an unused function"
...
This reverts commit df3a1c3cdd
.
Reason: compile failure: UpdateInputFromEvent was used from textinput
2023-10-15 02:23:27 +09:00
Hajime Hoshi
df3a1c3cdd
internal/ui: remove an unused function
2023-10-15 01:32:39 +09:00
Hajime Hoshi
2a8d8d71fc
internal/ui: merge init functions
...
The Go specification doesn't determine the order of init functions.
In order to reduce unexpected behavior, merge some init functions.
2023-10-15 00:17:09 +09:00
Hajime Hoshi
567e2fa04c
ebiten: add BlendOperationMin
and BlendOperationMax
...
Closes #2395
2023-10-13 01:56:33 +09:00
Hajime Hoshi
7018e7dfb1
internal/ui: rename files
2023-10-11 02:03:58 +09:00
Hajime Hoshi
54c6c6b728
internal/glfw: bug fix: always use draw.Draw for any images
...
Closes #2807
2023-10-11 01:03:06 +09:00
Hajime Hoshi
1e5086fd5a
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:06:09 +09:00
Hajime Hoshi
4701a61e4b
internal/buffered: skip a flaky test
...
Updates #2805
2023-10-10 02:22:12 +09:00
Hajime Hoshi
cc5174f104
internal/buffered: bug fix: images created in init() were not GCed
...
Closes #2805
2023-10-10 00:31:44 +09:00
Hajime Hoshi
738f13f73f
internal/ui: remove unnecessary build tags
2023-10-09 23:39:06 +09:00
Hajime Hoshi
f269b61903
internal/atlas: introduce a managed byte slice pool
...
A managed byte slice from the new byte slice pool has a function
to release and put it back to the pool explicitly, and this doesn't
rely on GCs.
Updates #1681
Closes #2804
2023-10-09 20:32:32 +09:00
Hajime Hoshi
34d577a5ff
Revert "internal/atlas: reintroduce a byte pool"
...
This reverts commit 7e17b25c56
.
Reason: the current byte pool suppresses allocations to some extent, but doesn't suppress GCs.
Updates #1681
2023-10-09 14:40:05 +09:00
Hajime Hoshi
7e17b25c56
internal/atlas: reintroduce a byte pool
...
The old byte pool depnded on lifetimes of command queues, and this
was tricky.
The new byte pool uses runtime.SetFinalizer so this should be much
easier to use.
Updates #1681
2023-10-09 03:28:29 +09:00
Hajime Hoshi
2405b7e825
internal/restorable: remove unnecessary copying
...
After 6e5361c328
, WritePixels can
expect that the given pixel byte slice is always new, and now can
be assumed immutable. Do not copy the slice for restoring.
Actually, these copying were introduced at 38ce46328a
in order to reuse the same slice regions.
2023-10-09 01:17:43 +09:00
Hajime Hoshi
6e5361c328
internal/restorable: use clearImage to avoid allocations
...
Bytes from a pool in a command queue is now pretty hard to use correctly
as the lifetime of a queue is not clear.
Remove the byte pools once. Let's reconsider pool usages later.
This change also removes imagesWithBuffers as this is no longer needed.
imagesWithBuffers was necessary to ensure all the bytes from the pool
of the command queue was used before the queue flushes the commands,
as the command queue cleared the pool after flushing. The lifetimes
were pretty ticky.
2023-10-09 00:42:58 +09:00
Hajime Hoshi
cc8cf688f4
internal/restorable: use clearImage to avoid allocations
2023-10-08 23:59:31 +09:00
Hajime Hoshi
e768e8ad40
internal/graphicscommand: refactoring: add commandqueue.go
2023-10-08 19:54:28 +09:00
Hajime Hoshi
9ed3c89594
internal/graphicscommand: remove an image from imageWithBuffers whenever possible
2023-10-08 19:43:58 +09:00
Hajime Hoshi
810b62f83e
internal/graphicscommand: introduce commandQueuePool and commandQueueManager
...
This removes the restriction of the number of command queues.
Updates #1704
2023-10-08 19:23:57 +09:00
Hajime Hoshi
d2dd62b6db
internal/graphicscommand: remove unnecessary references to drawTrianglesCommand
2023-10-08 17:18:16 +09:00
Hajime Hoshi
fd1083808c
internal/graphicscommand: switch the queue before flushing
...
This is a preparation to do something (e.g. handling inputs) during
being blocked by Flush.
Updates #1704
2023-10-08 16:10:07 +09:00
Hajime Hoshi
53525342b1
internal/graphicscommand: bug fix: Flush didn't return error when sync=false
2023-10-08 04:30:14 +09:00
Hajime Hoshi
cede5027d3
internal/glfw: merge internal/cglfw into internal/glfw
...
Closes #2703
2023-10-07 23:59:55 +09:00
Hajime Hoshi
ad0b61c022
internal/cglfw: fix errors to be close to internal/glfw
...
Updates #2703
2023-10-07 22:48:44 +09:00
Hajime Hoshi
6dc375f7a6
internal/cglfw: let Terminate return an error
...
This change also removes flushErrors, which is only for GLFW
debuggings.
2023-10-07 22:35:40 +09:00
Hajime Hoshi
7bcefa1035
internal/cglfw: remove acceptError
2023-10-07 22:14:34 +09:00
Hajime Hoshi
98dc59c89f
internal/cglfw: let functions return errors
...
Updates #2703
2023-10-07 20:28:03 +09:00
Hajime Hoshi
ee1c179c83
internal/cglfw: let functions return errors in native_linbsd.go
...
Updates #2703
2023-10-07 20:28:03 +09:00
Hajime Hoshi
6a5d46dc43
internal/cglfw: use stderr for logs
2023-10-07 20:28:03 +09:00
Hajime Hoshi
82bceba847
internal/cglfw: let functions return errors in native_darwin.go and glfw_unix.go
...
Updates #2703
2023-10-07 18:37:06 +09:00
Hajime Hoshi
cb023af4b6
internal/cglfw: use stderr instead of log
2023-10-07 18:36:20 +09:00
Hajime Hoshi
aef7b0dd38
internal/glfw: rename files
...
Updates #2703
2023-10-07 17:23:33 +09:00
Hajime Hoshi
a971e32ec1
internal/cglfw: rename files
...
Updates #2703
2023-10-07 17:13:28 +09:00
Hajime Hoshi
82f2319020
internal/hook: rename hooks -> hook
2023-10-06 13:58:00 +09:00
Hajime Hoshi
e7ad5c52fe
internal/glfw: merge internal/goglfw into internal/glfw
...
This also changes APIs in internal/glfw to return errors.
Updates #2703
2023-10-05 03:09:51 +09:00
Hajime Hoshi
ef1e495aba
internal/winver: fix a panic message
2023-10-05 01:25:09 +09:00
Hajime Hoshi
aa55953c11
internal/ui: replace (*userInterface).err with (*globalState).err
2023-10-05 00:45:04 +09:00
Hajime Hoshi
0af42e6620
internal/vettools: bug fix: vettool itself failed with vettool check
2023-10-04 12:56:14 +09:00
Hajime Hoshi
73524d8df5
.github/workflows: move vettools to internal to avoid a nested module
2023-10-04 12:16:32 +09:00
Hajime Hoshi
0e722669ef
internal/glfw: add const definitions
...
This is one of the steps to merge internal/glfw and internal/goglfw.
Updates #2703
2023-10-04 03:04:47 +09:00
Hajime Hoshi
84030a3f77
internal/ui: refactoring: remove unused functions
2023-10-04 02:54:55 +09:00
Hajime Hoshi
491b578866
ebiten: add KeyF13 to KeyF24
...
Closes #2801
2023-10-04 00:45:49 +09:00
Hajime Hoshi
33c51eeee4
internal/goglfw: remove files for macOS
...
Updates #2776
2023-10-03 22:44:38 +09:00
Hajime Hoshi
b2a6e79a5a
internal/graphicsdriver/opengl/gl: rename procaddr_others.go to procaddr_linbsd.go
2023-10-02 01:02:51 +09:00
Hajime Hoshi
386bda3c84
internal/graphicsdriver/opengl/gl: add do-not-edit comment
2023-10-02 00:21:53 +09:00
Hajime Hoshi
50508e1a8d
internal/thread: add comments
2023-10-02 00:06:41 +09:00
Hajime Hoshi
95b4eeafce
all: remove unnecessary build tag restrictions
2023-10-01 23:27:57 +09:00
Hajime Hoshi
8c7eb70635
internal/ui: bug fix: wrong monitor was detected on fullscreen
...
Updates #2225
Updates #2794
2023-09-30 13:41:12 +09:00
Hajime Hoshi
22118ba962
internal/ui: add a comment
...
Updates #2796
2023-09-30 02:55:04 +09:00
Hajime Hoshi
dce18d7c23
internal/ui: bug fix: SetWindowIcon(nil) didn't reset the window icon
...
Closes #2796
2023-09-30 02:46:40 +09:00
Hajime Hoshi
13dfb28a98
internal/ui: copy a slice at SetIconImages
...
This changes makes ebiten.SetIconImages a little safer.
2023-09-30 01:46:01 +09:00
Hajime Hoshi
7204ca86e3
internal/ui: refactoring: remove an unused member
2023-09-30 01:39:34 +09:00
Hajime Hoshi
aab22f4c1e
internal/ui: bug fix: use correct regions at (*monitors).monitorFromPosition
...
Updates #2781
2023-09-30 00:30:06 +09:00
Hajime Hoshi
2fbef2106d
internal/ui: refactoring
...
Updates #2781
2023-09-30 00:11:15 +09:00
Hajime Hoshi
03d6811a65
internal/ui: bug fix: initialMonitorByOS could return nil on macOS
...
initialMonitorByOS could return nil when a cursor was at an extreme
position like the bottom of the display. Apparently, a cursor position
could take an inclusive range of the monitor size.
This change fixes this issue by fixing the comparison.
Even if initialMonitorByOS returns nil, a fallback primary monitor
should be used, so this is not a critical issue.
Updates #2794
2023-09-29 16:54:47 +09:00
Hajime Hoshi
14a2c703df
internal/ui: fix wrong panic messages
2023-09-29 15:36:43 +09:00
Hajime Hoshi
91abfe2c10
internal/ui: bug fix: compilie error on Windows
...
Updates #2794
2023-09-29 12:54:41 +09:00
Hajime Hoshi
0bcee31a6f
internal/ui: bug fix: wrong monitor initialization on macOS
...
This change fixes these issues:
* `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 replaces this with a new method
`(*monitors).primaryMonitor`.
Updates #807
Closes #2794
2023-09-29 12:36:28 +09:00
Hajime Hoshi
4ca3fa5e57
internal/graphicsdriver: replace Region with image.Rectangle ( #2791 )
...
Closes #2790
2023-09-28 14:29:55 +09:00
Hajime Hoshi
94bf6a4cc1
internal/shaderir: performance optimization by reducing slices
2023-09-28 01:56:51 +09:00
Hajime Hoshi
7cb64ccffe
internal/ui: refactoring
2023-09-28 01:01:58 +09:00
Hajime Hoshi
a65a45586f
internal/ui: bug fix: need nil check at dipFromGLFWMonitorPixel
...
Updates #1878
2023-09-25 18:42:23 +09:00
Hajime Hoshi
58d3655597
internal/ui: remove unnecessary receivers from methods
2023-09-24 19:45:55 +09:00
Hajime Hoshi
b32575b7b2
internal/ui: refactoring: add (*Monitor).deviceScaleFactor
2023-09-24 19:41:37 +09:00
Hajime Hoshi
0e23045b90
internal/ui: refactoring: add (*monitors).monitorFromPosition
2023-09-24 19:41:28 +09:00
Hajime Hoshi
fab08bac92
internal/ui: use RLock/RUnlock whenever possible
2023-09-24 19:27:22 +09:00
Hajime Hoshi
4fb27adb9d
internal/ui: remove an old comment
...
Now Ebitengine allows to specify the initial monitor, having an
initial monitor is no longer a hack.
Updates #1575
Updates #1835
2023-09-24 19:24:23 +09:00
Hajime Hoshi
b5d0dc3686
internal/ui: change the initial window position adjustment
...
The window position should be posible if possible.
2023-09-24 19:07:21 +09:00
Hajime Hoshi
a23efac01c
internal/ui: refactoring: reduce member variables
2023-09-24 19:05:56 +09:00
Hajime Hoshi
c16bd1e249
internal/ui: refactoring: unify duplicated logics to initialize the window size and position
2023-09-24 18:55:45 +09:00
Hajime Hoshi
b95228a8a6
all: rename arguments in Kage
...
Closes #2767
2023-09-24 16:46:36 +09:00
Hajime Hoshi
915ed48f7a
internal/graphicsdriver/metal/mtl: bug fix: fail to resolve Metal.framework path with Xcode 15
...
Updates #2732
Closes #2784
2023-09-24 16:15:54 +09:00
Hajime Hoshi
c7d1d28582
internal/ui: move impls for device scale to internal/ui for desktops
...
This enables to remove restrictions for some functions to be called
from the main thread.
Updates #2423
2023-09-24 15:44:41 +09:00
Hajime Hoshi
458a415131
internal/ui: move impls for device scale to internal/ui for mobiles
2023-09-24 15:29:14 +09:00
Hajime Hoshi
b243dc0649
internal/devicescale: bug fix: this package cannot be compiled with GOOS=js
2023-09-24 03:35:54 +09:00
Hajime Hoshi
506a1de259
internal/ui: refactoring: move device-scale implementation to internal/ui for browsers
...
The returned value from internal/devicescale.At never changes for
browsers, so the detection of devicePixelRatio updates didn't work
in the first place. Also, there is not a good way to detect the
change [1].
This change moves the logic from internal/devicescale to internal/ui.
We aim to merge these packages as a device scale factor belongs to
a monitor and internal/ui manages monitors.
[1] https://crbug.com/123694
2023-09-24 03:19:31 +09:00
Hajime Hoshi
5d5e3c7c0b
internal/ui: refactoring: replace *glfw.Monitor with *Monitor
2023-09-24 02:39:53 +09:00
Hajime Hoshi
f72b8a4ced
internal/ui: refactoring: remove redundant Monitor members
2023-09-24 01:58:07 +09:00
Hajime Hoshi
121d6005cd
internal/ui: remove (*Monitor).Bounds
...
Updates #2780
2023-09-24 01:46:14 +09:00
Hajime Hoshi
01e2c92e56
internal/ui: remove unnecessary code
...
This was an old code when Ebitengine created a dummy invisible
window before creating the main window.
2023-09-24 01:42:39 +09:00
Hajime Hoshi
69e3a2b974
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:11 +09:00
Hajime Hoshi
7664647ad1
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:02:36 +09:00
Hajime Hoshi
4ef98b3ea9
internal/ui: bug fix: wrong calculation of the initial window position
...
Updates #2778
2023-09-23 18:51:58 +09:00
Hajime Hoshi
b3058b68a0
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 17:58:23 +09:00
Hajime Hoshi
d736a8cff7
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:18 +09:00
Hajime Hoshi
e0cd031aea
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:17:38 +09:00
Hajime Hoshi
2702c6b228
internal/processtest: suppress issue2475 test for Windows
...
The result seems flaky unfortunately.
2023-09-23 00:18:41 +09:00
Hajime Hoshi
0e27a8a30b
internal/shader: bug fix: spaces around a compiler directive should be allowed
...
Closes #2771
2023-09-22 01:45:11 +09:00
Hajime Hoshi
2f835a0ee2
internal/graphics: fix wrong comments
2023-09-21 01:59:20 +09:00
Hajime Hoshi
20ef839e03
all: rename arguments in Fragment
...
Updates #2767
2023-09-21 01:35:57 +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
Hajime Hoshi
9d73e45677
Revert "internal/ui: bug fix: preserve cursor positions for toggling fullscreening for desktops"
...
This reverts commit 7ed4db90be
.
Reason: compile error on Windows
2023-09-17 15:43:38 +09:00
Hajime Hoshi
7ed4db90be
internal/ui: bug fix: preserve cursor positions for toggling fullscreening for desktops
...
Updates #2475
2023-09-17 15:26:08 +09:00
Hajime Hoshi
7becaa19e6
internal/ui: bug fix: native APIs must be called from the main thread
...
Updates #2763
2023-09-17 15:14:57 +09:00
Hajime Hoshi
0475baf9e2
internal/ui: update comments
...
Updates #2763
2023-09-17 14:59:43 +09:00
Hajime Hoshi
8c25b07336
internal/ui: call updateInputState after layoutGame
...
The cursor position is affected by the current layout. Then, input
states should be updated after layoutGame is called.
Updates #2763
2023-09-17 14:58:32 +09:00
Hajime Hoshi
a62b8a00e7
internal/ui: use float64 for cursor positions internally
2023-09-17 03:43:18 +09:00
Hajime Hoshi
226497a8a9
internal/cglfw: bug fix: Motif hints should be updated for functions and decorations at the same time
...
Updates #2289
Closes #2760
2023-09-17 00:40:17 +09:00
Hajime Hoshi
90ee615e00
internal/cglfw: disable a maximizing button when a max window size is specified
...
Closes #2289
2023-09-16 23:41:19 +09:00
Hajime Hoshi
7698ec0665
internal/cglfw: rename a file
...
Updates #2759
2023-09-16 23:17:17 +09:00
Hajime Hoshi
2737bd6d04
internal/cglfw: drop a native Wayland support
...
Closes #2759
2023-09-16 21:46:24 +09:00
Hajime Hoshi
45acc2c5d8
internal/ui: reland: bug fix: disable window size limitation on fullscreen
...
Closes #2260
2023-09-16 16:49:49 +09:00
Hajime Hoshi
40fc96d78c
internal/ui: forbid a green button when a max window size limit is specified
...
Updates #2260
2023-09-16 16:40:03 +09:00
Hajime Hoshi
128215eedd
Revert "internal/ui: bug fix: disable window size limitation on fullscreen"
...
This reverts commit 9a5ef1b553
.
Reason: we should disable the green button instead
Updates #2260
2023-09-16 03:23:34 +09:00
Hajime Hoshi
657e4c2541
internal/ui: update a comment
...
Closes #2240
2023-09-16 03:12:37 +09:00
Hajime Hoshi
619436a47b
internal/ui: refactoring: add monitor_glfw.go
2023-09-16 00:16:00 +09:00
Hajime Hoshi
dd2768d5f3
internal/ui: bug fix: introduce locks for monitors
...
Updates #1853
2023-09-15 03:59:13 +09:00
Hajime Hoshi
32bd565df9
internal/ui: bug fix: setWindowMonitor was processed even when the same monitor was specified
...
Updates #1835
2023-09-15 03:30:15 +09:00
Hajime Hoshi
b710ff17c8
internal/ui: bug fix: wait for a while after exiting fullscreen on macOS
...
Closes #2758
2023-09-15 03:19:37 +09:00
Hajime Hoshi
90accfba1e
internal/ui: bug fix: do not call PollEvents on Windows and Linux
...
Updates #2296
2023-09-15 03:11:58 +09:00
Hajime Hoshi
568e98ef1c
internal/ui: bug fix: call setOrigWindowPos on entering fullscreen
...
Closes #2757
2023-09-15 02:53:38 +09:00
Hajime Hoshi
f7a801d591
internal/ui: refactoring
2023-09-15 02:45:31 +09:00
Hajime Hoshi
9a5ef1b553
internal/ui: bug fix: disable window size limitation on fullscreen
...
Closes #2260
2023-09-15 02:19:20 +09:00
Hajime Hoshi
0e19cd10be
internal/shader: add type checks for a bitwise operator + assignment
...
Closes #2754
2023-09-13 04:17:46 +09:00
Hajime Hoshi
1f67518319
internal/shader: clean up tests
2023-09-13 03:57:20 +09:00
Hajime Hoshi
320cec8869
internal/shaderir: refactoring
2023-09-13 03:25:42 +09:00
Hajime Hoshi
19413c2805
internal/shader: refactoring: move type deduction to shaderir package
...
Updates #2754
2023-09-13 00:18:47 +09:00
Hajime Hoshi
5e30e1ee1d
internal/shader: refactoring
2023-09-12 03:27:30 +09:00
Hajime Hoshi
73e4423fe7
internal/shader: bug fix: bitwise operators with assignment didn't work
...
Closes #2752
Updates #2754
2023-09-12 03:15:28 +09:00
Hajime Hoshi
c13980158f
internal/shader: add type checks for bitwise operators
...
Updates #2754
2023-09-12 02:40:42 +09:00
Hajime Hoshi
41c7852c7d
internal/ui: sort selectors in alphabetical order
2023-09-11 02:15:42 +09:00
TotallyGamerJet
5dc293fe4f
internal/ui: use new OBJC API ( #2750 )
...
Updates #1162
2023-09-11 02:05:42 +09:00
Hajime Hoshi
55bfc02509
internal/processtest: use (*testing.T).TempDir
2023-09-06 11:37:27 +09:00
Hajime Hoshi
20ddfba983
internal/shader: bug fix: error in assinments to multiple variables
...
Closes #2747
2023-09-04 02:21:45 +09:00
Hajime Hoshi
1bbded8653
internal/shader: bug fix: wrong local variable index was used for assignments
...
Closes #2655
2023-09-04 01:23:03 +09:00
Hajime Hoshi
f82114e8eb
internal/shader: add parseFor
...
Updates #1897
2023-09-03 17:15:39 +09:00
Hajime Hoshi
f30a58a393
internal/ui: bug fix: disable global functions after the game termination
...
Closes #2743
2023-09-02 15:38:41 +09:00
Hajime Hoshi
6e968558b1
internal/ui: bug fix: setRunning(true) must be called after the main thread is set
...
Some functions like ebiten.SetCursorMode use `running` to detect
whether the game starts or not. If the game starts, the main thread
must exist, but there was a timing when `running` was true but the
main thread didn't exist.
This change fixes this issue by changing the timing to call
`setRunning(true)` after the main thread initialization and before
`initOnMainThread`. `initOnMainThread` assumes that `running` is
true.
Closes #2742
2023-09-02 04:24:51 +09:00
Hajime Hoshi
d9757138a7
internal/restorable: use clearImage to clear a region
...
This is an improvement for https://github.com/hajimehoshi/ebiten/issues/2676#issuecomment-1650325027
Updates #2676
2023-08-31 23:32:54 +09:00
Hajime Hoshi
e082ea73dc
internal/restorable: reuse empty byte slices for ClearPixels
...
This is an improvement for https://github.com/hajimehoshi/ebiten/issues/2676#issuecomment-1650325027
Updates #2676
2023-08-31 23:02:40 +09:00
Hajime Hoshi
7ed2d73406
internal/builtinshader: bug fix: wrong blending rate
...
The blending rate of colors in a square vertices should be calculated
by the lower-right point, not the upper-left point.
mix(a, b, rate) function calculates (1-rate)*a + rate*b, so a should
be weighted if rate is close to 0, and b should be weighted if rate
is close to 1. The current implementation was opposite.
Rendering results don't seem to be changed so much actually, but the
current implementation doesn't make sense.
2023-08-31 15:11:37 +09:00
Hajime Hoshi
009fb504ed
internal/builtinshader: remove adjustments for tie-breaking
...
This seems no longer needed with the pixel mode.
This was confirmed by this test:
```
go run . -run=TestImageLinearFilterGlitch2
```
The same change didn't work at b5ca404c42
but worked at 49582519c1
, which
introduced the pixel mode.
Updates #1212
2023-08-30 23:55:44 +09:00
Ketchetwahmeegwun T. Southall
60b7de6a3c
ebiten: add APIs to treat monitors ( #2597 )
...
This change adds these APIs:
* `type MonitorType`
* `func (*MonitorType) Bounds() image.Rectangle`
* `func (*MonitorType) Name() string`
* `func Monitor() *MonitorType`
* `func SetMonitor(*MonitorType)`
* `func AppendMonitors([]*MonitorType) []*MonitorType`
Closes #1835
2023-08-30 21:02:04 +09:00
Hajime Hoshi
98ead195c6
audio: bug fix: deadlock between a player and a context
...
Closes #2737
2023-08-29 14:52:48 +09:00
Hajime Hoshi
1269315f75
internal/shader: bug fix: forbid duplicated uniform variables
...
Closes #2648
2023-08-29 00:43:10 +09:00
Hajime Hoshi
446a6dc952
internal/graphics: deprecated some built-in functions
...
Updates #1870
2023-08-29 00:06:54 +09:00
Hajime Hoshi
db34930ae8
internal/graphics: add built-in Kage functions
...
This change adds these Kage functions:
* imageDstOrigin
* imageDstSrc
* imageSrcNOrigin
* imageSrcNSrc
and deprecates these functions:
* imageDstRegionOnTexture
* imageSrcRegionOnTexture
Closes #1870
2023-08-28 15:06:45 +09:00
Hajime Hoshi
534370f7b1
internal/graphics: enable to specify regions for each source image
...
This is a preparation to specify different sizes of source images.
Updates #1870
2023-08-27 21:15:01 +09:00
Hajime Hoshi
dec08b9e4e
all: bug fix: relative paths for dlopen didn't work on macOS Sonoma
...
Closes #2732
2023-08-26 14:52:52 +09:00
Hajime Hoshi
592d6c57b7
internal/graphicsdriver/metal: improve an error message for Metal initialization
...
Updates #2732
2023-08-26 12:43:16 +09:00
Hajime Hoshi
4116fd3eb4
internal/debug: bug fix: add SwitchLogger to dump logs for each frame correctly
...
Closes #2731
2023-08-26 03:38:37 +09:00
Hajime Hoshi
b29fc5672c
internal/graphicscommand: use bufio to make dumping images faster
2023-08-26 00:50:45 +09:00
Hajime Hoshi
fd5e2d39c0
internal/graphics: add uniform variables for source image sizes
...
Updates #1870
2023-08-25 07:30:52 +09:00
Hajime Hoshi
a9b2f5f9ca
Revert "ebiten: panic if a non-existent uniform variable name is given"
...
This reverts commit 1b8580fab7
.
Reason: some existing applications don't work with this fix.
Updates #2710
2023-08-24 14:15:19 +09:00
Hajime Hoshi
3493358fd2
internal/graphics: use the terms 'image' and 'texture' appropriately
2023-08-24 02:36:51 +09:00
Hajime Hoshi
7ea3cd4738
internal/atlas: bug fix: copy the image slice before iterating it
...
Closes #2729
2023-08-23 16:41:34 +09:00
Hajime Hoshi
2de64088dc
internal/graphicscommand: reduce boundary checks
...
This can be confirmed by this command:
```
go build -gcflags="-d=ssa/check_bce" ./internal/graphicscommand/
```
Updates #2601
2023-08-21 03:15:31 +09:00
Hajime Hoshi
c00795416a
internal/graphicscommand: remove a redundant boundary check
...
The boundary is already checked the above 'copy' call. This can be
confirmed by the result of this command.
```
go build -gcflags="-d=ssa/check_bce" ./internal/graphicscommand/
```
2023-08-20 15:45:19 +09:00
Hajime Hoshi
407d7bd43f
internal/graphics: optimization: remove boundary checks
...
Before:
```
$ go build -gcflags="-d=ssa/check_bce" ./internal/graphics
internal/graphics/vertex.go:83:9: Found IsSliceInBounds
internal/graphics/vertex.go:85:5: Found IsInBounds
internal/graphics/vertex.go:86:5: Found IsInBounds
...
```
After:
```
$ go build -gcflags="-d=ssa/check_bce" ./internal/graphics
internal/graphics/vertex.go:83:11: Found IsSliceInBounds
internal/graphics/shader.go:134:37: Found IsSliceInBounds
```
Updates #2601
2023-08-20 15:38:07 +09:00
Hajime Hoshi
d9797423e5
ebiten, internal/builtinshader: use an array instead of a map
...
runtime.mapaccess2 is one of heavy function calls.
Updates #2601
2023-08-20 05:20:52 +09:00
Hajime Hoshi
10c9f489ce
internal/devicescale: use a slice instead of a map
...
runtime.mapaccess2 is one of heavy function calls.
Updates #2601
2023-08-20 05:00:46 +09:00