pub trait FactoryExt<R: Resources>: Factory<R> {
Show 15 methods
// Provided methods
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_geometry(
&mut self,
vs_code: &[u8],
gs_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 create_shader_set_tessellation_with_geometry(
&mut self,
vs_code: &[u8],
hs_code: &[u8],
ds_code: &[u8],
gs_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> { ... }
}Expand description
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§
Sourcefn create_vertex_buffer<T>(&mut self, vertices: &[T]) -> Buffer<R, T>
fn create_vertex_buffer<T>(&mut self, vertices: &[T]) -> Buffer<R, T>
Creates an immutable vertex buffer from the supplied vertices.
A Slice will have to manually be constructed.
Sourcefn create_index_buffer<T>(&mut self, indices: T) -> IndexBuffer<R>where
T: IntoIndexBuffer<R>,
fn create_index_buffer<T>(&mut self, indices: T) -> IndexBuffer<R>where
T: IntoIndexBuffer<R>,
Sourcefn create_vertex_buffer_with_slice<B, V>(
&mut self,
vertices: &[V],
indices: B,
) -> (Buffer<R, V>, Slice<R>)
fn create_vertex_buffer_with_slice<B, V>( &mut self, vertices: &[V], indices: B, ) -> (Buffer<R, V>, Slice<R>)
Creates an immutable vertex buffer from the supplied vertices,
together with a Slice from the supplied indices.
Sourcefn create_constant_buffer<T>(&mut self, num: usize) -> Buffer<R, T>where
T: Copy,
fn create_constant_buffer<T>(&mut self, num: usize) -> Buffer<R, T>where
T: Copy,
Creates a constant buffer for num identical elements of type T.
Sourcefn create_upload_buffer<T>(
&mut self,
num: usize,
) -> Result<Buffer<R, T>, CreationError>
fn create_upload_buffer<T>( &mut self, num: usize, ) -> Result<Buffer<R, T>, CreationError>
Creates an upload buffer for num elements of type T.
Sourcefn create_download_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>
Creates a download buffer for num elements of type T.
Sourcefn create_shader_set(
&mut self,
vs_code: &[u8],
ps_code: &[u8],
) -> Result<ShaderSet<R>, ProgramError>
fn create_shader_set( &mut self, vs_code: &[u8], ps_code: &[u8], ) -> Result<ShaderSet<R>, ProgramError>
Creates a ShaderSet from the supplied vertex and pixel shader source code.
Sourcefn create_shader_set_geometry(
&mut self,
vs_code: &[u8],
gs_code: &[u8],
ps_code: &[u8],
) -> Result<ShaderSet<R>, ProgramError>
fn create_shader_set_geometry( &mut self, vs_code: &[u8], gs_code: &[u8], ps_code: &[u8], ) -> Result<ShaderSet<R>, ProgramError>
Creates a ShaderSet from the supplied vertex, geometry, and pixel
shader source code. Mainly used for testing.
Sourcefn create_shader_set_tessellation(
&mut self,
vs_code: &[u8],
hs_code: &[u8],
ds_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>
Creates a ShaderSet from the supplied vertex, hull, domain, and pixel
shader source code. Mainly used for testing.
Sourcefn create_shader_set_tessellation_with_geometry(
&mut self,
vs_code: &[u8],
hs_code: &[u8],
ds_code: &[u8],
gs_code: &[u8],
ps_code: &[u8],
) -> Result<ShaderSet<R>, ProgramError>
fn create_shader_set_tessellation_with_geometry( &mut self, vs_code: &[u8], hs_code: &[u8], ds_code: &[u8], gs_code: &[u8], ps_code: &[u8], ) -> Result<ShaderSet<R>, ProgramError>
Creates a ShaderSet from the supplied vertex, hull, domain, geometry and pixel
shader source code. Mainly used for testing.
Sourcefn link_program(
&mut self,
vs_code: &[u8],
ps_code: &[u8],
) -> Result<Program<R>, ProgramError>
fn link_program( &mut self, vs_code: &[u8], ps_code: &[u8], ) -> Result<Program<R>, ProgramError>
Creates a basic shader Program from the supplied vertex and pixel shader source code.
Sourcefn 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_state<I: PipelineInit>( &mut self, shaders: &ShaderSet<R>, primitive: Primitive, rasterizer: Rasterizer, init: I, ) -> Result<PipelineState<R, I::Meta>, PipelineStateError<String>>
Similar to create_pipeline_from_program(..), but takes a ShaderSet as opposed to a
shader Program.
Sourcefn 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_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>>
Creates a strongly typed PipelineState from its Init structure, a shader Program, a
primitive type and a Rasterizer.
Sourcefn create_pipeline_simple<I: PipelineInit>(
&mut self,
vs: &[u8],
ps: &[u8],
init: I,
) -> Result<PipelineState<R, I::Meta>, PipelineStateError<String>>
fn create_pipeline_simple<I: PipelineInit>( &mut self, vs: &[u8], ps: &[u8], init: I, ) -> Result<PipelineState<R, I::Meta>, PipelineStateError<String>>
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.
Sourcefn create_sampler_linear(&mut self) -> Sampler<R>
fn create_sampler_linear(&mut self) -> Sampler<R>
Create a linear sampler with clamping to border.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.