pub fn from_matrix(device: &metal::Device, matrix: Matrix) -> MatrixBuffer {
        // Convert to the internal representation
        let matrix = matrix_float4x4::from(matrix);

        // Generate a metal buffer containing the matrix
        let matrix_ptr: *const matrix_float4x4  = &matrix;
        let buffer                              = device.new_buffer_with_data(matrix_ptr as *const c_void,
            std::mem::size_of::<matrix_float4x4>() as u64,
            metal::MTLResourceOptions::CPUCacheModeDefaultCache | metal::MTLResourceOptions::StorageModeManaged);

        // Return the buffer object
        MatrixBuffer {
            buffer: buffer
        }
    }
///
/// Creates a matrix buffer from a matrix
///
Creates a matrix buffer from a matrix
Creates a matrix buffer from a matrix
pub fn from_matrix(device: &metal::Device, matrix: Matrix) -> MatrixBuffer {
        // Convert to the internal representation
        let matrix = matrix_float4x4::from(matrix);
        // Generate a metal buffer containing the matrix
        let matrix_ptr: *const matrix_float4x4  = &matrix;
        let buffer                              = device.new_buffer_with_data(matrix_ptr as *const c_void,
            std::mem::size_of::<matrix_float4x4>() as u64,
            metal::MTLResourceOptions::CPUCacheModeDefaultCache | metal::MTLResourceOptions::StorageModeManaged);
        // Return the buffer object
        MatrixBuffer {
            buffer: buffer
        }
    }
pub fn from_matrix ( device : & metal :: Device , matrix : Matrix ) -> MatrixBuffer { // Convert to the internal representation let matrix = matrix_float4x4 :: from ( matrix ) ; // Generate a metal buffer containing the matrix let matrix_ptr : * const matrix_float4x4 = & matrix ; let buffer = device . new_buffer_with_data ( matrix_ptr as * const c_void , std :: mem :: size_of :: < matrix_float4x4 > ( ) as u64 , metal :: MTLResourceOptions :: CPUCacheModeDefaultCache | metal :: MTLResourceOptions :: StorageModeManaged ) ; // Return the buffer object MatrixBuffer { buffer : buffer } }
Creates a matrix buffer from a matrix
Creates a matrix buffer from a matrix
device
&metal::Device
matrix
Matrix