Merge branch 'render'

This commit is contained in:
Thomas Forgione
2018-04-10 15:14:25 +02:00
12 changed files with 493 additions and 40 deletions
+11
View File
@@ -33,6 +33,12 @@ macro_rules! make_vector {
}
}
impl<T> Into<[T; $number]> for $name<T> {
fn into(self) -> [T; $number] {
self.data
}
}
impl<T: Copy + Clone> Into<($( $t ) ,* )> for $name<T> {
fn into(self) -> ($( $t ) ,* ) {
( $( self.data[$y] ), *)
@@ -62,6 +68,11 @@ macro_rules! make_vector {
pub fn $x(&self) -> T {
self.data[$y]
}
/// Get a mut ref to the coordinate of the vector.
pub fn $x_mut(&mut self) -> &mut T {
&mut self.data[$y]
}
)*
}