Trait gfx::extra::factory::FactoryExt [] [src]

pub trait FactoryExt<R: Resources>: Factory<R> {
    fn create_mesh<T: VertexFormat>(&mut self, data: &[T]) -> Mesh<R> { ... }
    fn link_program(&mut self, vs_code: &[u8], fs_code: &[u8]) -> Result<Program<R>, ProgramError> { ... }
    fn link_program_source(&mut self, vs_src: ShaderSource, fs_src: ShaderSource, caps: &Capabilities) -> Result<Program<R>, ProgramError> { ... }
    fn compile_shader_source(&mut self, stage: Stage, source: ShaderSource) -> Result<Shader<R>, CreateShaderError> { ... }
    fn link_program_source2(&mut self, vs_src: ShaderSource, fs_src: ShaderSource) -> Result<Program<R>, ProgramError> { ... }
    fn create_texture_rgba8(&mut self, width: u16, height: u16) -> Result<Texture<R>, TextureError> { ... }
    fn create_texture_rgba8_static(&mut self, width: u16, height: u16, data: &[u32]) -> Result<Texture<R>, TextureError> { ... }
    fn create_texture_depth_stencil(&mut self, width: u16, height: u16) -> Result<Texture<R>, TextureError> { ... }
}

Factory extension trait

Provided Methods

fn create_mesh<T: VertexFormat>(&mut self, data: &[T]) -> Mesh<R>

Create a new mesh from the given vertex data. Convenience function around create_buffer and Mesh::from_format.

Create a simple program given a vertex shader with a fragment one.

DEPRECATED, use link_program_source2 instead

fn compile_shader_source(&mut self, stage: Stage, source: ShaderSource) -> Result<Shader<R>, CreateShaderError>

Compile a single shader of a given stage, automatically picking the right shader variant.

Create a simple program given ShaderSource versions of vertex and fragment shaders, automatically picking available shader variant.

fn create_texture_rgba8(&mut self, width: u16, height: u16) -> Result<Texture<R>, TextureError>

Create a simple RGBA8 2D texture.

fn create_texture_rgba8_static(&mut self, width: u16, height: u16, data: &[u32]) -> Result<Texture<R>, TextureError>

Create RGBA8 2D texture with given contents and mipmap chain.

fn create_texture_depth_stencil(&mut self, width: u16, height: u16) -> Result<Texture<R>, TextureError>

Create a simple depth+stencil 2D texture.

Implementors