Commit Graph

166 Commits

Author SHA1 Message Date
Hajime Hoshi
3eaa7dd0e1 uidriver/glfw: Set No-API when creating a hidden window first
GLFW tries to create an OpenGL context by default when creating a
window. This is not necessary when OpenGL is not used. This is an
optimization by skipping to create an OpenGL context if possible.
2020-07-05 15:01:06 +09:00
Hajime Hoshi
d08f57e610 uidriver/glfw: Bug fix: Skip some special 'joysticks'
Apparently, there are some special devices that are recognized as
joysticks by GLFW, even though they are not. Such devices can have
too many 'buttons'. Skip them as a tentative solution.

Updates #1173
2020-07-03 22:58:49 +09:00
Hajime Hoshi
b7a1e85788 uidriver/glfw: Remove unused logics 2020-07-03 22:24:30 +09:00
Hajime Hoshi
d98713728a uidriver/glfw: Bug fix: SetVsyncEnabled(false) did not work before the main loop
Fixes #1197
2020-06-14 11:50:58 +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
7b960a2df4 uidriver/glfw: Use the actual window size for the offscreen
On Windows, a specified window size might not match with the
actual window size when the size is too big. In this case, Ebiten
could not render the offscreen well and the upper side was cropped.

To avoid this, use the actual window size for the offscreen.

Fixes #1163
2020-05-22 18:18:38 +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
4fa52dcc56 Remove MonoGame support
Fixes #1148
2020-05-08 19:32:28 +09:00
Hajime Hoshi
0e75540f8e monogame: Add IsKeyPressed
Updates #1078
2020-04-21 22:48:57 +09:00
Hajime Hoshi
4dad044ad1 monogame: Update
Updates #1078
2020-04-16 01:10:16 +09:00
Hajime Hoshi
7f64043ba5 monogame: Implement drawing screens
Updates #1078
2020-04-06 01:51:06 +09:00
Hajime Hoshi
08ac91fb50 monogame: Refactoring 2020-04-05 20:00:53 +09:00
Hajime Hoshi
6236ba1f00 Add internal/monogame
Updates #1078
2020-04-04 22:59:13 +09:00
Hajime Hoshi
eabe4152a7 graphicsdriver/opengl: Rename Driver -> Graphics 2020-04-04 17:23:38 +09:00
Hajime Hoshi
6cbf37e855 Add graphicsdriver/monogame 2020-04-04 17:03:45 +09:00
Hajime Hoshi
8777140e91 driver: Simplify UIContext.Update 2020-04-03 00:18:27 +09:00
Hajime Hoshi
4179e6c122 Introduce 'monogame' build tag experimentally
Updates #1078
2020-04-01 23:42:17 +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
b09fe7157b uidriver/glfw: Update comments 2020-03-29 01:33:23 +09:00
Hajime Hoshi
e3def4ae50 uidriver/glfw: Update comments 2020-03-29 01:12:53 +09:00
Hajime Hoshi
9d5c35f029 uidriver/glfw: Bug fix: Initilizing the window position and the size in this order on Windows
It looks like the order is different on Windows from Linux. We
are not sure why.

Updates #1118
2020-03-29 00:50:19 +09:00
Hajime Hoshi
b7ab3d2df4 uidriver/glfw: Avoid using the window position before initializing
Especially in the initial phase before calling Run/RunGame, the
window position is not reliable and then getting the device scale
factor does not make sense based on the window position. Avoid
using the window position, and instead use the glfw.Monitor in
this situation.
2020-03-29 00:09:08 +09:00
Hajime Hoshi
14200eb42c uidriver/glfw: Add comments 2020-03-29 00:02:33 +09:00
Hajime Hoshi
8480f888dd Revert "uidriver/glfw: Bug fix: Do not use the window position for monitors"
Revert "uidriver/glfw: Bug fix: compile error on Linux"

This reverts commit 0a5126f776.
This reverts commit 3e244d7a7c.

Reason: GetMonitor is available only on fullscreen mode
2020-03-28 23:56:03 +09:00
Hajime Hoshi
e628350d4e uidriver/glfw: Bug fix: Initializing order mattered
Especially on Linux, the window size and the window position must
be initialized in this order.

Fixes #1118
2020-03-28 23:37:21 +09:00
Hajime Hoshi
34acf788d2 uidriver/glfw: Bug fix: Call Maximize explictly instead of the hint
Fixes #1117
2020-03-28 22:34:01 +09:00
Hajime Hoshi
4fe5acd711 ui: Panic on MaximizeWindow when the window is not resizable
On Windows, the window could be maximized even when the window was
not resizable. This behavior is confusing. Forbid it so that the
behavior will be clearer.
2020-03-28 22:08:48 +09:00
Hajime Hoshi
3e244d7a7c uidriver/glfw: Bug fix: compile error on Linux 2020-03-28 21:29:24 +09:00
Hajime Hoshi
8cca713d74 uidriver/glfw: Bug fix: adjustWindowPosition should consider the monitor position 2020-03-28 21:26:57 +09:00
Hajime Hoshi
0a5126f776 uidriver/glfw: Bug fix: Do not use the window position for monitors
Especially in the initial phase before calling Run/RunGame, the
window position is not reliable and then getting the device scale
factor does not make sense based on the window position. Avoid
using the window position, and instead use the glfw.Monitor.
2020-03-28 21:13:30 +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
4ec49dd4cf mobile/ebitenmobileview: Implement Android gamepad axes
Updates #1083
2020-03-25 01:15:43 +09:00
Hajime Hoshi
8fcee54849 mobile/ebitenmobileview: Implement Android gamepad buttons
This is still work in progress.

Updates #1083
2020-03-23 01:30:17 +09:00
Hajime Hoshi
f317f3b5fd ui: Add fuctions to maximize or minimize the window
This change adds these functions:

  * MaximizeWindow
  * IsWindowMaximized
  * MinimizeWIndow
  * IsWindowMinimized
  * RestoreWindow

Fixes #994
2020-03-21 22:13:58 +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
4ef3b3e804 ui: Add SetWindowFloating / IsWindowFloating
Fixes #880
2020-03-20 22:16:27 +09:00
Hajime Hoshi
6bc62b8f17 uidriver/glfw: Update comments 2020-03-15 15:42:05 +09:00
Hajime Hoshi
3af869732c uidriver/mobile: Implement InputChars for gomobile-build
This change also fixes InputChars to return only printable Unicode
chars on Android.

Updates #237
2020-02-23 01:01:40 +09:00
Hajime Hoshi
de52eb75e4 mobile/ebitenmobileview: Implement InputChars on Android / ebitenmobile
Updates #237
2020-02-23 00:51:49 +09:00
Hajime Hoshi
a208a026f6 uidriver/mobile: Implement keyboard key inputs for gomobile-build
Updates #237
2020-02-22 23:57:16 +09:00
Hajime Hoshi
5b7151595b mobile/ebitenmobileview: Handle keyboard keys on Android (ebitenmobile)
Updates #237
2020-02-20 01:53:51 +09:00
Hajime Hoshi
682f454fc2 input: Refactoring: Rename variables 2020-02-19 10:52:58 +09:00
corfe83
61c2d7cfe8
Simple optimization in IsKeyPressed (#1080)
Simple optimization on IsKeyPressed to avoid iterating through whole map of possible keys.
2020-02-16 02:02:05 +09:00
Hajime Hoshi
883b25f257 uidriver/mobile: Refactoring 2020-02-12 00:36:34 +09:00
Hajime Hoshi
d59aea1db1 driver: Remove the return value from RunWithoutMainLoop 2020-02-11 23:56:53 +09:00
Hajime Hoshi
aef4b4ba53 uidriver/mobile: Refactoring: Give a default outside size 2020-02-11 23:29:52 +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
a303487328 uidriver/mobile: Add comments 2020-02-11 14:45:50 +09:00