Mercurial > touhou
comparison examples/common.rs @ 715:2b2376811f46
examples: Update luminance.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Mon, 23 Sep 2019 00:22:08 +0200 |
parents | 3954801b6299 |
children | d5d5496e4e53 |
comparison
equal
deleted
inserted
replaced
714:fcc8f736c746 | 715:2b2376811f46 |
---|---|
32 | 32 |
33 // create the luminance texture; the third argument is the number of mipmaps we want (leave it | 33 // create the luminance texture; the third argument is the number of mipmaps we want (leave it |
34 // to 0 for now) and the latest is a the sampler to use when sampling the texels in the | 34 // to 0 for now) and the latest is a the sampler to use when sampling the texels in the |
35 // shader (we’ll just use the default one) | 35 // shader (we’ll just use the default one) |
36 let tex = | 36 let tex = |
37 Texture::new(surface, [width, height], 0, &Sampler::default()).expect("luminance texture creation"); | 37 Texture::new(surface, [width, height], 0, Sampler::default()).expect("luminance texture creation"); |
38 | 38 |
39 // the first argument disables mipmap generation (we don’t care so far) | 39 // the first argument disables mipmap generation (we don’t care so far) |
40 tex.upload(GenMipmaps::No, &texels).unwrap(); | 40 tex.upload(GenMipmaps::No, &texels).unwrap(); |
41 | 41 |
42 Some(LoadedTexture::Rgb(tex)) | 42 Some(LoadedTexture::Rgb(tex)) |
76 | 76 |
77 // create the luminance texture; the third argument is the number of mipmaps we want (leave it | 77 // create the luminance texture; the third argument is the number of mipmaps we want (leave it |
78 // to 0 for now) and the latest is a the sampler to use when sampling the texels in the | 78 // to 0 for now) and the latest is a the sampler to use when sampling the texels in the |
79 // shader (we’ll just use the default one) | 79 // shader (we’ll just use the default one) |
80 let tex = | 80 let tex = |
81 Texture::new(surface, [width, height], 0, &Sampler::default()).expect("luminance texture creation"); | 81 Texture::new(surface, [width, height], 0, Sampler::default()).expect("luminance texture creation"); |
82 | 82 |
83 // the first argument disables mipmap generation (we don’t care so far) | 83 // the first argument disables mipmap generation (we don’t care so far) |
84 tex.upload(GenMipmaps::No, &texels).unwrap(); | 84 tex.upload(GenMipmaps::No, &texels).unwrap(); |
85 | 85 |
86 Some(LoadedTexture::Rgba(tex)) | 86 Some(LoadedTexture::Rgba(tex)) |