Skip to content

Instantly share code, notes, and snippets.

@echochamber
Last active Aug 29, 2015
Embed
What would you like to do?
extern crate piston_window;
extern crate graphics;
extern crate piston;
use piston_window::*;
fn main() {
let opengl = OpenGL::V3_2;
let (width, height) = (800, 800);
let window: PistonWindow =
WindowSettings::new("Arc Example", (width, height))
.exit_on_esc(true)
.opengl(opengl)
.into();
for e in window {
match e.event {
Some(Event::Render(_)) => {
e.draw_2d(|c, g| {
clear([1.0, 1.0, 1.0, 1.0], g);
arc(
[0.3, 0.3, 0.6, 1.0],
4.0,
::std::f64::consts::PI * 0.25,
::std::f64::consts::PI * 1.25,
[370.0, 370.0, 60.0, 60.0],
c.transform,
g
);
});
},
_ => {}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment