Add flag for allow high DPI
This commit is contained in:
@@ -80,6 +80,7 @@ class NativeWindow {
|
||||
|
||||
}
|
||||
|
||||
if (Reflect.hasField (parent.config, "allowHighDPI") && parent.config.allowHighDPI) flags |= cast WindowFlags.WINDOW_FLAG_ALLOW_HIGHDPI;
|
||||
if (Reflect.hasField (parent.config, "borderless") && parent.config.borderless) flags |= cast WindowFlags.WINDOW_FLAG_BORDERLESS;
|
||||
if (Reflect.hasField (parent.config, "depthBuffer") && parent.config.depthBuffer) flags |= cast WindowFlags.WINDOW_FLAG_DEPTH_BUFFER;
|
||||
if (Reflect.hasField (parent.config, "fullscreen") && parent.config.fullscreen) flags |= cast WindowFlags.WINDOW_FLAG_FULLSCREEN;
|
||||
@@ -354,5 +355,6 @@ class NativeWindow {
|
||||
var WINDOW_FLAG_REQUIRE_SHADERS = 0x00000100;
|
||||
var WINDOW_FLAG_DEPTH_BUFFER = 0x00000200;
|
||||
var WINDOW_FLAG_STENCIL_BUFFER = 0x00000400;
|
||||
var WINDOW_FLAG_ALLOW_HIGHDPI = 0x00000800;
|
||||
|
||||
}
|
||||
@@ -21,6 +21,7 @@ typedef Config = {
|
||||
|
||||
typedef WindowConfig = {
|
||||
|
||||
@:optional var allowHighDPI:Bool;
|
||||
@:optional var antialiasing:Int;
|
||||
@:optional var background:Int;
|
||||
@:optional var borderless:Bool;
|
||||
|
||||
@@ -118,7 +118,7 @@ class HXProject {
|
||||
|
||||
defaultMeta = { title: "MyApplication", description: "", packageName: "com.example.myapp", version: "1.0.0", company: "Example, Inc.", companyUrl: "", buildNumber: "1", companyId: "" }
|
||||
defaultApp = { main: "Main", file: "MyApplication", path: "bin", preloader: "", swfVersion: 11.2, url: "", init: null }
|
||||
defaultWindow = { width: 800, height: 600, parameters: "{}", background: 0xFFFFFF, fps: 30, hardware: true, display: 0, resizable: true, borderless: false, orientation: Orientation.AUTO, vsync: false, fullscreen: false, antialiasing: 0, allowShaders: true, requireShaders: false, depthBuffer: false, stencilBuffer: false }
|
||||
defaultWindow = { width: 800, height: 600, parameters: "{}", background: 0xFFFFFF, fps: 30, hardware: true, display: 0, resizable: true, borderless: false, orientation: Orientation.AUTO, vsync: false, fullscreen: false, allowHighDPI: true, antialiasing: 0, allowShaders: true, requireShaders: false, depthBuffer: false, stencilBuffer: false }
|
||||
|
||||
platformType = PlatformType.DESKTOP;
|
||||
architectures = [];
|
||||
|
||||
@@ -1756,6 +1756,14 @@ class ProjectXMLParser extends HXProject {
|
||||
|
||||
}
|
||||
|
||||
case "allow-high-dpi":
|
||||
|
||||
if (Reflect.hasField (windows[id], "allowHighDPI")) {
|
||||
|
||||
Reflect.setField (windows[id], "allowHighDPI", value == "true");
|
||||
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
if (Reflect.hasField (windows[id], name)) {
|
||||
|
||||
@@ -16,6 +16,7 @@ typedef WindowData = {
|
||||
@:optional var borderless:Bool;
|
||||
@:optional var vsync:Bool;
|
||||
@:optional var fullscreen:Bool;
|
||||
@:optional var allowHighDPI:Bool;
|
||||
@:optional var antialiasing:Int;
|
||||
@:optional var orientation:Orientation;
|
||||
@:optional var allowShaders:Bool;
|
||||
|
||||
@@ -174,6 +174,13 @@ class HTML5Helper {
|
||||
var templatePaths = [ PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("lime")), "templates") ].concat (project.templatePaths);
|
||||
var args = [ "-Dapple.awt.UIElement=true", "-jar", PathHelper.findTemplate (templatePaths, "bin/compiler.jar"), "--js", sourceFile, "--js_output_file", tempFile ];
|
||||
|
||||
if (project.targetFlags.exists ("advanced")) {
|
||||
|
||||
args.push ("--compilation_level");
|
||||
args.push ("ADVANCED_OPTIMIZATIONS");
|
||||
|
||||
}
|
||||
|
||||
if (!LogHelper.verbose) {
|
||||
|
||||
args.push ("--jscomp_off=uselessCode");
|
||||
|
||||
@@ -62,7 +62,8 @@ namespace lime {
|
||||
WINDOW_FLAG_ALLOW_SHADERS = 0x00000080,
|
||||
WINDOW_FLAG_REQUIRE_SHADERS = 0x00000100,
|
||||
WINDOW_FLAG_DEPTH_BUFFER = 0x00000200,
|
||||
WINDOW_FLAG_STENCIL_BUFFER = 0x00000400
|
||||
WINDOW_FLAG_STENCIL_BUFFER = 0x00000400,
|
||||
WINDOW_FLAG_ALLOW_HIGHDPI = 0x00000800
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -39,7 +39,12 @@ namespace lime {
|
||||
if (flags & WINDOW_FLAG_HARDWARE) {
|
||||
|
||||
sdlFlags |= SDL_WINDOW_OPENGL;
|
||||
sdlFlags |= SDL_WINDOW_ALLOW_HIGHDPI;
|
||||
|
||||
if (flags & WINDOW_FLAG_ALLOW_HIGHDPI) {
|
||||
|
||||
sdlFlags |= SDL_WINDOW_ALLOW_HIGHDPI;
|
||||
|
||||
}
|
||||
|
||||
#if defined (HX_WINDOWS) && defined (NATIVE_TOOLKIT_SDL_ANGLE)
|
||||
SDL_GL_SetAttribute (SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
|
||||
|
||||
Reference in New Issue
Block a user