Type Definition ggez::graphics::Shader
[−]
[src]
type Shader<C> = ShaderGeneric<GlBackendSpec, C>;
A Shader
represents a handle to a user-defined shader that can be used
with a ggez graphics context
Methods
impl<C> Shader<C> where
C: 'static + Pod + Structure<ConstFormat> + Clone + Copy,
[src]
C: 'static + Pod + Structure<ConstFormat> + Clone + Copy,
fn new<P: AsRef<Path>, S: Into<String>>(
ctx: &mut Context,
vertex_path: P,
pixel_path: P,
consts: C,
name: S,
blend_modes: Option<&[BlendMode]>
) -> GameResult<Shader<C>>
[src]
ctx: &mut Context,
vertex_path: P,
pixel_path: P,
consts: C,
name: S,
blend_modes: Option<&[BlendMode]>
) -> GameResult<Shader<C>>
Create a new Shader
given a gfx pipeline object
In order to use a specific blend mode when this shader is being
used, you must include that blend mode as part of the
blend_modes
parameter at creation. If None
is given, only the
default Alpha
blend mode is used.
fn from_u8<S: Into<String>>(
ctx: &mut Context,
vertex_source: &[u8],
pixel_source: &[u8],
consts: C,
name: S,
blend_modes: Option<&[BlendMode]>
) -> GameResult<Shader<C>>
[src]
ctx: &mut Context,
vertex_source: &[u8],
pixel_source: &[u8],
consts: C,
name: S,
blend_modes: Option<&[BlendMode]>
) -> GameResult<Shader<C>>
Create a new Shader
directly from source given a gfx pipeline
object
In order to use a specific blend mode when this shader is being
used, you must include that blend mode as part of the
blend_modes
parameter at creation. If None
is given, only the
default Alpha
blend mode is used.
fn send(&self, ctx: &mut Context, consts: C) -> GameResult<()>
[src]
Send data to the GPU for use with the Shader
fn shader_id(&self) -> ShaderId
[src]
Gets the shader ID for the Shader
which is used by the
GraphicsContext
for identifying shaders in its cache