Trait gfx::traits::FactoryExt
[−]
[src]
pub trait FactoryExt<R: Resources>: Factory<R> { fn create_vertex_buffer<T>(&mut self, data: &[T]) -> (Buffer<R, T>, Slice<R>) where T: Copy + Structure<Format> { ... } fn create_vertex_buffer_indexed<V, I>(&mut self, vd: &[V], id: I) -> (Buffer<R, V>, Slice<R>) where V: Copy + Structure<Format>, I: ToIndexSlice<R>, Self: Sized { ... } fn create_constant_buffer<T>(&mut self, num: usize) -> Buffer<R, T> { ... } fn create_shader_set(&mut self, vs_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> { ... } fn create_pipeline_from_program<I: PipelineInit>(&mut self, program: &Program<R>, primitive: Primitive, rasterizer: Rasterizer, init: I) -> Result<PipelineState<R, I::Meta>, PipelineStateError> { ... } fn create_pipeline_simple<I: PipelineInit>(&mut self, vs: &[u8], ps: &[u8], cull: CullFace, init: I) -> Result<PipelineState<R, I::Meta>, PipelineStateError> { ... } fn create_sampler_linear(&mut self) -> Sampler<R> { ... } }
Factory extension trait
Provided Methods
fn create_vertex_buffer<T>(&mut self, data: &[T]) -> (Buffer<R, T>, Slice<R>) where T: Copy + Structure<Format>
Create a vertex buffer with an associated slice.
fn create_vertex_buffer_indexed<V, I>(&mut self, vd: &[V], id: I) -> (Buffer<R, V>, Slice<R>) where V: Copy + Structure<Format>, I: ToIndexSlice<R>, Self: Sized
Create a vertex buffer with an index, returned by a slice.
fn create_constant_buffer<T>(&mut self, num: usize) -> Buffer<R, T>
Create a constant buffer for num
identical elements of type T
.
fn create_shader_set(&mut self, vs_code: &[u8], ps_code: &[u8]) -> Result<ShaderSet<R>, ProgramError>
Create a shader set from a given vs/ps code for multiple shader models.
fn link_program(&mut self, vs_code: &[u8], ps_code: &[u8]) -> Result<Program<R>, ProgramError>
Create a simple program given a vertex shader with a pixel one.
fn create_pipeline_state<I: PipelineInit>(&mut self, shaders: &ShaderSet<R>, primitive: Primitive, rasterizer: Rasterizer, init: I) -> Result<PipelineState<R, I::Meta>, PipelineStateError>
Create a strongly-typed Pipeline State.
fn create_pipeline_from_program<I: PipelineInit>(&mut self, program: &Program<R>, primitive: Primitive, rasterizer: Rasterizer, init: I) -> Result<PipelineState<R, I::Meta>, PipelineStateError>
Create PSO with a given program.
fn create_pipeline_simple<I: PipelineInit>(&mut self, vs: &[u8], ps: &[u8], cull: CullFace, init: I) -> Result<PipelineState<R, I::Meta>, PipelineStateError>
Create a simplified version of the Pipeline State, which works on triangles, and only has VS and PS shaders in it.
fn create_sampler_linear(&mut self) -> Sampler<R>
Create a linear sampler with clamping to border.