sfml_types/
lib.rs

1/*
2* Rust-SFML - Copyright (c) 2013 Letang Jeremy.
3*
4* The original software, SFML library, is provided by Laurent Gomila.
5*
6* This software is provided 'as-is', without any express or implied warranty.
7* In no event will the authors be held liable for any damages arising from
8* the use of this software.
9*
10* Permission is granted to anyone to use this software for any purpose,
11* including commercial applications, and to alter it and redistribute it
12* freely, subject to the following restrictions:
13*
14* 1. The origin of this software must not be misrepresented; you must not claim
15*    that you wrote the original software. If you use this software in a product,
16*    an acknowledgment in the product documentation would be appreciated but is
17*    not required.
18*
19* 2. Altered source versions must be plainly marked as such, and must not be
20*    misrepresented as being the original software.
21*
22* 3. This notice may not be removed or altered from any source distribution.
23*/
24
25mod vector2;
26mod vector3;
27mod rect;
28
29pub use vector2::*;
30pub use vector3::*;
31pub use rect::{Rect, FloatRect, IntRect};
32
33#[repr(C)]
34#[derive(PartialEq, Eq, Clone, Copy)]
35pub enum sfBool {
36    SFFALSE = 0,
37    SFTRUE = 1
38}
39
40impl sfBool {
41    #[inline(always)]
42    pub fn to_bool(&self) -> bool {
43        match *self {
44            sfBool::SFFALSE => false,
45            sfBool::SFTRUE => true
46        }
47    }
48
49    #[inline(always)]
50    pub fn from_bool(b: bool) -> sfBool {
51        match b {
52            true => sfBool::SFTRUE,
53            false => sfBool::SFFALSE
54        }
55    }
56}