Move WebGL context creation into ol.webgl

This commit is contained in:
Tom Payne
2012-10-17 17:23:30 +02:00
parent c508ed39ef
commit 1d40b64db1
2 changed files with 13 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
goog.provide('ol.webgl');
goog.provide('ol.webgl.WebGLContextEventType');
@@ -8,3 +9,13 @@ ol.webgl.WebGLContextEventType = {
LOST: 'webglcontextlost',
RESTORED: 'webglcontextrestored'
};
/**
* @param {Element} canvas Canvas.
* @param {Object=} opt_attributes Attributes.
* @return {WebGLRenderingContext} WebGL rendering context.
*/
ol.webgl.getContext = function(canvas, opt_attributes) {
return canvas.getContext('experimental-webgl', opt_attributes);
};