Skip to main content

FerroNativeGlPlatformGraphics

Struct FerroNativeGlPlatformGraphics 

Source
pub struct FerroNativeGlPlatformGraphics { /* private fields */ }
Expand description

The OpenGL platform graphics of the macOS backend: one context shared by every top-level and both threads that render.

Implementations§

Source§

impl FerroNativeGlPlatformGraphics

Source

pub fn new( display: ComPtr<IFrnGlDisplay>, factory: &ComPtr<IFerroNativeFactory>, ) -> Result<FerroNativeGlPlatformGraphics, OpenGlException>

Creates a context to find out the version of OpenGL the system gives, the entry points and the format of the default framebuffer, then the shared context.

Fails, as the original throws, when the native display cannot create a context or make it current, and when the factory has no memory management helper.

Source

pub fn can_share_contexts(&self) -> bool

Whether contexts may share their objects: always.

Source

pub fn can_create_contexts(&self) -> bool

Whether the graphics create contexts: always.

Source

pub fn gl_display(&self) -> &Rc<GlDisplay>

The display the contexts belong to.

Source

pub fn shared_context(&self) -> &Rc<GlContext>

The context every top-level renders with.

Trait Implementations§

Source§

impl IPlatformGraphics for FerroNativeGlPlatformGraphics

Source§

fn create_context(&self) -> Rc<dyn IPlatformGraphicsContext>

A new context of the display, which shares nothing with the shared context, as in the original.

§Panics

Panics when the native display cannot create a context.

Source§

fn uses_shared_context(&self) -> bool

Whether the backend renders through one context shared by all surfaces.
Source§

fn get_shared_context(&self) -> Rc<dyn IPlatformGraphicsContext>

The shared graphics context; only valid when uses_shared_context is true.
Source§

fn as_feature_provider(&self) -> Option<&dyn IOptionalFeatureProvider>

Optional features of the graphics API, if the implementation provides any.
Source§

impl Send for FerroNativeGlPlatformGraphics

Source§

impl Sync for FerroNativeGlPlatformGraphics

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> IUnknownImpl for T
where T: ?Sized,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.