pub struct GlesTexture(/* private fields */);
renderer_gl
only.Expand description
A handle to a GLES texture
The texture can be used with the same GlesRenderer
it was created with, or one using a
shared EGLContext
.
Implementations§
Source§impl GlesTexture
impl GlesTexture
Sourcepub unsafe fn from_raw(
renderer: &GlesRenderer,
internal_format: Option<GLenum>,
opaque: bool,
tex: GLuint,
size: Size<i32, BufferCoord>,
) -> GlesTexture
pub unsafe fn from_raw( renderer: &GlesRenderer, internal_format: Option<GLenum>, opaque: bool, tex: GLuint, size: Size<i32, BufferCoord>, ) -> GlesTexture
Create a GlesTexture from a raw gl texture id.
It is expected to not be external or y_inverted.
Ownership over the texture is taken by the renderer, you should not free the texture yourself.
§Safety
The renderer cannot make sure tex
is a valid texture id.
Sourcepub fn tex_id(&self) -> GLuint
pub fn tex_id(&self) -> GLuint
OpenGL texture id of this texture
This id will become invalid, when the GlesTexture is dropped and does not transfer ownership.
Sourcepub fn is_y_inverted(&self) -> bool
pub fn is_y_inverted(&self) -> bool
Whether the texture is upside down
Sourcepub fn is_unique_reference(&mut self) -> bool
pub fn is_unique_reference(&mut self) -> bool
Whether this is the only reference to this texture (strong or weak)
Note that this tracks only references to this Smithay object (that you can get by cloning it). If you make a reference via OpenGL directly somehow, you need to keep track of it on your own.
Trait Implementations§
Source§impl Bind<GlesTexture> for GlesRenderer
impl Bind<GlesTexture> for GlesRenderer
Source§fn bind<'a>(
&mut self,
texture: &'a mut GlesTexture,
) -> Result<GlesTarget<'a>, GlesError>
fn bind<'a>( &mut self, texture: &'a mut GlesTexture, ) -> Result<GlesTarget<'a>, GlesError>
Source§fn supported_formats(&self) -> Option<FormatSet>
fn supported_formats(&self) -> Option<FormatSet>
Source§impl Clone for GlesTexture
impl Clone for GlesTexture
Source§fn clone(&self) -> GlesTexture
fn clone(&self) -> GlesTexture
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for GlesTexture
impl Debug for GlesTexture
Source§impl Offscreen<GlesTexture> for GlesRenderer
impl Offscreen<GlesTexture> for GlesRenderer
Source§fn create_buffer(
&mut self,
format: Fourcc,
size: Size<i32, BufferCoord>,
) -> Result<GlesTexture, GlesError>
fn create_buffer( &mut self, format: Fourcc, size: Size<i32, BufferCoord>, ) -> Result<GlesTexture, GlesError>
Source§impl Texture for GlesTexture
impl Texture for GlesTexture
Auto Trait Implementations§
impl Freeze for GlesTexture
impl RefUnwindSafe for GlesTexture
impl Send for GlesTexture
impl Sync for GlesTexture
impl Unpin for GlesTexture
impl UnwindSafe for GlesTexture
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.