webgl-framework
Advanced tools
Comparing version 2.1.5 to 2.1.6
@@ -124,2 +124,15 @@ "use strict"; | ||
/** | ||
* Generates mipmasp for textures. | ||
* | ||
* @param textures Textures to generate mipmaps for. | ||
*/ | ||
generateMipmaps(...textures) { | ||
for (const texture of textures) { | ||
this.gl.bindTexture(this.gl.TEXTURE_2D, texture); | ||
this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR); | ||
this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR_MIPMAP_LINEAR); | ||
this.gl.generateMipmap(this.gl.TEXTURE_2D); | ||
} | ||
} | ||
/** | ||
* Initializes WebGL and calls all callbacks. | ||
@@ -126,0 +139,0 @@ * |
@@ -79,2 +79,8 @@ import { mat4 } from "gl-matrix"; | ||
/** | ||
* Generates mipmasp for textures. | ||
* | ||
* @param textures Textures to generate mipmaps for. | ||
*/ | ||
protected generateMipmaps(...textures: WebGLTexture[]): void; | ||
/** | ||
* Initializes WebGL and calls all callbacks. | ||
@@ -81,0 +87,0 @@ * |
@@ -1477,2 +1477,15 @@ class FullScreenUtils { | ||
/** | ||
* Generates mipmasp for textures. | ||
* | ||
* @param textures Textures to generate mipmaps for. | ||
*/ | ||
generateMipmaps(...textures) { | ||
for (const texture of textures) { | ||
this.gl.bindTexture(this.gl.TEXTURE_2D, texture); | ||
this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR); | ||
this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR_MIPMAP_LINEAR); | ||
this.gl.generateMipmap(this.gl.TEXTURE_2D); | ||
} | ||
} | ||
/** | ||
* Initializes WebGL and calls all callbacks. | ||
@@ -1479,0 +1492,0 @@ * |
@@ -1483,2 +1483,15 @@ (function (global, factory) { | ||
/** | ||
* Generates mipmasp for textures. | ||
* | ||
* @param textures Textures to generate mipmaps for. | ||
*/ | ||
generateMipmaps(...textures) { | ||
for (const texture of textures) { | ||
this.gl.bindTexture(this.gl.TEXTURE_2D, texture); | ||
this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR); | ||
this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR_MIPMAP_LINEAR); | ||
this.gl.generateMipmap(this.gl.TEXTURE_2D); | ||
} | ||
} | ||
/** | ||
* Initializes WebGL and calls all callbacks. | ||
@@ -1485,0 +1498,0 @@ * |
{ | ||
"name": "webgl-framework", | ||
"version": "2.1.5", | ||
"version": "2.1.6", | ||
"description": "Basic low-level WebGL framework", | ||
@@ -5,0 +5,0 @@ "author": "Oleksandr Popov (github.com/keaukraine/)", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
668164
4674