Struct cogl::Onscreen [−][src]
Implementations
impl Onscreen[src]
pub fn new(context: &Context, width: i32, height: i32) -> Onscreen[src]
Instantiates an “unallocated” Onscreen framebuffer that may be
configured before later being allocated, either implicitly when
it is first used or explicitly via Framebuffer::allocate.
context
A Context
width
The desired framebuffer width
height
The desired framebuffer height
Returns
A newly instantiated Onscreen framebuffer
pub fn get_buffer_age(&self) -> i32[src]
Gets the current age of the buffer contents.
This function allows applications to query the age of the current
back buffer contents for a Onscreen as the number of frames
elapsed since the contents were most recently defined.
These age values exposes enough information to applications about how Cogl internally manages back buffers to allow applications to re-use the contents of old frames and minimize how much must be redrawn for the next frame.
The back buffer contents can either be reported as invalid (has an age of 0) or it may be reported to be the same contents as from n frames prior to the current frame.
The queried value remains valid until the next buffer swap.
<note>One caveat is that under X11 the buffer age does not reflect
changes to buffer contents caused by the window systems. X11
applications must track Expose events to determine what buffer
regions need to additionally be repaired each frame.</note>
The recommended way to take advantage of this buffer age api is to
build up a circular buffer of length 3 for tracking damage regions
over the last 3 frames and when starting a new frame look at the
age of the buffer and combine the damage regions for the current
frame with the damage regions of previous age frames so you know
everything that must be redrawn to update the old contents for the
new frame.
<note>If the system doesn’t not support being able to track the age
of back buffers then this function will always return 0 which
implies that the contents are undefined.</note>
<note>The FeatureID::OglFeatureIdBufferAge feature can optionally be
explicitly checked to determine if Cogl is currently tracking the
age of Onscreen back buffer contents. If this feature is
missing then this function will always return 0.</note>
Returns
The age of the buffer contents or 0 when the buffer contents are undefined.
pub fn get_frame_counter(&self) -> i64[src]
Gets the value of the framebuffers frame counter. This is
a counter that increases by one each time
Onscreen::swap_buffers or Onscreen::swap_region
is called.
Returns
the current frame counter value
pub fn get_resizable(&self) -> Bool[src]
Lets you query whether self has been marked as resizable via
the Onscreen::set_resizable api.
By default, if possible, a self will be created by Cogl
as non resizable, but it is not guaranteed that this is always
possible for all window systems.
<note>If cogl_onscreen_set_resizable(self, true) has been
previously called then this function will return true, but it’s
possible that the current windowing system being used does not
support window resizing (consider fullscreen windows on a phone or
a TV). This function is not aware of whether resizing is truly
meaningful with your window system, only whether the self has
been marked as resizable.</note>
Returns
Returns whether self has been marked as
resizable or not.
pub fn hide(&self)[src]
This requests to make self invisible to the user.
Actually the precise semantics of this function depend on the window system currently in use, and if you don’t have a multi-windowining system this function may in-fact do nothing.
This function does not implicitly allocate the given self
framebuffer before hiding it.
<note>Since Cogl doesn’t explicitly track the visibility status of
onscreen framebuffers it wont try to avoid redundant window system
requests e.g. to show an already visible window. This also means
that it’s acceptable to alternatively use native APIs to show and
hide windows without confusing Cogl.</note>
pub fn remove_dirty_callback(&self, closure: &mut OnscreenDirtyClosure)[src]
Removes a callback and associated user data that were previously
registered using Onscreen::add_dirty_callback.
If a destroy callback was passed to
Onscreen::add_dirty_callback to destroy the user data then
this will also get called.
closure
A OnscreenDirtyClosure returned from
Onscreen::add_dirty_callback
pub fn remove_frame_callback(&self, closure: &mut FrameClosure)[src]
Removes a callback and associated user data that were previously
registered using Onscreen::add_frame_callback.
If a destroy callback was passed to
Onscreen::add_frame_callback to destroy the user data then
this will get called.
closure
A FrameClosure returned from
Onscreen::add_frame_callback
pub fn remove_resize_callback(&self, closure: &mut OnscreenResizeClosure)[src]
Removes a resize callback and user_data pair that were previously
associated with self via Onscreen::add_resize_callback.
closure
An identifier returned from Onscreen::add_resize_callback
pub fn set_resizable(&self, resizable: Bool)[src]
Lets you request Cogl to mark an self framebuffer as
resizable or not.
By default, if possible, a self will be created by Cogl
as non resizable, but it is not guaranteed that this is always
possible for all window systems.
<note>Cogl does not know whether marking the self framebuffer
is truly meaningful for your current window system (consider
applications being run fullscreen on a phone or TV) so this
function may not have any useful effect. If you are running on a
multi windowing system such as X11 or Win32 or OSX then Cogl will
request to the window system that users be allowed to resize the
self, although it’s still possible that some other window
management policy will block this possibility.</note>
<note>Whenever an self framebuffer is resized the viewport
will be automatically updated to match the new size of the
framebuffer with an origin of (0,0). If your application needs more
specialized control of the viewport it will need to register a
resize handler using Onscreen::add_resize_callback so that it
can track when the viewport has been changed automatically.</note>
pub fn set_swap_throttled(&self, throttled: Bool)[src]
Requests that the given self framebuffer should have swap buffer
requests (made using Onscreen::swap_buffers) throttled either by a
displays vblank period or perhaps some other mechanism in a composited
environment.
throttled
Whether swap throttling is wanted or not.
pub fn show(&self)[src]
This requests to make self visible to the user.
Actually the precise semantics of this function depend on the window system currently in use, and if you don’t have a multi-windowining system this function may in-fact do nothing.
This function will implicitly allocate the given self
framebuffer before showing it if it hasn’t already been allocated.
When using the Wayland winsys calling this will set the surface to
a toplevel type which will make it appear. If the application wants
to set a different type for the surface, it can avoid calling
Onscreen::show and set its own type directly with the Wayland
client API via cogl_wayland_onscreen_get_surface.
<note>Since Cogl doesn’t explicitly track the visibility status of
onscreen framebuffers it wont try to avoid redundant window system
requests e.g. to show an already visible window. This also means
that it’s acceptable to alternatively use native APIs to show and
hide windows without confusing Cogl.</note>
pub fn swap_buffers(&self)[src]
Swaps the current back buffer being rendered too, to the front for display.
This function also implicitly discards the contents of the color, depth and
stencil buffers as if Framebuffer::discard_buffers were used. The
significance of the discard is that you should not expect to be able to
start a new frame that incrementally builds on the contents of the previous
frame.
<note>It is highly recommended that applications use
Onscreen::swap_buffers_with_damage instead whenever possible
and also use the Onscreen::get_buffer_age api so they can
perform incremental updates to older buffers instead of having to
render a full buffer for every frame.</note>
Trait Implementations
impl Clone for Onscreen[src]
impl Debug for Onscreen[src]
impl Display for Onscreen[src]
impl Eq for Onscreen[src]
impl Hash for Onscreen[src]
fn hash<__H: Hasher>(&self, state: &mut __H)[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl IsA<Framebuffer> for Onscreen[src]
impl IsA<Object> for Onscreen[src]
impl Ord for Onscreen[src]
fn cmp(&self, other: &Onscreen) -> Ordering[src]
#[must_use]pub fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self1.50.0[src]
impl<T: ObjectType> PartialEq<T> for Onscreen[src]
impl<T: ObjectType> PartialOrd<T> for Onscreen[src]
fn partial_cmp(&self, other: &T) -> Option<Ordering>[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl StaticType for Onscreen[src]
fn static_type() -> Type[src]
Auto Trait Implementations
impl RefUnwindSafe for Onscreen
impl !Send for Onscreen
impl !Sync for Onscreen
impl Unpin for Onscreen
impl UnwindSafe for Onscreen
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<Super, Sub> CanDowncast<Sub> for Super where
Sub: IsA<Super>,
Super: IsA<Super>, [src]
Sub: IsA<Super>,
Super: IsA<Super>,
impl<T> Cast for T where
T: ObjectType, [src]
T: ObjectType,
pub fn upcast<T>(self) -> T where
Self: IsA<T>,
T: ObjectType, [src]
Self: IsA<T>,
T: ObjectType,
pub fn upcast_ref<T>(&self) -> &T where
Self: IsA<T>,
T: ObjectType, [src]
Self: IsA<T>,
T: ObjectType,
pub fn downcast<T>(self) -> Result<T, Self> where
Self: CanDowncast<T>,
T: ObjectType, [src]
Self: CanDowncast<T>,
T: ObjectType,
pub fn downcast_ref<T>(&self) -> Option<&T> where
Self: CanDowncast<T>,
T: ObjectType, [src]
Self: CanDowncast<T>,
T: ObjectType,
pub fn dynamic_cast<T>(self) -> Result<T, Self> where
T: ObjectType, [src]
T: ObjectType,
pub fn dynamic_cast_ref<T>(&self) -> Option<&T> where
T: ObjectType, [src]
T: ObjectType,
pub unsafe fn unsafe_cast<T>(self) -> T where
T: ObjectType, [src]
T: ObjectType,
pub unsafe fn unsafe_cast_ref<T>(&self) -> &T where
T: ObjectType, [src]
T: ObjectType,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ObjectExt for T where
T: ObjectType, [src]
T: ObjectType,
pub fn is<U>(&self) -> bool where
U: StaticType, [src]
U: StaticType,
pub fn get_type(&self) -> Type[src]
pub fn get_object_class(&self) -> &ObjectClass[src]
pub fn set_properties(
&self,
property_values: &[(&str, &dyn ToValue)]
) -> Result<(), BoolError>[src]
&self,
property_values: &[(&str, &dyn ToValue)]
) -> Result<(), BoolError>
pub fn set_property<'a, N>(
&self,
property_name: N,
value: &dyn ToValue
) -> Result<(), BoolError> where
N: Into<&'a str>, [src]
&self,
property_name: N,
value: &dyn ToValue
) -> Result<(), BoolError> where
N: Into<&'a str>,
pub fn get_property<'a, N>(&self, property_name: N) -> Result<Value, BoolError> where
N: Into<&'a str>, [src]
N: Into<&'a str>,
pub unsafe fn set_qdata<QD>(&self, key: Quark, value: QD) where
QD: 'static, [src]
QD: 'static,
pub unsafe fn get_qdata<QD>(&self, key: Quark) -> Option<&QD> where
QD: 'static, [src]
QD: 'static,
pub unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD> where
QD: 'static, [src]
QD: 'static,
pub unsafe fn set_data<QD>(&self, key: &str, value: QD) where
QD: 'static, [src]
QD: 'static,
pub unsafe fn get_data<QD>(&self, key: &str) -> Option<&QD> where
QD: 'static, [src]
QD: 'static,
pub unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD> where
QD: 'static, [src]
QD: 'static,
pub fn block_signal(&self, handler_id: &SignalHandlerId)[src]
pub fn unblock_signal(&self, handler_id: &SignalHandlerId)[src]
pub fn stop_signal_emission(&self, signal_name: &str)[src]
pub fn disconnect(&self, handler_id: SignalHandlerId)[src]
pub fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec) + Send + Sync, [src]
F: 'static + Fn(&T, &ParamSpec) + Send + Sync,
pub unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: Fn(&T, &ParamSpec), [src]
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: Fn(&T, &ParamSpec),
pub fn notify<'a, N>(&self, property_name: N) where
N: Into<&'a str>, [src]
N: Into<&'a str>,
pub fn notify_by_pspec(&self, pspec: &ParamSpec)[src]
pub fn has_property<'a, N>(&self, property_name: N, type_: Option<Type>) -> bool where
N: Into<&'a str>, [src]
N: Into<&'a str>,
pub fn get_property_type<'a, N>(&self, property_name: N) -> Option<Type> where
N: Into<&'a str>, [src]
N: Into<&'a str>,
pub fn find_property<'a, N>(&self, property_name: N) -> Option<ParamSpec> where
N: Into<&'a str>, [src]
N: Into<&'a str>,
pub fn list_properties(&self) -> Vec<ParamSpec, Global>[src]
pub fn connect<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
N: Into<&'a str>, [src]
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
N: Into<&'a str>,
pub fn connect_local<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + 'static,
N: Into<&'a str>, [src]
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + 'static,
N: Into<&'a str>,
pub unsafe fn connect_unsafe<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value>,
N: Into<&'a str>, [src]
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value>,
N: Into<&'a str>,
pub fn emit<'a, N>(
&self,
signal_name: N,
args: &[&dyn ToValue]
) -> Result<Option<Value>, BoolError> where
N: Into<&'a str>, [src]
&self,
signal_name: N,
args: &[&dyn ToValue]
) -> Result<Option<Value>, BoolError> where
N: Into<&'a str>,
pub fn downgrade(&self) -> WeakRef<T>[src]
pub fn bind_property<'a, O, N, M>(
&'a self,
source_property: N,
target: &'a O,
target_property: M
) -> BindingBuilder<'a> where
O: ObjectType,
N: Into<&'a str>,
M: Into<&'a str>, [src]
&'a self,
source_property: N,
target: &'a O,
target_property: M
) -> BindingBuilder<'a> where
O: ObjectType,
N: Into<&'a str>,
M: Into<&'a str>,
pub fn ref_count(&self) -> u32[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> ToSendValue for T where
T: SetValue + Send + ToValue + ?Sized, [src]
T: SetValue + Send + ToValue + ?Sized,
pub fn to_send_value(&self) -> SendValue[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T> ToValue for T where
T: SetValue + ?Sized, [src]
T: SetValue + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,