Bladeren bron

allow -D window=777x888 for custom window size

Nicolas Cannasse 11 jaren geleden
bovenliggende
commit
9b4f62cbcb
1 gewijzigde bestanden met toevoegingen van 7 en 1 verwijderingen
  1. 7 1
      hxd/System.hx

+ 7 - 1
hxd/System.hx

@@ -88,13 +88,19 @@ class System {
 
 	public static function start(callb) {
 		#if nme
+		var windowSize = haxe.macro.Compiler.getDefine("window");
+		if( windowSize == null ) windowSize = "800x600";
+		var windowSize = windowSize.split("x");
+		var width = Std.parseInt(windowSize[0]), height = Std.parseInt(windowSize[1]);
+		if( width < 100 ) width = 100;
+		if( height < 100 ) height = 100;
 		nme.Lib.create(function() {
             nme.Lib.current.stage.align = nme.display.StageAlign.TOP_LEFT;
             nme.Lib.current.stage.scaleMode = nme.display.StageScaleMode.NO_SCALE;
             nme.Lib.current.loaderInfo = nme.display.LoaderInfo.create(null);
             callb();
          },
-         640, 480,
+         width, height,
          120, // using 60 FPS with no vsync gives a fps ~= 50
          0xFFFFFF,
          (true ? nme.Lib.HARDWARE : 0) |