Trait gfx::device::Factory
[−]
[src]
pub trait Factory<R: Resources> { type Mapper: Clone + Raw; fn get_capabilities<'a>(&'a self) -> &'a Capabilities; fn create_buffer_raw(&mut self, size: usize, usage: BufferUsage) -> RawBuffer<R>; fn create_buffer_static_raw(&mut self, data: &[u8], role: BufferRole) -> RawBuffer<R>; fn create_array_buffer(&mut self) -> Result<ArrayBuffer<R>, NotSupported>; fn create_shader(&mut self, stage: Stage, code: &[u8]) -> Result<Shader<R>, CreateShaderError>; fn create_program(&mut self, shaders: &[Shader<R>], targets: Option<&[&str]>) -> Result<Program<R>, CreateProgramError>; fn create_frame_buffer(&mut self) -> Result<FrameBuffer<R>, NotSupported>; fn create_surface(&mut self, SurfaceInfo) -> Result<Surface<R>, SurfaceError>; fn create_texture(&mut self, TextureInfo) -> Result<Texture<R>, TextureError>; fn create_sampler(&mut self, SamplerInfo) -> Sampler<R>; fn update_buffer_raw(&mut self, buf: &RawBuffer<R>, data: &[u8], offset_bytes: usize); fn map_buffer_raw(&mut self, &RawBuffer<R>, MapAccess) -> Self::Mapper; fn unmap_buffer_raw(&mut self, Self::Mapper); fn map_buffer_readable<T: Copy>(&mut self, &Buffer<R, T>) -> Readable<T, R, Self>; fn map_buffer_writable<T: Copy>(&mut self, &Buffer<R, T>) -> Writable<T, R, Self>; fn map_buffer_rw<T: Copy>(&mut self, &Buffer<R, T>) -> RW<T, R, Self>; fn update_texture_raw(&mut self, tex: &Texture<R>, img: &ImageInfo, data: &[u8], kind: Option<TextureKind>) -> Result<(), TextureError>; fn generate_mipmap(&mut self, &Texture<R>); fn cleanup(&mut self); fn create_buffer<T>(&mut self, num: usize, usage: BufferUsage) -> Buffer<R, T> { ... } fn create_buffer_static<T>(&mut self, data: &[T]) -> Buffer<R, T> { ... } fn create_buffer_index<T>(&mut self, data: &[T]) -> IndexBuffer<R, T> { ... } fn update_buffer<T>(&mut self, buf: &Buffer<R, T>, data: &[T], offset_elements: usize) { ... } fn update_texture<T>(&mut self, tex: &Texture<R>, img: &ImageInfo, data: &[T], kind: Option<TextureKind>) -> Result<(), TextureError> { ... } fn create_texture_static<T>(&mut self, info: TextureInfo, data: &[T]) -> Result<Texture<R>, TextureError> { ... } }
Associated Types
Required Methods
fn get_capabilities<'a>(&'a self) -> &'a Capabilities
Returns the capabilities available to the specific API implementation
fn create_buffer_raw(&mut self, size: usize, usage: BufferUsage) -> RawBuffer<R>
fn create_buffer_static_raw(&mut self, data: &[u8], role: BufferRole) -> RawBuffer<R>
fn create_array_buffer(&mut self) -> Result<ArrayBuffer<R>, NotSupported>
fn create_shader(&mut self, stage: Stage, code: &[u8]) -> Result<Shader<R>, CreateShaderError>
fn create_program(&mut self, shaders: &[Shader<R>], targets: Option<&[&str]>) -> Result<Program<R>, CreateProgramError>
fn create_frame_buffer(&mut self) -> Result<FrameBuffer<R>, NotSupported>
fn create_surface(&mut self, SurfaceInfo) -> Result<Surface<R>, SurfaceError>
fn create_texture(&mut self, TextureInfo) -> Result<Texture<R>, TextureError>
fn create_sampler(&mut self, SamplerInfo) -> Sampler<R>
fn update_buffer_raw(&mut self, buf: &RawBuffer<R>, data: &[u8], offset_bytes: usize)
Update the information stored in a specific buffer
fn map_buffer_raw(&mut self, &RawBuffer<R>, MapAccess) -> Self::Mapper
fn unmap_buffer_raw(&mut self, Self::Mapper)
fn map_buffer_readable<T: Copy>(&mut self, &Buffer<R, T>) -> Readable<T, R, Self>
fn map_buffer_writable<T: Copy>(&mut self, &Buffer<R, T>) -> Writable<T, R, Self>
fn map_buffer_rw<T: Copy>(&mut self, &Buffer<R, T>) -> RW<T, R, Self>
fn update_texture_raw(&mut self, tex: &Texture<R>, img: &ImageInfo, data: &[u8], kind: Option<TextureKind>) -> Result<(), TextureError>
Update the information stored in a texture
fn generate_mipmap(&mut self, &Texture<R>)
fn cleanup(&mut self)
Clean up all unreferenced resources
Provided Methods
fn create_buffer<T>(&mut self, num: usize, usage: BufferUsage) -> Buffer<R, T>
fn create_buffer_static<T>(&mut self, data: &[T]) -> Buffer<R, T>
fn create_buffer_index<T>(&mut self, data: &[T]) -> IndexBuffer<R, T>
fn update_buffer<T>(&mut self, buf: &Buffer<R, T>, data: &[T], offset_elements: usize)
fn update_texture<T>(&mut self, tex: &Texture<R>, img: &ImageInfo, data: &[T], kind: Option<TextureKind>) -> Result<(), TextureError>
fn create_texture_static<T>(&mut self, info: TextureInfo, data: &[T]) -> Result<Texture<R>, TextureError>
Create a new texture with given data