Struct radiant_rs::postprocessors::Basic [−][src]
pub struct Basic { /* fields omitted */ }
A basic postprocessor that applies a Program to the given input once.
Postprocessors are used with Renderer::postprocess()
.
The associated type for this postprocessor is BlendMode
and is expected as second argument
to the postprocess()
method
Examples
// Load a shader progam. let my_program = Program::from_string(&rendercontext, &program_source).unwrap(); // Create the postprocessor with the program. let my_postprocessor = postprocessors::Basic::new(&rendercontext, my_program); // ... in your renderloop... renderer.postprocess(&my_postprocessor, &blendmodes::ALPHA, || { renderer.clear(Color::BLACK); renderer.draw_layer(&my_layer, 0); });
Methods
impl Basic
[src]
impl Basic
pub fn new(context: &RenderContext, program: Program) -> Self
[src]
pub fn new(context: &RenderContext, program: Program) -> Self
Creates a new instance. The shader can use sheet*()
to access the input texture.
Trait Implementations
impl Postprocessor for Basic
[src]
impl Postprocessor for Basic
type T = BlendMode
The Basic postprocessor accepts a blendmode as argument to Renderer::postprocess()
.
fn target(&self) -> &Texture
[src]
fn target(&self) -> &Texture
Expected to return a texture for user drawing operations to target.
fn draw(&self, renderer: &Renderer, blendmode: &Self::T)
[src]
fn draw(&self, renderer: &Renderer, blendmode: &Self::T)
Expected to draw the final result. Draws issued within this function will target the rendertarget that the postprocessor is supposed to render to. Read more
fn process(&self, renderer: &Renderer, args: &Self::T)
[src]
fn process(&self, renderer: &Renderer, args: &Self::T)
Optionally expected to processes input data. Draws issued within this function will target the texure returned by target()
unless overridden via Renderer::render_to()
. Read more