Struct ggez::graphics::ShaderBuilder
source · pub struct ShaderBuilder<'a> { /* private fields */ }
Expand description
Builder pattern for assembling shaders.
Implementations§
source§impl<'a> ShaderBuilder<'a>
impl<'a> ShaderBuilder<'a>
sourcepub fn from_code(source: &'a str) -> Self
pub fn from_code(source: &'a str) -> Self
Use this wgsl code as both a vertex and fragment shader.
sourcepub fn from_path(path: &'a str) -> Self
pub fn from_path(path: &'a str) -> Self
Use a single wgsl resource as both a vertex and fragment shader.
sourcepub fn fragment_code(self, source: &'a str) -> Self
pub fn fragment_code(self, source: &'a str) -> Self
Use this wgsl shader code for the fragment shader.
sourcepub fn fragment_path(self, path: &'a str) -> Self
pub fn fragment_path(self, path: &'a str) -> Self
Use this wgsl code resource path for the fragment shader.
sourcepub fn vertex_code(self, source: &'a str) -> Self
pub fn vertex_code(self, source: &'a str) -> Self
Use this wgsl shader code for the vertex shader.
sourcepub fn vertex_path(self, path: &'a str) -> Self
pub fn vertex_path(self, path: &'a str) -> Self
Use this wgsl code resource path for the vertex shader.
sourcepub fn build(self, gfx: &impl Has<GraphicsContext>) -> GameResult<Shader>
pub fn build(self, gfx: &impl Has<GraphicsContext>) -> GameResult<Shader>
Create a Shader from the builder.
Trait Implementations§
source§impl<'a> Debug for ShaderBuilder<'a>
impl<'a> Debug for ShaderBuilder<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for ShaderBuilder<'a>
impl<'a> Send for ShaderBuilder<'a>
impl<'a> Sync for ShaderBuilder<'a>
impl<'a> Unpin for ShaderBuilder<'a>
impl<'a> UnwindSafe for ShaderBuilder<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
source§impl<T> HasMut<T> for T
impl<T> HasMut<T> for T
source§fn retrieve_mut(&mut self) -> &mut T
fn retrieve_mut(&mut self) -> &mut T
Method to retrieve the context type as mutable.