[−][src]Struct golem::ShaderProgram
Methods
impl ShaderProgram
[src]
pub fn new(
ctx: &Context,
desc: ShaderDescription
) -> Result<ShaderProgram, GolemError>
[src]
ctx: &Context,
desc: ShaderDescription
) -> Result<ShaderProgram, GolemError>
pub fn is_bound(&self) -> bool
[src]
pub fn set_uniform(
&self,
name: &str,
uniform: UniformValue
) -> Result<(), GolemError>
[src]
&self,
name: &str,
uniform: UniformValue
) -> Result<(), GolemError>
pub fn bind(&mut self, vb: &VertexBuffer)
[src]
pub unsafe fn draw(
&self,
eb: &ElementBuffer,
range: Range<usize>,
geometry: GeometryMode
) -> Result<(), GolemError>
[src]
&self,
eb: &ElementBuffer,
range: Range<usize>,
geometry: GeometryMode
) -> Result<(), GolemError>
Draw the given elements from the element buffer to the screen with this shader
The range should fall within the elements of the buffer (which is checked for via an
assert!
.) The GeometryMode determines what the set of indices produces: triangles
consumes 3 vertices into a filled triangle, lines consumes 2 vertices into a thin line,
etc.
Safety
The source of unsafety is the range values in the ElementBuffer: if they are out of bounds
of the VertexBuffer (see bind
), this will result in out-of-bounds reads on the GPU and
therefore undefined behavior. The caller is responsible for ensuring all elements are
valid and in-bounds.
Trait Implementations
impl Drop for ShaderProgram
[src]
Auto Trait Implementations
impl !RefUnwindSafe for ShaderProgram
impl !Send for ShaderProgram
impl !Sync for ShaderProgram
impl Unpin for ShaderProgram
impl !UnwindSafe for ShaderProgram
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,