tmp-demo / tde.js

JS demo engine.
2 stars 0 forks source link

Cannot load more than one texture from FS #8

Open gaelmotte opened 9 years ago

gaelmotte commented 9 years ago

Hello. I recently added the possibility to use textures from FS, but is seems to break as soon as i try to load a second one.

KoltesDigital commented 9 years ago

If I recall correctly, there are security restrictions on files from file://, in particular they can't be loaded as a texture. They have to come from http(s)://, which will be hard to do in the exported version of any demo.

This SO entry suggests that only Chrome has this behavior, and suggests work-arounds: http://stackoverflow.com/questions/18118138/lesson-5-not-working-locally

padenot commented 9 years ago

What does FS mean here ?

KoltesDigital commented 9 years ago

Filesystem

padenot commented 9 years ago

why would it work for one file and note two, then? either it's cross-origin or it's not.

KoltesDigital commented 9 years ago

I didn't see it breaks for the second file. Hm. I'll test that.

gaelmotte commented 9 years ago

I had some trouble updating the texture once the image fires onload event. I might have made a mistake when writting some closure (overwritting the first created item when second one loads most likely).