allegro_sys/
timer.rs

1// Copyright (c) 2014 by SiegeLord
2//
3// All rights reserved. Distributed under ZLib. For full terms see the file LICENSE.
4
5use crate::events::ALLEGRO_EVENT_SOURCE;
6
7use allegro_util::c_bool;
8use libc::*;
9
10allegro_util::opaque!(ALLEGRO_TIMER);
11
12unsafe extern "C" {
13	pub fn al_create_timer(speed_secs: c_double) -> *mut ALLEGRO_TIMER;
14	pub fn al_destroy_timer(timer: *mut ALLEGRO_TIMER);
15	pub fn al_start_timer(timer: *mut ALLEGRO_TIMER);
16	pub fn al_stop_timer(timer: *mut ALLEGRO_TIMER);
17	pub fn al_get_timer_started(timer: *const ALLEGRO_TIMER) -> c_bool;
18	pub fn al_get_timer_speed(timer: *const ALLEGRO_TIMER) -> c_double;
19	pub fn al_set_timer_speed(timer: *mut ALLEGRO_TIMER, speed_secs: c_double);
20	pub fn al_get_timer_count(timer: *const ALLEGRO_TIMER) -> i64;
21	pub fn al_set_timer_count(timer: *mut ALLEGRO_TIMER, count: i64);
22	pub fn al_add_timer_count(timer: *mut ALLEGRO_TIMER, diff: i64);
23	pub fn al_get_timer_event_source(timer: *mut ALLEGRO_TIMER) -> *mut ALLEGRO_EVENT_SOURCE;
24}