allegro_sys/
transformations.rs

1// Copyright (c) 2014 by SiegeLord
2//
3// All rights reserved. Distributed under ZLib. For full terms see the file LICENSE.
4
5use libc::*;
6
7#[repr(C)]
8#[derive(PartialEq, Copy, Clone, Debug, PartialOrd)]
9pub struct ALLEGRO_TRANSFORM
10{
11	pub m: [[c_float; 4]; 4],
12}
13
14unsafe extern "C" {
15	pub fn al_use_transform(trans: *const ALLEGRO_TRANSFORM);
16	pub fn al_use_projection_transform(trans: *const ALLEGRO_TRANSFORM);
17	pub fn al_copy_transform(dest: *mut ALLEGRO_TRANSFORM, src: *const ALLEGRO_TRANSFORM);
18	pub fn al_identity_transform(trans: *mut ALLEGRO_TRANSFORM);
19	pub fn al_build_transform(
20		trans: *mut ALLEGRO_TRANSFORM, x: c_float, y: c_float, sx: c_float, sy: c_float,
21		theta: c_float,
22	);
23	pub fn al_translate_transform(trans: *mut ALLEGRO_TRANSFORM, x: c_float, y: c_float);
24	pub fn al_rotate_transform(trans: *mut ALLEGRO_TRANSFORM, theta: c_float);
25	pub fn al_scale_transform(trans: *mut ALLEGRO_TRANSFORM, sx: c_float, sy: c_float);
26	pub fn al_transform_coordinates(
27		trans: *const ALLEGRO_TRANSFORM, x: *mut c_float, y: *mut c_float,
28	);
29	pub fn al_compose_transform(trans: *mut ALLEGRO_TRANSFORM, other: *const ALLEGRO_TRANSFORM);
30	pub fn al_get_current_transform() -> *const ALLEGRO_TRANSFORM;
31	pub fn al_invert_transform(trans: *mut ALLEGRO_TRANSFORM);
32	pub fn al_check_inverse(trans: *const ALLEGRO_TRANSFORM, tol: c_float) -> c_int;
33}