1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
pub const FPS_UPPER_LIMIT: u32 = 200;
pub const FPS_LOWER_LIMIT: u32 = 1;
pub const FPS_DEFAULT: u32 = 30;
pub type __uint32_t = libc::c_uint;
pub type Uint32 = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct FPSmanager {
pub framecount: Uint32,
pub rateticks: f32,
pub baseticks: Uint32,
pub lastticks: Uint32,
pub rate: Uint32,
}
#[test]
fn bindgen_test_layout_FPSmanager() {
assert_eq!(
::core::mem::size_of::<FPSmanager>(),
20usize,
concat!("Size of: ", stringify!(FPSmanager))
);
assert_eq!(
::core::mem::align_of::<FPSmanager>(),
4usize,
concat!("Alignment of ", stringify!(FPSmanager))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<FPSmanager>())).framecount as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(FPSmanager),
"::",
stringify!(framecount)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<FPSmanager>())).rateticks as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(FPSmanager),
"::",
stringify!(rateticks)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<FPSmanager>())).baseticks as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(FPSmanager),
"::",
stringify!(baseticks)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<FPSmanager>())).lastticks as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(FPSmanager),
"::",
stringify!(lastticks)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<FPSmanager>())).rate as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(FPSmanager),
"::",
stringify!(rate)
)
);
}
extern "C" {
pub fn SDL_initFramerate(manager: *mut FPSmanager);
}
extern "C" {
pub fn SDL_setFramerate(manager: *mut FPSmanager, rate: Uint32) -> libc::c_int;
}
extern "C" {
pub fn SDL_getFramerate(manager: *mut FPSmanager) -> libc::c_int;
}
extern "C" {
pub fn SDL_getFramecount(manager: *mut FPSmanager) -> libc::c_int;
}
extern "C" {
pub fn SDL_framerateDelay(manager: *mut FPSmanager) -> Uint32;
}