Move WebGL context creation into ol.webgl
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user