pub struct Program { /* private fields */ }
Expand description
Implementations§
source§impl Program
impl Program
sourcepub fn new(vertex_shader: Entrypoint<'_>) -> Result<Self, Error>
pub fn new(vertex_shader: Entrypoint<'_>) -> Result<Self, Error>
Create a new shader program from a vertex shader.
§Errors
Returns an error if:
- the shader program cannot be initialized
- the input shader is not a vertex shader or is otherwise invalid
sourcepub fn set_geometry_shader(
&mut self,
geometry_shader: Entrypoint<'_>,
stride: u8
) -> Result<(), Error>
pub fn set_geometry_shader( &mut self, geometry_shader: Entrypoint<'_>, stride: u8 ) -> Result<(), Error>
Set the geometry shader for a given program.
§Errors
Returns an error if the input shader is not a geometry shader or is otherwise invalid.
sourcepub fn get_uniform(&self, name: &str) -> Result<Index>
pub fn get_uniform(&self, name: &str) -> Result<Index>
Get the index of a uniform by name.
§Errors
- If the given
name
contains a null byte - If a uniform with the given
name
could not be found