Function bgfx_sys::bgfx_make_ref_release
source · pub unsafe extern "C" fn bgfx_make_ref_release(
_data: *const c_void,
_size: u32,
_releaseFn: bgfx_release_fn_t,
_userData: *mut c_void
) -> *const bgfx_memory_t
Expand description
Make reference to data to pass to bgfx. Unlike bgfx::alloc
, this call
doesn’t allocate memory for data. It just copies the _data pointer. You
can pass ReleaseFn
function pointer to release this memory after it’s
consumed, otherwise you must make sure _data is available for at least 2
bgfx::frame
calls. ReleaseFn
function must be able to be called
from any thread.
@attention Data passed must be available for at least 2 bgfx::frame
calls.
@param[in] _data Pointer to data. @param[in] _size Size of data. @param[in] _releaseFn Callback function to release memory after use. @param[in] _userData User data to be passed to callback function.
@returns Referenced memory.