Commit Graph

4158 Commits

Author SHA1 Message Date
Hajime Hoshi
d947cf0da0 internal/atlas: refactoring: use moveTo to make an image isolated
This reduces backend allocations by &backend{...}.

Updates #2581
2023-02-23 02:23:03 +09:00
Hajime Hoshi
0720ec2251 internal/packing: allow initialization with a rectangle size
Updates #2327
2023-02-23 00:45:42 +09:00
Hajime Hoshi
b08b740914 internal/buffered: bug fix: functions were not concurrent-safe
Before this change, `delayedCommandsFlushed` was set as 1 BEFORE
buffered commands were flushed. This meant that a function call and
a command being flushed were not concurrent-safe.

This change fixes this issue by changing the timing of setting
`delayedCommandsFlushed` as 1 to the later time after flushing the
buffered commands.

Closes #2580
2023-02-21 20:38:06 +09:00
Hajime Hoshi
ea7d007df9 internal/ui: bug fix: dstRegion should not exceed the image region
Closes #2577
2023-02-21 14:15:39 +09:00
Hajime Hoshi
ad7d5a86f9 internal/shader: bug fix: check the type for composite literal
Closes #2348
2023-02-20 23:07:11 +09:00
Hajime Hoshi
d91b8cae88 internal/ui: reland: refactoring: improve anti-alias logic
* Remove the image extension. The image is always flushed when necessary.
* Use a small offscreen image whichever the blend is.

Updates #2399
2023-02-19 23:49:32 +09:00
Hajime Hoshi
3aa8448511 Revert "internal/ui: refactoring: improve anti-alias logic"
This reverts commit 41f8295611.

Reason: test failures: https://github.com/hajimehoshi/ebiten/actions/runs/4216421788/jobs/7318236488
2023-02-19 22:46:37 +09:00
Hajime Hoshi
41f8295611 internal/ui: refactoring: improve anti-alias logic
* Remove the image extension. The image is always flushed when necessary.
* Use a small offscreen image whichever the blend is.

Closes #2399
2023-02-19 22:14:23 +09:00
Hajime Hoshi
961c34efb5 internal/ui: use a small buffer image for anti-alias
Closes #2399
2023-02-19 17:35:43 +09:00
Hajime Hoshi
8479fee606 internal/ui: refactoring 2023-02-18 18:23:57 +09:00
Hajime Hoshi
0e57fc4c5f internal/processtest: set timeout
Updates #2571
2023-02-18 17:36:31 +09:00
Hajime Hoshi
56597800dd internal/ui: refactoring: add bigOffscreenImage
Updates #2399
2023-02-18 02:32:41 +09:00
Hajime Hoshi
7018d1aebe internal/processtest: fix the timeout logic
Updates #2571
2023-02-15 22:41:18 +09:00
Hajime Hoshi
a65b65110b Revert "internal/processtest: prevent parallel process testing"
This reverts commit 397da70815.

Reason: This did not resolve the issue: https://github.com/hajimehoshi/ebiten/actions/runs/4180959132/jobs/7242421909

Updates #2571
2023-02-15 15:13:57 +09:00
Hajime Hoshi
7315044dcf internal/ui: remove a redundant call to close a window
glfw.Terminate should close the window too. This might fix the issue
so let's wait and see.

Updates #2551
2023-02-15 14:36:28 +09:00
Hajime Hoshi
397da70815 internal/processtest: prevent parallel process testing
Updates #2571
2023-02-14 18:13:27 +09:00
TotallyGamerJet
93537650c0
internal/goglfw: use platform agnostic functions for context_windows.go (#2570)
context_windows.go is used for all the platforms. However, it used syscall.Syscall which behaves differently on macOS
and Windows as well as windows.BytePtrToString which isn't available on Linux or macOS.

This commit replaces syscall.Syscall with purego.SyscallN and windows.BytePtrToString with a copied version called
bytePtrToString.

Updates #2546
2023-02-10 02:35:17 +09:00
TotallyGamerJet
b359985e97
internal/goglfw: separate windows specific struct from common structs (#2567)
Many of the structs found in internal.h (internal_windows.go) contain defines such as GLFW_WIN32_WINDOW_STATE
which gets replaced with a struct defined in win32platform_windows.go (win32_platform.h).

Originally, these structs where directly placed inside of internal_windows.go. However, to make it easier to add macOS
and Linux these cannot be in this file.

This commit separates the windows specific structs into the respective windows file and updates the field to be named
state.

Updates #2546
2023-02-08 03:05:46 +09:00
Hajime Hoshi
8864ce1291 all: update comments 2023-02-07 12:05:43 +09:00
Hajime Hoshi
f4371991fe internal/gamepad: refactoring 2023-02-02 22:33:01 +09:00
Hajime Hoshi
628418d88e internal/gamepaddb: update the database 2023-02-02 22:00:34 +09:00
Pierre Curto
4de807cc44
all: fix typos (#2558)
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
2023-01-28 19:06:38 +09:00
Hajime Hoshi
f009dd8dd2 ebiten: implement DroppedFiles to replace AppendDroppedFiles
Closes #2552
2023-01-25 14:27:11 +09:00
Hajime Hoshi
aa52402a90 internal/graphicsdriver/metal: fix a comment 2023-01-24 02:22:35 +09:00
Hajime Hoshi
16e49e0499 internal/ui: fix a potential out-of-range error 2023-01-24 00:32:08 +09:00
Hajime Hoshi
7f39b9c5b6 internal/graphicsdriver/metal: use supportsFeatureSet: as a fallback
This change is a fix for a regression that happened on macOS High Sierra.

Closes #2553
2023-01-23 23:44:56 +09:00
Hajime Hoshi
84e32c2e4e internal/ui: more precise detection of directory on browsers
Updates #1868
2023-01-22 18:28:34 +09:00
Hajime Hoshi
8c25fac860 ebiten: add AppendDroppedFiles
Closes #1868
2023-01-22 17:22:25 +09:00
Hajime Hoshi
b79f0394cc internal/ui: refactoring: allow slices in InputState 2023-01-22 01:28:57 +09:00
Hajime Hoshi
d53803615a internal/ui: merge a window-closing state into an input state 2023-01-21 23:42:48 +09:00
Hajime Hoshi
35e25a3636 rename internal/glfwwin -> internal/goglfw
Updates #2546
2023-01-21 22:09:21 +09:00
Hajime Hoshi
06bc569b73 internal/shader: bug fix: wrongly typed constants were unexpectedly used
Closes #2549
2023-01-20 02:26:39 +09:00
Hajime Hoshi
f054a7634a ebiten: deprecate (*Image).Size
Closes #2351
2023-01-20 01:26:37 +09:00
Hajime Hoshi
96a44eceaf internal/glfwwin: remove unused functions 2023-01-14 17:04:46 +09:00
Hajime Hoshi
72f026e254 internal/graphicsdriver/opengl/gl: bug fix: searching GL libraries failed on some machines
On a Debian machine, LD_LIBRARY_PATH might not be set and libGL.so might
not exist (libGL.so.1 exists instead). In this case, searching for a GL
library fails

This change fixes the issue by not using LD_LIBRARY_PATH and also including
`libGL.so.*` files as candidates for dlopen.

Closes #2539
2023-01-13 15:08:06 +09:00
Hajime Hoshi
08fba564f8 internal/ui: refactoring: define global sel_ objects 2023-01-09 01:41:13 +09:00
divVerent
abece041f4
internal/graphicsdriver/opengl: fix state tracking of glBindTexture / glActiveTexture interaction (#2526)
After switching texture units using glActiveTexture, a different texture may
be bound. For now, let's just force the active texture state variable to zero
so the next glBindTexture call isn't skipped.

Closes #2525
2023-01-07 23:13:14 +09:00
Hajime Hoshi
95f1ef0fb9 internal/ui: bug fix: recover the cursor shape when the cursor is visible
Closes #2527
2023-01-07 20:03:21 +09:00
Hajime Hoshi
86fa9366f7 internal/ui: use 'set' instead of 'push' for cursors
We don't need to use a cursor stack.
2023-01-07 19:16:41 +09:00
Hajime Hoshi
847d1cae73 internal/graphicsdriver/opengl/gl/: refactoring 2023-01-07 17:01:00 +09:00
Hajime Hoshi
d615c2f42a internal/graphicsdriver/opengl/gl: bug fix: isES was not set 2023-01-07 03:46:30 +09:00
Hajime Hoshi
869ca1e01f internal/graphicsdriver/opengl/gl: fix a wrong comment 2023-01-07 03:41:02 +09:00
Hajime Hoshi
983e8abd46 internal/graphicsdriver/opengl/gl: bug fix: an unavailable library name might be chosen
Instead, let's try all the names with dlopen.

Updates #2523
2023-01-07 03:06:12 +09:00
Hajime Hoshi
df7b7b731e internal/graphicsdriver/opengl/gl: bug fix: libGL.so might not exist in Steam
Instead, libGL.so.1 might exist. Use LD_LIBRARY_PATH and list the
candidates.

Closes #2523
2023-01-07 00:03:07 +09:00
Hajime Hoshi
b860d8dc61 internal/graphicsdriver/metal/mtl: bug fix: test failures 2023-01-05 14:14:42 +09:00
Hajime Hoshi
c5848455f5 internal/graphicsdriver/metal: use MTLGPUFamily instead of MTLGPUFeatureSet 2023-01-05 13:37:37 +09:00
Hajime Hoshi
cf76e3c646 internal/graphicsdriver/opengl: better place to reset uniform variables
Updates #2517
2023-01-04 01:36:04 +09:00
Hajime Hoshi
599be725b9 internal/graphicsdriver/metal: fix comments 2023-01-03 23:16:01 +09:00
Hajime Hoshi
7418576c16 internal/ui: re-enable skipping to render the final screen when possible
With Metal, nextDrawable could return immediately when a command buffer
is empty. To avoid high CPU usage, this change adds a slight sleep in
this case.

With DirectX, Present waits for a while even though nothing is updated,
then that's fine.

Updates #2341
Updates #2342
Updates #2520
2023-01-03 23:09:28 +09:00
Hajime Hoshi
edb952c9e7 internal/graphicsdriver/metal: add comments 2023-01-03 22:10:33 +09:00