[Pas2js] Records as pure data?

Michael Van Canneyt michael at freepascal.org
Wed May 9 14:35:07 CEST 2018



On Wed, 9 May 2018, Ryan Joseph wrote:

>
>
>> 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?

Only the buffersource/bufferview classes allow such things.

https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView

You really should not think in terms of memory buffers when programming the browser.
The sooner you abandon this concept, the better. The above is the only
'low-level' memory buffer that is available.

Michael.


More information about the Pas2js mailing list