Struct allegro::shader::Shader[][src]

pub struct Shader { /* fields omitted */ }

A shader program comprising of a pixel (fragment) and a vertex shader. Wraps ALLEGRO_SHADER.

Implementations

impl Shader[src]

pub unsafe fn wrap(shader: *mut ALLEGRO_SHADER) -> Shader[src]

pub fn get_allegro_shader(&self) -> *mut ALLEGRO_SHADER[src]

Return the wrapped Allegro shader pointer.

pub fn attach_shader_source(
    &self,
    shader_type: ShaderType,
    source: Option<&str>
) -> Result<(), String>
[src]

Attach a source to the shader. Passing None clears the source.

Returns the log if there was an error.

pub fn attach_shader_source_file(
    &self,
    shader_type: ShaderType,
    filename: &str
) -> Result<(), String>
[src]

Attach a source to the shader that is loaded from a file.

Returns the log if there was an error.

pub fn build(&self) -> Result<(), String>[src]

Build the shader. Call this after attaching the sources.

Returns the log if there was an error.

pub fn get_log(&self) -> String[src]

Get the log from the shader. Call this function if any of the attach/build functions fail to determine what went wrong.

pub fn get_platform(&self) -> ShaderPlatform[src]

Return the platform of this shader.

Trait Implementations

impl Drop for Shader[src]

impl Send for Shader[src]

impl Sync for Shader[src]

Auto Trait Implementations

impl RefUnwindSafe for Shader

impl Unpin for Shader

impl UnwindSafe for Shader

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, 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.