Ebitengine 2.4 Release Notes
v2.4.0
"Truly pure Go" for Windows
Ebitengine originally included GLFW DLL files and extracted them dynamically. This was problematic in terms of portability. For v2.4, we rewrote the GLFW part for Windows into pure Go, which means Ebitengine becomes truly pure Go for Windows. Now an Ebitengine application can be built for an Arm Windows native binary, but this is not tested yet. This fix is also a preparation for other Windows-like system like Xbox.
With this change, the build tag ebitenexternaldll
was removed.
Unmanaged images
New APIs NewImageWithOptions
and NewImageFromImageWithOptions
were added. You can specify these options:
Unmanaged
represents whether the image is unmanaged or not. The default (zero) value is false, that means the image is managed. An unmanaged image is never on an internal automatic texture atlas. A regular image is a part of an internal texture atlas, and locating them is done automatically in Ebitengine.Unmanaged
is useful when you want finer controls over the image for performance and memory reasons.PreserveBounds
represents whether the new image's bounds are the same as the given image. The default (zero) value is false, that means the new image's upper-left position is adjusted to (0, 0).
Audio decoding without resampling
(#2055)
New audio APIs to decode without resampling were added. Implicit resampling by Decode
was useful but problematic since it might unexpectedly be slow. DecodeWithoutResampling
is more explicit in terms of execution cost.
Also, an API to resample the source explicitly was added:
Debug info
(#2177)
A new function ebiten.ReadDebugInfo
and a new struct ebiten.DebugInfo
were added. Now what you can get from these APIs is only the type of the current graphics library so far.
Other new APIs
ebiten.IsStandardGamepadAxisAvailable
(#2040)ebiten.IsStandardGamepadButtonAvailable
(#2040)(*ebiten.Image).ReadPixels
(#1995)ebitenutil.DrawCircle
(#2163)ebitenutil.NewImageFromFileSystem
(this is available only with Go 1.16 or newer) (#1948)inpututil.AppendJustReleasedTouchIDs
(#2057)inpututil.TouchPositionInPreviousTick
(#2057)- An environment variable
EBITENGINE_OPENGL
Renaming APIs
These new API were added as aliases to existing APIs. The existing APIs are still available but deprecated.
ebiten.SetMaxTPS
→ebiten.SetTPS
ebiten.MaxTPS
→ebiten.TPS
ebiten.CurrentFPS
→ebiten.ActualFPS
ebiten.CurrentTPS
→ebiten.ActualTPS
(*ebiten.Image).ReplacePixels
→(*ebiten.Image).WritePixels
Also, environment variables and build tags were renamed. Old ones are still available but deprecated:
- An environment variable
EBITEN_SCREENSHOT_KEY
→EBITENGINE_SCREENSHOT_KEY
- An environment variable
EBITEN_INTERNALIMAGES_KEY
→EBITENGINE_INTERNAL_IMAGES_KEY
- An environment variable
EBITEN_GRAPHICS_LIBRARY
→EBITENGINE_GRAPHICS_LIBRARY
- An environment variable
EBITEN_DIRECTX
→EBITENGINE_DIRECTX
- A build tag
ebitendebug
→ebitenginedebug
- A build tag
ebitensinglethread
→ebitenginesinglethread
Improving Kage (the shading language for Ebitengine)
Now NewShader
checks types for builtin function arguments and operators more strictly (#2184, #2187).
Also, these new built-in functions were added:
discard
(this is available only inFragment
function) (#1969)refract
(this was documented but was not implemented) (#2255)
DirectX performance improvement
The DirectX driver now runs 2x-3x faster than the version 2.3.
Bug fixes
This release includes all the bug fixes in the version 2.3.
(*ebiten.Image).Set
sometimes didn't work correctly (#2154, #2176, #2180).- An application might crash when trying to use gamepads on Firefox in a non-HTTPS context (#2100).
- Other small fixes
Breaking changes
- go2cpp is no longer supported (#2126).
- A build tag
ebitenwebgl1
was removed. Instead, use an environment variableEBITENGINE_OPENGL
with the valuewebgl1
.
v2.4.1
Bug fixes
- An application might crash due to memory leak on Windows (#2292, #2249).
- A window size was not restored correctly after exiting from fullscreen (#2295).
ebitenutil.NewImageFromReader
was not available on mobiles (#2301).
v2.4.2
Bug fixes
- Checking arguments for the built-in function
pow
for Kage was not correct (#2304). - Vendoring Ebitengine by
go mod vendor
didn't work (#2306). - An application under the Snap sandbox might crash with a gamepad (#2307).
v2.4.3
Bug fixes
- A wireless Xbox controller didn't work correctly on macOS (#266).
- An application crashed when plugging out a headset on Windows (#2314).
- Audio output was not switched when replugging in a headset on Windows (#2317).
v2.4.4
Bug fixes
- Some gamepad mappings didn't work correctly (#2334).
- An application could deadlock on browsers (#2339).
v2.4.5
Bug fixes
- An application crashed when
DrawImage
was called and thenWritePixels
for a partial region was called on Android (#2346).