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
namecontains a null byte - If a uniform with the given
namecould not be found