pub struct DisplayConfig {
pub mode: VideoMode,
pub resolution: Resolution,
pub offset: (i16, i16),
}Expand description
Video standard, resolution and picture position, as one value.
use psx_gpu::display::{DisplayConfig, Resolution, VideoMode};
let centred = DisplayConfig::new(VideoMode::Ntsc, Resolution::R320X240);
let nudged = centred.with_offset((4, -2));
assert_eq!(nudged.offset, (4, -2));Fields§
§mode: VideoModeVideo standard.
resolution: ResolutionResolution.
offset: (i16, i16)Picture shift from the standard position: pixels right, scanlines down. It moves the picture in the TV signal (GP1(06h) and GP1(07h)), the way period games recentred an image inside a CRT’s overscan; VRAM and the draw offset are untouched. The window never starts before the blanking edge.
Implementations§
Source§impl DisplayConfig
impl DisplayConfig
Sourcepub const fn new(mode: VideoMode, resolution: Resolution) -> Self
pub const fn new(mode: VideoMode, resolution: Resolution) -> Self
The standard, centred picture for mode and resolution.
Sourcepub const fn with_offset(self, offset: (i16, i16)) -> Self
pub const fn with_offset(self, offset: (i16, i16)) -> Self
The same display with the picture shifted by offset.
Trait Implementations§
Source§impl Clone for DisplayConfig
impl Clone for DisplayConfig
Source§fn clone(&self) -> DisplayConfig
fn clone(&self) -> DisplayConfig
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DisplayConfig
impl Debug for DisplayConfig
Source§impl Hash for DisplayConfig
impl Hash for DisplayConfig
Source§impl PartialEq for DisplayConfig
impl PartialEq for DisplayConfig
impl Copy for DisplayConfig
impl Eq for DisplayConfig
impl StructuralPartialEq for DisplayConfig
Auto Trait Implementations§
impl Freeze for DisplayConfig
impl RefUnwindSafe for DisplayConfig
impl Send for DisplayConfig
impl Sync for DisplayConfig
impl Unpin for DisplayConfig
impl UnsafeUnpin for DisplayConfig
impl UnwindSafe for DisplayConfig
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)