Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

TextureWindow

Struct TextureWindow 

Source
pub struct TextureWindow { /* private fields */ }
Expand description

GP0(E2) texture-window state.

Mask and offset values are stored in the hardware’s 8-texel units. TextureWindow::NONE is a no-op window. Non-zero masks let a primitive repeat a sub-rectangle of the active tpage without physically duplicating texels in VRAM.

Implementations§

Source§

impl TextureWindow

Source

pub const NONE: Self

No texture window.

Source

pub const fn new(mask_x: u8, mask_y: u8, offset_x: u8, offset_y: u8) -> Self

Build from raw GP0(E2) fields. Each value must fit in 5 bits.

Source

pub const fn power_of_two_tile( origin_x: u8, origin_y: u8, size_x: u8, size_y: u8, ) -> Self

Build a window for a power-of-two tile.

origin_* and size_* are in texels. Each origin must align to its tile size because GP0(E2) replaces the coordinate bits selected by the mask. The complete tile must fit in the active 256x256 texture page.

Source

pub const fn word(self) -> u32

Encoded GP0(E2) word.

Source

pub const fn origin_texels(self) -> [u8; 2]

Texture-page origin selected by this window, in texels.

Power-of-two atlas placements use the raw offset fields as their aligned page-local origin. Exposing it lets a cooker-proven surface address the same texels directly and omit GP0(E2) from its packets.

Trait Implementations§

Source§

impl Clone for TextureWindow

Source§

fn clone(&self) -> TextureWindow

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TextureWindow

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for TextureWindow

Source§

fn eq(&self, other: &TextureWindow) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for TextureWindow

Source§

impl Eq for TextureWindow

Source§

impl StructuralPartialEq for TextureWindow

Auto Trait Implementations§

§

impl Freeze for TextureWindow

§

impl RefUnwindSafe for TextureWindow

§

impl Send for TextureWindow

§

impl Sync for TextureWindow

§

impl Unpin for TextureWindow

§

impl UnsafeUnpin for TextureWindow

§

impl UnwindSafe for TextureWindow

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> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.