5 releases
Uses old Rust 2015
0.1.4 | Nov 30, 2020 |
---|---|
0.1.3 | May 21, 2018 |
0.1.2 | May 17, 2018 |
0.1.1 | May 16, 2018 |
0.1.0 | May 4, 2018 |
#948 in Graphics APIs
Used in 2 crates
15KB
339 lines
glslwatch
A live glsl source tree with #include
support.
lib.rs
:
glslwatch provides a live glsl source with include support.
Construct the GLSL source tree by passing the shader path and a vec of paths to search for included files.
let include_dirs: Vec<String> = vec!["shaders/include"];
let src_tree = GLSLTree::new("shaders/frag.glsl", include_dirs)?;
The fully rendered tree is cached in memory and we can retrieve it with
.render()
.
let src_str = src_tree.render();
We can refresh the tree if it is expired.
let src_tree = if src_tree.expired()? {
src_tree.refresh()?
} else {
src_tree
};
Dependencies
~3–4.5MB
~88K SLoC