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<'_>
impl TopScreen3D<'_>
sourcepub fn split(&self) -> (Ref<'_, TopScreenLeft>, Ref<'_, TopScreenRight>)
pub fn split(&self) -> (Ref<'_, TopScreenLeft>, Ref<'_, TopScreenRight>)
Immutably borrow the two sides of the screen as (left, right)
.
sourcepub fn split_mut(
&self
) -> (RefMut<'_, TopScreenLeft>, RefMut<'_, TopScreenRight>)
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<'_>
impl Drop for TopScreen3D<'_>
source§impl Flush for TopScreen3D<'_>
impl Flush for TopScreen3D<'_>
source§fn flush_buffers(&mut self)
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>
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§impl Swap for TopScreen3D<'_>
impl Swap for TopScreen3D<'_>
source§fn swap_buffers(&mut self)
fn swap_buffers(&mut self)
Swaps the video buffers. Read more
source§fn set_double_buffering(&mut self, enabled: bool)
fn set_double_buffering(&mut self, enabled: bool)
Set whether to use double buffering. Read more