I'm not sure this belongs in the spec. There exists a similar thing on
npm [1] which deals with Buffers instead, but you could adapt it
similarly to work with ArrayBuffers (via a DataView). In reality, this
really only would have two uses: native C interop (in Node/etc.) and
WebAssembly interop (which is better addressed by separate
`foo_create` and `foo_destroy` exports with raw pointers and creating
a JS wrapper to manage them more idiomatically).

[1]: https://www.npmjs.com/package/ref-struct
-----

Isiah Meadows
[email protected]

Looking for web consulting? Or a new website?
Send me an email and we can get started.
www.isiahmeadows.com


On Sun, Jul 2, 2017 at 9:42 AM, J Decker <[email protected]> wrote:
>
> I would like to open a discussion to propose that an extension to
> http://www.ecma-international.org/ecma-262/6.0/#sec-typedarray-objects
> should be defined that would allow defintiion of interleaved typed data.
>
> Support for interleaved vertex data is one use...
>
> https://developer.apple.com/library/content/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/TechniquesforWorkingwithVertexData/TechniquesforWorkingwithVertexData.html
>  section Use Interleaved Vertex Data
>
>
> https://www.khronos.org/opengl/wiki/Vertex_Specification
> Defines how OpenGL describes interleaved data.
>
> This could also be used to interop with native code as an array of packed
> (C) structs.
>
> I don't really know what the definition mechanics might be, but for usage I
> might like to see...
>
> var arr = new InterleavedTypeArray( [ { name: "fieldName", type:"uint32' },
> ... probably an array of objects defining the fields in an element ],
> <element count> );
>
> arr[x].fieldName = value.
>
>
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to