Skip to content

Instantly share code, notes, and snippets.

@hb3p8
Created April 19, 2017 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hb3p8/d8c6f48a0eb9f5c882eac33dd852a6af to your computer and use it in GitHub Desktop.
Save hb3p8/d8c6f48a0eb9f5c882eac33dd852a6af to your computer and use it in GitHub Desktop.
getBufferSubData for Emscripten
int size = ...
void* data = new char[size];
EM_ASM_(
{
Module.ctx.getBufferSubData(Module.ctx.ARRAY_BUFFER, 0, HEAPU8.subarray($0, $0 + $1));
}, data, size);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment