This simple change brings my simple test project from 752 allocations per frame to 474 allocations per frame. It seems a shame that go's escape analysis is not smart enough to leave this variable on the stack.
GeoM is a 24-byte struct and there is a slight perf difference that we are storing it in stack, but also copying it around with this change (instead of an 8-byte pointer). This could make things faster (due to stack / CPU cache) or slower (due to copying more memory) - when I try a stress test (drawing 100K images per frame), I can't see any actual performance difference (but I do see 100K fewer allocations, and GC is no longer running almost all the time).
I've been doing some profiling of a very simple ebiten project, and noticed that thread.go was doing a bunch of unnecessary allocations to accomplish its work. This change seeks to reduce GC work.
Input.go was also doing some unnecessary allocations.
The thread.go change reduces the total number of allocations per frame from 1342 to 852 (~36% reduction). The input.go change reduces it further to 752 (~44% total reduction). Perf tests were done on windows.
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
After the game loop is finished, any goroutines should not exist.
Otherwise, 'Go program has already exited' error can happen on
Wasm.
This change ensures that the goroutines are finished when the game
is finished. Note that time.Sleep was required to ensure that the
(*time.Ticker) ends.
Fixes#1027
This adds hooks on resuming/suspending the application, and
switches the foreground state there. This change also updates
the logic to suspend the game loop to be clearer.
Fixes#1037
Unfotunately, PBO might slow Android applications expecially when
coming back from context lost. Ebiten sends a lot of draw calls to
replace pixels in such case.
Until we find a good solution, let's not use PBO on Android.
Fixes#988
Now grpahicscommand saves the error and shows the error after a
while. This was good to simplify the API but was the cause to hide
some issues.
This change fixes all the errors to be returned immediately, and
buffer this in the ebiten package instead.
Fixes#971
Gamepad GUID is a SDL specific notion and, strictly speaking,
they are not GUID (UUID) since they don't follow UUID's
specifications.
Renaming the function makes the situation clearer.
Updates #1048