diff examples/stdrenderer.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/stdrenderer.rs
+++ b/examples/stdrenderer.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, TessSliceIndex};
-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;
@@ -89,7 +89,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]>,
@@ -211,6 +211,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| {