Wrap WebGL shader code in define condition

This commit is contained in:
Andreas Hocevar
2017-01-02 22:01:58 +01:00
parent 9c79564676
commit dcbf3a97e8
7 changed files with 700 additions and 672 deletions
@@ -6,6 +6,8 @@ goog.require('ol.webgl.Fragment');
goog.require('ol.webgl.Vertex'); goog.require('ol.webgl.Vertex');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.webgl.Fragment} * @extends {ol.webgl.Fragment}
@@ -144,3 +146,5 @@ ol.render.webgl.circlereplay.defaultshader.Locations = function(gl, program) {
*/ */
this.a_radius = gl.getAttribLocation(program, 'g'); this.a_radius = gl.getAttribLocation(program, 'g');
}; };
}
@@ -6,6 +6,8 @@ goog.require('ol.webgl.Fragment');
goog.require('ol.webgl.Vertex'); goog.require('ol.webgl.Vertex');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.webgl.Fragment} * @extends {ol.webgl.Fragment}
@@ -134,3 +136,5 @@ ol.render.webgl.imagereplay.defaultshader.Locations = function(gl, program) {
*/ */
this.a_texCoord = gl.getAttribLocation(program, 'd'); this.a_texCoord = gl.getAttribLocation(program, 'd');
}; };
}
@@ -6,6 +6,8 @@ goog.require('ol.webgl.Fragment');
goog.require('ol.webgl.Vertex'); goog.require('ol.webgl.Vertex');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.webgl.Fragment} * @extends {ol.webgl.Fragment}
@@ -149,3 +151,5 @@ ol.render.webgl.linestringreplay.defaultshader.Locations = function(gl, program)
*/ */
this.a_position = gl.getAttribLocation(program, 'e'); this.a_position = gl.getAttribLocation(program, 'e');
}; };
}
@@ -6,6 +6,8 @@ goog.require('ol.webgl.Fragment');
goog.require('ol.webgl.Vertex'); goog.require('ol.webgl.Vertex');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.webgl.Fragment} * @extends {ol.webgl.Fragment}
@@ -114,3 +116,5 @@ ol.render.webgl.polygonreplay.defaultshader.Locations = function(gl, program) {
*/ */
this.a_position = gl.getAttribLocation(program, 'a'); this.a_position = gl.getAttribLocation(program, 'a');
}; };
}
@@ -6,6 +6,8 @@ goog.require('ol.webgl.Fragment');
goog.require('ol.webgl.Vertex'); goog.require('ol.webgl.Vertex');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.webgl.Fragment} * @extends {ol.webgl.Fragment}
@@ -114,3 +116,5 @@ ol.renderer.webgl.defaultmapshader.Locations = function(gl, program) {
*/ */
this.a_texCoord = gl.getAttribLocation(program, 'c'); this.a_texCoord = gl.getAttribLocation(program, 'c');
}; };
}
+4
View File
@@ -6,6 +6,8 @@ goog.require('ol.webgl.Fragment');
goog.require('ol.webgl.Vertex'); goog.require('ol.webgl.Vertex');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.webgl.Fragment} * @extends {ol.webgl.Fragment}
@@ -104,3 +106,5 @@ ol.renderer.webgl.tilelayershader.Locations = function(gl, program) {
*/ */
this.a_texCoord = gl.getAttribLocation(program, 'c'); this.a_texCoord = gl.getAttribLocation(program, 'c');
}; };
}
+4
View File
@@ -6,6 +6,8 @@ goog.require('ol.webgl.Fragment');
goog.require('ol.webgl.Vertex'); goog.require('ol.webgl.Vertex');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.webgl.Fragment} * @extends {ol.webgl.Fragment}
@@ -98,3 +100,5 @@ ol.inherits({{className}}.Vertex, ol.webgl.Vertex);
this.{{originalName}} = gl.getAttribLocation(program, '{{shortName}}'); this.{{originalName}} = gl.getAttribLocation(program, '{{shortName}}');
{{/getAttributes}} {{/getAttributes}}
}; };
}