webgles: Replace BufferForPointer with equivalent functionality from client.h