Commit Graph

349 Commits

Author SHA1 Message Date
Hajime Hoshi
c494b53822 ui: Refactoring: Add deviceScale struct 2018-10-02 23:06:56 +09:00
Hajime Hoshi
635d624b77 ui: Update device scale on browsers (#644) 2018-10-02 11:43:45 +09:00
Hajime Hoshi
21c1ee5dfb ui: Cache devicescale value on mobiles 2018-10-02 03:51:13 +09:00
Hajime Hoshi
9906c935f6 ui: Remove unnecessary lock protection 2018-10-02 03:25:30 +09:00
Hajime Hoshi
fce82e1502 ui: Use frame counter to update device scale 2018-10-02 03:21:59 +09:00
Hajime Hoshi
78f2946797 ui: Bug fix: timer condition was wrong 2018-10-02 02:53:17 +09:00
Hajime Hoshi
bf850e12a4 ui: Recalc device scale repeatedly for multiple displays (#644) 2018-10-02 02:49:08 +09:00
Hajime Hoshi
308c8091cd ui: Fix comments 2018-09-30 18:53:38 +09:00
Hajime Hoshi
803e42714e input: Implement wheel event on browsers
Fixes #630
2018-09-30 17:08:18 +09:00
Hajime Hoshi
25a5f1dd83 ui: Sleep when vsync doesn't work (#692) 2018-09-30 14:44:54 +09:00
Hajime Hoshi
15260537a2 graphics: Bug fix: fullscreen rendering was wrong
After fad65f2f5d, the viewport size
is always same as the framebuffer size. The 'screen' image size
was the actual rendering region size, and padding was not
considered in the size. The padding is added on the fullscreen
mode.

This fix adds the extra padding values to the 'screen' image size
so that the 'screen' framebuffer will be same size as the monitor
size.

Fixes #693
2018-09-29 21:47:41 +09:00
Hajime Hoshi
eb68cdad6e ui: Bug fix: Freezing on calling SetVsyncEnabled 2018-07-17 02:37:22 +09:00
Hajime Hoshi
09c93ac86d ui: Avoid using eval 2018-07-14 23:47:31 +09:00
Hajime Hoshi
e25c237a01 Add IsVsyncEnabled / SetVsyncEnabled
This enables the game to work more efficiently (but consume much
more CPU).

Fixes #405.
2018-07-14 21:43:55 +09:00
Hajime Hoshi
6e51d31524
Use new GopherWasm API (#634)
I plan to merge this right after
https://github.com/gopherjs/gopherwasm/pull/3 is merged.
2018-06-30 00:02:15 +09:00
Hajime Hoshi
f19e349d38 web: Remove IsNodeJS
gjbt now creates a pseudo-Node environment by creating
window.process object, and this conflicted with an assumption that
Ebiten doesn't nothing on Node environment. See
https://github.com/myitcv/gjbt/pull/13 for the detail.

This change allows Ebiten work on pseudo-Node environment. Even
after this change, Ebiten doesn't work on real Node environment
due to lack of DOM.
2018-06-28 00:12:24 +09:00
Hajime Hoshi
a9359e4ef8 Use GopherJS/GopherWasm 2018-06-24 16:10:24 +09:00
Hajime Hoshi
8d644479cc opengl: Initialize consts first to avoid 'Get' calls 2018-06-19 04:02:56 +09:00
Hajime Hoshi
62bd35e412 Avoid 'Get' call if possible
(*js.Value).Get has some overhead especially on Wasm.
2018-06-19 03:43:24 +09:00
Philipp Steinhaus
39b3170185 input: Enable mouse wheel input (#628) 2018-06-18 00:38:30 +09:00
Hajime Hoshi
b87a851c0e ui: New GopherWASM API 2018-06-16 00:26:28 +09:00
Hajime Hoshi
be665a3526 ui: Better way to avoid blocking
Fixes #625
2018-06-09 13:36:35 +09:00
Hajime Hoshi
6e12f287b0 ui: Use goroutine to avoid blocking on GopherJS 2018-06-09 03:05:37 +09:00
Hajime Hoshi
311788dfe2 ui: Remove warnings of deadlock
Now gopherwasm fixed this problem by avoiding js.MakeFunc.

See also: 3fe87b73c0
2018-05-27 04:10:14 +09:00
Hajime Hoshi
8e9c3bd304 ui: Use gopherwasm 2018-05-27 02:35:17 +09:00
Hajime Hoshi
5976e4bbbc audio: More intellegent suspending/resuming (#617)
Before this change, the audio is suspended when the game stops for
1/12[s]. However, as game often stops for more than 1/12[s]
especially on mobiles, this implemntation caused some audio
glitches.

This change fixes this problem by re-implementing suspending/
resumeing audio by detecting the window is active/focused or not.
2018-05-26 23:31:04 +09:00
Hajime Hoshi
d88d1be4ad mobile: Refactoring 2018-05-26 22:51:30 +09:00
Hajime Hoshi
c2df8326fc ui: Refactoring: Use IsNodeJS 2018-05-16 22:02:33 +09:00
Hajime Hoshi
3ccfe087d9 Refactoring 2018-05-12 15:25:01 +09:00
Hajime Hoshi
453921f1d3 ui: Bug fix: sizeChange must be set after updateFullscreenScaleIfNeeded 2018-05-12 02:11:37 +09:00
Hajime Hoshi
d8dba69b47 ui: Add MonitorSize
Fixes #470
2018-05-05 02:42:45 +09:00
Hajime Hoshi
d41f959b96 ui: Initialize GLFW before Run 2018-05-04 23:55:23 +09:00
Hajime Hoshi
9efccea31c ui: Add SetWindowTitle
Fixes #595
2018-05-02 19:21:17 +09:00
Hajime Hoshi
899f007fd0 ui: Panic when error is found on mobile 2018-04-07 03:33:20 +09:00
Hajime Hoshi
2d3c6ab5b8 ui: Remove build tag 'gomobilebuild'
Fixes #573
2018-04-07 02:14:54 +09:00
Hajime Hoshi
fcf4657a70 ui: Adjust touch positions at ui package (mobile) 2018-04-03 01:50:07 +09:00
Hajime Hoshi
76cb43a7f8 input: Refactoring: Remove unused arguments 2018-04-03 01:21:52 +09:00
Hajime Hoshi
0f2beab260 ui: Adjust touch positions in ui package (js) 2018-04-03 00:53:09 +09:00
Hajime Hoshi
c540d0fc0d ui: Add AdjustedTouches for consistency 2018-04-02 01:54:44 +09:00
Hajime Hoshi
7d2fd9654a input: Adjust mouse cursor position in ui package 2018-04-01 23:53:26 +09:00
Hajime Hoshi
4de2dc0240 Add input package 2018-04-01 23:20:45 +09:00
Hajime Hoshi
2110191794 mobile: Accept gomobile build (#249) 2018-03-24 02:52:42 +09:00
Hajime Hoshi
5ec5cf2450 ui: Add comments 2018-03-17 18:34:20 +09:00
Hajime Hoshi
526fbd3619 ui: Implement SetWindowDecorated and IsWindowDecorated
Fixes #430.
2018-03-17 18:30:55 +09:00
Hajime Hoshi
ef5de62780 Follow the standard comment rule
See https://golang.org/s/generatedcode
2018-03-08 02:47:59 +09:00
Hajime Hoshi
4c1cc9e699 ui: Bug fix: exit update function once when the context is lost (#526) 2018-03-02 01:05:54 +09:00
Hajime Hoshi
0cc456b534 ui: Rename sizeChanged -> toChangeSize 2018-02-25 00:44:45 +09:00
Hajime Hoshi
04341a014c ui: Add comments 2018-02-25 00:44:41 +09:00
Hajime Hoshi
a644e92298 restorable: Better calculation to clear restorable.Image 2018-02-24 21:16:30 +09:00
Hajime Hoshi
692f36f664 graphics: Add comments 2018-02-24 20:40:26 +09:00