Struct glslwatch::GLSLTree
[−]
[src]
pub struct GLSLTree { /* fields omitted */ }
An in-memory GLSL source tree.
Methods
impl GLSLTree
[src]
pub fn new<P: AsRef<Path>, P2: AsRef<Path>>(
path: P,
include_dirs: &[P2]
) -> Result<Self, Error>
[src]
path: P,
include_dirs: &[P2]
) -> Result<Self, Error>
Creates a GLSL source tree from the given glsl file, tracing all its include directives and looking for the included files in all given include directories.
If an include is ambiguous, the first file found will be loaded, so take care of your include directory order if this applies to you.
pub fn with_default_version<P: AsRef<Path>, P2: AsRef<Path>>(
path: P,
include_dirs: &[P2],
default_version: usize
) -> Result<Self, Error>
[src]
path: P,
include_dirs: &[P2],
default_version: usize
) -> Result<Self, Error>
Works like new
, except sets the default version. By default OpenGL assumes GLSL
source without a version pragma is version 110. You can pass another default version
to this constructor, but the root source's explicit version pragma if it has one will
always override the default.
pub fn refresh(self) -> Result<Self, Error>
[src]
Refreshes the source tree from disk, re-tracing from the root. Only files still included in the source tree will be present in the refreshed cache.
pub fn expired(&self) -> Result<bool, Error>
[src]
Returns whether one or more nodes of the cached source tree are out of sync with the filesystem.
pub fn render<'a>(&'a self) -> &'a str
[src]
Returns the cached source string, whith all includes processed. This is the result you should feed into your GLSL compiler.
Trait Implementations
impl Debug for GLSLTree
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more