|
@@ -40,7 +40,7 @@ class Engine {
|
|
var lastTime : Float;
|
|
var lastTime : Float;
|
|
var antiAlias : Int;
|
|
var antiAlias : Int;
|
|
var tmpVector = new h3d.Vector();
|
|
var tmpVector = new h3d.Vector();
|
|
- var stage : hxd.Stage;
|
|
|
|
|
|
+ var window : hxd.Window;
|
|
|
|
|
|
var targetTmp : TargetTmp;
|
|
var targetTmp : TargetTmp;
|
|
var targetStack : TargetTmp;
|
|
var targetStack : TargetTmp;
|
|
@@ -53,16 +53,16 @@ class Engine {
|
|
public var ready(default,null) = false;
|
|
public var ready(default,null) = false;
|
|
@:allow(hxd.res) var resCache = new Map<{},Dynamic>();
|
|
@:allow(hxd.res) var resCache = new Map<{},Dynamic>();
|
|
|
|
|
|
- @:access(hxd.Stage)
|
|
|
|
|
|
+ @:access(hxd.Window)
|
|
public function new( hardware = true, aa = 0 ) {
|
|
public function new( hardware = true, aa = 0 ) {
|
|
this.hardware = hardware;
|
|
this.hardware = hardware;
|
|
this.antiAlias = aa;
|
|
this.antiAlias = aa;
|
|
this.autoResize = true;
|
|
this.autoResize = true;
|
|
fullScreen = !hxd.System.getValue(IsWindowed);
|
|
fullScreen = !hxd.System.getValue(IsWindowed);
|
|
- stage = hxd.Stage.getInstance();
|
|
|
|
|
|
+ window = hxd.Window.getInstance();
|
|
realFps = hxd.System.getDefaultFrameRate();
|
|
realFps = hxd.System.getDefaultFrameRate();
|
|
lastTime = haxe.Timer.stamp();
|
|
lastTime = haxe.Timer.stamp();
|
|
- stage.addResizeEvent(onStageResize);
|
|
|
|
|
|
+ window.addResizeEvent(onWindowResize);
|
|
#if (js || cpp || hlsdl || usegl)
|
|
#if (js || cpp || hlsdl || usegl)
|
|
driver = new h3d.impl.GlDriver(antiAlias);
|
|
driver = new h3d.impl.GlDriver(antiAlias);
|
|
#elseif flash
|
|
#elseif flash
|
|
@@ -220,8 +220,8 @@ class Engine {
|
|
function onCreate( disposed ) {
|
|
function onCreate( disposed ) {
|
|
setCurrent();
|
|
setCurrent();
|
|
if( autoResize ) {
|
|
if( autoResize ) {
|
|
- width = stage.width;
|
|
|
|
- height = stage.height;
|
|
|
|
|
|
+ width = window.width;
|
|
|
|
+ height = window.height;
|
|
}
|
|
}
|
|
if( disposed )
|
|
if( disposed )
|
|
mem.onContextLost();
|
|
mem.onContextLost();
|
|
@@ -246,9 +246,9 @@ class Engine {
|
|
public dynamic function onReady() {
|
|
public dynamic function onReady() {
|
|
}
|
|
}
|
|
|
|
|
|
- function onStageResize() {
|
|
|
|
|
|
+ function onWindowResize() {
|
|
if( autoResize && !driver.isDisposed() ) {
|
|
if( autoResize && !driver.isDisposed() ) {
|
|
- var w = stage.width, h = stage.height;
|
|
|
|
|
|
+ var w = window.width, h = window.height;
|
|
if( w != width || h != height )
|
|
if( w != width || h != height )
|
|
resize(w, h);
|
|
resize(w, h);
|
|
onResized();
|
|
onResized();
|
|
@@ -258,7 +258,7 @@ class Engine {
|
|
function set_fullScreen(v) {
|
|
function set_fullScreen(v) {
|
|
fullScreen = v;
|
|
fullScreen = v;
|
|
if( mem != null && hxd.System.getValue(IsWindowed) )
|
|
if( mem != null && hxd.System.getValue(IsWindowed) )
|
|
- stage.setFullScreen(v);
|
|
|
|
|
|
+ window.setFullScreen(v);
|
|
return v;
|
|
return v;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -400,7 +400,7 @@ class Engine {
|
|
|
|
|
|
public function dispose() {
|
|
public function dispose() {
|
|
driver.dispose();
|
|
driver.dispose();
|
|
- stage.removeResizeEvent(onStageResize);
|
|
|
|
|
|
+ window.removeResizeEvent(onWindowResize);
|
|
}
|
|
}
|
|
|
|
|
|
function get_fps() {
|
|
function get_fps() {
|