Commit Graph

72 Commits

Author SHA1 Message Date
Hajime Hoshi
5bbb148a38 uidriver/js: Add jsKeyToID to avoid js.Value.String
Fixes #1437
2020-12-16 13:30:42 +09:00
Hajime Hoshi
69b1d2e820 uidriver/js: Use js.Value as key strings
Updates #1437
2020-12-16 12:53:33 +09:00
Hajime Hoshi
442be20f4d uidriver/js: Avoid calling String when possible to reduce overhead
Updates #1437
2020-12-16 12:41:55 +09:00
Hajime Hoshi
35867c7697 uidriver/js: Add go2cpp.screenWidth/screenHeight 2020-12-09 10:10:34 +09:00
Hajime Hoshi
768fdd2c47 uidriver/js: Separate registering event handlers 2020-12-06 22:56:09 +09:00
Hajime Hoshi
5897e1ab7c Implement some preparation code for go2cpp
Updates #744
2020-11-30 23:18:42 +09:00
Hajime Hoshi
4df958c9fd Avoid comparing to js.Undefined() for consistency 2020-11-21 14:25:17 +09:00
Hajime Hoshi
14070ee153 uidriver: Copy the runes on the callee sides 2020-11-18 19:37:12 +09:00
Hajime Hoshi
1864c22ad6 uidriver/glfw: Reduce (*thread).Call at (*Input).update 2020-10-17 05:22:23 +09:00
Hajime Hoshi
770661c609 driver: Refactoring: Remove (UIContext).Draw 2020-10-15 01:27:50 +09:00
Hajime Hoshi
3c21246db5 uidirve/js: Bug fix: Fix key codes for Edge browser
Updates #1382
2020-10-11 19:03:49 +09:00
Hajime Hoshi
5ee3fdf628 ebiten: Add KeySuper
Fixes #1382
2020-10-11 18:40:40 +09:00
Hajime Hoshi
7f55fdf769 uidriver/js: Stop auto-focusing on loading when the page is in an iframe
Fixes #1373
2020-10-10 15:52:33 +09:00
Hajime Hoshi
b1c67c7661 ebiten: Introduce type TouchID
Fixes #604
2020-10-10 03:57:47 +09:00
Hajime Hoshi
809b7a3afa ebiten: Introduce type GamepadID
Updates #604
2020-10-08 01:57:08 +09:00
Hajime Hoshi
7a0e31a23a Clean up the 'js' build tags
Updates #1129
2020-10-07 01:33:10 +09:00
Hajime Hoshi
00f3d83d4c Remove supporting GopherJS
Fixes #1129
2020-10-07 01:10:09 +09:00
Hajime Hoshi
41cf90a321 ebiten: Change the default value of IsRunningOnUnfocused to be true
Fixes #1180
2020-10-07 00:30:49 +09:00
Hajime Hoshi
bf515bb594 Update version to v2.0.0-alpha 2020-10-04 04:30:40 +09:00
Hajime Hoshi
77fa0cb9ef ui: Add SetInitFocused
Fixes #769
2020-08-23 02:19:09 +09:00
Hajime Hoshi
dea716c9a6 uidriver: Remove force focusing by clicking the body
As long as the game is embedded in an iframe, this is no longer
needed.
2020-08-22 18:40:34 +09:00
Hajime Hoshi
2bdef2e8c4 restorable: Add an explicit way to detect context-lost
isTexture was used to detect context-lost and called every frame.
This was not good for performance.

This change adds a way to notify context-lost from the WebGL
handlers directly, and the package restorable uses it instead of
calling (*Image).isInvalaidated.

Fixes #1175
2020-05-30 20:29:15 +09:00
Hajime Hoshi
7ccc29e3c7 uidriver/js: Clean up 2020-05-19 04:08:33 +09:00
Hajime Hoshi
be1a8bddbf uidriver/js: Bug fix: Create goroutine for a function passed to rAF
This is necessary not to cause dead-lock.

Updates #1161
2020-05-19 03:28:20 +09:00
Hajime Hoshi
8777140e91 driver: Simplify UIContext.Update 2020-04-03 00:18:27 +09:00
Hajime Hoshi
a718ddbf7e driver: Add UIDriver.Draw
This is a preparation for XNA.

Updates #1078
2020-04-01 02:55:50 +09:00
Hajime Hoshi
7b5fb0a0d0 ui: Bug fix: The window was not shown on the secondary monitor on launching
This change changes the behavior of WindowPosition /
SetWindowPosition. The window position is now a relative position
and the origin position is the left-upper of the current monitor.

Fixes #1115
2020-03-28 19:51:47 +09:00
Hajime Hoshi
978ee26898 ui: Add function aliases *OnUnfocused for *InBackground
Now a window can be floating with SetWindowFloating, the functions
that have suffix 'IsBackground' seems misleading. However, we
cannot rename them due to backward compatibility. Then, let's add
aliases and revisit them when updating the major version of Ebiten.

Fixes #1102
2020-03-21 00:42:00 +09:00
Hajime Hoshi
56358fd0c4 ui: Rename IsForeground -> IsFocused
Updates #1102
2020-03-21 00:12:47 +09:00
Hajime Hoshi
682f454fc2 input: Refactoring: Rename variables 2020-02-19 10:52:58 +09:00
Hajime Hoshi
d59aea1db1 driver: Remove the return value from RunWithoutMainLoop 2020-02-11 23:56:53 +09:00
Hajime Hoshi
c927d33457 mobile/ebitenmobileview: Use the common uiContext for layouting
This means that the whole offscreen is cleared correctly.

This change is a little breaking change: SetScreenSize or other
functions no longer works on ebitenmobile. Use Layout instead.

Fixes #1019
2020-02-11 19:40:47 +09:00
Hajime Hoshi
099ce1b3b4 Revert "ui: Add SetInitFocused"
This reverts commit bb04fc8a29.

Reason: glfw.Focused / glfw.FocusOnShow did not work

Updates #769
2020-02-10 01:10:40 +09:00
Hajime Hoshi
bb04fc8a29 ui: Add SetInitFocused
Updates #769
2020-02-09 23:45:59 +09:00
Hajime Hoshi
32471af18f uidriver/js: Ensure that the checking-audio loop is finished when the game is finished
After the game loop is finished, any goroutines should not exist.
Otherwise, 'Go program has already exited' error can happen on
Wasm.

This change ensures that the goroutines are finished when the game
is finished. Note that time.Sleep was required to ensure that the
(*time.Ticker) ends.

Fixes #1027
2020-02-09 03:39:08 +09:00
Hajime Hoshi
d6d17a7e85 uidriver/js: Implement GamepadSDLID
Fixes #1053
2020-02-05 00:00:00 +09:00
Hajime Hoshi
38f49c3768 uidriver/js: Implement IsForeground
Updates #1037
2020-01-21 23:56:57 +09:00
Zachary Burkett
6686044452 ui: Add IsForeground API to glfw driver (#1058)
Updates #1037
2020-01-16 10:47:23 +09:00
Hajime Hoshi
b4819c4523
input: Rename GamepadGUID -> GamepadSDLID (#1049)
Gamepad GUID is a SDL specific notion and, strictly speaking,
they are not GUID (UUID) since they don't follow UUID's
specifications.

Renaming the function makes the situation clearer.

Updates #1048
2020-01-11 15:50:37 +09:00
Jake Bentvelzen
c17946bb82 ui: Add GamepadGUID and GamepadName functions (#1035)
Fixes #1034
2020-01-09 22:11:32 +09:00
Hajime Hoshi
982b7d6ddc driver: Let UI have Graphics
Now UIs own the implementation of Graphics.

Updates #1026
2020-01-03 18:32:27 +09:00
Hajime Hoshi
9ed8279fc8 driver: Add interface Window 2019-12-25 00:24:21 +09:00
Hajime Hoshi
7d56e4335e ui: Add RunGame, WindowSize and SetWindowSize
This change introduces the new APIs RunGame, WindowSize and
SetWindowSize. These new APIs hides the notion of 'scale', and is
more flexible with the outside size change. This means that we can
introduce a resizable window.

This change also adds -legacy flag to examples/windowsize. If the
flag is off, the new APIs are used.

This change deprecates these functions since the notion of 'scale'
is deprecated:

  * ScreenScale
  * ScreenSizeInFullscreen
  * SetScreenScale
  * SetScreenSize

Fixes #943, #571
Updates #320
2019-12-22 03:35:31 +09:00
Hajime Hoshi
57d527bea2 driver: Remove 'title' argument from UI.Run 2019-12-22 01:41:51 +09:00
Hajime Hoshi
8b995b086b driver: Remove some arguments from UI.Run 2019-12-21 22:52:23 +09:00
Hajime Hoshi
8013fef9ea uidriver: Bug fix: Needed to implement MonitorPosition 2019-12-21 21:15:58 +09:00
Hajime Hoshi
85cbc7e56b Enable to compile Ebiten on js/wasm with Go 1.14
Fixes #1024
2019-12-19 00:45:53 +09:00
Hajime Hoshi
bda11b0e17 driver: Add UI.SetWindowSize and UIContext.Layout
This is a preparation to introduce RunGame function.

Updates # 943 (Fix this line before committing)
2019-12-15 02:29:43 +09:00
Hajime Hoshi
d8f02cf03e uidriver/js: Bug fix: Compile error on CursorMode 2019-12-14 12:54:21 +09:00
Zachary Burkett
ed19d6fae9 Add cursor capture functionality (#1016)
Fixes #1016
2019-12-14 12:30:03 +09:00