Trait ctru::services::gfx::Swap

source ·
pub trait Swap: Sealed {
    // Required methods
    fn swap_buffers(&mut self);
    fn set_double_buffering(&mut self, enabled: bool);
}
Expand description

Trait for screens that can have its frame buffers swapped, when double buffering is enabled.

This trait applies to all Screens that have swappable frame buffers.

Required Methods§

source

fn swap_buffers(&mut self)

Swaps the video buffers.

Even if double buffering is disabled, “swapping” the buffers has the side effect of committing any configuration changes to the buffers (e.g. TopScreen::set_wide_mode(), Screen::set_framebuffer_format(), Swap::set_double_buffering()), so it should still be used.

This should be called once per frame at most.

source

fn set_double_buffering(&mut self, enabled: bool)

Set whether to use double buffering.

§Notes

Double buffering is enabled by default. Swap::swap_buffers must be called after this function for the configuration change to take effect.

Implementors§