|
@@ -95,6 +95,7 @@ class App implements h3d.IDrawable {
|
|
engine = h3d.Engine.getCurrent(); // if was changed
|
|
engine = h3d.Engine.getCurrent(); // if was changed
|
|
isDisposed = false;
|
|
isDisposed = false;
|
|
engine.onReady = staticHandler; // in case we have another pending app
|
|
engine.onReady = staticHandler; // in case we have another pending app
|
|
|
|
+ engine.onContextLost = onContextLost;
|
|
engine.onResized = function() {
|
|
engine.onResized = function() {
|
|
if( s2d == null ) return; // if disposed
|
|
if( s2d == null ) return; // if disposed
|
|
s2d.checkResize();
|
|
s2d.checkResize();
|
|
@@ -103,6 +104,10 @@ class App implements h3d.IDrawable {
|
|
hxd.System.setLoop(mainLoop);
|
|
hxd.System.setLoop(mainLoop);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function onContextLost() {
|
|
|
|
+ if( s3d != null ) s3d.onContextLost();
|
|
|
|
+ }
|
|
|
|
+
|
|
function setScene2D( s2d : h2d.Scene, disposePrevious = true ) {
|
|
function setScene2D( s2d : h2d.Scene, disposePrevious = true ) {
|
|
sevents.removeScene(this.s2d);
|
|
sevents.removeScene(this.s2d);
|
|
sevents.addScene(s2d,0);
|
|
sevents.addScene(s2d,0);
|
|
@@ -127,6 +132,7 @@ class App implements h3d.IDrawable {
|
|
function setup() {
|
|
function setup() {
|
|
var initDone = false;
|
|
var initDone = false;
|
|
engine.onReady = staticHandler;
|
|
engine.onReady = staticHandler;
|
|
|
|
+ engine.onContextLost = onContextLost;
|
|
engine.onResized = function() {
|
|
engine.onResized = function() {
|
|
if( s2d == null ) return; // if disposed
|
|
if( s2d == null ) return; // if disposed
|
|
s2d.checkResize();
|
|
s2d.checkResize();
|