pub struct Shader { /* private fields */ }
Expand description
A shader program comprising of a pixel (fragment) and a vertex shader. Wraps ALLEGRO_SHADER.
Implementations
sourceimpl Shader
impl Shader
pub unsafe fn wrap(shader: *mut ALLEGRO_SHADER) -> Shader
sourcepub fn get_allegro_shader(&self) -> *mut ALLEGRO_SHADER
pub fn get_allegro_shader(&self) -> *mut ALLEGRO_SHADER
Return the wrapped Allegro shader pointer.
sourcepub fn attach_shader_source(
&self,
shader_type: ShaderType,
source: Option<&str>
) -> Result<(), String>
pub fn attach_shader_source(
&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.
sourcepub fn attach_shader_source_file(
&self,
shader_type: ShaderType,
filename: &str
) -> Result<(), String>
pub fn attach_shader_source_file(
&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.
sourcepub fn build(&self) -> Result<(), String>
pub fn build(&self) -> Result<(), String>
Build the shader. Call this after attaching the sources.
Returns the log if there was an error.
sourcepub fn get_log(&self) -> String
pub fn get_log(&self) -> String
Get the log from the shader. Call this function if any of the attach/build functions fail to determine what went wrong.
sourcepub fn get_platform(&self) -> ShaderPlatform
pub fn get_platform(&self) -> ShaderPlatform
Return the platform of this shader.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Shader
impl !Send for Shader
impl !Sync for Shader
impl Unpin for Shader
impl UnwindSafe for Shader
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more