Changes

Jump to: navigation, search

Platform/AreWeFunYet

413 bytes added, 08:52, 10 March 2012
Typed Arrays for Managing Assets
=== Typed Arrays for Managing Assets ===
It seems that game developers would like to store assets in binary form in Typed Arrays. How possible/feasible is that? For example, can I say 'take this typed array and interpret it as a JPEG image' ?  ''No you can't. You can convert the data into a Blob and get a URL for that, but that involves a memory copy.'' Another orthogonal question: can one cache on disk (IndexedDB?) the contents of a Typed Array? ''Yes, you can store Typed Arrays and ArrayBuffers in IndexedDB just like many other data types.''
Currently if you want to take data in a Typed Array and display in an <img> or otherwise end up interacting with the DOM, you'll have to copy the data at least once. One solution might be the ability to create a blob-url representing the contents of a Typed Array.
 
''Yes, we should add the ability to get a URL which represents the contents of a TypedArray/ArrayBuffer. Basically that simply means supporting a TypedArray or ArrayBuffer to URL.createObjectURL()''
=== Compression of JavaScript code ===
Confirm
716
edits

Navigation menu