Tetra v0.3.0 Release Notes

Release Date: 2019-12-14 // over 4 years ago
  • โž• Added

    • The State trait now provides an event method for hooking into window/input events. This is useful in scenarios where you want to be notified of events rather than polling (for example, reacting to window size changes).
    • โšก๏ธ A Context can now be configured to have a variable update rate, if that suits your game/architecture better. This is exposed via the time_step method on ContextBuilder.
    • ๐Ÿ›  Several new functions have been added to the time module, to support both variable and fixed timesteps.
    • Functions for getting and setting vsync have been added to window.
    • Details of the active graphics device can now be retrieved by calling graphics::get_device_info.
    • Shader::from_vertex_string and Shader::from_fragment_string constructors have been added.
    • Color::RED, Color::GREEN and Color::BLUE constants have been added.
    • graphics::get_transform_matrix, graphics::set_transform_matrix and graphics::reset_transform_matrix has been added, which allows you to apply a transformation to your rendering.
    • The Camera struct has been added, which provides a simple way of creating a transform matrix.
    • ๐Ÿ‘ Serde support has been added (via the serde_support Cargo feature) for the following types:
      • graphics::Color
      • graphics::Rectangle
      • input::Key
      • input::MouseButton
      • input::GamepadButton
      • input::GamepadAxis
      • input::GamepadStick
      • Various math types, as defined by the Vek crate.

    ๐Ÿ”„ Changed

    • โœ… Tetra now targets the latest stable Rust compiler, rather than a fixed minimum version. This will hopefully change once Cargo has better functionality for enforcing minimum supported compiler versions - currently it's impossible to make guarentees, as our dependencies can change their minimum versions at will.
    • State::draw no longer takes the blend factor as a third parameter - instead, you can call the new time::get_blend_factor function.
    • ๐Ÿšš Key and MouseButton are now Tetra-specific types, rather than re-exporting the SDL versions. Note that some names have been changed for consistency, and some variants have been removed to simplify the docs.
    • ๐Ÿ”€ TetraError::Sdl and TetraError::OpenGl have been merged into TetraError::PlatformError, since they both represent the scenario where something's gone seriously wrong with the underlying platform.
    • DEFAULT_VERTEX_SHADER and DEFAULT_FRAGMENT_SHADER are now const instead of static.
    • Screen scaling has been extracted from the core of the engine, and is now provided via the ScreenScaler struct. This allows it to be more flexibly integrated with the rest of your game's rendering.
    • Various functions now return errors instead of panicking.
    • TetraError has been reorganized, so that the errors returned are more descriptive.
    • The glm module has been renamed to math, and the nalgebra-glm dependency has been replaced with vek.
    • Vec2 is now exported from math, not graphics.
    • More types can now be passed into shader uniforms via the UniformValue trait.
    • 0๏ธโƒฃ The graphics device debugging info is now hidden by default. Set the debug_info option on Game to true to bring this back.
    • The functions for setting the fullscreen/cursor visibility state have been changed to take booleans, instead of there being multiple functions.
    • The Shader::vertex and Shader::fragment constructors have been renamed to Shader::from_vertex_file and Shader::from_fragment_file.
    • Animations now use a Duration to specify the frame length, and as such, they are no longer coupled to your game's tick rate. Call advance from your draw method to advance the animation's timer.
    • โšก๏ธ Updated glow to 0.3.0-alpha3.
    • โšก๏ธ Updated hashbrown to 0.6.
    • โšก๏ธ Updated image to 0.22.
    • โšก๏ธ Updated glyph_brush to 0.6.
    • โšก๏ธ Updated rodio to 0.10.

    โœ‚ Removed

    • time::duration_to_f64 and time::f64_to_duration have been removed, as the standard library now provides this functionality (Duration::from_secs_f64 and Duration::as_secs_f64 respectively).
    • ๐Ÿšš ContextBuilder::tick_rate has been removed, as ContextBuilder::time_step now fulfils the same purpose.
    • โœ‚ Removed deprecated sub-modules from graphics.
    • โœ‚ Removed deprecated color::BLACK and color::WHITE constants - use Color::BLACK and Color::WHITE instead.
    • Removed deprecated from_data constructors - use from_file_data instead.
    • โœ‚ Removed deprecated DrawParams::build_matrix method.
    • โœ‚ Removed re-exports of Animation and NineSlice from graphics - from now on this functionality will be accessible via graphics::animation and graphics::ui respectively.