logo
pub unsafe trait GraphicsContext: Sized {
    type Backend;

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

    fn query(&mut self) -> Query<'_, Self::Backend>
    where
        Self::Backend: QueryBackend
, { ... } fn new_pipeline_gate(&mut self) -> PipelineGate<'_, Self::Backend> { ... } fn new_framebuffer<D, CS, DS>(
        &mut self,
        size: D::Size,
        mipmaps: usize,
        sampler: Sampler
    ) -> Result<Framebuffer<Self::Backend, D, CS, DS>, FramebufferError>
    where
        Self::Backend: FramebufferBackend<D>,
        D: Dimensionable,
        CS: ColorSlot<Self::Backend, D>,
        DS: DepthStencilSlot<Self::Backend, D>
, { ... } fn new_shader_stage<R>(
        &mut self,
        ty: StageType,
        src: R
    ) -> Result<Stage<Self::Backend>, StageError>
    where
        Self::Backend: Shader,
        R: AsRef<str>
, { ... } fn new_shader_program<Sem, Out, Uni>(
        &mut self
    ) -> ProgramBuilder<'_, Self, Sem, Out, Uni>
    where
        Self::Backend: Shader,
        Sem: Semantics
, { ... } fn new_shader_data<T>(
        &mut self,
        values: impl IntoIterator<Item = T>
    ) -> Result<ShaderData<Self::Backend, T>, ShaderDataError>
    where
        Self::Backend: ShaderDataBackend<T>
, { ... } fn new_tess(
        &mut self
    ) -> TessBuilder<'_, Self::Backend, (), (), (), Interleaved>
    where
        Self::Backend: TessBackend<(), (), (), Interleaved>
, { ... } fn new_deinterleaved_tess<V, W>(
        &mut self
    ) -> TessBuilder<'_, Self::Backend, V, (), W, Deinterleaved>
    where
        Self::Backend: TessBackend<V, (), W, Deinterleaved>,
        V: TessVertexData<Deinterleaved>,
        W: TessVertexData<Deinterleaved>
, { ... } fn new_texture<D, P>(
        &mut self,
        size: D::Size,
        sampler: Sampler,
        texels: TexelUpload<'_, [P::Encoding]>
    ) -> Result<Texture<Self::Backend, D, P>, TextureError>
    where
        Self::Backend: TextureBackend<D, P>,
        D: Dimensionable,
        P: Pixel
, { ... } fn new_texture_raw<D, P>(
        &mut self,
        size: D::Size,
        sampler: Sampler,
        texels: TexelUpload<'_, [P::RawEncoding]>
    ) -> Result<Texture<Self::Backend, D, P>, TextureError>
    where
        Self::Backend: TextureBackend<D, P>,
        D: Dimensionable,
        P: Pixel
, { ... } }
Expand description

Class of graphics context.

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

Required Associated Types

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.

Required Methods

Access the underlying backend.

Provided Methods

Access the query API.

Create a new pipeline gate

Create a new framebuffer.

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

Create a new shader stage.

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

Create a new shader program.

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

Create a new shader data.

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

Create a TessBuilder.

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

Create a TessBuilder with deinterleaved memory.

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

Create a new texture from texels.

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

Create a new texture from raw texels.

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

Implementors