pub fn add_frame_callback<P: Fn(&Onscreen, &FrameEvent, &FrameInfo) + 'static>(
        &self,
        callback: P,
    ) -> Option<FrameClosure> {
        let callback_data: Box_<P> = Box_::new(callback);
        unsafe extern "C" fn callback_func<P: Fn(&Onscreen, &FrameEvent, &FrameInfo) + 'static>(
            onscreen: *mut ffi::CoglOnscreen,
            event: ffi::CoglFrameEvent,
            info: *mut ffi::CoglFrameInfo,
            user_data: glib_sys::gpointer,
        ) {
            let onscreen = from_glib_borrow(onscreen);
            let event = from_glib(event);
            let info = from_glib_borrow(info);
            let callback: &P = &*(user_data as *mut _);
            (*callback)(&onscreen, &event, &info);
        }
        let callback = Some(callback_func::<P> as _);
        let super_callback0: Box_<P> = callback_data;
        unsafe {
            from_glib_full(ffi::cogl_onscreen_add_frame_callback(
                self.to_glib_none().0,
                callback,
                Box_::into_raw(super_callback0) as *mut _,
                None,
            ))
        }
    }
/// Installs a `callback` function that will be called for significant
/// events relating to the given `self` framebuffer.
///
/// The `callback` will be used to notify when the system compositor is
/// ready for this application to render a new frame. In this case
/// `FrameEvent::Sync` will be passed as the event argument to the
/// given `callback` in addition to the `FrameInfo` corresponding to
/// the frame beeing acknowledged by the compositor.
///
/// The `callback` will also be called to notify when the frame has
/// ended. In this case `FrameEvent::Complete` will be passed as
/// the event argument to the given `callback` in addition to the
/// `FrameInfo` corresponding to the newly presented frame. The
/// meaning of "ended" here simply means that no more timing
/// information will be collected within the corresponding
/// `FrameInfo` and so this is a good opportunity to analyse the
/// given info. It does not necessarily mean that the GPU has finished
/// rendering the corresponding frame.
///
/// We highly recommend throttling your application according to
/// `FrameEvent::Sync` events so that your application can avoid
/// wasting resources, drawing more frames than your system compositor
/// can display.
/// ## `callback`
/// A callback function to call for frame events
/// ## `user_data`
/// A private pointer to be passed to `callback`
///
/// # Returns
///
/// a `FrameClosure` pointer that can be used to
///  remove the callback and associated `user_data` later.
Installs a `callback` function that will be called for significant
events relating to the given `self` framebuffer.

The `callback` will be used to notify when the system compositor is
ready for this application to render a new frame.

The `callback` will also be called to notify when the frame has
ended.

We highly recommend throttling your application according to
`FrameEvent::Sync` events so that your application can avoid
wasting resources, drawing more frames than your system compositor
can display.
Installs a ` callback ` function that will be called for significant events relating to the given ` self ` framebuffer . The ` callback ` will be used to notify when the system compositor is ready for this application to render a new frame . The ` callback ` will also be called to notify when the frame has ended . We highly recommend throttling your application according to ` FrameEvent :: Sync ` events so that your application can avoid wasting resources drawing more frames than your system compositor can display .
pub fn add_frame_callback<P: Fn(&Onscreen, &FrameEvent, &FrameInfo) + 'static>(
        &self,
        callback: P,
    ) -> Option<FrameClosure> {
        let callback_data: Box_<P> = Box_::new(callback);
        unsafe extern "C" fn callback_func<P: Fn(&Onscreen, &FrameEvent, &FrameInfo) + 'static>(
            onscreen: *mut ffi::CoglOnscreen,
            event: ffi::CoglFrameEvent,
            info: *mut ffi::CoglFrameInfo,
            user_data: glib_sys::gpointer,
        ) {
            let onscreen = from_glib_borrow(onscreen);
            let event = from_glib(event);
            let info = from_glib_borrow(info);
            let callback: &P = &*(user_data as *mut _);
            (*callback)(&onscreen, &event, &info);
        }
        let callback = Some(callback_func::<P> as _);
        let super_callback0: Box_<P> = callback_data;
        unsafe {
            from_glib_full(ffi::cogl_onscreen_add_frame_callback(
                self.to_glib_none().0,
                callback,
                Box_::into_raw(super_callback0) as *mut _,
                None,
            ))
        }
    }
pub fn add_frame_callback < P : Fn ( & Onscreen , & FrameEvent , & FrameInfo ) + ' static > ( & self , callback : P , ) -> Option < FrameClosure > { let callback_data : Box_ < P > = Box_ :: new ( callback ) ; unsafe extern " " fn callback_func < P : Fn ( & Onscreen , & FrameEvent , & FrameInfo ) + ' static > ( onscreen : * mut ffi :: CoglOnscreen , event : ffi :: CoglFrameEvent , info : * mut ffi :: CoglFrameInfo , user_data : glib_sys :: gpointer , ) { let onscreen = from_glib_borrow ( onscreen ) ; let event = from_glib ( event ) ; let info = from_glib_borrow ( info ) ; let callback : & P = & * ( user_data as * mut _ ) ; ( * callback ) ( & onscreen , & event , & info ) ; } let callback = Some ( callback_func :: < P > as _ ) ; let super_callback0 : Box_ < P > = callback_data ; unsafe { from_glib_full ( ffi :: cogl_onscreen_add_frame_callback ( self . to_glib_none ( ) . 0 , callback , Box_ :: into_raw ( super_callback0 ) as * mut _ , None , ) ) } }
Installs a `callback` function that will be called for significant
events relating to the given `self` framebuffer.
Installs a ` callback ` function that will be called for significant events relating to the given ` self ` framebuffer .
&self
callback
P
a `FrameClosure` pointer that can be used to
remove the callback and associated `user_data` later.
a ` FrameClosure ` pointer that can be used to remove the callback and associated ` user_data ` later .
&self
callback
P
`callback`
A callback function to call for frame events
A callback function to call for frame events
`user_data`
A private pointer to be passed to `callback`
A private pointer to be passed to ` callback `