use crate::ode::*;
use std::ffi::{c_uint, c_int, c_char};
pub const DS_VERSION: c_int = 2;
pub enum DS_TEXTURE_NUMBER {
DS_NONE = 0,
DS_WOOD = 1,
DS_CHECKERED = 2,
DS_GROUND = 3,
DS_SKY = 4
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dsFunctions_C {
pub version: c_int,
pub start: Option<unsafe extern "C" fn()>,
pub step: Option<unsafe extern "C" fn(pause: c_int)>,
pub command: Option<unsafe extern "C" fn(cmd: c_int)>,
pub stop: Option<unsafe extern "C" fn()>,
pub path_to_textures: *const c_char
}
pub trait Tdrawstuff {
fn Debug(&self, msg: *const c_char); fn DrawBox(&self, pos: *const f32, rot: *const f32, lxyz: *const f32);
fn DrawBoxD(&self, pos: *const f64, rot: *const f64, lxyz: *const f64);
fn DrawCapsule(&self, pos: *const f32, rot: *const f32, l: f32, r: f32);
fn DrawCapsuleD(&self, pos: *const f64, rot: *const f64, l: f32, r: f32);
fn DrawConvex(&self, pos: *const f32, rot: *const f32,
planes: *const f32, planecount: c_uint,
points: *const f32, pointcount: c_uint,
polygons: *const c_uint);
fn DrawConvexD(&self, pos: *const f64, rot: *const f64,
planes: *const f64, planecount: c_uint,
points: *const f64, pointcount: c_uint,
polygons: *const c_uint);
fn DrawCylinder(&self, pos: *const f32, rot: *const f32, l: f32, r: f32);
fn DrawCylinderD(&self, pos: *const f64, rot: *const f64, l: f32, r: f32);
fn DrawLine(&self, pos1: *const f32, pos2: *const f32);
fn DrawLineD(&self, pos1: *const f64, pos2: *const f64);
fn DrawSphere(&self, pos: *const f32, rot: *const f32, radius: f32);
fn DrawSphereD(&self, pos: *const f64, rot: *const f64, radius: f32);
fn DrawTriangle(&self, pos: *const f32, rot: *const f32,
v0: *const f32, v1: *const f32, v2: *const f32, solid: c_int);
fn DrawTriangleD(&self, pos: *const f64, rot: *const f64,
v0: *const f64, v1: *const f64, v2: *const f64, solid: c_int);
fn DrawTriangles(&self, pos: *const f32, rot: *const f32,
v: *const f32, n: c_int, solid: c_int);
fn DrawTrianglesD(&self, pos: *const f64, rot: *const f64,
v: *const f64, n: c_int, solid: c_int);
fn ElapsedTime(&self) -> f64;
fn Error(&self, msg: *const c_char); fn GetViewpoint(&self, xyz: *mut f32, hpr: *mut f32);
fn Print(&self, msg: *const c_char); fn SetCapsuleQuality(&self, n: c_int);
fn SetColor(&self, red: f32, green: f32, blue: f32);
fn SetColorAlpha(&self, red: f32, green: f32, blue: f32, alpha: f32);
fn SetDrawMode(&self, mode: c_int);
fn SetSphereQuality(&self, n: c_int);
fn SetTexture(&self, texture_number: c_int);
fn SetViewpoint(&self, xyz: *mut f32, hpr: *mut f32);
fn SimulationLoop(&self, argc: c_int, argv: *mut *mut c_char,
window_width: c_int, window_height: c_int, functions: *mut dsFunctions_C);
fn Stop(&self);
}
pub trait TdrawstuffSetter {
fn set_drawstuff(ds: &mut Option<Box<dyn Tdrawstuff>>,
drawstuff: impl Tdrawstuff + 'static) {
unsafe {
*ds = Some(Box::new(drawstuff));
}
}
}
impl TdrawstuffSetter for ODE {
}