aboutsummaryrefslogtreecommitdiff
path: root/js/lib
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-03-09 08:21:13 -0800
committerNivesh Rajbhandari2012-03-09 08:27:44 -0800
commit86784888a98a05523dbedcbe32fd4dea336878e7 (patch)
treeba7e4f5a06172186031c5d82c8575dd1f8196c20 /js/lib
parentd9552dbac17fa7e12dd26f05ebe14172aaa32483 (diff)
downloadninja-86784888a98a05523dbedcbe32fd4dea336878e7.tar.gz
Eyedropper support for getting color value from webgl shapes.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/lib')
-rwxr-xr-xjs/lib/drawing/world.js10
1 files changed, 7 insertions, 3 deletions
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;
26// Class GLWorld 26// Class GLWorld
27// Manages display in a canvas 27// Manages display in a canvas
28/////////////////////////////////////////////////////////////////////// 28///////////////////////////////////////////////////////////////////////
29var World = function GLWorld( canvas, use3D ) { 29var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) {
30 /////////////////////////////////////////////////////////////////////// 30 ///////////////////////////////////////////////////////////////////////
31 // Instance variables 31 // Instance variables
32 /////////////////////////////////////////////////////////////////////// 32 ///////////////////////////////////////////////////////////////////////
@@ -39,7 +39,11 @@ var World = function GLWorld( canvas, use3D ) {
39 39
40 this._canvas = canvas; 40 this._canvas = canvas;
41 if (this._useWebGL) { 41 if (this._useWebGL) {
42 this._glContext = canvas.getContext("experimental-webgl"); 42 if(preserveDrawingBuffer) {
43 this._glContext = canvas.getContext("experimental-webgl", {preserveDrawingBuffer: true});
44 } else {
45 this._glContext = canvas.getContext("experimental-webgl");
46 }
43 } else { 47 } else {
44 this._2DContext = canvas.getContext( "2d" ); 48 this._2DContext = canvas.getContext( "2d" );
45 } 49 }
@@ -680,7 +684,7 @@ World.prototype.render = function() {
680 var root = this.getGeomRoot(); 684 var root = this.getGeomRoot();
681 this.hRender( root ); 685 this.hRender( root );
682 } else { 686 } else {
683 g_Engine.setContext( this._canvas.rdgeId ); 687 g_Engine.setContext( this._canvas.rdgeid );
684 //this.draw(); 688 //this.draw();
685 this.restartRenderLoop(); 689 this.restartRenderLoop();
686 } 690 }