pub struct Shader { /* private fields */ }Implementations§
Source§impl Shader
impl Shader
Sourcepub fn new<P: AsRef<Path>>(
ctx: &mut Context,
quad_ctx: &mut GraphicsContext,
vertex_path: P,
pixel_path: P,
shader_meta: ShaderMeta,
blend_mode: Option<BlendMode>,
) -> GameResult<ShaderId>
pub fn new<P: AsRef<Path>>( ctx: &mut Context, quad_ctx: &mut GraphicsContext, vertex_path: P, pixel_path: P, shader_meta: ShaderMeta, blend_mode: Option<BlendMode>, ) -> GameResult<ShaderId>
Create a new Shader given source files, constants and a name.
Sourcepub fn from_u8(
ctx: &mut Context,
quad_ctx: &mut GraphicsContext,
vertex_source: &[u8],
pixel_source: &[u8],
shader_meta: ShaderMeta,
blend_mode: Option<BlendMode>,
) -> GameResult<ShaderId>
pub fn from_u8( ctx: &mut Context, quad_ctx: &mut GraphicsContext, vertex_source: &[u8], pixel_source: &[u8], shader_meta: ShaderMeta, blend_mode: Option<BlendMode>, ) -> GameResult<ShaderId>
Create a new Shader directly from GLSL source code, given as byte slices.
Sourcepub fn from_str(
ctx: &mut Context,
quad_ctx: &mut GraphicsContext,
vertex_source: &str,
pixel_source: &str,
shader_meta: ShaderMeta,
blend_mode: Option<BlendMode>,
) -> GameResult<ShaderId>
pub fn from_str( ctx: &mut Context, quad_ctx: &mut GraphicsContext, vertex_source: &str, pixel_source: &str, shader_meta: ShaderMeta, blend_mode: Option<BlendMode>, ) -> GameResult<ShaderId>
Create a new Shader directly from GLSL source code.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Shader
impl RefUnwindSafe for Shader
impl Send for Shader
impl Sync for Shader
impl Unpin for Shader
impl UnwindSafe for Shader
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
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more