Struct cogl::Renderer [−][src]
Implementations
impl Renderer
[src]
pub fn new() -> Renderer
[src]
Instantiates a new (unconnected) Renderer
object. A
Renderer
represents a means to render. It encapsulates the
selection of an underlying driver, such as OpenGL or OpenGL-ES and
a selection of a window system binding API such as GLX, or EGL or
WGL.
While the renderer is unconnected it can be configured so that
applications may specify backend constraints, such as “must use
x11” for example via Renderer::add_constraint
.
There are also some platform specific configuration apis such
as cogl_xlib_renderer_set_foreign_display
that may also be
used while the renderer is unconnected.
Once the renderer has been configured, then it may (optionally) be
explicitly connected using Renderer::connect
which allows
errors to be handled gracefully and potentially fallback
configurations can be tried out if there are initial failures.
If a renderer is not explicitly connected then Display::new
will automatically connect the renderer for you. If you don’t
have any code to deal with error/fallback situations then its fine
to just let Cogl do the connection for you.
Once you have setup your renderer then the next step is to create a
Display
using Display::new
.
<note>
Many applications don’t need to explicitly use
Renderer::new
or Display::new
and can just jump
straight to Context::new
and pass a None
display argument
so Cogl will automatically connect and setup a renderer and
display.</note>
Returns
A newly created Renderer
.
pub fn add_constraint(&self, constraint: RendererConstraint)
[src]
This adds a renderer selection constraint
.
Applications should ideally minimize how many of these constraints they depend on to ensure maximum portability.
constraint
A RendererConstraint
to add
pub fn check_onscreen_template(
&self,
onscreen_template: &OnscreenTemplate
) -> Result<bool, Error>
[src]
&self,
onscreen_template: &OnscreenTemplate
) -> Result<bool, Error>
Tests if a given onscreen_template
can be supported with the given
self
.
onscreen_template
A OnscreenTemplate
Returns
true
if the onscreen_template
can be supported,
else false
.
pub fn connect(&self) -> Result<bool, Error>
[src]
Connects the configured self
. Renderer connection isn’t a
very active process, it basically just means validating that
any given constraint criteria can be satisfied and that a
usable driver and window system backend can be found.
Returns
true
if there was no error while connecting the
given self
. false
if there was an error.
pub fn foreach_output<P: FnMut(&Output)>(&self, callback: P)
[src]
Iterates all known display outputs for the given self
and
passes a corresponding Output
pointer to the given callback
for each one, along with the given user_data
.
callback
A CoglOutputCallback
to be called for
each display output
user_data
A user pointer to be passed to callback
pub fn get_driver(&self) -> Driver
[src]
Queries what underlying driver is being used by Cogl.
This may only be called on a connected Renderer
.
pub fn get_n_fragment_texture_units(&self) -> i32
[src]
Queries how many texture units can be used from fragment programs
Returns
the number of texture image units.
pub fn get_winsys_id(&self) -> WinsysID
[src]
Queries which window system backend Cogl has chosen to use.
This may only be called on a connected Renderer
.
Returns
The WinsysID
corresponding to the chosen window
system backend.
pub fn remove_constraint(&self, constraint: RendererConstraint)
[src]
This removes a renderer selection constraint
.
Applications should ideally minimize how many of these constraints they depend on to ensure maximum portability.
constraint
A RendererConstraint
to remove
pub fn set_driver(&self, driver: Driver)
[src]
Requests that Cogl should try to use a specific underlying driver for rendering.
If you select an unsupported driver then Renderer::connect
will fail and report an error. Most applications should not
explicitly select a driver and should rely on Cogl automatically
choosing the driver.
This may only be called on an un-connected Renderer
.
pub fn set_winsys_id(&self, winsys_id: WinsysID)
[src]
This allows you to explicitly select a winsys backend to use instead of letting Cogl automatically select a backend.
if you select an unsupported backend then Renderer::connect
will fail and report an error.
This may only be called on an un-connected Renderer
.
winsys_id
An ID of the winsys you explicitly want to use.
Trait Implementations
impl Clone for Renderer
[src]
impl Debug for Renderer
[src]
impl Default for Renderer
[src]
impl Display for Renderer
[src]
impl Eq for Renderer
[src]
impl Hash for Renderer
[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<Object> for Renderer
[src]
impl Ord for Renderer
[src]
fn cmp(&self, other: &Renderer) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<T: ObjectType> PartialEq<T> for Renderer
[src]
impl<T: ObjectType> PartialOrd<T> for Renderer
[src]
fn partial_cmp(&self, other: &T) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StaticType for Renderer
[src]
fn static_type() -> Type
[src]
Auto Trait Implementations
impl RefUnwindSafe for Renderer
impl !Send for Renderer
impl !Sync for Renderer
impl Unpin for Renderer
impl UnwindSafe for Renderer
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
N: Into<&'a str>,
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
[src]
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
N: Into<&'a str>,
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
pub fn connect_local<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
N: Into<&'a str>,
F: Fn(&[Value]) -> Option<Value> + 'static,
[src]
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
N: Into<&'a str>,
F: Fn(&[Value]) -> Option<Value> + 'static,
pub unsafe fn connect_unsafe<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
N: Into<&'a str>,
F: Fn(&[Value]) -> Option<Value>,
[src]
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
N: Into<&'a str>,
F: Fn(&[Value]) -> Option<Value>,
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>,