Skip to content

Commit

Permalink
From trait for WindowPos
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRadioGuy committed May 21, 2020
1 parent 3c6e104 commit 3046f9b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sdl2/video.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,12 @@ pub enum WindowPos {
Positioned(i32)
}

impl From<i32> for WindowPos {
fn from(pos: i32) -> Self {
WindowPos::Positioned(pos)
}
}

fn to_ll_windowpos (pos: WindowPos) -> c_int {
match pos {
WindowPos::Undefined => sys::SDL_WINDOWPOS_UNDEFINED_MASK as c_int,
Expand Down

0 comments on commit 3046f9b

Please sign in to comment.