Commit Graph

937 Commits

Author SHA1 Message Date
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
7018e7dfb1 internal/ui: rename files 2023-10-11 02:03:58 +09:00
Hajime Hoshi
738f13f73f internal/ui: remove unnecessary build tags 2023-10-09 23:39:06 +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
98dc59c89f internal/cglfw: let functions return errors
Updates #2703
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
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
aa55953c11 internal/ui: replace (*userInterface).err with (*globalState).err 2023-10-05 00:45:04 +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
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
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
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
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