Load events for `Texture`

Why do you disagree? You asked questions, I answered them, but you didn’t say why you disagree really. I think it was only me trying to convince anyone.

It is hardly any work to add this, and the benefit is there.

This is also a small non-breaking change that makes it easy to fix 3rd party code with minimal changes in a good way (IMO).

thirdPartyRenderingAPI.texture = someTexture // it receives a texture and knows when to re-render

I’ve been watching this disuccsion closely, being curious where it would lead…

I strongly believe you should separate the concept of images and textures. Userland (your) code is responsible for loading data (images, canvas data, videos and what-not), which you then feed to a Texture once loaded. From what I understand is that you’re effectively trying to move (copy) a problem that is already being solved.

There is no callback or event to listen to when it comes to uploading texture data to the GPU. And this is precisely the job of a Texture class. Please keep the concern of a data source and target separated. It’ll only add confusion since everything you’re looking for is already solved by the browser.

1 Like