Tetra v0.7.0 Release Notes
Release Date: 2022-03-23 // about 3 years ago-
โ Added
Texture
,Canvas
andImageData
can now be created with different underlying data formats.- Vector fonts can now be generated with premultiplied alpha.
Color::clamp
can be used to clamp a color's components between 0 and 1.
๐ Changed
- ๐ฅ Breaking: This crate now uses Rust 2021, and therefore requires at least Rust 1.56.
- ๐ฅ Breaking: Most enums in the API are now marked as
non_exhaustive
, and so must have a wildcard arm when matching on them.- This is to make it so adding a new enum variant is not a breaking change in the future.
- ๐ฅ Breaking: The naming scheme for various constructors has been changed to be more consistent/simple:
new
usually involves loading from a file path (as this is the most common use-case).from_data
loads from raw data, without any specific file-type encoding (e.g. RGBA8 pixels).from_encoded
loads from encoded data in a supported file format (e.g. PNG).- This applies to
Texture
,ImageData
,Sound
andBmFontBuilder
.
- ๐ฅ Breaking:
BlendMode
andBlendAlphaMode
have been replaced withBlendState
,BlendFactor
andBlendOperation
, which give you much lower-level control of how colors are blended.- As such,
graphics::set_blend_mode
andgraphics::reset_blend_mode
have been renamed tographics::set_blend_state
andgraphics::reset_blend_state
respectively. - The old presets for blending behaviour are still available as
const
constructors onBlendState
, so you should be able to migrate without any changes in behaviour.
- As such,
- ๐ฅ Breaking: Updated
vek
to 0.15. - ๐ฅ Breaking: Updated
rodio
to 0.15. - โก๏ธ Updated
hashbrown
to 0.12. Color
operations are no longer saturating.- This is so that HDR colors can be represented without data loss.
- โช
KeyModifier
's behaviour has been reverted to be layout-based rather than position-based.- This better matches the expected behaviour for keyboard shortcuts (which is the primary use case for this type), and the behaviour of the underlying platform code.
- The transparent padding between font glyphs is now incorporated into the rendered quads. This prevents texture filtering/anti-aliasing from cutting off unnaturally at the edges.
โ Removed
- ๐ฅ Breaking:
Canvas::multisampled
has been removed - useCanvas::builder
instead. - ๐ฅ Breaking:
Texture::from_rgba
has been removed - useTexture::from_data
instead. - ๐ฅ Breaking:
ImageData::from_rgba
has been removed - useImageData::from_data
instead. - ๐ฅ Breaking:
BmFontBuilder::with_page_rgba
has been removed - useBmFontBuilder::with_page_data
instead. - ๐
Key
s that don't represent a physical position on the keyboard have been removed - you should either switch to theKey
for the position you want, or switch toKeyLabel
if you still want to use the system keyboard layout.
๐ Fixed
Shader::from_vertex_string
andShader::from_fragment_string
no longer have an unused type parameter. (@LiquidityC in #301)
Previous changes from v0.6.7
-
๐ Changed
- ๐ The backend for gamepad vibration has been rewritten, and now supports a wider range of controllers (including DualShock 4).
time::get_fps
no longer pre-fills the buffer it uses for averaging the FPS at startup.- Previously, the whole buffer would be initialized to 60fps, with the intent being that the initial output would be less jittery. However, this didn't actually help that much, and it didn't work well if the monitor wasn't vsync-ed to 60hz.
- โก๏ธ Updated
sdl2
to 0.35.
๐ Fixed
- Tetra no longer fails to compile when built in a project with
edition = "2021"
orresolver = "2"
in the Cargo.toml. - The
Display
implementation forTetraError
now includes extra details for errors that don't have asource
. - ๐ Games will no longer fail to start on platforms that do not support setting vsync on or off.