Add ol.DEBUG_WEBGL @define
This commit is contained in:
@@ -14,6 +14,12 @@ goog.require('ol.webgl.shader.Fragment');
|
|||||||
goog.require('ol.webgl.shader.Vertex');
|
goog.require('ol.webgl.shader.Vertex');
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @define {boolean} Enable WebGL debugging.
|
||||||
|
*/
|
||||||
|
ol.DEBUG_WEBGL = false;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @enum {string}
|
* @enum {string}
|
||||||
*/
|
*/
|
||||||
@@ -57,6 +63,10 @@ ol.webgl.Map = function(target, opt_values) {
|
|||||||
});
|
});
|
||||||
goog.asserts.assert(!goog.isNull(this.gl_));
|
goog.asserts.assert(!goog.isNull(this.gl_));
|
||||||
|
|
||||||
|
if (ol.DEBUG_WEBGL) {
|
||||||
|
this.gl_ = WebGLDebugUtils.makeDebugContext(this.gl_);
|
||||||
|
}
|
||||||
|
|
||||||
goog.events.listen(this.canvas_, ol.webgl.WebGLContextEventType.LOST,
|
goog.events.listen(this.canvas_, ol.webgl.WebGLContextEventType.LOST,
|
||||||
this.handleWebGLContextLost, false, this);
|
this.handleWebGLContextLost, false, this);
|
||||||
goog.events.listen(this.canvas_, ol.webgl.WebGLContextEventType.RESTORED,
|
goog.events.listen(this.canvas_, ol.webgl.WebGLContextEventType.RESTORED,
|
||||||
|
|||||||
Reference in New Issue
Block a user