[−][src]Function res::generate
pub fn generate(shader_builders: &[ShaderBuilder])
Generate code for including resources in your project.
Call this function in your build.rs
, and in your crate's root add this:
mod res { include!(concat!(env!("OUT_DIR"), "/res.rs")); }
... to create a res
module that contains all of your resources.
Where do I put my resources?
Resources go in /res/
under the crate's root directory. Each type of file
has it's own folder within /res/
.
/res/texture/
- PNG textures files./res/shader/
- MuON shader files.
Where do I find my resources?
res/texture/image.png
// Get image data for image.png use crate::res::texture; texture::image