pub struct RasterProgram {
pub program: Program,
}Expand description
A program for rasterizing VertexArrayObjects in a target Framebuffer.
Fields§
§program: ProgramProgram base object.
Implementations§
Source§impl RasterProgram
impl RasterProgram
Sourcepub fn new(
context: &Context,
fragment_shader: &FragmentShader,
vertex_shader: &VertexShader,
) -> Result<Self, String>
pub fn new( context: &Context, fragment_shader: &FragmentShader, vertex_shader: &VertexShader, ) -> Result<Self, String>
Creates a new RasterProgram with a FragmentShader and VertexShader.
Sourcepub fn raster(
&self,
framebuffer: &Framebuffer,
vertex_array_object: &VertexArrayObject,
raster_geometry: RasterGeometry,
n_vertices: u32,
)
pub fn raster( &self, framebuffer: &Framebuffer, vertex_array_object: &VertexArrayObject, raster_geometry: RasterGeometry, n_vertices: u32, )
Draws the n_vertices in a VertexArrayObject as the specified RasterGeometry on the target Framebuffer.
Methods from Deref<Target = Program>§
Sourcepub fn resource(&self) -> <Context as HasContext>::Program
pub fn resource(&self) -> <Context as HasContext>::Program
Gets the ProgramResource object.
pub fn uniform_mat4(&mut self, location: usize, transpose: bool, v: &[f32])
Sourcepub fn bind_texture_2d(
&mut self,
texture: &Texture2D,
sampler: &Sampler,
index: u32,
)
pub fn bind_texture_2d( &mut self, texture: &Texture2D, sampler: &Sampler, index: u32, )
Binds a Texture2D at index so it can be sampled with the specified sampler,
pub fn bind_vec2(&mut self, vec2: (f32, f32), index: u32)
Trait Implementations§
Source§impl AsMut<Program> for RasterProgram
impl AsMut<Program> for RasterProgram
Source§impl AsRef<Program> for RasterProgram
impl AsRef<Program> for RasterProgram
Source§impl Borrow<Program> for RasterProgram
impl Borrow<Program> for RasterProgram
Source§impl BorrowMut<Program> for RasterProgram
impl BorrowMut<Program> for RasterProgram
Source§fn borrow_mut(&mut self) -> &mut Program
fn borrow_mut(&mut self) -> &mut Program
Mutably borrows from an owned value. Read more
Source§impl Deref for RasterProgram
impl Deref for RasterProgram
Auto Trait Implementations§
impl Freeze for RasterProgram
impl RefUnwindSafe for RasterProgram
impl !Send for RasterProgram
impl !Sync for RasterProgram
impl Unpin for RasterProgram
impl UnwindSafe for RasterProgram
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