I'm trying to convert an object
to an unsafe void*
. Here's an example :
public static void glBufferData(uint target, ulong size, object data, uint usage)
{
_glBufferData(target, size, data, usage);
}
Here are the parameters of _glBufferData
:
uint target, ulong size, void* data, uint usage
I'm passing this object :
float[] positions =
{
-0.5f, -0.5f,
0.0f, 0.5f,
0.5f, -0.5f
};
I tried this but it didn't work.
fixed (void* ptr = &data)
{
}
My class is unsafe by the way.
How can I do that ?