Comparing version 0.8.2 to 0.9.0
{ | ||
"name": "2gl", | ||
"version": "0.8.2", | ||
"version": "0.9.0", | ||
"description": "WebGL library for 2GIS projects", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -18,2 +18,9 @@ import Texture from './Texture'; | ||
/** | ||
* Текстура создается в конструкторе, чтобы можно было сразу получить на нее ссылку. | ||
* @type {?Texture} | ||
* @ignore | ||
*/ | ||
this._texture = new Texture(null, this.options); | ||
/** | ||
* Контекст WebGL, в котором был инициализирован фреймбуфер. | ||
@@ -83,3 +90,7 @@ * Используется только для удаления, подумать хорошо, прежде чем использовать для чего-то ещё. | ||
this._glContext = gl; | ||
this._texture = new Texture(null, this.options); | ||
// Проверяем наличие текстуры, т.к. она может быть удалена через метод _unprepare. | ||
if (!this._texture) { | ||
this._texture = new Texture(null, this.options); | ||
} | ||
this._texture.prepare(gl); | ||
@@ -108,10 +119,12 @@ | ||
_unprepare() { | ||
if (this._texture) { | ||
this._texture.remove(this._glContext); | ||
this._texture = null; | ||
} | ||
if (this._frameBuffer) { | ||
const gl = this._glContext; | ||
this._texture.remove(gl); | ||
gl.deleteFramebuffer(this._frameBuffer); | ||
gl.deleteRenderbuffer(this._renderBuffer); | ||
this._glContext.deleteFramebuffer(this._frameBuffer); | ||
this._glContext.deleteRenderbuffer(this._renderBuffer); | ||
this._frameBuffer = null; | ||
this._renderBuffer = null; | ||
this._texture = null; | ||
} | ||
@@ -157,2 +170,2 @@ } | ||
*/ | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9SZW5kZXJUYXJnZXQuanMiXSwibmFtZXMiOlsiVGV4dHVyZSIsIlJlbmRlclRhcmdldCIsImNvbnN0cnVjdG9yIiwib3B0aW9ucyIsIk9iamVjdCIsImFzc2lnbiIsImRlZmF1bHRPcHRpb25zIiwiX2dsQ29udGV4dCIsImJpbmQiLCJnbCIsIl9mcmFtZUJ1ZmZlciIsIl9wcmV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AgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKCdVbmV4cGVjdGVkIGZyYW1lYnVmZmVyIHN0YXR1czogJyArIHN0YXR1cyk7XG4gICAgICAgIH1cbiAgICB9XG59XG5cblJlbmRlclRhcmdldC5kZWZhdWx0T3B0aW9ucyA9IE9iamVjdC5hc3NpZ24oe30sIFRleHR1cmUuZGVmYXVsdE9wdGlvbnMsIHtcbiAgICBzaXplOiBbMCwgMF0sXG4gICAgZ2VuZXJhdGVNaXBtYXBzOiBmYWxzZSxcbn0pO1xuXG5leHBvcnQgZGVmYXVsdCBSZW5kZXJUYXJnZXQ7XG5cbi8qKlxuICog0J/QsNGA0LDQvNC10YLRgNGLINGB0LLRj9C30YvQstCw0L3QuNGPINGC0LXQutGB0YLRg9GA0YtcbiAqXG4gKiBAdHlwZWRlZiB7T2JqZWN0fSBSZW5kZXJUYXJnZXRPcHRpb25zXG4gKiBAcHJvcGVydHkge051bWJlcltdfSBzaXplXG4gKi9cbiJdfQ== |
@@ -18,2 +18,9 @@ import Texture from './Texture'; | ||
/** | ||
* Текстура создается в конструкторе, чтобы можно было сразу получить на нее ссылку. | ||
* @type {?Texture} | ||
* @ignore | ||
*/ | ||
this._texture = new Texture(null, this.options); | ||
/** | ||
* Контекст WebGL, в котором был инициализирован фреймбуфер. | ||
@@ -83,3 +90,7 @@ * Используется только для удаления, подумать хорошо, прежде чем использовать для чего-то ещё. | ||
this._glContext = gl; | ||
this._texture = new Texture(null, this.options); | ||
// Проверяем наличие текстуры, т.к. она может быть удалена через метод _unprepare. | ||
if (!this._texture) { | ||
this._texture = new Texture(null, this.options); | ||
} | ||
this._texture.prepare(gl); | ||
@@ -108,10 +119,12 @@ | ||
_unprepare() { | ||
if (this._texture) { | ||
this._texture.remove(this._glContext); | ||
this._texture = null; | ||
} | ||
if (this._frameBuffer) { | ||
const gl = this._glContext; | ||
this._texture.remove(gl); | ||
gl.deleteFramebuffer(this._frameBuffer); | ||
gl.deleteRenderbuffer(this._renderBuffer); | ||
this._glContext.deleteFramebuffer(this._frameBuffer); | ||
this._glContext.deleteRenderbuffer(this._renderBuffer); | ||
this._frameBuffer = null; | ||
this._renderBuffer = null; | ||
this._texture = null; | ||
} | ||
@@ -118,0 +131,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1757571
124
8051
1