Commit Graph

239 Commits

Author SHA1 Message Date
Hajime Hoshi
049aa552d4 ui: Add SetWindowResizable
This change also fixes example/windowsize.

Fixes #320
2019-12-22 19:26:04 +09:00
Hajime Hoshi
812a29bf07 ui: Refactoring: theUIContext is always non-nil 2019-12-22 18:53:23 +09:00
Hajime Hoshi
4c6006343e ui: Refactoring 2019-12-22 17:22:54 +09:00
Hajime Hoshi
1566bb1cd3 ui: Update comments of RunGame 2019-12-22 13:21:15 +09:00
Hajime Hoshi
c9863284cf uidriver/glfw: Set a default window size
Now RunGame can be called without SetWindowSize.
2019-12-22 12:51:36 +09:00
Hajime Hoshi
0e63241bcb Update comments 2019-12-22 03:50:30 +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
dabaf66b81 uidriver: Remove width/height/scale arguments from run
The initial window position is determined on ebiten package side.

Updates #943
2019-12-21 20:10:58 +09:00
Hajime Hoshi
6a8013ed37 ui: Reduce arguments from newUIContext 2019-12-16 11:12:38 +09:00
Hajime Hoshi
46a7ae6175 ui: Define and use defaultGame
This is a pareparation for Game interface and RunGame.

Updates #943
2019-12-16 01:21:16 +09:00
Hajime Hoshi
12a13892cd ui: Protect uiContext.scaleForWindow by mutex 2019-12-15 20:15:13 +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
Zachary Burkett
ed19d6fae9 Add cursor capture functionality (#1016)
Fixes #1016
2019-12-14 12:30:03 +09:00
Hajime Hoshi
7f88732cc5 ui: Fix comments 2019-12-12 12:00:45 +09:00
Hajime Hoshi
0ec447e0d0 ui: Add SetScreenTransparent / IsScreenTransparent
Fixes #1001
2019-12-01 03:31:32 +09:00
Hajime Hoshi
5ecd010f5a ui: Add window.go 2019-11-27 00:29:30 +09:00
Hajime Hoshi
e0d780b029 uidriver/glfw: Enable to call SetWindowDecorated after Run
Fixes #556
2019-11-26 11:46:18 +09:00
Hajime Hoshi
b5d8be96a6 mobile: Move Game definition to package ebiten
Updates #943
2019-11-25 00:49:13 +09:00
Hajime Hoshi
3c51ee0991 ui: Remove theUIContext, which is not used anywhere 2019-11-17 22:24:17 +09:00
Hajime Hoshi
49a5a2bf4e uidriver/js: Bug fix: Needed to initialize pseudoScale with the given scale
Updates #960, #973
2019-10-27 17:16:49 +09:00
Hajime Hoshi
2f7ccf17f5 docs: Fix comments 2019-10-22 04:15:15 +09:00
Hajime Hoshi
e391d7241d docs: Add backward compatibility notes 2019-10-22 04:07:14 +09:00
Hajime Hoshi
75721e6fc1 ui: Auto scaling on browsers
This change forces Ebiten apps on browsers 'fullscreen' mode.
After this change, 'scale' value is no longer used on browsers.

Note that this breaks backward compatibility, but as long as the
game works in an iframe, this should not be problematic.

Fixes #960
2019-10-15 00:02:02 +09:00
Hajime Hoshi
52900fac79 Move back driver getters to ebiten package 2019-09-03 01:46:11 +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
ef56d0a535 Refactoring: isRunning -> isImageAvailable 2019-08-25 00:14:37 +09:00
Hajime Hoshi
df8fdc855a Bug fix: Compile error on GOOS=linux CGO_ENABLED=0 2019-08-01 08:17:58 +09:00
Hajime Hoshi
de915a1736 Move driver getters to graphicsdriver/uidriver packages
This enables to add internal functions to these packages so that
the driver selector logics can be modified.
2019-08-01 00:40:59 +09:00
Hajime Hoshi
833e467fde Make Ebiten buildable on the playground environment
Bug: #871
2019-05-22 12:25:38 +09:00
Hajime Hoshi
f984f5ada9 Force to use Go 1.12 or later
As syscall/js has incompatible change between Go 1.11 and Go 1.12,
it is safe to force to use Go 1.12.
2019-05-01 17:43:38 +09:00
Hajime Hoshi
db689f4e50 driver: Remove UI.Loop and add UI.RunWithoutMainLoop 2019-04-09 21:55:59 -04:00
Hajime Hoshi
f6367308fc driver: Rename GraphicsContext -> UIContext 2019-04-08 23:28:08 -04:00
Hajime Hoshi
26c32d36b5 uidriver: Move input implementation to uidrivers 2019-04-07 19:16:00 +09:00
Hajime Hoshi
7e5085f15b Add uidriver package and move UI implementation to this packaage 2019-04-07 18:21:16 +09:00
Hajime Hoshi
6b8516c7a5 driver: Move ui.RegularTermination to driver 2019-04-07 10:54:05 +09:00
Hajime Hoshi
a980de8326 ui: Take the Input driver 2019-04-06 23:29:13 +09:00
Hajime Hoshi
747d1be54e driver: Move getting actual drivers to ebiten package 2019-03-30 22:19:21 +09:00
Hajime Hoshi
f2e42c3ea1 ui: Remove dependencies on driver package 2019-03-30 21:59:11 +09:00
Hajime Hoshi
f56c3bd096 ui: Unexport SetWindowResizable (#320) 2019-02-25 02:19:47 +09:00
Hajime Hoshi
55e9a861d0 ui: Bug fix: isRunning should never be 'false' even after Run on GopherJS 2019-01-19 03:29:07 +09:00
Hajime Hoshi
58cc5cb105 graphics: Better error message for At and Set (#790) 2019-01-19 02:59:22 +09:00
Hajime Hoshi
248f51cc02 ui: Fix comments 2019-01-17 23:40:33 +09:00
Hajime Hoshi
ddecc1c602 ui: Fix comments 2019-01-13 23:25:32 +09:00
Hajime Hoshi
607186859d ui: Run returns immediately on GopherJS
Fixes #778
2019-01-13 22:16:33 +09:00
Hajime Hoshi
866f64a625 Add a better error message for Go version
Fixes #777
2019-01-10 23:44:35 +09:00
Hajime Hoshi
ae84e79d16 ui: Add IsWindowResizable and SetWindowResizable (again)
Fixes #320
2019-01-09 00:24:16 +09:00
Hajime Hoshi
0d4e903b7a Revert "ui: Add IsWindowResizable and SetWindowResizable"
This reverts commit f403e0716f.

Reason: Compilation error on browsers
2019-01-09 00:12:57 +09:00
Hajime Hoshi
f403e0716f ui: Add IsWindowResizable and SetWindowResizable
Fixes #320
2019-01-08 23:52:53 +09:00