Struct glitter::context::texture_context::Texture2dBuilder [] [src]

pub struct Texture2dBuilder<'a, C> where
    C: 'a + TextureUnit0Context
{ /* fields omitted */ }

Provide a safe interface for building a 2D texture object that is checked to be complete. A Texture2dBuilder can be created using the gl.build_texture_2d method.

Methods

impl<'a, C> Texture2dBuilder<'a, C> where
    C: TextureUnit0Context
[src]

[src]

Set the 2D image data to fill the texture with.

[src]

Set the parameters for creating an empty texture.

[src]

Automatically generate mipmaps for the texture.

[src]

Set the texture's minifying filter.

[src]

Set the texture's magnifying filter.

[src]

Set the texture's wrap mode for the s-coordinate.

[src]

Set the texture's wrap mode for the t-coordinate.

[src]

Create and return a texture with the specified options, or return an error.

Failures

If any of the following conditions are met, an error will be returned:

  • The texture is not complete.
  • The texture was set to be empty, but either the width or height were 0.
  • The texture was neither set to be empty with empty, nor had any image data supplied with image_2d.
  • The texture had a mipmap filter set for the min_filter, but mimaps were not generated using generate_mipmaps.

[src]

Create a texture with the specified options, or panic.

Panic

See the try_unwrap method docs for all of the possible failure cases when building a texture.