pub struct FPoint { /* private fields */ }Expand description
Immutable point type with float precision, consisting of x and y.
Implementations§
Source§impl FPoint
impl FPoint
pub fn from_ll(raw: SDL_FPoint) -> FPoint
pub fn raw_slice(slice: &[FPoint]) -> *const SDL_FPoint
pub fn raw(&self) -> *const SDL_FPoint
Sourcepub fn offset(self, x: f32, y: f32) -> FPoint
pub fn offset(self, x: f32, y: f32) -> FPoint
Returns a new point by shifting this point’s coordinates by the given x and y values.
Trait Implementations§
Source§impl AddAssign for FPoint
impl AddAssign for FPoint
Source§fn add_assign(&mut self, rhs: FPoint)
fn add_assign(&mut self, rhs: FPoint)
Performs the
+= operation. Read moreSource§impl AsMut<SDL_FPoint> for FPoint
impl AsMut<SDL_FPoint> for FPoint
Source§fn as_mut(&mut self) -> &mut SDL_FPoint
fn as_mut(&mut self) -> &mut SDL_FPoint
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl AsRef<SDL_FPoint> for FPoint
impl AsRef<SDL_FPoint> for FPoint
Source§fn as_ref(&self) -> &SDL_FPoint
fn as_ref(&self) -> &SDL_FPoint
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl DerefMut for FPoint
impl DerefMut for FPoint
Source§fn deref_mut(&mut self) -> &mut SDL_FPoint
fn deref_mut(&mut self) -> &mut SDL_FPoint
§Example
use sdl2::rect::FPoint;
let mut point = FPoint::new(2.0, 3.0);
point.x = 4.0;
assert_eq!(4.0, point.x);Source§impl DivAssign<f32> for FPoint
impl DivAssign<f32> for FPoint
Source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
Performs the
/= operation. Read moreSource§impl From<FPoint> for SDL_FPoint
impl From<FPoint> for SDL_FPoint
Source§impl From<SDL_FPoint> for FPoint
impl From<SDL_FPoint> for FPoint
Source§fn from(prim: SDL_FPoint) -> FPoint
fn from(prim: SDL_FPoint) -> FPoint
Converts to this type from the input type.
Source§impl MulAssign<f32> for FPoint
impl MulAssign<f32> for FPoint
Source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
Performs the
*= operation. Read moreSource§impl SubAssign for FPoint
impl SubAssign for FPoint
Source§fn sub_assign(&mut self, rhs: FPoint)
fn sub_assign(&mut self, rhs: FPoint)
Performs the
-= operation. Read moreSource§impl Deref for FPoint
impl Deref for FPoint
Source§fn deref(&self) -> &SDL_FPoint
fn deref(&self) -> &SDL_FPoint
§Example
use sdl2::rect::FPoint;
let point = FPoint::new(2.0, 3.0);
assert_eq!(2.0, point.x);Source§type Target = SDL_FPoint
type Target = SDL_FPoint
The resulting type after dereferencing.
impl Copy for FPoint
Auto Trait Implementations§
impl Freeze for FPoint
impl RefUnwindSafe for FPoint
impl Send for FPoint
impl Sync for FPoint
impl Unpin for FPoint
impl UnwindSafe for FPoint
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more