Commit Graph

42 Commits

Author SHA1 Message Date
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
58d3655597 internal/ui: remove unnecessary receivers from methods 2023-09-24 19:45:55 +09:00
Hajime Hoshi
5d5e3c7c0b internal/ui: refactoring: replace *glfw.Monitor with *Monitor 2023-09-24 02:39:53 +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
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
14f2ee198e ebiten: add SetWindowMousePassthrough and IsWindowMousePassthrough
Closes #2511
2023-09-18 18:31:22 +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
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
d53803615a internal/ui: merge a window-closing state into an input state 2023-01-21 23:42:48 +09:00
Hajime Hoshi
e9248c6f33 internal/ui: rename t -> mainThread 2022-12-28 15:59:53 +09:00
Artem Yadelskyi
5b53cef59e
all: remove old // +build comments (#2431)
Closes #2325
2022-11-03 12:55:14 +09:00
Hajime Hoshi
12f42544dd internal/ui: refactoring: simplify logic by removing setSizeCallbackEnabled
Closes #1816
2022-09-25 23:48:40 +09:00
Hajime Hoshi
c7deed6e72 internal/ui: add setFullscreen 2022-09-25 22:31:26 +09:00
Hajime Hoshi
25405783a7 internal/ui: refactoring
Updates #1816
2022-09-25 02:05:26 +09:00
Kacper Drobny
9c177c1b8e
internal/ui: allow maximizeWindow when no max boundaries are set (#2291)
Closes #2290
2022-09-01 22:34:17 +09:00
Hajime Hoshi
833473316f internal/ui: forbide RestoreWindow when the window size limits are specified
Closes #2259
2022-08-20 22:36:37 +09:00
Hajime Hoshi
31141d5112 internal/ui: forbid maximizing window when a window size is limited
Closes #2258
2022-08-20 22:24:13 +09:00
Hajime Hoshi
5b182efe7e internal/ui: forbide SetWindowSize when the window is maximized
On Windows, changing the size of a maximized window results in
unexpected states. Let's forbid this.

On macOS, a maximized window is just a regular window so it is
OK to allow resizing by `SetWindowSize`.

On Linux or other Unix, the behavior depends on window systems
and it is hard to expect what would happen, so forbid this just in
case.

Closes #1986
2022-08-15 16:29:20 +09:00
Hajime Hoshi
e7c0a121c4 all: remove the build tag 'ebitencbackend'
This also automatically enables 'egl' when 'nintendosdk' is specified.

Updates #2242
2022-08-12 13:15:39 +09:00
Hajime Hoshi
dac6548c0c all: rename ebitenginecbackend to nintendosdk
Updates #2242
2022-08-12 02:05:29 +09:00
Hajime Hoshi
85aabf734b internal/ui: remove panic at (*glfwWindow).Maximize
Just doing nothing is more consistent with other functions.

Updates #1990
2022-08-10 22:18:55 +09:00
Hajime Hoshi
b5196a5a7c internal/ui: bug fix: glfwWindow.IsMaximized should not return true on fullscreen
Closes #2239
2022-08-10 21:17:13 +09:00
Hajime Hoshi
7a936f7052 internal/ui: enable SetWindowSize even with fullscreen on macOS
Closes #1590
2022-08-10 15:57:59 +09:00
Hajime Hoshi
d0fa68691c internal/ui: enable some functions even on fullsceen
This is thanks to a GLFW v3.3.8 change:
9950cc52df

Updates #1590
2022-08-10 09:00:33 +09:00
Hajime Hoshi
428b1263d9 add ebitenginecbackend build tag besides ebitencbackend
Updates #2111
Updates #2190
2022-07-09 15:23:52 +09:00
Hajime Hoshi
9c15bda275 internal/ui: return a null Window on Xbox
Updates #2084
2022-06-01 01:26:31 +09:00
Hajime Hoshi
93b4c0d9b1 internal/ui: add comments
Updates #1590
2022-04-08 18:40:13 +09:00
Hajime Hoshi
90070c09fe internal/ui: rename origPos -> origWindowPos 2022-04-08 15:59:16 +09:00
Hajime Hoshi
b5a9ff007c internal/ui: bug fix: WindowPosition/SetWindowPosition didn't work on macOS fullscreen
Updates #1590
Closes #2043
2022-03-30 12:10:48 +09:00
Hajime Hoshi
be1836339b internal/ui: define the common struct UserInterface for all the environments
The existing UserInterface structs became userInterfaceImpl structs.
2022-03-21 23:10:27 +09:00
Hajime Hoshi
2c2c4bc428 ebiten: add WindowResizingModeType and its constants and functions
This allows a new state to disallow resizing the window but allow
making the window fullscreen on macOS by a user.

This change adds the new type WindowResizingModeType. There are
these constants of this type:

 * WindowResizingModeDisabled
 * WindowResizingModeOnlyFullscreenEnabled
 * WindowResizingModeEnabled

Closes #1819
2022-02-11 04:59:04 +09:00
Hajime Hoshi
f1987cae10 internal/ui: refactoring 2022-02-10 19:35:51 +09:00
Hajime Hoshi
35b9dd0846 internal/ui: give up SetWindowAspectRatioFixed
Unfortunately, it is almost impossible to provide a consistent behavior
to keep the aspect ratio of the window on Windows. Instead of having an
incomplete API, let's remove this.

Closes #1988
2022-02-10 18:35:00 +09:00
Hajime Hoshi
891ca2a08d ebiten: add IsWindowAspectRatioFixed
This also updates examples/windowsize.

Closes #1804
2022-02-09 20:06:18 +09:00
Hajime Hoshi
7482cae978 internal/ui: bug fix: the aspect ratio must be updated whenever the window size is forcibly updated
This also adds a new flag -aspectratiofixed to examples/windowsize

Updates #1804
2022-02-09 19:56:50 +09:00
Hajime Hoshi
740dfd5aed internal/glfw: refactoring: keep the original API when possible
Updates #1804
2022-02-09 19:36:47 +09:00
Hajime Hoshi
623c050537 ebiten: rename SetKeepWindowAspectRatio -> SetWindowAspectRatioFixed
Updates #1804
2022-02-09 19:29:55 +09:00
Tom Lister
18659ef4ab
internal/ui: add SetWindowKeepAspectRatio (#1985)
Updates #1804
2022-02-09 19:11:25 +09:00
Hajime Hoshi
4c6c31e384 all: reorder build tags in an alphabetical order 2022-02-08 15:49:15 +09:00
Hajime Hoshi
0f09ddfbd2 internal/driver: remove Window
Closes #1983
2022-02-06 20:12:40 +09:00
Hajime Hoshi
149736c3cf internal/uidriver/*: integrate the packages into internal/ui
Updates #1983
2022-02-06 17:23:04 +09:00