[−][src]Struct miniquad::graphics::Texture
Fields
width: u32
height: u32
format: TextureFormat
Implementations
impl Texture
[src]
pub fn empty() -> Texture
[src]
pub fn gl_internal_id(&self) -> GLuint
[src]
pub fn delete(&self)
[src]
Delete GPU texture, leaving handle unmodified.
More high-level code on top of miniquad probably is going to call this in Drop implementation of some more RAII buffer object.
There is no protection against using deleted textures later. However its not an UB in OpenGl and thats why this function is not marked as unsafe
impl Texture
[src]
pub fn new_render_texture(ctx: &mut Context, params: TextureParams) -> Texture
[src]
Shorthand for new(ctx, TextureAccess::RenderTarget, params)
pub fn new(
ctx: &mut Context,
_access: TextureAccess,
bytes: Option<&[u8]>,
params: TextureParams
) -> Texture
[src]
ctx: &mut Context,
_access: TextureAccess,
bytes: Option<&[u8]>,
params: TextureParams
) -> Texture
pub fn from_data_and_format(
ctx: &mut Context,
bytes: &[u8],
params: TextureParams
) -> Texture
[src]
ctx: &mut Context,
bytes: &[u8],
params: TextureParams
) -> Texture
Upload texture to GPU with given TextureParams
pub fn from_rgba8(
ctx: &mut Context,
width: u16,
height: u16,
bytes: &[u8]
) -> Texture
[src]
ctx: &mut Context,
width: u16,
height: u16,
bytes: &[u8]
) -> Texture
Upload RGBA8 texture to GPU
pub fn set_filter(&self, ctx: &mut Context, filter: FilterMode)
[src]
pub fn resize(
&mut self,
ctx: &mut Context,
width: u32,
height: u32,
bytes: Option<&[u8]>
)
[src]
&mut self,
ctx: &mut Context,
width: u32,
height: u32,
bytes: Option<&[u8]>
)
pub fn update(&self, ctx: &mut Context, bytes: &[u8])
[src]
Update whole texture content bytes should be width * height * 4 size - non rgba8 textures are not supported yet anyway
pub fn update_texture_part(
&self,
ctx: &mut Context,
x_offset: i32,
y_offset: i32,
width: i32,
height: i32,
bytes: &[u8]
)
[src]
&self,
ctx: &mut Context,
x_offset: i32,
y_offset: i32,
width: i32,
height: i32,
bytes: &[u8]
)
pub fn read_pixels(&self, bytes: &mut [u8])
[src]
Read texture data into CPU memory
Trait Implementations
impl Clone for Texture
[src]
impl Copy for Texture
[src]
impl Debug for Texture
[src]
impl PartialEq<Texture> for Texture
[src]
impl StructuralPartialEq for Texture
[src]
Auto Trait Implementations
impl RefUnwindSafe for Texture
[src]
impl Send for Texture
[src]
impl Sync for Texture
[src]
impl Unpin for Texture
[src]
impl UnwindSafe for Texture
[src]
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,