diff examples/eclrenderer.rs @ 753:a662dddd4a2b

examples: Use array textures for enemy PNGs This requires luminance 0.39.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 25 Feb 2020 21:03:44 +0100
parents 5e5e7136ac92
children
line wrap: on
line diff
--- a/examples/eclrenderer.rs
+++ b/examples/eclrenderer.rs
@@ -5,7 +5,7 @@ use luminance::pixel::NormUnsigned;
 use luminance::render_state::RenderState;
 use luminance::shader::program::{Program, Uniform};
 use luminance::tess::{Mode, TessBuilder};
-use luminance::texture::{Dim2, Flat};
+use luminance::texture::Dim2;
 use luminance_derive::{Semantics, Vertex, UniformInterface};
 use luminance_glfw::{Action, Key, WindowEvent, GlfwSurface, Surface, WindowDim, WindowOpt};
 use touhou::th06::anm0::Anm0;
@@ -82,7 +82,7 @@ struct Vertex {
 #[derive(UniformInterface)]
 struct ShaderInterface {
     // the 'static lifetime acts as “anything” here
-    color_map: Uniform<&'static BoundTexture<'static, Flat, Dim2, NormUnsigned>>,
+    color_map: Uniform<&'static BoundTexture<'static, Dim2, NormUnsigned>>,
 
     #[uniform(name = "mvp")]
     mvp: Uniform<[[f32; 4]; 4]>,
@@ -198,6 +198,7 @@ fn main() {
                 let bound_tex = match &tex {
                     LoadedTexture::Rgb(tex) => pipeline.bind_texture(tex),
                     LoadedTexture::Rgba(tex) => pipeline.bind_texture(tex),
+                    LoadedTexture::RgbaArray(tex) => unreachable!(),
                 };
 
                 shd_gate.shade(&program, |iface, mut rdr_gate| {