Display a ground chunk with a given biome

This commit is contained in:
2022-10-16 23:30:23 +02:00
parent d75a564805
commit 5236c99383
2 changed files with 63 additions and 34 deletions
+8 -3
View File
@@ -18,10 +18,15 @@ fn main() {
// building the vertex and index buffers
let vertex_buffer = support::load_ground(&display);
let image = image::load(Cursor::new(&include_bytes!("../opengl.png")),
image::ImageFormat::Png).unwrap().to_rgba8();
let image = image::load(
Cursor::new(&include_bytes!("../grassGreen.jpg")),
image::ImageFormat::Jpeg,
)
.unwrap()
.to_rgba8();
let image_dimensions = image.dimensions();
let image = glium::texture::RawImage2d::from_raw_rgba_reversed(&image.into_raw(), image_dimensions);
let image =
glium::texture::RawImage2d::from_raw_rgba_reversed(&image.into_raw(), image_dimensions);
let texture = glium::texture::SrgbTexture2d::new(&display, image).unwrap();
// the program