pub unsafe fn buf_desc(
    // null if dyn, some if immutable
    data_ptr: *const c_void,
    data_size: usize,
    buffer_type: BufferType,
    usage: ResourceUsage,
    label: &str,
) -> BufferDesc {
    ffi::sg_buffer_desc {
        size: data_size as _,
        data: Range {
            ptr: data_ptr,
            size: data_size as _,
        },
        type_: buffer_type.to_ffi(),
        usage: usage.to_ffi(),
        label: if label.is_empty() {
            std::ptr::null_mut()
        } else {
            // FIXME: lifetime. maybe use global CString storage?
            let label = CString::new(label).expect("Unable to create CString in BufferDesc::new");
            label.as_ptr() as *mut _
        },
        ..Default::default()
    }
}
/// [Non-Sokol] Helper for creating dynamic vertex buffer
[Non-Sokol] Helper for creating dynamic vertex buffer
[ Non - Sokol ] Helper for creating dynamic vertex buffer
pub unsafe fn buf_desc(
    // null if dyn, some if immutable
    data_ptr: *const c_void,
    data_size: usize,
    buffer_type: BufferType,
    usage: ResourceUsage,
    label: &str,
) -> BufferDesc {
    ffi::sg_buffer_desc {
        size: data_size as _,
        data: Range {
            ptr: data_ptr,
            size: data_size as _,
        },
        type_: buffer_type.to_ffi(),
        usage: usage.to_ffi(),
        label: if label.is_empty() {
            std::ptr::null_mut()
        } else {
            // FIXME: lifetime. maybe use global CString storage?
            let label = CString::new(label).expect("Unable to create CString in BufferDesc::new");
            label.as_ptr() as *mut _
        },
        ..Default::default()
    }
}
pub unsafe fn buf_desc ( // null if dyn, some if immutable data_ptr : * const c_void , data_size : usize , buffer_type : BufferType , usage : ResourceUsage , label : & str , ) -> BufferDesc { ffi :: sg_buffer_desc { size : data_size as _ , data : Range { ptr : data_ptr , size : data_size as _ , } , type_ : buffer_type . to_ffi ( ) , usage : usage . to_ffi ( ) , label : if label . is_empty ( ) { std :: ptr :: null_mut ( ) } else { // FIXME: lifetime. maybe use global CString storage? let label = CString :: new ( label ) . expect ( " " ) ; label . as_ptr ( ) as * mut _ } , .. Default :: default ( ) } }
[Non-Sokol] Helper for creating dynamic vertex buffer
[ Non - Sokol ] Helper for creating dynamic vertex buffer
data_ptr
*const c_void
data_size
usize
buffer_type
BufferType
usage
ResourceUsage
label
&str
data_ptr
*const c_void
data_size
usize
buffer_type
BufferType
usage
ResourceUsage
label
&str