浏览代码

added -D windowSize=WWWxHHH for hxsdl

Nicolas Cannasse 10 年之前
父节点
当前提交
5cf77fdf40
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      hxd/System.hx

+ 6 - 0
hxd/System.hx

@@ -452,6 +452,12 @@ class System {
 		for( sdl in keys.keys() )
 			addKey(sdl, keys.get(sdl));
 		sdl.Sdl.init();
+		var size = haxe.macro.Compiler.getDefine("windowSize");
+		if( size != null ) {
+			var p = size.split("x");
+			windowWidth = Std.parseInt(p[0]);
+			windowHeight = Std.parseInt(p[1]);
+		}
 		win = new sdl.Window("", windowWidth, windowHeight);
 		init();
 		sdl.Sdl.loop(mainLoop,onEvent);