asny / three-d

2D/3D renderer - makes it simple to draw stuff across platforms (including web)
MIT License
1.24k stars 105 forks source link

Expose texture IDs as an escape-hatch for non-standard texture sources #387

Closed seancribbs closed 11 months ago

seancribbs commented 11 months ago

This will allow binding of non-standard texture sources (e.g. HtmlVideoElement, HtmlImageElement, and VideoFrame on web) by calling the lower-level context operations outside of the texture struct's implementation, but keeping the management of textures consistent with the mid-level API.

asny commented 11 months ago

@seancribbs I had a hard time figuring out what would be the nicest approach, but ended on the change in #388. Then the texture needs to be created manually by raw context calls and then it can be used in a program using the proposed method. What do you think?