Tetra v0.3.0 Release Notes
Release Date: 2019-12-14 // over 4 years ago-
โ Added
- The
State
trait now provides anevent
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 thetime_step
method onContextBuilder
. - ๐ 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
andShader::from_fragment_string
constructors have been added.Color::RED
,Color::GREEN
andColor::BLUE
constants have been added.graphics::get_transform_matrix
,graphics::set_transform_matrix
andgraphics::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 theVek
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 newtime::get_blend_factor
function.- ๐
Key
andMouseButton
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
andTetraError::OpenGl
have been merged intoTetraError::PlatformError
, since they both represent the scenario where something's gone seriously wrong with the underlying platform. DEFAULT_VERTEX_SHADER
andDEFAULT_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 tomath
, and thenalgebra-glm
dependency has been replaced withvek
. Vec2
is now exported frommath
, notgraphics
.- 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 onGame
totrue
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
andShader::fragment
constructors have been renamed toShader::from_vertex_file
andShader::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. Calladvance
from yourdraw
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
andtime::f64_to_duration
have been removed, as the standard library now provides this functionality (Duration::from_secs_f64
andDuration::as_secs_f64
respectively).- ๐
ContextBuilder::tick_rate
has been removed, asContextBuilder::time_step
now fulfils the same purpose. - โ Removed deprecated sub-modules from
graphics
. - โ Removed deprecated
color::BLACK
andcolor::WHITE
constants - useColor::BLACK
andColor::WHITE
instead. - Removed deprecated
from_data
constructors - usefrom_file_data
instead. - โ Removed deprecated
DrawParams::build_matrix
method. - โ Removed re-exports of
Animation
andNineSlice
fromgraphics
- from now on this functionality will be accessible viagraphics::animation
andgraphics::ui
respectively.
- The