Converted SDL_gfx to autogenerated bindings

Renamed the binding files to be consistent.
The build script could probably benefit from a good cleanup.
Closes #647
This commit is contained in:
Jon Emil Jahren
2018-04-02 10:41:23 +02:00
parent a27c3c62a5
commit 0aab5ef28a
18 changed files with 1236 additions and 627 deletions

View File

@@ -279,17 +279,29 @@ fn main() {
fn copy_pregenerated_bindings() {
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
let crate_path = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
fs::copy(crate_path.join("pregenerated_bindings.rs"), out_path.join("bindings.rs"))
fs::copy(crate_path.join("sdl_bindings.rs"), out_path.join("sdl_bindings.rs"))
.expect("Couldn't find pregenerated bindings!");
fs::copy(crate_path.join("sdl_image_bindings.rs"), out_path.join("image_bindings.rs"))
fs::copy(crate_path.join("sdl_image_bindings.rs"), out_path.join("sdl_image_bindings.rs"))
.expect("Couldn't find pregenerated SDL_image bindings!");
fs::copy(crate_path.join("sdl_ttf_bindings.rs"), out_path.join("ttf_bindings.rs"))
fs::copy(crate_path.join("sdl_ttf_bindings.rs"), out_path.join("sdl_ttf_bindings.rs"))
.expect("Couldn't find pregenerated SDL_ttf bindings!");
fs::copy(crate_path.join("sdl_mixer_bindings.rs"), out_path.join("mixer_bindings.rs"))
fs::copy(crate_path.join("sdl_mixer_bindings.rs"), out_path.join("sdl_mixer_bindings.rs"))
.expect("Couldn't find pregenerated SDL_mixer bindings!");
fs::copy(crate_path.join("sdl_gfx_framerate_bindings.rs"), out_path.join("sdl_gfx_framerate_bindings.rs"))
.expect("Couldn't find pregenerated SDL_gfx framerate bindings!");
fs::copy(crate_path.join("sdl_gfx_primitives_bindings.rs"), out_path.join("sdl_gfx_primitives_bindings.rs"))
.expect("Couldn't find pregenerated SDL_gfx primitives bindings!");
fs::copy(crate_path.join("sdl_gfx_imagefilter_bindings.rs"), out_path.join("sdl_gfx_imagefilter_bindings.rs"))
.expect("Couldn't find pregenerated SDL_gfx imagefilter bindings!");
fs::copy(crate_path.join("sdl_gfx_rotozoom_bindings.rs"), out_path.join("sdl_gfx_rotozoom_bindings.rs"))
.expect("Couldn't find pregenerated SDL_gfx rotozoom bindings!");
}
#[cfg(feature = "bindgen")]
@@ -301,6 +313,10 @@ fn generate_bindings<S: AsRef<str> + ::std::fmt::Debug>(target: &str, host: &str
let mut image_bindings = bindgen::Builder::default();
let mut ttf_bindings = bindgen::Builder::default();
let mut mixer_bindings = bindgen::Builder::default();
let mut gfx_framerate_bindings = bindgen::Builder::default();
let mut gfx_primitives_bindings = bindgen::Builder::default();
let mut gfx_imagefilter_bindings = bindgen::Builder::default();
let mut gfx_rotozoom_bindings = bindgen::Builder::default();
// Set correct target triple for bindgen when cross-compiling
if target != host {
@@ -315,6 +331,18 @@ fn generate_bindings<S: AsRef<str> + ::std::fmt::Debug>(target: &str, host: &str
mixer_bindings = mixer_bindings.clang_arg("-target");
mixer_bindings = mixer_bindings.clang_arg(target.clone());
gfx_framerate_bindings = gfx_framerate_bindings.clang_arg("-target");
gfx_framerate_bindings = gfx_framerate_bindings.clang_arg(target.clone());
gfx_primitives_bindings = gfx_primitives_bindings.clang_arg("-target");
gfx_primitives_bindings = gfx_primitives_bindings.clang_arg(target.clone());
gfx_imagefilter_bindings = gfx_imagefilter_bindings.clang_arg("-target");
gfx_imagefilter_bindings = gfx_imagefilter_bindings.clang_arg(target.clone());
gfx_rotozoom_bindings = gfx_rotozoom_bindings.clang_arg("-target");
gfx_rotozoom_bindings = gfx_rotozoom_bindings.clang_arg(target.clone());
}
if headers_paths.len() == 0 {
@@ -326,6 +354,10 @@ fn generate_bindings<S: AsRef<str> + ::std::fmt::Debug>(target: &str, host: &str
image_bindings = image_bindings.clang_arg(format!("-I{}", include_path.display()));
ttf_bindings = ttf_bindings.clang_arg(format!("-I{}", include_path.display()));
mixer_bindings = mixer_bindings.clang_arg(format!("-I{}", include_path.display()));
gfx_framerate_bindings = gfx_framerate_bindings.clang_arg(format!("-I{}", include_path.display()));
gfx_primitives_bindings = gfx_primitives_bindings.clang_arg(format!("-I{}", include_path.display()));
gfx_imagefilter_bindings = gfx_imagefilter_bindings.clang_arg(format!("-I{}", include_path.display()));
gfx_rotozoom_bindings = gfx_rotozoom_bindings.clang_arg(format!("-I{}", include_path.display()));
} else {
// if paths are included, use them for bindgen. Bindgen should use the first one.
for headers_path in headers_paths {
@@ -333,6 +365,10 @@ fn generate_bindings<S: AsRef<str> + ::std::fmt::Debug>(target: &str, host: &str
image_bindings = image_bindings.clang_arg(format!("-I{}", headers_path.as_ref()));
ttf_bindings = ttf_bindings.clang_arg(format!("-I{}", headers_path.as_ref()));
mixer_bindings = mixer_bindings.clang_arg(format!("-I{}", headers_path.as_ref()));
gfx_framerate_bindings = gfx_framerate_bindings.clang_arg(format!("-I{}", headers_path.as_ref()));
gfx_primitives_bindings = gfx_primitives_bindings.clang_arg(format!("-I{}", headers_path.as_ref()));
gfx_imagefilter_bindings = gfx_imagefilter_bindings.clang_arg(format!("-I{}", headers_path.as_ref()));
gfx_rotozoom_bindings = gfx_rotozoom_bindings.clang_arg(format!("-I{}", headers_path.as_ref()));
}
}
@@ -360,6 +396,30 @@ fn generate_bindings<S: AsRef<str> + ::std::fmt::Debug>(target: &str, host: &str
mixer_bindings = mixer_bindings.clang_arg(format!("-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt"));
mixer_bindings = mixer_bindings.clang_arg(format!("-IC:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include"));
mixer_bindings = mixer_bindings.clang_arg(format!("-IC:/Program Files (x86)/Windows Kits/8.1/Include/um"));
gfx_framerate_bindings = gfx_framerate_bindings.clang_arg(format!("-IC:/Program Files (x86)/Windows Kits/8.1/Include/shared"));
gfx_framerate_bindings = gfx_framerate_bindings.clang_arg(format!("-IC:/Program Files/LLVM/lib/clang/5.0.0/include"));
gfx_framerate_bindings = gfx_framerate_bindings.clang_arg(format!("-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt"));
gfx_framerate_bindings = gfx_framerate_bindings.clang_arg(format!("-IC:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include"));
gfx_framerate_bindings = gfx_framerate_bindings.clang_arg(format!("-IC:/Program Files (x86)/Windows Kits/8.1/Include/um"));
gfx_primitives_bindings = gfx_primitives_bindings.clang_arg(format!("-IC:/Program Files (x86)/Windows Kits/8.1/Include/shared"));
gfx_primitives_bindings = gfx_primitives_bindings.clang_arg(format!("-IC:/Program Files/LLVM/lib/clang/5.0.0/include"));
gfx_primitives_bindings = gfx_primitives_bindings.clang_arg(format!("-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt"));
gfx_primitives_bindings = gfx_primitives_bindings.clang_arg(format!("-IC:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include"));
gfx_primitives_bindings = gfx_primitives_bindings.clang_arg(format!("-IC:/Program Files (x86)/Windows Kits/8.1/Include/um"));
gfx_imagefilter_bindings = gfx_imagefilter_bindings.clang_arg(format!("-IC:/Program Files (x86)/Windows Kits/8.1/Include/shared"));
gfx_imagefilter_bindings = gfx_imagefilter_bindings.clang_arg(format!("-IC:/Program Files/LLVM/lib/clang/5.0.0/include"));
gfx_imagefilter_bindings = gfx_imagefilter_bindings.clang_arg(format!("-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt"));
gfx_imagefilter_bindings = gfx_imagefilter_bindings.clang_arg(format!("-IC:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include"));
gfx_imagefilter_bindings = gfx_imagefilter_bindings.clang_arg(format!("-IC:/Program Files (x86)/Windows Kits/8.1/Include/um"));
gfx_rotozoom_bindings = gfx_rotozoom_bindings.clang_arg(format!("-IC:/Program Files (x86)/Windows Kits/8.1/Include/shared"));
gfx_rotozoom_bindings = gfx_rotozoom_bindings.clang_arg(format!("-IC:/Program Files/LLVM/lib/clang/5.0.0/include"));
gfx_rotozoom_bindings = gfx_rotozoom_bindings.clang_arg(format!("-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt"));
gfx_rotozoom_bindings = gfx_rotozoom_bindings.clang_arg(format!("-IC:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include"));
gfx_rotozoom_bindings = gfx_rotozoom_bindings.clang_arg(format!("-IC:/Program Files (x86)/Windows Kits/8.1/Include/um"));
};
// SDL2 hasn't a default configuration for Linux
@@ -372,6 +432,14 @@ fn generate_bindings<S: AsRef<str> + ::std::fmt::Debug>(target: &str, host: &str
ttf_bindings = ttf_bindings.clang_arg("-DSDL_VIDEO_DRIVER_WAYLAND");
mixer_bindings = mixer_bindings.clang_arg("-DSDL_VIDEO_DRIVER_X11");
mixer_bindings = mixer_bindings.clang_arg("-DSDL_VIDEO_DRIVER_WAYLAND");
gfx_framerate_bindings = gfx_framerate_bindings.clang_arg("-DSDL_VIDEO_DRIVER_X11");
gfx_framerate_bindings = gfx_framerate_bindings.clang_arg("-DSDL_VIDEO_DRIVER_WAYLAND");
gfx_primitives_bindings = gfx_primitives_bindings.clang_arg("-DSDL_VIDEO_DRIVER_X11");
gfx_primitives_bindings = gfx_primitives_bindings.clang_arg("-DSDL_VIDEO_DRIVER_WAYLAND");
gfx_imagefilter_bindings = gfx_imagefilter_bindings.clang_arg("-DSDL_VIDEO_DRIVER_X11");
gfx_imagefilter_bindings = gfx_imagefilter_bindings.clang_arg("-DSDL_VIDEO_DRIVER_WAYLAND");
gfx_rotozoom_bindings = gfx_rotozoom_bindings.clang_arg("-DSDL_VIDEO_DRIVER_X11");
gfx_rotozoom_bindings = gfx_rotozoom_bindings.clang_arg("-DSDL_VIDEO_DRIVER_WAYLAND");
}
let bindings = bindings
@@ -384,7 +452,7 @@ fn generate_bindings<S: AsRef<str> + ::std::fmt::Debug>(target: &str, host: &str
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("bindings.rs"))
.write_to_file(out_path.join("sdl_bindings.rs"))
.expect("Couldn't write bindings!");
let image_bindings = image_bindings
@@ -401,7 +469,7 @@ fn generate_bindings<S: AsRef<str> + ::std::fmt::Debug>(target: &str, host: &str
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
image_bindings
.write_to_file(out_path.join("image_bindings.rs"))
.write_to_file(out_path.join("sdl_image_bindings.rs"))
.expect("Couldn't write image_bindings!");
let ttf_bindings = ttf_bindings
@@ -417,7 +485,7 @@ fn generate_bindings<S: AsRef<str> + ::std::fmt::Debug>(target: &str, host: &str
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
ttf_bindings
.write_to_file(out_path.join("ttf_bindings.rs"))
.write_to_file(out_path.join("sdl_ttf_bindings.rs"))
.expect("Couldn't write ttf_bindings!");
let mixer_bindings = mixer_bindings
@@ -436,8 +504,84 @@ fn generate_bindings<S: AsRef<str> + ::std::fmt::Debug>(target: &str, host: &str
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
mixer_bindings
.write_to_file(out_path.join("mixer_bindings.rs"))
.write_to_file(out_path.join("sdl_mixer_bindings.rs"))
.expect("Couldn't write mixer_bindings!");
let gfx_framerate_bindings = gfx_framerate_bindings
.header("wrapper_gfx_framerate.h")
.whitelist_type("FPS.*")
.whitelist_function("SDL_.*rame.*")
.whitelist_var("FPS.*")
.blacklist_type("_IO.*|FILE")
.generate()
.expect("Unable to generate gfx_framerate_bindings!");
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
gfx_framerate_bindings
.write_to_file(out_path.join("sdl_gfx_framerate_bindings.rs"))
.expect("Couldn't write gfx_framerate_bindings!");
let gfx_primitives_bindings = gfx_primitives_bindings
.header("wrapper_gfx_primitives.h")
.blacklist_type("SDL_.*")
.whitelist_function("pixel.*")
.whitelist_function("rectangle.*")
.whitelist_function("rounded.*")
.whitelist_function("box.*")
.whitelist_function(".*line(Color|RGBA).*")
.whitelist_function("thick.*")
.whitelist_function(".*circle.*")
.whitelist_function("arc.*")
.whitelist_function("filled.*")
.whitelist_function(".*ellipse.*")
.whitelist_function("pie.*")
.whitelist_function(".*trigon.*")
.whitelist_function(".*polygon.*")
.whitelist_function("textured.*")
.whitelist_function("bezier.*")
.whitelist_function("character.*")
.whitelist_function("string.*")
.whitelist_function("gfx.*")
.blacklist_type("_IO.*|FILE")
.generate()
.expect("Unable to generate gfx_primitives_bindings!");
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
gfx_primitives_bindings
.write_to_file(out_path.join("sdl_gfx_primitives_bindings.rs"))
.expect("Couldn't write gfx_primitives_bindings!");
let gfx_imagefilter_bindings = gfx_imagefilter_bindings
.header("wrapper_gfx_imagefilter.h")
.whitelist_function("SDL_image.*")
.blacklist_type("_IO.*|FILE")
.generate()
.expect("Unable to generate gfx_imagefilter_bindings!");
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
gfx_imagefilter_bindings
.write_to_file(out_path.join("sdl_gfx_imagefilter_bindings.rs"))
.expect("Couldn't write gfx_imagefilter_bindings!");
let gfx_rotozoom_bindings = gfx_rotozoom_bindings
.header("wrapper_gfx_rotozoom.h")
.blacklist_type("SDL_.*")
.whitelist_function("rotozoom.*")
.whitelist_function("zoom.*")
.whitelist_function("shrink.*")
.whitelist_function("rotate.*")
.blacklist_type("_IO.*|FILE")
.generate()
.expect("Unable to generate gfx_rotozoom_bindings!");
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
gfx_rotozoom_bindings
.write_to_file(out_path.join("sdl_gfx_rotozoom_bindings.rs"))
.expect("Couldn't write gfx_rotozoom_bindings!");
}
fn get_os_from_triple(triple: &str) -> Option<&str>

View File

@@ -0,0 +1,94 @@
/* automatically generated by rust-bindgen */
pub const FPS_UPPER_LIMIT: u32 = 200;
pub const FPS_LOWER_LIMIT: u32 = 1;
pub const FPS_DEFAULT: u32 = 30;
pub type __uint32_t = ::std::os::raw::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!(
::std::mem::size_of::<FPSmanager>(),
20usize,
concat!("Size of: ", stringify!(FPSmanager))
);
assert_eq!(
::std::mem::align_of::<FPSmanager>(),
4usize,
concat!("Alignment of ", stringify!(FPSmanager))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<FPSmanager>())).framecount as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(FPSmanager),
"::",
stringify!(framecount)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<FPSmanager>())).rateticks as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(FPSmanager),
"::",
stringify!(rateticks)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<FPSmanager>())).baseticks as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(FPSmanager),
"::",
stringify!(baseticks)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<FPSmanager>())).lastticks as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(FPSmanager),
"::",
stringify!(lastticks)
)
);
assert_eq!(
unsafe { &(*(::std::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) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_getFramerate(manager: *mut FPSmanager) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_getFramecount(manager: *mut FPSmanager) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_framerateDelay(manager: *mut FPSmanager) -> Uint32;
}

View File

@@ -0,0 +1,231 @@
/* automatically generated by rust-bindgen */
extern "C" {
pub fn SDL_imageFilterMMXdetect() -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterMMXoff();
}
extern "C" {
pub fn SDL_imageFilterMMXon();
}
extern "C" {
pub fn SDL_imageFilterAdd(
Src1: *mut ::std::os::raw::c_uchar,
Src2: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterMean(
Src1: *mut ::std::os::raw::c_uchar,
Src2: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterSub(
Src1: *mut ::std::os::raw::c_uchar,
Src2: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterAbsDiff(
Src1: *mut ::std::os::raw::c_uchar,
Src2: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterMult(
Src1: *mut ::std::os::raw::c_uchar,
Src2: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterMultNor(
Src1: *mut ::std::os::raw::c_uchar,
Src2: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterMultDivby2(
Src1: *mut ::std::os::raw::c_uchar,
Src2: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterMultDivby4(
Src1: *mut ::std::os::raw::c_uchar,
Src2: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterBitAnd(
Src1: *mut ::std::os::raw::c_uchar,
Src2: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterBitOr(
Src1: *mut ::std::os::raw::c_uchar,
Src2: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterDiv(
Src1: *mut ::std::os::raw::c_uchar,
Src2: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterBitNegation(
Src1: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterAddByte(
Src1: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
C: ::std::os::raw::c_uchar,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterAddUint(
Src1: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
C: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterAddByteToHalf(
Src1: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
C: ::std::os::raw::c_uchar,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterSubByte(
Src1: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
C: ::std::os::raw::c_uchar,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterSubUint(
Src1: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
C: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterShiftRight(
Src1: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
N: ::std::os::raw::c_uchar,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterShiftRightUint(
Src1: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
N: ::std::os::raw::c_uchar,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterMultByByte(
Src1: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
C: ::std::os::raw::c_uchar,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterShiftRightAndMultByByte(
Src1: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
N: ::std::os::raw::c_uchar,
C: ::std::os::raw::c_uchar,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterShiftLeftByte(
Src1: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
N: ::std::os::raw::c_uchar,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterShiftLeftUint(
Src1: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
N: ::std::os::raw::c_uchar,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterShiftLeft(
Src1: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
N: ::std::os::raw::c_uchar,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterBinarizeUsingThreshold(
Src1: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
T: ::std::os::raw::c_uchar,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterClipToRange(
Src1: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
Tmin: ::std::os::raw::c_uchar,
Tmax: ::std::os::raw::c_uchar,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SDL_imageFilterNormalizeLinear(
Src: *mut ::std::os::raw::c_uchar,
Dest: *mut ::std::os::raw::c_uchar,
length: ::std::os::raw::c_uint,
Cmin: ::std::os::raw::c_int,
Cmax: ::std::os::raw::c_int,
Nmin: ::std::os::raw::c_int,
Nmax: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}

View File

@@ -0,0 +1,669 @@
/* automatically generated by rust-bindgen */
pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __int16_t = ::std::os::raw::c_short;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type Uint8 = u8;
pub type Sint16 = i16;
pub type Uint32 = u32;
extern "C" {
pub fn pixelColor(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn pixelRGBA(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn hlineColor(
renderer: *mut SDL_Renderer,
x1: Sint16,
x2: Sint16,
y: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn hlineRGBA(
renderer: *mut SDL_Renderer,
x1: Sint16,
x2: Sint16,
y: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn vlineColor(
renderer: *mut SDL_Renderer,
x: Sint16,
y1: Sint16,
y2: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn vlineRGBA(
renderer: *mut SDL_Renderer,
x: Sint16,
y1: Sint16,
y2: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn rectangleColor(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn rectangleRGBA(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn roundedRectangleColor(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
rad: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn roundedRectangleRGBA(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
rad: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn boxColor(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn boxRGBA(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn roundedBoxColor(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
rad: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn roundedBoxRGBA(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
rad: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn lineColor(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn lineRGBA(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn aalineColor(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn aalineRGBA(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn thickLineColor(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
width: Uint8,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn thickLineRGBA(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
width: Uint8,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn circleColor(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
rad: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn circleRGBA(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
rad: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn arcColor(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
rad: Sint16,
start: Sint16,
end: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn arcRGBA(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
rad: Sint16,
start: Sint16,
end: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn aacircleColor(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
rad: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn aacircleRGBA(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
rad: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn filledCircleColor(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
r: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn filledCircleRGBA(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
rad: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn ellipseColor(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
rx: Sint16,
ry: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn ellipseRGBA(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
rx: Sint16,
ry: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn aaellipseColor(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
rx: Sint16,
ry: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn aaellipseRGBA(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
rx: Sint16,
ry: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn filledEllipseColor(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
rx: Sint16,
ry: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn filledEllipseRGBA(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
rx: Sint16,
ry: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn pieColor(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
rad: Sint16,
start: Sint16,
end: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn pieRGBA(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
rad: Sint16,
start: Sint16,
end: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn filledPieColor(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
rad: Sint16,
start: Sint16,
end: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn filledPieRGBA(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
rad: Sint16,
start: Sint16,
end: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn trigonColor(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
x3: Sint16,
y3: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn trigonRGBA(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
x3: Sint16,
y3: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn aatrigonColor(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
x3: Sint16,
y3: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn aatrigonRGBA(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
x3: Sint16,
y3: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn filledTrigonColor(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
x3: Sint16,
y3: Sint16,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn filledTrigonRGBA(
renderer: *mut SDL_Renderer,
x1: Sint16,
y1: Sint16,
x2: Sint16,
y2: Sint16,
x3: Sint16,
y3: Sint16,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn polygonColor(
renderer: *mut SDL_Renderer,
vx: *const Sint16,
vy: *const Sint16,
n: ::std::os::raw::c_int,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn polygonRGBA(
renderer: *mut SDL_Renderer,
vx: *const Sint16,
vy: *const Sint16,
n: ::std::os::raw::c_int,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn aapolygonColor(
renderer: *mut SDL_Renderer,
vx: *const Sint16,
vy: *const Sint16,
n: ::std::os::raw::c_int,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn aapolygonRGBA(
renderer: *mut SDL_Renderer,
vx: *const Sint16,
vy: *const Sint16,
n: ::std::os::raw::c_int,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn filledPolygonColor(
renderer: *mut SDL_Renderer,
vx: *const Sint16,
vy: *const Sint16,
n: ::std::os::raw::c_int,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn filledPolygonRGBA(
renderer: *mut SDL_Renderer,
vx: *const Sint16,
vy: *const Sint16,
n: ::std::os::raw::c_int,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn texturedPolygon(
renderer: *mut SDL_Renderer,
vx: *const Sint16,
vy: *const Sint16,
n: ::std::os::raw::c_int,
texture: *mut SDL_Surface,
texture_dx: ::std::os::raw::c_int,
texture_dy: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bezierColor(
renderer: *mut SDL_Renderer,
vx: *const Sint16,
vy: *const Sint16,
n: ::std::os::raw::c_int,
s: ::std::os::raw::c_int,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bezierRGBA(
renderer: *mut SDL_Renderer,
vx: *const Sint16,
vy: *const Sint16,
n: ::std::os::raw::c_int,
s: ::std::os::raw::c_int,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn gfxPrimitivesSetFont(fontdata: *const ::std::os::raw::c_void, cw: Uint32, ch: Uint32);
}
extern "C" {
pub fn gfxPrimitivesSetFontRotation(rotation: Uint32);
}
extern "C" {
pub fn characterColor(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
c: ::std::os::raw::c_char,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn characterRGBA(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
c: ::std::os::raw::c_char,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn stringColor(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
s: *const ::std::os::raw::c_char,
color: Uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn stringRGBA(
renderer: *mut SDL_Renderer,
x: Sint16,
y: Sint16,
s: *const ::std::os::raw::c_char,
r: Uint8,
g: Uint8,
b: Uint8,
a: Uint8,
) -> ::std::os::raw::c_int;
}

View File

@@ -0,0 +1,75 @@
/* automatically generated by rust-bindgen */
pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type Uint8 = u8;
pub type Uint32 = u32;
extern "C" {
pub fn rotozoomSurface(
src: *mut SDL_Surface,
angle: f64,
zoom: f64,
smooth: ::std::os::raw::c_int,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn rotozoomSurfaceXY(
src: *mut SDL_Surface,
angle: f64,
zoomx: f64,
zoomy: f64,
smooth: ::std::os::raw::c_int,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn rotozoomSurfaceSize(
width: ::std::os::raw::c_int,
height: ::std::os::raw::c_int,
angle: f64,
zoom: f64,
dstwidth: *mut ::std::os::raw::c_int,
dstheight: *mut ::std::os::raw::c_int,
);
}
extern "C" {
pub fn rotozoomSurfaceSizeXY(
width: ::std::os::raw::c_int,
height: ::std::os::raw::c_int,
angle: f64,
zoomx: f64,
zoomy: f64,
dstwidth: *mut ::std::os::raw::c_int,
dstheight: *mut ::std::os::raw::c_int,
);
}
extern "C" {
pub fn zoomSurface(
src: *mut SDL_Surface,
zoomx: f64,
zoomy: f64,
smooth: ::std::os::raw::c_int,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn zoomSurfaceSize(
width: ::std::os::raw::c_int,
height: ::std::os::raw::c_int,
zoomx: f64,
zoomy: f64,
dstwidth: *mut ::std::os::raw::c_int,
dstheight: *mut ::std::os::raw::c_int,
);
}
extern "C" {
pub fn shrinkSurface(
src: *mut SDL_Surface,
factorx: ::std::os::raw::c_int,
factory: ::std::os::raw::c_int,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn rotateSurface90Degrees(
src: *mut SDL_Surface,
numClockwiseTurns: ::std::os::raw::c_int,
) -> *mut SDL_Surface;
}

View File

@@ -1,18 +1 @@
/* automatically generated by rust-bindgen */
use ::std::os::raw::*;
#[repr(C)]
pub struct FPSmanager {
pub framecount: c_uint,
pub rateticks: c_float,
pub baseticks: c_uint,
pub lastticks: c_uint,
pub rate: c_uint,
}
extern "C" {
pub fn SDL_initFramerate(manager: *mut FPSmanager);
pub fn SDL_setFramerate(manager: *mut FPSmanager, rate: c_uint) -> c_int;
pub fn SDL_getFramerate(manager: *mut FPSmanager) -> c_int;
pub fn SDL_getFramecount(manager: *mut FPSmanager) -> c_int;
pub fn SDL_framerateDelay(manager: *mut FPSmanager) -> c_uint;
}
include!(concat!(env!("OUT_DIR"), "/sdl_gfx_framerate_bindings.rs"));

View File

@@ -1,75 +1 @@
use ::std::os::raw::*;
extern "C" {
pub fn SDL_imageFilterMMXdetect() -> c_int;
pub fn SDL_imageFilterMMXoff();
pub fn SDL_imageFilterMMXon();
pub fn SDL_imageFilterAdd(Src1: *mut u8, Src2: *mut u8,
Dest: *mut u8, length: c_uint) -> c_int;
pub fn SDL_imageFilterMean(Src1: *mut u8, Src2: *mut u8,
Dest: *mut u8, length: c_uint) -> c_int;
pub fn SDL_imageFilterSub(Src1: *mut u8, Src2: *mut u8,
Dest: *mut u8, length: c_uint) -> c_int;
pub fn SDL_imageFilterAbsDiff(Src1: *mut u8, Src2: *mut u8,
Dest: *mut u8, length: c_uint) ->
c_int;
pub fn SDL_imageFilterMult(Src1: *mut u8, Src2: *mut u8,
Dest: *mut u8, length: c_uint) -> c_int;
pub fn SDL_imageFilterMultNor(Src1: *mut u8, Src2: *mut u8,
Dest: *mut u8, length: c_uint) ->
c_int;
pub fn SDL_imageFilterMultDivby2(Src1: *mut u8, Src2: *mut u8,
Dest: *mut u8, length: c_uint) ->
c_int;
pub fn SDL_imageFilterMultDivby4(Src1: *mut u8, Src2: *mut u8,
Dest: *mut u8, length: c_uint) ->
c_int;
pub fn SDL_imageFilterBitAnd(Src1: *mut u8, Src2: *mut u8,
Dest: *mut u8, length: c_uint) -> c_int;
pub fn SDL_imageFilterBitOr(Src1: *mut u8, Src2: *mut u8,
Dest: *mut u8, length: c_uint) -> c_int;
pub fn SDL_imageFilterDiv(Src1: *mut u8, Src2: *mut u8,
Dest: *mut u8, length: c_uint) -> c_int;
pub fn SDL_imageFilterBitNegation(Src1: *mut u8, Dest: *mut u8,
length: c_uint) -> c_int;
pub fn SDL_imageFilterAddByte(Src1: *mut u8, Dest: *mut u8,
length: c_uint, C: u8) -> c_int;
pub fn SDL_imageFilterAddUint(Src1: *mut u8, Dest: *mut u8,
length: c_uint, C: c_uint) -> c_int;
pub fn SDL_imageFilterAddByteToHalf(Src1: *mut u8,
Dest: *mut u8, length: c_uint,
C: u8) -> c_int;
pub fn SDL_imageFilterSubByte(Src1: *mut u8, Dest: *mut u8,
length: c_uint, C: u8) -> c_int;
pub fn SDL_imageFilterSubUint(Src1: *mut u8, Dest: *mut u8,
length: c_uint, C: c_uint) -> c_int;
pub fn SDL_imageFilterShiftRight(Src1: *mut u8, Dest: *mut u8,
length: c_uint, N: u8) -> c_int;
pub fn SDL_imageFilterShiftRightUint(Src1: *mut u8,
Dest: *mut u8, length: c_uint,
N: u8) -> c_int;
pub fn SDL_imageFilterMultByByte(Src1: *mut u8, Dest: *mut u8,
length: c_uint, C: u8) -> c_int;
pub fn SDL_imageFilterShiftRightAndMultByByte(Src1: *mut u8,
Dest: *mut u8,
length: c_uint, N: u8,
C: u8) -> c_int;
pub fn SDL_imageFilterShiftLeftByte(Src1: *mut u8,
Dest: *mut u8, length: c_uint,
N: u8) -> c_int;
pub fn SDL_imageFilterShiftLeftUint(Src1: *mut u8,
Dest: *mut u8, length: c_uint,
N: u8) -> c_int;
pub fn SDL_imageFilterShiftLeft(Src1: *mut u8, Dest: *mut u8,
length: c_uint, N: u8) -> c_int;
pub fn SDL_imageFilterBinarizeUsingThreshold(Src1: *mut u8,
Dest: *mut u8,
length: c_uint, T: u8)
-> c_int;
pub fn SDL_imageFilterClipToRange(Src1: *mut u8, Dest: *mut u8,
length: c_uint, Tmin: u8,
Tmax: u8) -> c_int;
pub fn SDL_imageFilterNormalizeLinear(Src: *mut u8,
Dest: *mut u8, length: c_uint,
Cmin: c_int, Cmax: c_int,
Nmin: c_int, Nmax: c_int) -> c_int;
}
include!(concat!(env!("OUT_DIR"), "/sdl_gfx_imagefilter_bindings.rs"));

View File

@@ -1,494 +1,2 @@
/* automatically generated by rust-bindgen */
use ::SDL_Renderer;
use ::SDL_Surface;
use ::std::os::raw::*;
extern "C" {
pub fn pixelColor(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
color: c_uint)
-> c_int;
pub fn pixelRGBA(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn hlineColor(renderer: *const SDL_Renderer,
x1: c_short,
x2: c_short,
y: c_short,
color: c_uint)
-> c_int;
pub fn hlineRGBA(renderer: *const SDL_Renderer,
x1: c_short,
x2: c_short,
y: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn vlineColor(renderer: *const SDL_Renderer,
x: c_short,
y1: c_short,
y2: c_short,
color: c_uint)
-> c_int;
pub fn vlineRGBA(renderer: *const SDL_Renderer,
x: c_short,
y1: c_short,
y2: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn rectangleColor(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
color: c_uint)
-> c_int;
pub fn rectangleRGBA(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn roundedRectangleColor(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
rad: c_short,
color: c_uint)
-> c_int;
pub fn roundedRectangleRGBA(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
rad: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn boxColor(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
color: c_uint)
-> c_int;
pub fn boxRGBA(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn roundedBoxColor(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
rad: c_short,
color: c_uint)
-> c_int;
pub fn roundedBoxRGBA(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
rad: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn lineColor(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
color: c_uint)
-> c_int;
pub fn lineRGBA(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn aalineColor(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
color: c_uint)
-> c_int;
pub fn aalineRGBA(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn thickLineColor(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
width: c_uchar,
color: c_uint)
-> c_int;
pub fn thickLineRGBA(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
width: c_uchar,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn circleColor(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
rad: c_short,
color: c_uint)
-> c_int;
pub fn circleRGBA(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
rad: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn arcColor(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
rad: c_short,
start: c_short,
end: c_short,
color: c_uint)
-> c_int;
pub fn arcRGBA(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
rad: c_short,
start: c_short,
end: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn aacircleColor(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
rad: c_short,
color: c_uint)
-> c_int;
pub fn aacircleRGBA(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
rad: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn filledCircleColor(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
r: c_short,
color: c_uint)
-> c_int;
pub fn filledCircleRGBA(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
rad: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn ellipseColor(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
rx: c_short,
ry: c_short,
color: c_uint)
-> c_int;
pub fn ellipseRGBA(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
rx: c_short,
ry: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn aaellipseColor(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
rx: c_short,
ry: c_short,
color: c_uint)
-> c_int;
pub fn aaellipseRGBA(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
rx: c_short,
ry: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn filledEllipseColor(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
rx: c_short,
ry: c_short,
color: c_uint)
-> c_int;
pub fn filledEllipseRGBA(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
rx: c_short,
ry: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn pieColor(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
rad: c_short,
start: c_short,
end: c_short,
color: c_uint)
-> c_int;
pub fn pieRGBA(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
rad: c_short,
start: c_short,
end: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn filledPieColor(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
rad: c_short,
start: c_short,
end: c_short,
color: c_uint)
-> c_int;
pub fn filledPieRGBA(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
rad: c_short,
start: c_short,
end: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn trigonColor(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
x3: c_short,
y3: c_short,
color: c_uint)
-> c_int;
pub fn trigonRGBA(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
x3: c_short,
y3: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn aatrigonColor(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
x3: c_short,
y3: c_short,
color: c_uint)
-> c_int;
pub fn aatrigonRGBA(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
x3: c_short,
y3: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn filledTrigonColor(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
x3: c_short,
y3: c_short,
color: c_uint)
-> c_int;
pub fn filledTrigonRGBA(renderer: *const SDL_Renderer,
x1: c_short,
y1: c_short,
x2: c_short,
y2: c_short,
x3: c_short,
y3: c_short,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn polygonColor(renderer: *const SDL_Renderer,
vx: *const c_short,
vy: *const c_short,
n: c_int,
color: c_uint)
-> c_int;
pub fn polygonRGBA(renderer: *const SDL_Renderer,
vx: *const c_short,
vy: *const c_short,
n: c_int,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn aapolygonColor(renderer: *const SDL_Renderer,
vx: *const c_short,
vy: *const c_short,
n: c_int,
color: c_uint)
-> c_int;
pub fn aapolygonRGBA(renderer: *const SDL_Renderer,
vx: *const c_short,
vy: *const c_short,
n: c_int,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn filledPolygonColor(renderer: *const SDL_Renderer,
vx: *const c_short,
vy: *const c_short,
n: c_int,
color: c_uint)
-> c_int;
pub fn filledPolygonRGBA(renderer: *const SDL_Renderer,
vx: *const c_short,
vy: *const c_short,
n: c_int,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn texturedPolygon(renderer: *const SDL_Renderer,
vx: *const c_short,
vy: *const c_short,
n: c_int,
texture: *mut SDL_Surface,
texture_dx: c_int,
texture_dy: c_int)
-> c_int;
pub fn bezierColor(renderer: *const SDL_Renderer,
vx: *const c_short,
vy: *const c_short,
n: c_int,
s: c_int,
color: c_uint)
-> c_int;
pub fn bezierRGBA(renderer: *const SDL_Renderer,
vx: *const c_short,
vy: *const c_short,
n: c_int,
s: c_int,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn gfxPrimitivesSetFont(fontdata: *const c_void, cw: c_uint, ch: c_uint);
pub fn gfxPrimitivesSetFontRotation(rotation: c_uint);
pub fn characterColor(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
c: c_char,
color: c_uint)
-> c_int;
pub fn characterRGBA(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
c: c_char,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
pub fn stringColor(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
s: *mut c_char,
color: c_uint)
-> c_int;
pub fn stringRGBA(renderer: *const SDL_Renderer,
x: c_short,
y: c_short,
s: *mut c_char,
r: c_uchar,
g: c_uchar,
b: c_uchar,
a: c_uchar)
-> c_int;
}
use ::*;
include!(concat!(env!("OUT_DIR"), "/sdl_gfx_primitives_bindings.rs"));

View File

@@ -1,28 +1,2 @@
/* automatically generated by rust-bindgen */
use ::SDL_Surface;
use ::std::os::raw::*;
extern "C" {
pub fn rotozoomSurface(src: *mut SDL_Surface, angle: c_double,
zoom: c_double, smooth: c_int) -> *mut SDL_Surface;
pub fn rotozoomSurfaceXY(src: *mut SDL_Surface, angle: c_double,
zoomx: c_double, zoomy: c_double, smooth: c_int)
-> *mut SDL_Surface;
pub fn rotozoomSurfaceSize(width: c_int, height: c_int, angle: c_double,
zoom: c_double, dstwidth: *mut c_int,
dstheight: *mut c_int);
pub fn rotozoomSurfaceSizeXY(width: c_int, height: c_int, angle: c_double,
zoomx: c_double, zoomy: c_double,
dstwidth: *mut c_int, dstheight: *mut c_int);
pub fn zoomSurface(src: *mut SDL_Surface, zoomx: c_double,
zoomy: c_double, smooth: c_int) -> *mut SDL_Surface;
pub fn zoomSurfaceSize(width: c_int, height: c_int, zoomx: c_double,
zoomy: c_double, dstwidth: *mut c_int,
dstheight: *mut c_int);
pub fn shrinkSurface(src: *mut SDL_Surface, factorx: c_int,
factory: c_int) -> *mut SDL_Surface;
pub fn rotateSurface90Degrees(src: *mut SDL_Surface,
numClockwiseTurns: c_int) ->
*mut SDL_Surface;
}
use ::*;
include!(concat!(env!("OUT_DIR"), "/sdl_gfx_rotozoom_bindings.rs"));

View File

@@ -1,2 +1,2 @@
use ::*;
include!(concat!(env!("OUT_DIR"), "/image_bindings.rs"));
include!(concat!(env!("OUT_DIR"), "/sdl_image_bindings.rs"));

View File

@@ -8,7 +8,7 @@
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
include!(concat!(env!("OUT_DIR"), "/sdl_bindings.rs"));
#[cfg(feature = "mixer")]
pub mod mixer;

View File

@@ -1,2 +1,2 @@
use ::*;
include!(concat!(env!("OUT_DIR"), "/mixer_bindings.rs"));
include!(concat!(env!("OUT_DIR"), "/sdl_mixer_bindings.rs"));

View File

@@ -1,2 +1,2 @@
use ::*;
include!(concat!(env!("OUT_DIR"), "/ttf_bindings.rs"));
include!(concat!(env!("OUT_DIR"), "/sdl_ttf_bindings.rs"));

View File

@@ -0,0 +1 @@
#include <SDL2/SDL2_framerate.h>

View File

@@ -0,0 +1 @@
#include <SDL2/SDL2_imageFilter.h>

View File

@@ -0,0 +1,2 @@
#include <SDL2/SDL2_gfxPrimitives_font.h>
#include <SDL2/SDL2_gfxPrimitives.h>

View File

@@ -0,0 +1 @@
#include <SDL2/SDL2_rotozoom.h>