[−][src]Struct glslwatch::GLSLTree
An in-memory GLSL source tree.
Implementations
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
Auto Trait Implementations
impl RefUnwindSafe for GLSLTree
impl Send for GLSLTree
impl Sync for GLSLTree
impl Unpin for GLSLTree
impl UnwindSafe for GLSLTree
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,