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>
Convert the TopScreen into a TopScreen3D and activate stereoscopic 3D.
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