Trait gfx::traits::FactoryExt [] [src]

pub trait FactoryExt<R: Resources>: Factory<R> {
    fn create_vertex_buffer<T>(&mut self, vertices: &[T]) -> Buffer<R, T>
    where
        T: Pod + Structure<Format>
, { ... } fn create_index_buffer<T>(&mut self, indices: T) -> IndexBuffer<R>
    where
        T: IntoIndexBuffer<R>
, { ... } fn create_vertex_buffer_with_slice<B, V>(
        &mut self,
        vertices: &[V],
        indices: B
    ) -> (Buffer<R, V>, Slice<R>)
    where
        V: Pod + Structure<Format>,
        B: IntoIndexBuffer<R>
, { ... } fn create_constant_buffer<T>(&mut self, num: usize) -> Buffer<R, T>
    where
        T: Copy
, { ... } fn create_upload_buffer<T>(
        &mut self,
        num: usize
    ) -> Result<Buffer<R, T>, CreationError> { ... } fn create_download_buffer<T>(
        &mut self,
        num: usize
    ) -> Result<Buffer<R, T>, CreationError> { ... } fn create_shader_set(
        &mut self,
        vs_code: &[u8],
        ps_code: &[u8]
    ) -> Result<ShaderSet<R>, ProgramError> { ... } fn create_shader_set_tessellation(
        &mut self,
        vs_code: &[u8],
        hs_code: &[u8],
        ds_code: &[u8],
        ps_code: &[u8]
    ) -> Result<ShaderSet<R>, ProgramError> { ... } fn link_program(
        &mut self,
        vs_code: &[u8],
        ps_code: &[u8]
    ) -> Result<Program<R>, ProgramError> { ... } fn create_pipeline_state<I: PipelineInit>(
        &mut self,
        shaders: &ShaderSet<R>,
        primitive: Primitive,
        rasterizer: Rasterizer,
        init: I
    ) -> Result<PipelineState<R, I::Meta>, PipelineStateError<String>> { ... } fn create_pipeline_from_program<'a, I: PipelineInit>(
        &mut self,
        program: &'a Program<R>,
        primitive: Primitive,
        rasterizer: Rasterizer,
        init: I
    ) -> Result<PipelineState<R, I::Meta>, PipelineStateError<&'a str>> { ... } fn create_pipeline_simple<I: PipelineInit>(
        &mut self,
        vs: &[u8],
        ps: &[u8],
        init: I
    ) -> Result<PipelineState<R, I::Meta>, PipelineStateError<String>> { ... } fn create_sampler_linear(&mut self) -> Sampler<R> { ... } }

This trait is responsible for creating and managing graphics resources, much like the Factory trait in the gfx crate. Every Factory automatically implements FactoryExt.

Provided Methods

Creates an immutable vertex buffer from the supplied vertices. A Slice will have to manually be constructed.

Creates an immutable index buffer from the supplied vertices.

The paramater indices is typically a &[u16] or &[u32] slice.

Creates an immutable vertex buffer from the supplied vertices, together with a Slice from the supplied indices.

Creates a constant buffer for num identical elements of type T.

Creates an upload buffer for num elements of type T.

Creates a download buffer for num elements of type T.

Creates a ShaderSet from the supplied vertex and pixel shader source code.

Mainly for testing

Creates a basic shader Program from the supplied vertex and pixel shader source code.

Similar to create_pipeline_from_program(..), but takes a ShaderSet as opposed to a shader Program.

Creates a strongly typed PipelineState from its Init structure, a shader Program, a primitive type and a Rasterizer.

Creates a strongly typed PipelineState from its Init structure. Automatically creates a shader Program from a vertex and pixel shader source, as well as a Rasterizer capable of rendering triangle faces without culling.

Create a linear sampler with clamping to border.

Implementors