1use crate::Texture;
2use glib::object::IsA;
3use glib::translate::*;
4use std::fmt;
5
6glib_wrapper! {
7 pub struct Offscreen(Object<ffi::CoglOffscreen, OffscreenClass>);
8
9 match fn {
10 get_type => || ffi::cogl_offscreen_get_gtype(),
11 }
12}
13
14impl Offscreen {
15 pub fn with_texture<P: IsA<Texture>>(texture: &P) -> Offscreen {
16 unsafe {
17 from_glib_full(ffi::cogl_offscreen_new_with_texture(
18 texture.as_ref().to_glib_none().0,
19 ))
20 }
21 }
22}
23
24impl fmt::Display for Offscreen {
25 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
26 write!(f, "Offscreen")
27 }
28}