pub struct Shader<T: ShaderDescriptor<TEXTURES>, const TEXTURES: usize> { /* private fields */ }
Expand description
Represents the runtime metadata required to configure and draw with a shader.
Implementations
sourceimpl<T: ShaderDescriptor<TEXTURES>, const TEXTURES: usize> Shader<T, TEXTURES>
impl<T: ShaderDescriptor<TEXTURES>, const TEXTURES: usize> Shader<T, TEXTURES>
sourcepub fn new(_ctx: &Context<impl App>) -> Shader<T, TEXTURES>
pub fn new(_ctx: &Context<impl App>) -> Shader<T, TEXTURES>
Creates a new shader. Shaders hold no mutable state and should be reused as often as possible.
sourcepub fn bind(
&self,
uniform: &Uniform<T::VertexUniformType>,
textures: [&Texture; TEXTURES]
)
pub fn bind(
&self,
uniform: &Uniform<T::VertexUniformType>,
textures: [&Texture; TEXTURES]
)
Executes the given closure in the context of the shader.
Arguments
uniform
- The uniform to use for the shader invocation.textures
- The set of textures to use in the fragment shader.
Trait Implementations
Auto Trait Implementations
impl<T, const TEXTURES: usize> RefUnwindSafe for Shader<T, TEXTURES> where
T: RefUnwindSafe,
impl<T, const TEXTURES: usize> !Send for Shader<T, TEXTURES>
impl<T, const TEXTURES: usize> !Sync for Shader<T, TEXTURES>
impl<T, const TEXTURES: usize> Unpin for Shader<T, TEXTURES> where
T: Unpin,
impl<T, const TEXTURES: usize> UnwindSafe for Shader<T, TEXTURES> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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