comparison examples/anmrenderer.rs @ 649:967627181a76

Use the merged name of RGB in AnmRenderer. See https://github.com/phaazon/luminance-rs/pull/150 for reasoning.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 08 Aug 2019 13:39:28 +0200
parents 7d92730bf543
children 988e5130fb00
comparison
equal deleted inserted replaced
648:3331eb7389b3 649:967627181a76
1 use image::GenericImageView; 1 use image::GenericImageView;
2 use luminance::context::GraphicsContext; 2 use luminance::context::GraphicsContext;
3 use luminance::framebuffer::Framebuffer; 3 use luminance::framebuffer::Framebuffer;
4 use luminance::pipeline::BoundTexture; 4 use luminance::pipeline::BoundTexture;
5 use luminance::pixel::{RGB, Floating}; 5 use luminance::pixel::{NormRGB8UI, Floating};
6 use luminance::render_state::RenderState; 6 use luminance::render_state::RenderState;
7 use luminance::shader::program::{Program, Uniform}; 7 use luminance::shader::program::{Program, Uniform};
8 use luminance::tess::{Mode, TessBuilder}; 8 use luminance::tess::{Mode, TessBuilder};
9 use luminance::texture::{Dim2, Flat, Sampler, Texture, GenMipmaps}; 9 use luminance::texture::{Dim2, Flat, Sampler, Texture, GenMipmaps};
10 use luminance_derive::{Semantics, Vertex, UniformInterface}; 10 use luminance_derive::{Semantics, Vertex, UniformInterface};
201 fn fill_vertices(sprite: Rc<RefCell<Sprite>>, vertices: &mut [Vertex; 4]) { 201 fn fill_vertices(sprite: Rc<RefCell<Sprite>>, vertices: &mut [Vertex; 4]) {
202 let mut fake_vertices = unsafe { std::mem::transmute::<&mut [Vertex; 4], &mut [FakeVertex; 4]>(vertices) }; 202 let mut fake_vertices = unsafe { std::mem::transmute::<&mut [Vertex; 4], &mut [FakeVertex; 4]>(vertices) };
203 sprite.borrow().fill_vertices(&mut fake_vertices); 203 sprite.borrow().fill_vertices(&mut fake_vertices);
204 } 204 }
205 205
206 fn load_from_disk(surface: &mut GlfwSurface, path: &Path) -> Option<Texture<Flat, Dim2, RGB>> { 206 fn load_from_disk(surface: &mut GlfwSurface, path: &Path) -> Option<Texture<Flat, Dim2, NormRGB8UI>> {
207 // load the texture into memory as a whole bloc (i.e. no streaming) 207 // load the texture into memory as a whole bloc (i.e. no streaming)
208 match image::open(&path) { 208 match image::open(&path) {
209 Ok(img) => { 209 Ok(img) => {
210 let (width, height) = img.dimensions(); 210 let (width, height) = img.dimensions();
211 let texels = img 211 let texels = img