mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Added SetData for single struct
This commit is contained in:
@@ -144,6 +144,17 @@ namespace GlitchyEngine.Renderer
|
|||||||
_description = description;
|
_description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param data The struct containing the data that will be copied into the buffer.
|
||||||
|
* @param destinationByteOffset The offset in bytes form the start of the destination buffer.
|
||||||
|
* @param mapType Only relevant for dynamic buffers...
|
||||||
|
*/
|
||||||
|
public Result<void> SetData<T>(T data, uint32 destinationByteOffset = 0, MapType mapType = .Write) where T : struct
|
||||||
|
{
|
||||||
|
var data;
|
||||||
|
return PlatformSetData(&data, (uint32)(sizeof(T)), destinationByteOffset, mapType);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param data The span containing the data that will be copied into the buffer.
|
* @param data The span containing the data that will be copied into the buffer.
|
||||||
* @param destinationByteOffset The offset in bytes form the start of the destination buffer.
|
* @param destinationByteOffset The offset in bytes form the start of the destination buffer.
|
||||||
|
|||||||
Reference in New Issue
Block a user