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_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> { ... } fn create_buffer_persistent_readable<T>(&mut self,
                                            num: usize,
                                            role: Role,
                                            bind: Bind)
                                            -> (Buffer<R, T>, Readable<R, T>) where T: Copy { ... } fn create_buffer_persistent_writable<T>(&mut self,
                                            num: usize,
                                            role: Role,
                                            bind: Bind)
                                            -> (Buffer<R, T>, Writable<R, T>) where T: Copy { ... } fn create_buffer_persistent_rw<T>(&mut self,
                                      num: usize,
                                      role: Role,
                                      bind: Bind)
                                      -> (Buffer<R, T>, RWable<R, T>) where T: Copy { ... } 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

Create a vertex buffer from the supplied data. A Slice will have to manually be constructed.

Shorthand for creating a new vertex buffer from the supplied vertices, together with a Slice from the supplied indices.

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

Creates and maps a readable persistent buffer.

Creates and maps a writable persistent buffer.

Creates and maps an rw persistent buffer.

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