Peach
A processing-esque graphical programming framework implemented in Rust.
What is this, really?
Really, this is an opportunity for me to test my skills at graphical programming and Rust. I thoroughly enjoy both graphics and Rust, however I've never had a real project in either, so I'm a complete newbie.
Why not kill two birds with one stone?
What it will look like (eventually).
extern crate peach;
struct Handler {
degrees: f32,
}
impl Handler {
fn new() -> Self {
Self {
degrees: 0.0,
}
}
}
impl peach::Handler for Handler {
fn update(&mut self, dt: f64, m: &mut peach::Peach) -> peach::Control {
self.degrees += 30.0 * dt;
peach::Control::Continue
}
fn draw(&mut self, m: &mut peach::Peach) -> peach::Control {
m.rotation(self.degrees);
let (x, y) = m.center();
m.rect(x, y, 16.0, 24.0);
peach::Control::Continue
}
}
fn main() {
let mut config = peach::Config::default();
config.size = (512, 512);
config.angle_mode = peach::AngleMode::Degrees;
config.rect_mode = peach::RectMode::Center;
config.clear_color = peach::Color::hex(0x282a36ff);
let mut handler = Handler::new();
peach::run(&mut handler, config);
}
Of course, this example is currently non-functional, but this is what a basic sketch, programmed in the end product will eventually look like.