#[repr(C)]pub struct Texture {
pub texture_id: GLuint,
pub flags: TextureFlags,
pub size: PhysicalSizeU32,
pub background_color: ColorU,
pub gl_context: GlContextPtr,
pub format: RawImageFormat,
pub refcount: *const AtomicUsize,
pub run_destructor: bool,
}Expand description
OpenGL texture, use ReadOnlyWindow::create_texture to create a texture
Fields§
§texture_id: GLuintRaw OpenGL texture ID
flags: TextureFlagsHints and flags for optimization purposes
size: PhysicalSizeU32Size of this texture (in pixels)
background_color: ColorUBackground color of this texture
gl_context: GlContextPtrA reference-counted pointer to the OpenGL context (so that the texture can be deleted in the destructor)
format: RawImageFormatFormat of the texture (rgba8, brga8, etc.)
refcount: *const AtomicUsizeReference count, shared across
run_destructor: boolImplementations§
Source§impl Texture
impl Texture
pub fn new( texture_id: GLuint, flags: TextureFlags, size: PhysicalSizeU32, background_color: ColorU, gl_context: GlContextPtr, format: RawImageFormat, ) -> Self
pub fn allocate_rgba8( gl_context: GlContextPtr, size: PhysicalSizeU32, background: ColorU, ) -> Self
pub fn clear(&mut self)
pub fn get_descriptor(&self) -> ImageDescriptor
Trait Implementations§
Source§impl Ord for Texture
impl Ord for Texture
Source§impl PartialOrd for Texture
impl PartialOrd for Texture
impl Eq for Texture
Auto Trait Implementations§
impl Freeze for Texture
impl RefUnwindSafe for Texture
impl !Send for Texture
impl !Sync for Texture
impl Unpin for Texture
impl UnwindSafe for Texture
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more