Developer Documentation

CustomEffect<T>.SerializeUserdata

public virtual byte[] SerializeUserdata(T value)
public virtual IntPtr SerializeUserdata(T value, bool destroy = true)

Serialize arbitary userdata

Parameters

NameTypeDescription
value<T>byte array data of value
destroyBooleantrue to call the DestroyStructure(IntPtr, Type) method.

Returns

TypeDescription
Byte[]byte array representation of userdata value
IntPtr

Variants

SerializeUserdata(value)

public virtual byte[] SerializeUserdata(T value)

Serialize arbitary userdata

Parameters

NameTypeDescription
value<T>byte array data of value

Returns

TypeDescription
Byte[]byte array representation of userdata value

SerializeUserdata(value, destroy)

public virtual IntPtr SerializeUserdata(T value, bool destroy = true)

Serialize arbitary userdata

Warning

When the memory block already contains data and destroy is false can lead to a memory leak

Parameters

NameTypeDescription
value<T>object data of value
destroyBooleantrue to call the DestroyStructure(IntPtr, Type) method.

Returns

TypeDescription
IntPtr