[][src]Trait luminance_front::context::GraphicsContext

pub unsafe trait GraphicsContext {
    type Backend: ?Sized;
    fn backend(&mut self) -> &mut Self::Backend;

    fn new_pipeline_gate(&mut self) -> PipelineGate<'_, Self::Backend> { ... }
fn new_buffer<T>(
        &mut self,
        len: usize
    ) -> Result<Buffer<Self::Backend, T>, BufferError>
    where
        T: Copy + Default,
        Self::Backend: Buffer<T>
, { ... }
fn new_buffer_from_vec<T, X>(
        &mut self,
        vec: X
    ) -> Result<Buffer<Self::Backend, T>, BufferError>
    where
        T: Copy,
        X: Into<Vec<T>>,
        Self::Backend: Buffer<T>
, { ... }
fn new_buffer_repeating<T>(
        &mut self,
        len: usize,
        value: T
    ) -> Result<Buffer<Self::Backend, T>, BufferError>
    where
        T: Copy,
        Self::Backend: Buffer<T>
, { ... }
fn new_framebuffer<D, CS, DS>(
        &mut self,
        size: <D as Dimensionable>::Size,
        mipmaps: usize,
        sampler: Sampler
    ) -> Result<Framebuffer<Self::Backend, D, CS, DS>, FramebufferError>
    where
        CS: ColorSlot<Self::Backend, D>,
        D: Dimensionable,
        DS: DepthSlot<Self::Backend, D>,
        Self::Backend: Framebuffer<D>
, { ... }
fn new_shader_stage<R>(
        &mut self,
        ty: StageType,
        src: R
    ) -> Result<Stage<Self::Backend>, StageError>
    where
        R: AsRef<str>,
        Self::Backend: Shader
, { ... }
fn new_shader_program<Sem, Out, Uni>(
        &mut self
    ) -> ProgramBuilder<'_, Self, Sem, Out, Uni>
    where
        Sem: Semantics,
        Self::Backend: Shader
, { ... }
fn new_tess(
        &mut self
    ) -> TessBuilder<'_, Self::Backend, (), (), (), Interleaved>
    where
        Self::Backend: Tess<(), (), (), Interleaved>
, { ... }
fn new_deinterleaved_tess<V, W>(
        &mut self
    ) -> TessBuilder<'_, Self::Backend, V, (), W, Deinterleaved>
    where
        V: TessVertexData<Deinterleaved>,
        W: TessVertexData<Deinterleaved>,
        Self::Backend: Tess<V, (), W, Deinterleaved>
, { ... }
fn new_texture<D, P>(
        &mut self,
        size: <D as Dimensionable>::Size,
        mipmaps: usize,
        sampler: Sampler
    ) -> Result<Texture<Self::Backend, D, P>, TextureError>
    where
        D: Dimensionable,
        P: Pixel,
        Self::Backend: Texture<D, P>
, { ... } }

Class of graphics context.

Graphics context must implement this trait to be able to be used throughout the rest of the crate.

Associated Types

type Backend: ?Sized

Internal type used by the backend to cache, optimize and store data. This roughly represents the GPU data / context a backend implementation needs to work correctly.

Loading content...

Required methods

fn backend(&mut self) -> &mut Self::Backend

Access the underlying backend.

Loading content...

Provided methods

fn new_pipeline_gate(&mut self) -> PipelineGate<'_, Self::Backend>

Create a new pipeline gate

fn new_buffer<T>(
    &mut self,
    len: usize
) -> Result<Buffer<Self::Backend, T>, BufferError> where
    T: Copy + Default,
    Self::Backend: Buffer<T>, 

Create a new buffer.

See the documentation of Buffer::new for further details.

fn new_buffer_from_vec<T, X>(
    &mut self,
    vec: X
) -> Result<Buffer<Self::Backend, T>, BufferError> where
    T: Copy,
    X: Into<Vec<T>>,
    Self::Backend: Buffer<T>, 

Create a new buffer from a slice.

See the documentation of Buffer::from_vec for further details.

fn new_buffer_repeating<T>(
    &mut self,
    len: usize,
    value: T
) -> Result<Buffer<Self::Backend, T>, BufferError> where
    T: Copy,
    Self::Backend: Buffer<T>, 

Create a new buffer by repeating a value.

See the documentation of Buffer::repeat for further details.

fn new_framebuffer<D, CS, DS>(
    &mut self,
    size: <D as Dimensionable>::Size,
    mipmaps: usize,
    sampler: Sampler
) -> Result<Framebuffer<Self::Backend, D, CS, DS>, FramebufferError> where
    CS: ColorSlot<Self::Backend, D>,
    D: Dimensionable,
    DS: DepthSlot<Self::Backend, D>,
    Self::Backend: Framebuffer<D>, 

Create a new framebuffer.

See the documentation of Framebuffer::new for further details.

fn new_shader_stage<R>(
    &mut self,
    ty: StageType,
    src: R
) -> Result<Stage<Self::Backend>, StageError> where
    R: AsRef<str>,
    Self::Backend: Shader

Create a new shader stage.

See the documentation of Stage::new for further details.

fn new_shader_program<Sem, Out, Uni>(
    &mut self
) -> ProgramBuilder<'_, Self, Sem, Out, Uni> where
    Sem: Semantics,
    Self::Backend: Shader

Create a new shader program.

See the documentation of ProgramBuilder::new for further details.

fn new_tess(
    &mut self
) -> TessBuilder<'_, Self::Backend, (), (), (), Interleaved> where
    Self::Backend: Tess<(), (), (), Interleaved>, 

Create a TessBuilder.

See the documentation of TessBuilder::new for further details.

fn new_deinterleaved_tess<V, W>(
    &mut self
) -> TessBuilder<'_, Self::Backend, V, (), W, Deinterleaved> where
    V: TessVertexData<Deinterleaved>,
    W: TessVertexData<Deinterleaved>,
    Self::Backend: Tess<V, (), W, Deinterleaved>, 

Create a TessBuilder with deinterleaved memory.

See the documentation of TessBuilder::new for further details.

fn new_texture<D, P>(
    &mut self,
    size: <D as Dimensionable>::Size,
    mipmaps: usize,
    sampler: Sampler
) -> Result<Texture<Self::Backend, D, P>, TextureError> where
    D: Dimensionable,
    P: Pixel,
    Self::Backend: Texture<D, P>, 

Create a new texture.

Feel free to have a look at the documentation of Texture::new for further details.

Loading content...

Implementors

Loading content...