Last active
August 29, 2015 14:27
-
-
Save echochamber/83f81156fbbf5b7e1546 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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