[][src]Struct glslwatch::GLSLTree

pub struct GLSLTree { /* fields omitted */ }

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]

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]

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 Clone for GLSLTree[src]

impl Debug for GLSLTree[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.