[Pas2js] Records as pure data?
Ryan Joseph
ryan at thealchemistguild.com
Wed May 9 14:26:32 CEST 2018
> On May 9, 2018, at 5:36 PM, Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:
>
> Are you kidding?
I don’t know what I was thinking. :) I typed that out before I left the house and had a mental breakdown I guess. What I mean is they are consecutive blocks of memory and you can in fact index into them but perhaps not in JS. The “array” index is a byte offset which may have some parallel in JS.
According to http://learnwebgl.brown37.net/rendering/interleaved_buffers.html you can use interleaved buffers in WebGL but in this example all the values are the same type so I don’t think it works like it normally would.
To be clear does JS have any notion of structs or a way to pack bytes together? Float32Array seems to do this but it only works for a single type. I wonder if you could use Float32Array and Int8Array for example and concatenate them. There may be a way to make records actually work properly and that would be a big win imo.
Regards,
Ryan Joseph
More information about the Pas2js
mailing list