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
#![allow(non_camel_case_types, non_snake_case)]
extern crate libc;
use libc::{c_longlong, c_float, c_int, c_void};
pub enum sfClock {}
extern "C" {
pub fn sfClock_create() -> *mut sfClock;
pub fn sfClock_copy(clock: *mut sfClock) -> *mut sfClock;
pub fn sfClock_destroy(clock: *mut sfClock);
pub fn sfClock_getElapsedTime(clock: *mut sfClock) -> sfTime;
pub fn sfClock_restart(clock: *mut sfClock) -> sfTime;
pub fn sfSleep(duration: sfTime);
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct sfTime {
microseconds: c_longlong
}
extern "C" {
pub fn sfTime_asSeconds(time: sfTime) -> c_float;
pub fn sfTime_asMilliseconds(time: sfTime) -> c_int;
pub fn sfTime_asMicroseconds(time: sfTime) -> c_longlong;
pub fn sfSeconds(amount: c_float) -> sfTime;
pub fn sfMilliseconds(amount: c_int) -> sfTime;
pub fn sfMicroseconds(amount: c_longlong) -> sfTime;
}
#[repr(C)]
pub struct sfInputStream {
pub read: extern fn (*mut c_void, c_longlong, *mut c_void) -> c_longlong,
pub seek: extern fn(c_longlong, *mut c_void) -> c_longlong,
pub tell: extern fn(*mut c_void) -> c_longlong,
pub getSize: extern fn(*mut c_void) -> c_longlong,
pub userData: *mut c_void
}