gdk4/auto/gl_texture.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4#![allow(deprecated)]
5
6use crate::{ffi, Paintable, Texture};
7use glib::translate::*;
8
9glib::wrapper! {
10 /// A GdkTexture representing a GL texture object.
11 ///
12 /// # Implements
13 ///
14 /// [`TextureExt`][trait@crate::prelude::TextureExt], [`PaintableExt`][trait@crate::prelude::PaintableExt], [`trait@gio::prelude::IconExt`], [`trait@gio::prelude::LoadableIconExt`], [`TextureExtManual`][trait@crate::prelude::TextureExtManual]
15 #[doc(alias = "GdkGLTexture")]
16 pub struct GLTexture(Object<ffi::GdkGLTexture, ffi::GdkGLTextureClass>) @extends Texture, @implements Paintable, gio::Icon, gio::LoadableIcon;
17
18 match fn {
19 type_ => || ffi::gdk_gl_texture_get_type(),
20 }
21}
22
23impl GLTexture {
24 /// Releases the GL resources held by a [`GLTexture`][crate::GLTexture].
25 ///
26 /// The texture contents are still available via the
27 /// [`TextureExtManual::download()`][crate::prelude::TextureExtManual::download()] function, after this
28 /// function has been called.
29 #[doc(alias = "gdk_gl_texture_release")]
30 pub fn release(&self) {
31 unsafe {
32 ffi::gdk_gl_texture_release(self.to_glib_none().0);
33 }
34 }
35}
36
37unsafe impl Send for GLTexture {}
38unsafe impl Sync for GLTexture {}