| 18 | }; |
| 19 | |
| 20 | pub fn output_image_native(image_data: Vec<u8>, texture_dims: (usize, usize), path: &str) { |
| 21 | let writer = std::fs::File::create(path).unwrap(); |
| 22 | let encoder = blue_engine::image::codecs::png::PngEncoder::new(writer); |
| 23 | encoder |
| 24 | .write_image( |
| 25 | &image_data, |
| 26 | texture_dims.0 as u32, |
| 27 | texture_dims.1 as u32, |
| 28 | blue_engine::image::ExtendedColorType::Rgba8, |
| 29 | ) |
| 30 | .unwrap(); |
| 31 | |
| 32 | println!("generated a frame!"); |
| 33 | |
| 34 | // to be able to view the image. Remove it if you're testing it in other ways. |
| 35 | std::process::exit(0); |
| 36 | } |
| 37 | |
| 38 | fn main() -> Result<(), blue_engine::error::Error> { |
| 39 | let mut engine = Engine::new_config(EngineSettings { |