When the two channels don't receive for a while, call DoWork forcibly to avoid
freeze.
In theory, this timeout should not be necessary. However, it looks like this
'select' statement sometimes blocks forever on some Android devices like
Pixel 4(a). Apparently workAvailable sometimes not receives even though there
are queued OpenGL functions. Call DoWork for such case as a symptomatic
treatment.
Calling DoWork without waiting for workAvailable is safe. If there are no tasks,
DoWork should return immediately.
Updates #1322Fixes#1332
An Ebiten application often freezes on Pixel 4. Apparently adding
loggings or runtime.Gosched hides the issue, though this doesn't fix
the root cause. The root cause might be in gomobile itself, but it
seeems really hard to make a minimum case.
As a tentative fix, add runtime.Gosched to avoid freezing.
Fixes#1322
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.
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
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
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
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.
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