Skip to content

Instantly share code, notes, and snippets.

@echochamber
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save echochamber/83f81156fbbf5b7e1546 to your computer and use it in GitHub Desktop.
Save echochamber/83f81156fbbf5b7e1546 to your computer and use it in GitHub Desktop.
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