Struct ctru::services::gfx::TopScreen3D

source ·
pub struct TopScreen3D<'screen> { /* private fields */ }
Expand description

The top LCD screen set in stereoscopic 3D mode.

A helper container for both sides of the top screen. Once the TopScreen is converted into this, 3D mode will be enabled until this struct is dropped.

Implementations§

source§

impl TopScreen3D<'_>

source

pub fn split(&self) -> (Ref<'_, TopScreenLeft>, Ref<'_, TopScreenRight>)

Immutably borrow the two sides of the screen as (left, right).

source

pub fn split_mut( &self ) -> (RefMut<'_, TopScreenLeft>, RefMut<'_, TopScreenRight>)

Mutably borrow the two sides of the screen as (left, right).

Trait Implementations§

source§

impl Drop for TopScreen3D<'_>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Flush for TopScreen3D<'_>

source§

fn flush_buffers(&mut self)

Unlike most other implementations of Flush, this flushes the buffers for both the left and right sides of the top screen.

source§

impl<'screen> From<&'screen RefCell<TopScreen>> for TopScreen3D<'screen>

Convert the TopScreen into a TopScreen3D and activate stereoscopic 3D.

§Example

use ctru::services::gfx::{Gfx, TopScreen, TopScreen3D};
let gfx = Gfx::new()?;

let mut top_screen = TopScreen3D::from(&gfx.top_screen);

let (left, right) = top_screen.split_mut();

// Rendering must be done twice for each side
// (with a slight variation in perspective to simulate the eye-to-eye distance).
render(left);
render(right);
source§

fn from(top_screen: &'screen RefCell<TopScreen>) -> Self

Converts to this type from the input type.
source§

impl Swap for TopScreen3D<'_>

source§

fn swap_buffers(&mut self)

Swaps the video buffers. Read more
source§

fn set_double_buffering(&mut self, enabled: bool)

Set whether to use double buffering. Read more

Auto Trait Implementations§

§

impl<'screen> !RefUnwindSafe for TopScreen3D<'screen>

§

impl<'screen> !Send for TopScreen3D<'screen>

§

impl<'screen> !Sync for TopScreen3D<'screen>

§

impl<'screen> Unpin for TopScreen3D<'screen>

§

impl<'screen> !UnwindSafe for TopScreen3D<'screen>

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.