[−][src]Struct gpu::Texture2D
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]
context: &Context,
dimension: (usize, usize),
format: &TextureFormat
) -> Self
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]
context: &Context,
dimension: (usize, usize),
format: &TextureFormat,
data: &[T],
data_format: &TextureFormat
) -> Self
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]
&mut self,
dimensions: (usize, usize),
format: &TextureFormat,
data: &[T],
data_format: &TextureFormat
)
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]
fn borrow_mut(&mut self) -> &mut Texture
[src]
impl Deref for Texture2D
[src]
impl DerefMut for Texture2D
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Texture2D
impl !Send for Texture2D
impl !Sync for Texture2D
impl Unpin for Texture2D
impl UnwindSafe for Texture2D
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,