Skip to content

Commit

Permalink
Merge pull request openlayers#32 from tsauerwein/webgl-point-offset
Browse files Browse the repository at this point in the history
[webgl-point] Fix call to drawElements
  • Loading branch information
Tobias Sauerwein committed Nov 12, 2014
2 parents 01bc022 + 41887e6 commit 2a5fffa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ol/render/webgl/webglreplay.js
Expand Up @@ -610,8 +610,10 @@ ol.render.webgl.ImageReplay.prototype.replay = function(context,
for (i = 0, ii = this.textures_.length, start = 0; i < ii; ++i) {
gl.bindTexture(goog.webgl.TEXTURE_2D, this.textures_[i]);
var end = this.groupIndices_[i];
gl.drawElements(goog.webgl.TRIANGLES, end - start,
goog.webgl.UNSIGNED_SHORT, start);
var numItems = end - start;
var offsetInBytes = start * 2; // 2 Bytes for UNSIGNED_SHORT
gl.drawElements(goog.webgl.TRIANGLES, numItems,
goog.webgl.UNSIGNED_SHORT, offsetInBytes);
start = end;
}
};
Expand Down

0 comments on commit 2a5fffa

Please sign in to comment.