use physx_sys::{create_profiler_callback, PxProfilerCallback};
use std::ffi::c_void;
#[allow(clippy::missing_safety_doc)]
pub unsafe trait ProfilerCallback: Sized {
unsafe extern "C" fn zone_start(
name: *const i8,
detached: bool,
context_id: u64,
user_data: *const c_void,
) -> *mut c_void;
unsafe extern "C" fn zone_end(
context: *const c_void,
name: *const i8,
detached: bool,
context_id: u64,
user_data: *const c_void,
);
unsafe fn into_px(self) -> *mut PxProfilerCallback {
unsafe {
create_profiler_callback(
Self::zone_start,
Self::zone_end,
Box::into_raw(Box::new(self)) as *mut c_void,
)
}
}
}