Tetra v0.7.0 Release Notes

Release Date: 2022-03-23 // 2 months ago
  • โž• Added

    • Texture, Canvas and ImageData 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 and BmFontBuilder.
    • ๐Ÿ’ฅ Breaking: BlendMode and BlendAlphaMode have been replaced with BlendState, BlendFactor and BlendOperation, which give you much lower-level control of how colors are blended.
      • As such, graphics::set_blend_mode and graphics::reset_blend_mode have been renamed to graphics::set_blend_state and graphics::reset_blend_state respectively.
      • The old presets for blending behaviour are still available as const constructors on BlendState, so you should be able to migrate without any changes in behaviour.
    • ๐Ÿ’ฅ 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 - use Canvas::builder instead.
    • ๐Ÿ’ฅ Breaking: Texture::from_rgba has been removed - use Texture::from_data instead.
    • ๐Ÿ’ฅ Breaking: ImageData::from_rgba has been removed - use ImageData::from_data instead.
    • ๐Ÿ’ฅ Breaking: BmFontBuilder::with_page_rgba has been removed - use BmFontBuilder::with_page_data instead.
    • ๐Ÿšš Keys that don't represent a physical position on the keyboard have been removed - you should either switch to the Key for the position you want, or switch to KeyLabel if you still want to use the system keyboard layout.

    ๐Ÿ›  Fixed

    • Shader::from_vertex_string and Shader::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" or resolver = "2" in the Cargo.toml.
    • The Display implementation for TetraError now includes extra details for errors that don't have a source.
    • ๐Ÿ‘ Games will no longer fail to start on platforms that do not support setting vsync on or off.