Set the WebGL texture, called automatically if using multiple textures * - This may also flush the gl buffer resulting in more draw calls and worse performance * @param {WebGLTexture} texture * @memberof WebGL
(texture)
| 310 | * @param {WebGLTexture} texture |
| 311 | * @memberof WebGL */ |
| 312 | function glSetTexture(texture) |
| 313 | { |
| 314 | // must flush cache with the old texture to set a new one |
| 315 | if (!glContext || texture === glActiveTexture) return; |
| 316 | |
| 317 | glFlush(); |
| 318 | glActiveTexture = texture; |
| 319 | glContext.bindTexture(glContext.TEXTURE_2D, glActiveTexture); |
| 320 | } |
| 321 | |
| 322 | /** Set the wrap mode (REPEAT or CLAMP_TO_EDGE) on an existing WebGL texture |
| 323 | * Flushes the current batch only if the texture is the active one |
no test coverage detected