All Versions
56
Latest Version
Avg Release Cycle
31 days
Latest Release
256 days ago

Changelog History
Page 1

  • v0.7.0 Changes

    March 23, 2022

    โž• 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)
  • v0.6.7 Changes

    November 05, 2021

    ๐Ÿ”„ 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.
  • v0.6.6 Changes

    October 10, 2021

    โž• Added

    • window::set_icon has been added, allowing for the window's icon to be changed at runtime.
      • In general, it's preferable to set the icons via your application's packaging - this function should only be used if the icon needs to change at runtime, or if you're feeling lazy and don't feel like setting up proper packaging.
    • Various utility functions have been added to the window module, allowing for control over window positioning and size. (@Tairesh in #278)
    • An example of using ECS libraries with Tetra has been added. (@rghartmann in #268)
    • A KeyLabel type has been added, which represents how keys are labelled in the current keyboard layout.
    • input::get_key_with_label and input::get_key_label have been added, so that keys can be mapped to and from the current system keyboard layout.

    ๐Ÿ”„ Changed

    • ๐Ÿ‘ Key now represents the physical position of a key, rather than how it is labelled. This allows for non-QWERTY keyboard layouts to be supported without extra work on the developer's part.
    • KeyModifier now implements Display.
    • The ContextBuilder::key_repeat setting now applies to the input polling APIs as well as events. (@Tairesh in #279)
      • This is in order to make the API more consistent - now, whenever there is an Event::KeyPressed, it is guarenteed to also be returned via is_key_pressed and get_keys_pressed.
      • The behaviour with key_repeat turned off is unchanged.
    • โšก๏ธ Updated glow to 0.11.

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fixed an issue where the blend mode was getting set on the GPU even when it hadn't changed.
  • v0.6.5 Changes

    May 26, 2021

    โž• Added

    • ๐Ÿ‘ Uniform arrays are now supported in shaders, and can be set by passing an array or a slice to set_uniform.
    • ๐Ÿ‘ Basic support for instanced mesh rendering has been added, via Mesh::draw_instanced.

    ๐Ÿ›  Fixed

    • Switching away from a non-multisampled canvas no longer resolves the canvas.
      • This was a regression due to a refactor in 0.6.3 - it should not have caused any change to the rendered image, but may have negatively impacted performance.
  • v0.6.4 Changes

    May 14, 2021

    โž• Added

    • Stencil buffers can now be used, both with the main framebuffer and with Canvas rendering. (@tesselode in #261)
      • Stencil buffers will only be created if they are requested via ContextBuilder::stencil_buffer or CanvasBuilder::stencil_buffer.
    • window::get_physical_size has been added, making it possible to find out the size of the window in unscaled, physical pixels.
    • window::get_dpi_scale has been added, allowing the window/monitor's pixel density to be queried. (@sumibi-yakitori in #249)
    • Texture and Canvas now have a get_data method, allowing their texture data to be copied from the GPU into an ImageData.
    • ImageData now has as_bytes and into_bytes method, which allows you to access the underlying buffer.

    ๐Ÿ”„ Changed

    • Canvases are now initialized to transparent black, rather than containing unspecified data on creation.
    • ๐Ÿ‘ Multisampled canvases will now automatically lower their level of multisampling (or disable it altogether) if the hardware does not support the requested number of samples.
      • This should allow games with multisampling to gracefully degrade on older/weaker GPUs.
    • ImageData::from_rgba has been replaced with ImageData::from_rgba8, and BmFontBuilder::with_page_rgba has been replaced with BmFontBuilder::with_page_rgba8.
      • This is for consistency with existing methods (e.g. on Color).
      • The old names have been deprecated, and will be removed in 0.7.
    • โšก๏ธ Updated glow to 0.9.

    ๐Ÿ›  Fixed

    • Texture::filter_mode and Canvas::filter_mode now return the correct initial value. Previously, they would always return FilterMode::Linear until set_filter_mode was called.
    • DPI scaling should now continue to work after calling graphics::reset_canvas.
    • graphics::set_scissor is now properly aware of DPI scaling.
    • When a texture, canvas or buffer fails to be created by the GPU (e.g. due to being out of memory or going over the max size), an error will now be returned, instead of unspecified behaviour occurring.

    ๐Ÿ—„ Deprecated

    • ImageData::from_rgba and BmFontBuilder::with_page_rgba has been deprecated in favour of more consistently named functions (see above).
    • ๐Ÿ— Canvas::multisampled has been deprecated in favour of Canvas::builder.
  • v0.6.3 Changes

    April 09, 2021

    โž• Added

    • ๐Ÿ‘ BMFont-formatted fonts are now supported, via Font::bmfont and BmFontBuilder.
    • Various std operator traits have been implemented for the combination of Color and f32, allowing for all four components to be operated on at once.
      • This can be especially useful when working with premultiplied alpha - to set the opacity of a opaque color, you can now just multiply it by an f32.
    • Color now has a to_premultiplied method, which can be used to convert a color into its premultiplied version.
    • Color can now be converted to and from [f32; 4] and [u8; 4] via From and Into.
    • The ImageData struct can be used to load and manipulate image data on the CPU, without the need for a Context.
      • This can be useful for asset loading/pre-processing.
      • To avoid future breaking changes if/when Tetra gains support for multiple pixel formats, the API doesn't currently give access to the underlying raw pixel data. It instead operates purely on Colors, automatically converting to and from as needed.
    • 0๏ธโƒฃ Color and Vertex now implement Default, with the default values being all zeroes (for consistency with the vector types, and to make them more useful for zeroing out buffers).

    ๐Ÿ”„ Changed

    • ๐Ÿ‘Œ Improved docs for the UniformValue trait.
  • v0.6.2 Changes

    March 15, 2021

    ๐Ÿ›  Fixed

    • VertexBuffer::set_data was mistakenly measuring its offset in individual floats, rather than vertices. This was inconsistent with IndexBuffer, and could potentially lead to corrupted data.
      • I do not believe this was a memory safety issue, as all writes were still valid and aligned - they were just in the wrong place!
  • v0.6.1 Changes

    March 15, 2021

    โž• Added

    • Blend modes can now be set when rendering (including variants for pre-multiplied alpha). (@tesselode in #244)
    • Scissor rectangles can now be set when rendering, via graphics::set_scissor and graphics::reset_scissor.
    • Rectangle::combine has been added, which can be used to get a rectangle that contains two other rectangles.
    • Fonts can now have their filter mode set, instead of always using nearest neighbor filtering. (@tesselode in #246)
      • Fonts now also respect the default filter mode when they are created.
    • Text now supports word-wrapping, via the Text::wrapped constructor or the Text::set_max_width method.
    • More events have been added for window state changes, such as minimizing and maximizing. (@sumibi-yakitori in #248
    • window::set_visible and window::is_visible can be used to get and set whether or not the window is currently hidden to the user.

    ๐Ÿ”„ Changed

    • โšก๏ธ Updated hashbrown to 0.11.
    • โšก๏ธ Updated glow to 0.8.

    ๐Ÿ›  Fixed

    • Text::get_bounds no longer returns incorrect results when a tall glyph is added after a short glyph. (@tesselode in #241)
    • Kerning is now taken into account when rasterizing characters, rather than just for positioning.
  • v0.6.0 Changes

    February 05, 2021

    โž• Added

    • All drawable objects now have an inherant draw method, instead of relying on Drawable/graphics::draw.
    • Texture::draw_region can be used to draw a sub-section of a texture.
    • Texture::draw_nine_slice can be used to draw UI panels.
    • DrawParams::to_matrix has been added, which can be used to create a transformation matrix matching the behaviour of DrawParams.
    • Font now has a from_vector_file_data constructor, which is a shortcut for VectorFontBuilder::from_file_data(data)?.with_size(ctx, size). (@fossegutten in #232)
    • Mesh now has methods for getting and setting the winding order, which will automatically be applied when drawing it.
    • Mesh now has methods for getting, enabling and disabling backface culling.
    • A new Canvas::multisampled constructor has been added, allowing for off-screen rendering with MSAA.
    • ๐Ÿ“„ More example links have been added to the docs, where appropriate.

    ๐Ÿ”„ Changed

    • ๐Ÿ’ฅ Breaking: Mesh and shape rendering types have been moved to graphics::mesh, to avoid cluttering the main graphics module.
    • ๐Ÿ’ฅ Breaking: The zoom field on Camera has been renamed to scale, and is now a Vec2<f32>.
      • Note that numeric operations are implemented on Vec2<f32> for f32, so you can still add/subtract/multiply/divide both components at the same time.
    • ๐Ÿ’ฅ Breaking: Text::draw and Text::get_bounds now take &mut self.
      • This better reflects the fact that they cache geometry under the hood, and avoids RefCell overhead.
    • ๐Ÿ’ฅ Breaking: NineSlice is now a config object for Texture::draw_nine_slice, rather than a wrapper for a texture.
    • ๐Ÿ’ฅ Breaking: Font are now sized and positioned more accurately, and should look the same in Tetra as in other programs. (@fossegutten in #229)
      • This is not an API breaking change, but will alter the behaviour of existing games.
    • ๐Ÿ’ฅ Breaking: FLAC audio support has been disabled by default - use the audio_flac feature to re-enable it.
    • ๐Ÿ’ฅ Breaking: Updated vek to 0.13.
      • As Vek is exposed via Tetra's API in the form of the tetra::math module, this is potentially a breaking change.
    • time::get_delta_time now returns a fixed value when called from update in fixed timestep mode.
      • Using delta time in fixed timestep mode is not required, but can be useful if you want to measure things in 'per second' terms rather than 'per frame'.
      • Previously, trying to use delta time in this way could introduce floating point error/non-determinism into your game logic, and would break in the case of a double update.
    • The audio files for the tetras example are no longer ridiculously big.

    โœ‚ Removed

    • ๐Ÿ’ฅ Breaking: graphics::draw and the Drawable trait has been removed.
    • ๐Ÿ’ฅ Breaking: DrawParams::clip has been removed.
      • Texture::draw_region can be used instead.
    • ๐Ÿ’ฅ Breaking: graphics::get_front_face_winding and graphics::set_front_face_winding have been removed.
      • Mesh::front_face_winding and Mesh::set_front_face_winding can be used instead.
    • ๐Ÿ’ฅ Breaking: graphics::ui has been removed.
      • NineSlice is now located in graphics.
  • v0.5.8 Changes

    January 26, 2021

    โž• Added

    • ๐Ÿ‘ Basic support for multisample anti-aliasing has been added, in the form of ContextBuilder::multisampling.
      • This is currently only supported for the main backbuffer.
    • Mesh now has constructors for various primitive shapes. (@tesselode in #226)
      • There is also a new GeometryBuilder type, which can be used to create more complex/combined shapes.
    • Color now has methods (with_red, with_blue, with_green, with_alpha) for creating a new Color with one component changed. (@tesselode in #227)

    ๐Ÿ”„ Changed

    • โšก๏ธ When running in Timestep::Fixed mode, the accumulator now has a cap of 150 milliseconds (around 6.5fps). This prevents the game from entering a 'spiral of doom' if updates are consistently running too slowly for the game loop to catch up - in this scenario, the game will now just slow down. This is still not a good experience for the player, but it prevents freezes/crashes.
    • โšก๏ธ Updated bytemuck to 1.5.

    ๐Ÿ›  Fixed

    • Font atlases now include the correct amount of padding after a resize.