From bcf6e7d7b12f87e9ab6d9ac792bb44b0cb557dc5 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Sun, 15 Jul 2012 20:44:25 +0200 Subject: [PATCH] Add ol.DEBUG_WEBGL @define --- src/ol/webgl/map.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ol/webgl/map.js b/src/ol/webgl/map.js index 0b1a080f30..421b0ea09d 100644 --- a/src/ol/webgl/map.js +++ b/src/ol/webgl/map.js @@ -14,6 +14,12 @@ goog.require('ol.webgl.shader.Fragment'); goog.require('ol.webgl.shader.Vertex'); +/** + * @define {boolean} Enable WebGL debugging. + */ +ol.DEBUG_WEBGL = false; + + /** * @enum {string} */ @@ -57,6 +63,10 @@ ol.webgl.Map = function(target, opt_values) { }); 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, this.handleWebGLContextLost, false, this); goog.events.listen(this.canvas_, ol.webgl.WebGLContextEventType.RESTORED,