2 #[macro_use(uniform,implement_vertex)]
5 #[cfg(feature = "image")]
8 #[cfg(feature = "editor")]
9 extern crate rust_rocket;
21 pub use bounding_box::BoundingBox;
23 pub use shaded_cube::ShadedCube;
25 #[cfg(feature = "image")]
26 pub fn screenshot(display : &glium::Display) {
27 let image: glium::texture::RawImage2d<u8> = display.read_front_buffer();
28 let image = image::ImageBuffer::from_raw(image.width, image.height, image.data.into_owned()).unwrap();
29 let image = image::DynamicImage::ImageRgba8(image).flipv().to_rgb();
30 let image = image::DynamicImage::ImageRgb8(image);
31 let mut output = std::fs::File::create(&std::path::Path::new("screenshot.png")).unwrap();
32 image.save(&mut output, image::ImageFormat::PNG).unwrap();
35 #[cfg(not(feature = "image"))]
36 pub fn screenshot(_ : &glium::Display) {