sinisterchipmunk / jax

Framework for creating rich WebGL-enabled applications using JavaScript and Ruby
http://jaxgl.com
MIT License
96 stars 16 forks source link

Jax.Texture#getData #51

Closed sinisterchipmunk closed 12 years ago

sinisterchipmunk commented 12 years ago

It would be nice to have a simple way to get raw texture data. Even though it's slow, there are cases when it would be helpful (example: for loading height maps).

Jax.Texture#getData should return null if the texture hasn't been loaded yet. It should return the data cached in memory if it has been previously retrieved. Otherwise, it should draw the texture to an internal Canvas2D, and then query the 2D context to return raw info.

Jax.Texture#dispose should clean up any data cached by Jax.Texture#getData.