new stuff
This commit is contained in:
parent
8998bc3936
commit
64c8492e5c
6907 changed files with 3401899 additions and 0 deletions
10
assimp/port/assimp_rs/Cargo.toml
Normal file
10
assimp/port/assimp_rs/Cargo.toml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[package]
|
||||
name = "assimp_rs"
|
||||
version = "0.1.0"
|
||||
authors = ["David Golembiowski <dmgolembiowski@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[build-dependencies]
|
||||
bindgen = "*"
|
||||
40
assimp/port/assimp_rs/build.rs
Normal file
40
assimp/port/assimp_rs/build.rs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
extern crate bindgen;
|
||||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
// Rerun if wrapper header changes
|
||||
println!("cargo:rerun-if-changed=./src/assimp_wrapper.h");
|
||||
|
||||
// Tell cargo to look for shared libraries in the specified directory
|
||||
println!("cargo:rustc-link-search=../../bin/");
|
||||
|
||||
// Tell cargo to tell rustc to link the assimp shared library.
|
||||
println!("cargo:rustc-link-lib=assimp");
|
||||
|
||||
// The bindgen::Builder is the main entry point
|
||||
// to bindgen, and lets you build up options for
|
||||
// the resulting bindings.
|
||||
let bindings = bindgen::Builder::default()
|
||||
// The input header we would like to generate
|
||||
// bindings for.
|
||||
.header("./src/assimp_wrapper.h").clang_arg("-I../../include/")
|
||||
// Tell cargo to invalidate the built crate whenever any of the
|
||||
// included header files changed.
|
||||
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
|
||||
.blocklist_item("FP_ZERO")
|
||||
.blocklist_item("FP_SUBNORMAL")
|
||||
.blocklist_item("FP_NORMAL")
|
||||
.blocklist_item("FP_INFINITE")
|
||||
.blocklist_item("FP_NAN")
|
||||
// Finish the builder and generate the bindings.
|
||||
.generate()
|
||||
// Unwrap the Result and panic on failure.
|
||||
.expect("Unable to generate bindings");
|
||||
|
||||
// Write the bindings to the $OUT_DIR/bindings.rs file.
|
||||
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
bindings
|
||||
.write_to_file(out_path.join("bindings.rs"))
|
||||
.expect("Couldn't write bindings!");
|
||||
}
|
||||
48
assimp/port/assimp_rs/src/assimp_wrapper.h
Normal file
48
assimp/port/assimp_rs/src/assimp_wrapper.h
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#ifndef ASSIMP_WRAPPER_H_INC
|
||||
#define ASSIMP_WRAPPER_H_INC
|
||||
|
||||
#include <assimp/defs.h>
|
||||
#include <assimp/camera.h>
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/types.h>
|
||||
#include <assimp/vector3.h>
|
||||
#include <assimp/matrix4x4.h>
|
||||
#include <assimp/quaternion.h>
|
||||
#include <assimp/color4.h>
|
||||
#include <assimp/mesh.h>
|
||||
#include <assimp/anim.h>
|
||||
#include <assimp/metadata.h>
|
||||
#include <assimp/light.h>
|
||||
#include <assimp/material.h>
|
||||
#include <assimp/texture.h>
|
||||
#include <assimp/postprocess.h>
|
||||
#include <assimp/version.h>
|
||||
#include <assimp/importerdesc.h>
|
||||
#include <assimp/aabb.h>
|
||||
#include <assimp/anim.h>
|
||||
#include <assimp/camera.h>
|
||||
#include <assimp/cexport.h>
|
||||
#include <assimp/cfileio.h>
|
||||
#include <assimp/cimport.h>
|
||||
#include <assimp/color4.h>
|
||||
#include <assimp/commonMetaData.h>
|
||||
#include <assimp/defs.h>
|
||||
#include <assimp/importerdesc.h>
|
||||
#include <assimp/light.h>
|
||||
#include <assimp/material.h>
|
||||
#include <assimp/matrix3x3.h>
|
||||
#include <assimp/matrix4x4.h>
|
||||
#include <assimp/mesh.h>
|
||||
#include <assimp/metadata.h>
|
||||
#include <assimp/pbrmaterial.h>
|
||||
#include <assimp/postprocess.h>
|
||||
#include <assimp/quaternion.h>
|
||||
#include <assimp/revision.h>
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/texture.h>
|
||||
#include <assimp/types.h>
|
||||
#include <assimp/vector2.h>
|
||||
#include <assimp/vector3.h>
|
||||
#include <assimp/version.h>
|
||||
|
||||
#endif // ASSIMP_WRAPPER_H_INC
|
||||
21
assimp/port/assimp_rs/src/lib.rs
Normal file
21
assimp/port/assimp_rs/src/lib.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
#![allow(non_upper_case_globals)]
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn import_test() {
|
||||
unsafe {
|
||||
use crate::aiImportFile;
|
||||
let mut file: *mut dyn const i8 = std::ptr::null_mut();
|
||||
//let file = String::from("test.obj");
|
||||
//let (ptr, len, cap) = file.into_raw_parts();
|
||||
//let raw_file = unsafe{String::from_raw_parts}
|
||||
let asset = aiImportFile(file, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue