mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
surface.rs: added get_pitch, changed width and height casts to int.
This commit is contained in:
+9
-5
@@ -120,15 +120,19 @@ impl Surface {
|
||||
}
|
||||
|
||||
//TODO: From Data
|
||||
pub fn get_width(&self) -> u16 {
|
||||
unsafe { (*self.raw).w as u16 }
|
||||
pub fn get_width(&self) -> int {
|
||||
unsafe { (*self.raw).w as int }
|
||||
}
|
||||
|
||||
pub fn get_height(&self) -> u16 {
|
||||
unsafe { (*self.raw).h as u16 }
|
||||
pub fn get_height(&self) -> int {
|
||||
unsafe { (*self.raw).h as int }
|
||||
}
|
||||
|
||||
pub fn get_size(&self) -> (u16, u16) {
|
||||
pub fn get_pitch(&self) -> int {
|
||||
unsafe { (*self.raw).pitch as int }
|
||||
}
|
||||
|
||||
pub fn get_size(&self) -> (int, int) {
|
||||
(self.get_width(), self.get_height())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user