From 86784888a98a05523dbedcbe32fd4dea336878e7 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 9 Mar 2012 08:21:13 -0800 Subject: Eyedropper support for getting color value from webgl shapes. Signed-off-by: Nivesh Rajbhandari --- js/lib/drawing/world.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'js/lib/drawing') diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js index 3d6c6fc4..04e4d96b 100755 --- a/js/lib/drawing/world.js +++ b/js/lib/drawing/world.js @@ -26,7 +26,7 @@ var MaterialsModel = require("js/models/materials-model").MaterialsModel; // Class GLWorld // Manages display in a canvas /////////////////////////////////////////////////////////////////////// -var World = function GLWorld( canvas, use3D ) { +var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) { /////////////////////////////////////////////////////////////////////// // Instance variables /////////////////////////////////////////////////////////////////////// @@ -39,7 +39,11 @@ var World = function GLWorld( canvas, use3D ) { this._canvas = canvas; if (this._useWebGL) { - this._glContext = canvas.getContext("experimental-webgl"); + if(preserveDrawingBuffer) { + this._glContext = canvas.getContext("experimental-webgl", {preserveDrawingBuffer: true}); + } else { + this._glContext = canvas.getContext("experimental-webgl"); + } } else { this._2DContext = canvas.getContext( "2d" ); } @@ -680,7 +684,7 @@ World.prototype.render = function() { var root = this.getGeomRoot(); this.hRender( root ); } else { - g_Engine.setContext( this._canvas.rdgeId ); + g_Engine.setContext( this._canvas.rdgeid ); //this.draw(); this.restartRenderLoop(); } -- cgit v1.2.3