This commit is contained in:
Thomas Forgione 2022-08-21 14:55:31 +02:00
parent 238f523379
commit b5167ff79c
2 changed files with 3 additions and 3 deletions

View File

@ -168,7 +168,7 @@ fn main() {
camera.z_near = 0.0001;
let mut controls: Box<Controls> = if matches.is_present("first person") {
let mut controls: Box<dyn Controls> = if matches.is_present("first person") {
Box::new(FirstPersonControls::new())
} else {
Box::new(OrbitControls::new(

View File

@ -8,7 +8,7 @@ use image;
use image::{DynamicImage, ImageBuffer, Rgba};
use glium::draw_parameters::{Blend, DepthTest};
use glium::glutin::{ContextCurrentState, PossiblyCurrent as Pc};
use glium::glutin::PossiblyCurrent as Pc;
use glium::index::{NoIndices, PrimitiveType};
use glium::program::ProgramCreationInput;
use glium::texture::{RawImage2d, SrgbTexture2d, Texture2dDataSink};
@ -138,7 +138,7 @@ impl Renderer {
/// Creates a SrgbTexture from a path to an image.
pub fn make_texture(&self, path: &str) -> SrgbTexture2d {
let image = match image::open(path) {
Ok(r) => r.to_rgba(),
Ok(r) => r.to_rgba8(),
Err(e) => panic!("Error while opening file {}: {}", path, e),
};