Crate glslwatch [] [src]

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
};

Structs

GLSLTree

An in-memory GLSL source tree.

Enums

Error

An error loading or refreshing a GLSL source tree.