Skip to content

Graphic rendering using Piston and Glutin written in pure Rust

License

Notifications You must be signed in to change notification settings

KennFatt/Snowflakes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snowflakes

This project is part of my boredum in quarantine, so I have to learn something new (Rust language) and then implement it with something fun!

Ikr, nothing fancy here. My first attempt with Rust tho.

How to

build

cargo build --release

run

cargo run --release

Considering to use release mode.

Notes

If somebody or myself in the future wondering why I wrote this code:

pub struct Snowflakes {
    capacity: usize,
    radius: Vec<f64>,
    velocity: Vec<f64>,
    x: Vec<f64>,
    y: Vec<f64>,
}

pub struct Snowflake {
    pub id: usize,
    pub radius: f64,
    pub velocity: f64,
    pub x: f64,
    pub y: f64,
}

here is my explanation, first the struct Snowflakes is implement the SoA pattern. I'm not sure if it will perform well on heap allocation (those vectors). I want to use something like FixedSizeArray in the future if it's finally arrive as the stable features.

Lastly, the struct Snowflake is just a template for me to manipulate the data that I got from Snowflakes to more specific.

About

Graphic rendering using Piston and Glutin written in pure Rust

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages