[][src]Struct gpu::Texture2D

pub struct Texture2D {
    pub texture: Texture,
    // some fields omitted
}

A Texture2D representation.

Fields

texture: Texture

Base texture object.

Implementations

impl Texture2D[src]

pub fn dimensions(&self) -> (usize, usize)[src]

Gets the dimensions.

pub fn allocate(
    context: &Context,
    dimension: (usize, usize),
    format: &TextureFormat
) -> Self
[src]

Allocates a new Texture2D with the specified dimensions and TextureFormat.

pub fn from_data<T>(
    context: &Context,
    dimension: (usize, usize),
    format: &TextureFormat,
    data: &[T],
    data_format: &TextureFormat
) -> Self
[src]

Creates a new Texture2D from a slice.

pub fn reallocate(&mut self, dimensions: (usize, usize), format: &TextureFormat)[src]

Reallocates the memory on the GPU side.

pub fn set_data<T>(
    &mut self,
    dimensions: (usize, usize),
    format: &TextureFormat,
    data: &[T],
    data_format: &TextureFormat
)
[src]

Gets a copy of the data on the GPU.

pub fn data<T>(&self) -> Vec<T>[src]

Gets a copy of the data on the GPU.

Methods from Deref<Target = Texture>

pub fn typ(&self) -> u32[src]

Gets the internal OpenGL type.

pub fn format(&self) -> &TextureFormat[src]

Gets the TextureFormat.

pub fn resource(&self) -> <Context as HasContext>::Texture[src]

Gets TextureResource.

Trait Implementations

impl AsMut<Texture> for Texture2D[src]

impl AsRef<Texture> for Texture2D[src]

impl Borrow<Texture> for Texture2D[src]

impl BorrowMut<Texture> for Texture2D[src]

impl Deref for Texture2D[src]

type Target = Texture

The resulting type after dereferencing.

impl DerefMut for Texture2D[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.