Syncing was already incomplete (e.g. decoding takes more than one
frame and delays can happen in this case). Giving up syncing audio
timer and game timer should not affect the game experience so much.
Instead, clock implementation will be much simpler.
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.
Actually, at least 704d4cf464,
examples/moire doesn't work well without roundTexel on MacBook Pro.
However, now other parts are fixed (e.g. highp is used), it looks
like roundTexel is no longer needed.
Some pretty old machines don't support OpenGL 3.x or later, and in
such environment, some framebuffer functions like glGenFramebuffers
are not available. Instead, EXT versions can be used even on
machines that don't support OpenGL 3.x.
After this change, Ebiten always tries to use EXT version of
framebuffer functions. I believe EXT version is always available
when non-EXT version is available, so this chang eshould be safe.
Fixes#602
nosync package for GopherJS is problematic since nosync's mutex
assumes that Lock call is never duplicated, which is not true in
actual applications.
See also #603.
Clear is called when an image becomes a render target, and it
looks like Clear causes the memory spikes.
Before this change, when an image is created, shared region on a GL
texture is allocated. After that, the image's region is copied to
non-shared region when the image becomes a rendering target.
After this change, an image is not allocated on a GL texture first,
and allocated only when it is necessary. Then, Clear calls can be
avoided as much as possible.
This reverts commit fb641d88cd.
Reason: When restoring the image where ReplacePixels is called,
dummyImage might not be restored since there is no record of
relationships between this image and dummyImage. Now pixels is not
nil when reverting by chance, but this would cause problems in the
future.