Struct allegro::shader::Shader [−][src]
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]
&self,
shader_type: ShaderType,
source: Option<&str>
) -> Result<(), String>
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]
&self,
shader_type: ShaderType,
filename: &str
) -> Result<(), String>
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
Auto Trait Implementations
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, 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>,