Commit Graph

4476 Commits

Author SHA1 Message Date
Hajime Hoshi
31e0721973 cmd/ebitenmobile: Ensure that frame-update never happens on background 2019-09-13 11:47:45 +09:00
Hajime Hoshi
af3b7117c3 cmd/ebitenmobile: Refactoring 2019-09-13 03:26:13 +09:00
Hajime Hoshi
16337bb6bf cmd/ebitenmobile: Add suspendGame/resumeGame to the ViewController
Updates #894
2019-09-13 03:19:01 +09:00
Hajime Hoshi
71b28b6211 event: Bug fix: Add chan.go
Updates #926
2019-09-12 22:01:09 +09:00
Hajime Hoshi
695c93efd6 event: Add a converting function from driver.Event to event.Event
Update #926
2019-09-12 21:59:13 +09:00
Hajime Hoshi
529ab5f191
event: Auto-generate event definitions (#935)
As event package needs to depend on driver package, and drvier
package needs to emit events, we need event definitions in both
side. This change add a generator for event definitions.

Updates #926
2019-09-12 11:32:20 +09:00
Hajime Hoshi
e85c847376 input: Refactoring: Use filepath.Join 2019-09-11 01:08:48 +09:00
Hajime Hoshi
3fb9c02e2f graphicsdriver/metal: Bug fix: Use correct pixel format for the screen 2019-09-08 03:52:29 +09:00
Hajime Hoshi
ef91fb739f cmd/ebitenmobile: Bug fix: Resume the view correctly 2019-09-07 02:33:38 +09:00
Hajime Hoshi
dbb8a5e873 audio: Block all the players when suspended
This avoid to write 0 bytes when the app is in background. This
should reduce CPU usage.

Updates #931
2019-09-07 02:03:59 +09:00
Hajime Hoshi
c982e00bb0 Fix .travis.yml not to test the playground
Updates #871
2019-09-03 02:06:37 +09:00
Hajime Hoshi
675db373da Remove driver getters for the playground
Unless the driver implementation is finished for the playground,
this is confusing. Let's remove this.

Updates #871
2019-09-03 01:47:48 +09:00
Hajime Hoshi
52900fac79 Move back driver getters to ebiten package 2019-09-03 01:46:11 +09:00
Hajime Hoshi
ba08a5bb55 event: Add a comment at Modifier
Updates #926
2019-09-03 01:18:20 +09:00
Hajime Hoshi
25a2bf3c1f event: Add Modifier
Modifier keys are selected of a common set of GLFW keys [1] and Web
API keys [2].

This change also renames the member Modifiers to Modifer to
follow the convension (e.g., [3]).

Updates #926

[1] https://www.glfw.org/docs/latest/group__mods.html
[2] https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState
[3] https://godoc.org/golang.org/x/tools/go/packages#Config
2019-09-03 01:12:50 +09:00
Hajime Hoshi
06d38790ff
event: Add Key (#933)
This also renames event names from Key* to KeyboardKey*.

Updates #926
2019-09-03 00:45:27 +09:00
Hajime Hoshi
272923da65 Revert gomobile version
The latest version includes an issue: golang/go#33937
2019-09-02 03:00:17 +09:00
Hajime Hoshi
56f45d77bd Update dependencies 2019-09-02 02:57:19 +09:00
Hajime Hoshi
05f4ca2a4d input: Refactoring: nameToJSKeyCodes -> nameToJSKeyCode 2019-09-02 00:30:17 +09:00
Hajime Hoshi
83b2d4b112 input: driver.Key now distinguishes left/right modifier keys
This is a preparation for event package, that will have key enum.

Updates #926
2019-09-01 23:49:00 +09:00
Hajime Hoshi
23002c7597 input: Refactoring 2019-09-01 21:49:25 +09:00
Hajime Hoshi
e465c59395 input: Refactoring 2019-09-01 18:46:54 +09:00
Hajime Hoshi
31a47d05b1 event: Add comments about backforward compatibility 2019-08-31 01:05:50 +09:00
Hajime Hoshi
96f6714b66 Add Beoran to AUTHORS 2019-08-31 01:04:43 +09:00
Beoran
d51d5f2eb0 Add package event (#930)
Package event is a package that models events that occur during
the execution of a program. The current implementation is mock
and we plan to add implementation later.

Updates #926
2019-08-31 01:03:21 +09:00
Hajime Hoshi
19103dcfeb graphicscommand: Bug fix: Adjust vertices to avoid jaggy
If vertices are (almost) half-integer values, adjust them to avoid
jaggy.

Fixes #929.
2019-08-27 23:18:08 +09:00
Hajime Hoshi
22c31da6c1 restorable: Bug fix: Do not include emptyImage into the dependency graph
Instead, add baseColor to Pixels and use it when restoring.

Fixes #928.
2019-08-27 08:17:14 +09:00
Hajime Hoshi
76330c492c shareable: Refactoring 2019-08-26 00:32:30 +09:00
Hajime Hoshi
464713f19d graphics: Refactoring 2019-08-25 22:06:20 +09:00
Hajime Hoshi
3646e7930d graphics: Bug fix: the flag and the enqueueing operation must be protected by a same mutex
It was theoretically possible that an item was enqueued even
though the flag said it should not.
2019-08-25 21:22:54 +09:00
Hajime Hoshi
fc939fabb8 graphics: Bug fix: Copy variables out of the closures 2019-08-25 21:06:44 +09:00
Hajime Hoshi
d2312f1450 shareable: Lock before BeginFrame
This make package shareable more consistent. The mutex is lock
after EndFrame and before BeginFrame, and the similar rule will be
applied at launching (BeginFrame unlocks the lock in any cases).

Instead, package ebiten queues image operations if BeginFrame and
doesn't create provisional non-shared images. This should improve
performance at launching since this reduces the number of draw
calls, especifally for creating new images.

Updates #879.
Updates #921.
2019-08-25 18:12:04 +09:00
Hajime Hoshi
7907bb43ce shareable: Refactoring: reduce sync.Once 2019-08-25 17:32:32 +09:00
Hajime Hoshi
b53279b1e1 shareable: Remove InitializeGraphicsDriverState 2019-08-25 17:28:59 +09:00
Hajime Hoshi
3960a4bbdf restorable: Add (*Image).Fill
This resets the infomation for restoring if possible. This makes
it more efficient to use offscreens.
2019-08-25 02:57:44 +09:00
Hajime Hoshi
856e2df1ec web: Bug fix: compile error on browsers 2019-08-25 02:40:28 +09:00
Hajime Hoshi
b8eeded538 graphics: Remove 'resetRestoringState'
This is basically a revert of 2d079b123f

As filling can happen on a part of a shared image, resetting the
restoring state was wrong.
2019-08-25 02:18:51 +09:00
Hajime Hoshi
e931494c66 shareable: Allocate the screen framebuffer image lazily
This improves consistency.
2019-08-25 00:43:29 +09:00
Hajime Hoshi
ef56d0a535 Refactoring: isRunning -> isImageAvailable 2019-08-25 00:14:37 +09:00
Hajime Hoshi
a42b5274df cmd/ebitenmobile: Use GOROOT/bin/go instead of go
Fixes #927
2019-08-24 01:06:16 +09:00
Hajime Hoshi
c49815a2b2 docs: Update the link 2019-08-22 23:16:44 +09:00
Hajime Hoshi
07c484fa49 graphics: Fix documentation 2019-08-21 01:43:08 +09:00
Hajime Hoshi
42d7cce989 graphics: Update docs about (*Image).Dispose
Updates #920
2019-08-19 22:41:45 +09:00
Hajime Hoshi
42c70e48ff uidriver/mobile: No need to use sync.Once
devicescale.At is already locked by a mutex and keeps values in its
cache.
2019-08-19 02:32:53 +09:00
Hajime Hoshi
2c23860226 uidriver/mobile: Prefer sync.Once to sync.Mutex 2019-08-19 02:25:01 +09:00
Hajime Hoshi
d7aa24c295 uidriver/glfw: Bug fix: Wrong usage of RWLock 2019-08-19 01:47:55 +09:00
Hajime Hoshi
4d0e23c460 uidriver/glfw: Reduce mutex to avoid potential deadlock 2019-08-19 01:01:43 +09:00
Hajime Hoshi
25ac788ee6 uidriver/mobile: Reduce mutex to avoid potential deadlock 2019-08-19 00:32:52 +09:00
Hajime Hoshi
6cd74a9f4d uidriver/mobile: Simplify updating logic 2019-08-19 00:13:56 +09:00
Hajime Hoshi
2c770f3644 cmd/ebitenmobile: Define an error handler for iOS
Updates #919
2019-08-18 20:55:36 +09:00