greggman / twgl.js

A Tiny WebGL helper Library
http://twgljs.org
MIT License
2.61k stars 258 forks source link

[expo-gl][react-native]support expo-gl version of gl.texImage2D #163

Closed wood1986 closed 4 years ago

wood1986 commented 4 years ago

https://github.com/greggman/twgl.js/blob/addd2f6ca5fd2d7ea551eb73f981e90397026508/src/textures.js#L1646-L1652

Is it possible to change from throw to not throw with warning message?

In expo-gl version of gl.texImage2D, the last argument is in { width, height, localUri }. See https://youtu.be/xUD4ER_3r_4?t=366

} else {
  if (!isTexImageSource(src)) {
   console.warn("unsupported src type but we will try")
  }
  setTextureFromElement(gl, tex, src, options); 
  width  = src.width; 
  height = src.height; 
}
greggman commented 4 years ago

I just removed the check.

https://github.com/greggman/twgl.js/commit/0e7464cc8e25fa013add8f663bda9384857c3eff

wood1986 commented 4 years ago

Thanks. I can close my PR and issue