Ebitengine 2.8 Release Notes
v2.8.0
This release primarily includes minor feature additions, bug fixes, and performance improvements.
Starting with Ebitengine 2.8, Go 1.22 or higher is required.
32-bit Float Audio Stream
This release adds 32-bit float as a format for audio streams. Compared to 16-bit integer audio streams, 32-bit float streams make processing easier and may improve performance by reducing internal conversions.
The current 16-bit integer audio stream format will still be supported. You can mix 16-bit integer and 32-bit float streams. While there are no plans to deprecate 16-bit streams for now, Ebitengine version 3 is expected to support only 32-bit float streams.
(*audio.Context).NewPlayerF32
(*audio.Context).NewPlayerF32FromBytes
audio.NewInfiniteLoopF32
audio.NewInfiniteLoopWithIntroF32
audio.ResampleF32
mp3.DecodeF32
vorbis.DecodeF32
wav.DecodeF32
Adding Custom Data to Vertex
Four new float32
members—Custom0
, Custom1
, Custom2
, and Custom3
—have been added to the ebiten.Vertex
structure as custom elements. This allows for more complex processing using Kage, the custom shader.
Correspondingly, the signature of the Fragment
function in Kage has been updated. When using custom elements, use the signature that accepts custom vec4
.
func Fragment() vec4
func Fragment(dstPos vec4) vec4
func Fragment(dstPos vec4, srcPos vec2) vec4
func Fragment(dstPos vec4, srcPos vec2, color vec4) vec4
func Fragment(dstPos vec4, srcPos vec2, color vec4, custom vec4) vec4
Improved Portability of exp/textinput
exp/textinput
supported Windows and macOS but was not implemented for environments like Linux. When used on Linux, no text could be input.
From this release, when exp/textinput
is used in environments where IME handling is not implemented, text input will be possible without using IME. This improves code portability. The plan is to extend IME handling to more environments in the future.
OpenGL ES Preference
In environments where OpenGL ES is available, it will now be preferred over OpenGL. This resolves performance issues in environments like the Raspberry Pi. The environment variable EBITENGINE_OPENGL
is now ignored.
New APIs
ebiten.ColorSpaceDefault
(#2871)ebiten.ColorSpaceSRGB
(#2871)ebiten.ColorSpaceDisplayP3
(#2871)ebiten.DrawImageOptions.DisableMipmaps
(#3095)ebiten.DrawTrianglesOptions.DisableMipmaps
(#3095)ebiten.FillRuleFillAll
(#3006)ebiten.FillRuleNoneZero
(#3006)ebiten.FillRuleEvenOdd
(#3006)ebiten.RequestAttention()
(#2998)ebiten.RunGameOptions.ColorSpace
(#2871)ebiten.RunGameOptions.DisableHiDPI
(#2987)(*mp3.Stream).SampleRate()
(#2996)(*vorbis.Stream).SampleRate()
(#2996)(*wav.Stream).SampleRate()
(#2996)text.Glyph.OriginOffsetX
(#3070)text.Glyph.OriginOffsetY
(#3070)text.Glyph.OriginX
(#3070)text.Glyph.OriginY
(#3070)text.Metrics.CapHeight
(#3082)text.Metrics.XHeight
(#3082)
Deprecated APIs
Before v2.8 | After v2.8 | Issue |
---|---|---|
ebiten.FillAll |
ebiten.FillRuleFillAll |
#3006 |
ebiten.NonZero |
ebiten.FillRuleNoneZero |
#3006 |
ebiten.EvenOdd |
ebiten.FillRuleEvenOdd |
#3006 |
Bug Fixes
This release includes all bug fixes from version 2.7 in addition to the following fixes:
- Fixed an issue where cursor position became incorrect after cursor capture failure in Safari (#2764).
- Fixed an issue where IME was unnecessarily handled when not in use on Windows (#2918).
- Fixed several issues in the Kage parser (#2965, #2989, #2993, #3111, #3112).
- Fixed an issue where pressing Enter was sometimes ignored in mobile browsers when using
exp/textinput
(#3015). - Fixed a crash when a non-hashable
io.Reader
was given toaudio.NewPlayer
(#3039). - Fixed an issue where
ebiten.DroppedFiles
did not work correctly when multiple files were dropped in Firefox and Safari (#3045). - Fixed an issue where
SetScreenClearedEveryFrame(false)
did not work properly on ChromeOS Linux (#3055). - Fixed an issue where Ebitengine did not work on Android Termux (#3057).
- Fixed an issue where
cmd/ebitenmobile
did not work correctly depending on the contents of the go.mod file (#3086). - Fixed an issue where the window was not displayed when
SetRunnableOnUnfocused(false)
was called before starting the game on ChromeOS Linux (#3091). - Fixed an issue where the rendering became incorrect when resizing the window while using
SetScreenClearedEveryFrame(false)
(#3105).
Performance Improvements
Breaking Changes
- The return type of
(*GoTextFaceSource).UnsafeInternal()
intext/v2
has been changed fromfont.Face
toany
due to an update in the dependent librarygo-text/typesetting
.
v2.8.1
Bug Fixes
- Fixed an issue where sound sometimes did not play in the browser (#3122).
v2.8.2
Bug Fixes
- Fixed an issue where compilation failed when certain assignment operators were included in Kage shaders (#3140).
v2.8.3
Bug Fixes
- Fixed an issue where
inpututil.AppendJustReleasedGamepadButtons
andinpututil.AppendJustReleasedStandardGamepadButtons
did not return correct values (#3147).
v2.8.4
Bug Fixes
- Fixed an issue where applications would sometimes fail to launch in Linux or UNIX Wayland environments (#3152).
v2.8.5
Bug Fixes
- Fixed an issue where the window could not be positioned at the top of the screen when calling
ebiten.SetWindowDecorated(false)
on Windows (#3118).