Commit Graph

182 Commits

Author SHA1 Message Date
Hajime Hoshi
9a8d6e7b41 internal/ui: implement (*Monitor).Size for mobiles
Closes #2935
2024-09-16 19:42:23 +09:00
Hajime Hoshi
4a10702f6c internal/ui: replace deprecated APIs
[UIScreen mainScreen] is now deprecated.
2024-09-16 18:20:03 +09:00
Hajime Hoshi
07d29fa729 cmd/ebitenmobile: bug fix: consider EbitenSurfaceView recreation
On Android Emulator (Small Desktop API 32), EbitenRenderer can be
easily recreated by resizing the window. Thus, EbitenRenderer should
not have any flags like strictContextRestoration. Also, the flag
onceSurfaceCreated_ doesn't work there.
2024-09-09 16:42:57 +09:00
Hajime Hoshi
35f4884a74 ebiten: add RunGameOptions.StrictContextRestration
This reverts commit a30f075896.

This change adds a new option StrictContextRestration to make the
restoration optional.

Closes #3083
2024-09-07 18:36:04 +09:00
Hajime Hoshi
f98003bcd5 ebiten: add ColorSpace and RunGameOptions.ColorSpace
This works only for macOS Metal and WebGL so far.

Closes #2871
2024-08-28 03:03:57 +09:00
Hajime Hoshi
bb799da51f internal/ui: use atomic.Int32 instead of atomic.Store/LoadInt32
Updates #2422
2024-04-29 21:53:43 +09:00
Hajime Hoshi
f34932151d all: use atomic.Bool instead of atomic.Store/LoadUint32
Updates #2422
2024-04-29 21:16:01 +09:00
Hajime Hoshi
f4029aaa77 ebiten: add (*Monitor).Size() to replace ScreenSizeInFullscreen()
Also, this change fixes redundant checks the case when a monitor
does not exist. Now Ebitengine checks a monitor existence at the
initialization.

Closes #2145
Closes #2795
2024-03-23 23:32:43 +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
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
9539a87b17 all: drop the support of gomobile-build
Closes #2741
2024-01-08 00:43:26 +09:00
Hajime Hoshi
2da56c00c8 internal/ui: remove renderThread
Updates #2714
2024-01-02 17:14:38 +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
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
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
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
8274b32301 internal/graphicslibrary: refactoring: remove IsGL and IsDirectX 2023-10-15 17:30:16 +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
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
82f2319020 internal/hook: rename hooks -> hook 2023-10-06 13:58:00 +09:00
Hajime Hoshi
95b4eeafce all: remove unnecessary build tag restrictions 2023-10-01 23:27:57 +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
8a0aba45f5 internal/ui: update touches after the layout is determined on mobiles
Closes #2763
2023-09-17 21:56:26 +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
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
3869e2e4f6 internal/ui: refactoring: integrate the render thread usages into internal/graphicscommand
Updates #2664
2023-07-30 03:50:49 +09:00
Hajime Hoshi
b40c5b1e99 internal/ui: catch an error at At at updateIconIfNeeded
Closes #2647
2023-04-20 00:59:14 +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
0e137e8dd7 internal/ui: bug fix: compile error on mobiles 2022-12-30 15:44:01 +09:00
Hajime Hoshi
7e7deeab22 internal/ui: bug fix: SetWindowIcon crashed in the single-thread mode
Updates #1468
Closes #2513
2022-12-30 00:01:11 +09:00
Hajime Hoshi
4d89b5de07 internal/ui: refactoring 2022-12-29 20:47:32 +09:00
Hajime Hoshi
c638727759 internal/thread: remove Stop and use context.Context instead 2022-12-28 17:11:55 +09:00
Hajime Hoshi
5e7ec81f5c internal/ui: rename functions 2022-12-27 12:54:01 +09:00
Hajime Hoshi
a5b6f39ed7 internal/ui: bug fix: reset the input state immediately after reading
Before this change, the input state was reset at the end of a tick.
This means that wheel deltas or input chars in a tick might be reset
unexpectedly.

This change fixes the issue by reseting the input state immediately
when reading, so that wheel events and input-char events are preserved.

Updates #2496
Updates #2501
2022-12-21 00:27:28 +09:00
Hajime Hoshi
59295cc85f internal/ui: bug fix: input state should be reset for each tick, not frame
Before this change, input states were reset for each frame. When FPS
is bigger than TPS, the input state was reset more often than expected
and then some inputs were missing.

This change fixes the issue by resetting input states not for each frame
but for each tick.

This change also updates some comments of the input API.

Updates #2496
Closes #2501
2022-12-20 10:07:19 +09:00
Hajime Hoshi
d1b9a0a9a1 internal/ui: freeze the input state for each frame
After this change, the input APIs will return more consistent results
for one frame.

Closes #2496
2022-12-18 23:54:43 +09:00
Hajime Hoshi
3024e07ecc ebiten: add RunGameOptions.ScreenTransparent
Closes #2378
2022-12-09 22:50:57 +09:00
Hajime Hoshi
d31b0189a2 ebiten: add RunGameOptions.InitUnfocused
Updates #2378
2022-12-09 21:27:32 +09:00
Hajime Hoshi
bb68ebfcad ebiten: add RunGameWithOptions to specify graphics library
This also adds mobile.SetGameWithOptions.

Updates #2378
2022-12-09 21:27:31 +09:00
Hajime Hoshi
7d146fb70b internal/ui: bug fix: IsGL / SetUIView can be called before initialization is done
The functions in the package `mobile/ebitenmobileview` could be invoked
from EbitenViewController even before the graphics driver initialization
is done in theory.

This change fixes this issue by waiting the initialization by
channels. Also, this change adds error handlings at these functions.

Closes #2455
2022-11-15 01:53:20 +09:00
Hajime Hoshi
a0a5f2b301 internal/graphicsdriver/opengl: remove SetGomobileGLContext
This change is needed to initialize the context at opengl.NewGraphics.

Updates #2451
2022-11-13 15:07:14 +09:00
Artem Yadelskyi
5b53cef59e
all: remove old // +build comments (#2431)
Closes #2325
2022-11-03 12:55:14 +09:00