aboutsummaryrefslogtreecommitdiff
path: root/js/lib
diff options
context:
space:
mode:
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 }