SetOverlayRaw (possibly) not working as intended
Closed this issue · 1 comments
DASPRiD commented
I might not be understanding this correctly, so maybe you can clarify this:
IVROverlay.SetOverlayRaw
is defined like this in TypeScript:
SetOverlayRaw(OverlayHandle: VROverlayHandle_t, Buffer: number, Width: number, Height: number, BytesPerPixel: number): void;
Looking at the C++ binding as well as OpenVR itself, it seems like the buffer should be a pointer to a char array containing the raw image data. Obviously we don't have such a thing in NodeJS.
Wouldn't it make sense that it accepts a Buffer
object as buffer, and the C++ binding then converts that to a char array? That would allow to use e.g. node-canvas and it's toBuffer('raw')
method to directly feed that into SetOverlayRaw()
.
I'm sadly not familiar enough with C++, else I'd write a pull request.
SieR-VR commented
It's fixed. I changed to SetOverlayRaw accepts Node Buffer Object.