Ebiten 2.1 Release Notes
Issues for v2.1.0
These functions were added (#770, #995, #1385, #1561):
ebiten.CursorShape: gets the current cursor shape.
ebiten.SetCursorShape: sets the current cursor shape.
ebiten.SetWindowSizeLimits: sets the window size limits.
ebiten.WindowSizeLimits: gets the window size limits.
inpututil.PressedKeys: returns all the pressed keys.
See the new example
examples/cursor for the cursors.
These functions were added (#1460):
mp3.DecodeWithSampleRate: decodes decodes an MP3 data with the give sample rate.
vorbis.DecodeWithSampleRate: decodes decodes an Ogg/Vorbis data with the give sample rate.
wav.DecodeWithSampleRate: decodes decodes a WAV data with the give sample rate.
text.CacheGlyphs was added (#1413).
text.CacheGlyphs precaches the glyphs for the given text and the given font face into the cache.
The cache is shared with
text.Draw. Glyphs are cached in a LRU way. As the cache's capacity has limit, it is not guaranteed that all the glyphs for runes given at
CacheGlyphs are cached.
Draw automatically creates and caches necessary glyphs, so usually you don't have to call
CacheGlyphs explicitly. However, for example, when you call
Draw for each rune of one big text,
Draw tries to create the glyph cache and render it for each rune. This is very inefficient because creating a glyph image and rendering it are different operations (
(*ebiten.Image).DrawImage) and can never be merged as one draw call.
CacheGlyphs creates necessary glyphs without rendering them so that these operations are likely merged into one draw call regardless of the size of the text. The two functions are implemented like this:
Draw= Create glyphs by
(*ebiten.Image).ReplacePixelsand put them into the cache if necessary + Draw them onto the destination by
CacheGlyphs= Create glyphs by
(*ebiten.Image).ReplacePixelsand put them into the cache if necessary
For system cursors, a new type
CursorShapeType and these constants were added (#995):
These key constants were added (#1382, #1561):
As the key name convention has changed, these key constants were added to replace some of the existing keys (#1394). The key constants to be replaced are kept for compatibility:
A new build tag
ebitensinglethread was added (#1367). If this is enabled, the number of the internal threads becomes one and you can expect performance improvement. As a side effect, all Ebiten's concurrent-safe functions become concurrent-unsafe.
- A tool to convert Go to C, go2cpp, was supported (#744). With this tool, Ebiten will work in an environment where Go is supposed not to work. Implmenting a binding for the targetted environment is necessary. We plan to announce the details later.
- Rendering no longer stops when a user resizes the window (#1204).
- A sub-image created by
SubImagecan now call
DrawImageand so on as a receiver (#1255, #1461). With this, you can render an image with clipping.
CursorModeCapturedbecame available on some of browsers (#1572).
constbecame available in the shading language Kage (#1192).
- A function
capwas added to Kage (#1361).
- A function
imageDstOnTexturewas added to Kage (#1428).
- Audio for browsers was reimplemented (#1458). A buffer size became bigger and you can expect less noises.
- "Negative mipmap" was abandoned (#1400). By this, rendering results of edges with a big scale might be different from those in v2.0. If you want to make sure edges are rendreed, you have to render a sub-image created by
SubImageas a part of a big image.
This release includes all the bug fixes in v2.0.x.
- Too low TPS didn't work (#1417)
- Too high TPS didn't work (#1443, #1444)
CursorPositioncould return an extremely small number (#1587).
GamepadSDLIDcould return wrong values on browsers (#1472).
SetWindowIconcrashed when an
*ebiten.Imagewas given (#1468).
- In fullscreen, icons disappeared when calling
NewInfiniteLoopWithIntrodidn't work with a buffer whose size was not in multiples of 4 (#1503).
- In the shading language Kage, functions
fwidthdidn't work on browsers (#1404).
- In the shading language Kage, duplicated functions were not error (#1430).
- Reduced thread context switchings (#1358).
- Made cache for the results of
- Fixed the problem that
ReplacePixelsmight be slow in Metal (#1418, #1517).
ReplacePixelswhen extending an internal texture (#1022, #1414).
ReplacePixelswhen putting an idependent internal texture onto an internal texture atlas (#1508).
- Used WebGL2 functions (#1435).
- Reduced object creations when the package
inpututilis used (#1473).
Issues for v2.1.1
- Audio didn't stop when the screen unfocused on browsers (#1630).
- Crashed when the audio length was exactly multiples of the internal buffer size on browsers (#1635).
Issues for v2.1.2
ebitenmobilecommand didn't work with the environment variable
ebitenmobiledidn't clean temporary directories up (#1668).
- Too many calls of
SetWindowSizemight cause crash on Windows (#1672).
Issues for v2.1.3
(*ebiten.Image).Fillon a sub-image might have an unexpected result (#1691).
- Memory leak on macOS (#1698).
Issues for v2.1.4
- Screenshots by
EBITEN_SCREENSHOT_KEYincluded unexpected 1px border (#1736).
- Fallback to WebGL1 might not work when WebGL2 didn't work (#1738).
Issues for v2.1.5
- Crash when some gamepads were used (#1229).
- Crash on 32bit Windows (#1750).
- Creating a
Shaderafter disposing a
Shadermight cause unexpected rendering (#1753).
- Shaders might not work correctly on Windows (#1754).
Issues for v2.1.6
- The vsync mode was unexpectedly reset when going fullscreen on Windows (#1787).
Issues for v2.1.7
- Freeze when
MaximizeWindowis called for a native fullscreen application on macOS (#1810).