Merge pull request #1436 from Beeblerox/failIfMajorPerformanceCaveat
Add failIfMajorPerformanceCaveat setting
This commit is contained in:
@@ -287,7 +287,7 @@ class HTML5Window
|
|||||||
premultipliedAlpha: true,
|
premultipliedAlpha: true,
|
||||||
stencil: Reflect.hasField(contextAttributes, "stencil") ? contextAttributes.stencil : false,
|
stencil: Reflect.hasField(contextAttributes, "stencil") ? contextAttributes.stencil : false,
|
||||||
preserveDrawingBuffer: false,
|
preserveDrawingBuffer: false,
|
||||||
failIfMajorPerformanceCaveat: true
|
failIfMajorPerformanceCaveat: Reflect.hasField(contextAttributes, "failIfMajorPerformanceCaveat") ? contextAttributes.failIfMajorPerformanceCaveat : false,
|
||||||
};
|
};
|
||||||
|
|
||||||
var glContextType = ["webgl", "experimental-webgl"];
|
var glContextType = ["webgl", "experimental-webgl"];
|
||||||
|
|||||||
@@ -48,4 +48,10 @@ typedef RenderContextAttributes =
|
|||||||
Whether vertical-sync (VSync) is enabled
|
Whether vertical-sync (VSync) is enabled
|
||||||
**/
|
**/
|
||||||
@:optional var vsync:Bool;
|
@:optional var vsync:Bool;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Boolean that indicates if a context will be created
|
||||||
|
if the system performance is low or if no hardware GPU is available
|
||||||
|
**/
|
||||||
|
@:optional var failIfMajorPerformanceCaveat:Bool;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -509,6 +509,8 @@ class System
|
|||||||
attributes.x = Std.parseInt(argValue);
|
attributes.x = Std.parseInt(argValue);
|
||||||
case "y":
|
case "y":
|
||||||
attributes.y = Std.parseInt(argValue);
|
attributes.y = Std.parseInt(argValue);
|
||||||
|
case "failIfMajorPerformanceCaveat":
|
||||||
|
attributes.context.failIfMajorPerformanceCaveat = __parseBool(argValue);
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ class HXProject extends Script
|
|||||||
depthBuffer: true,
|
depthBuffer: true,
|
||||||
stencilBuffer: true,
|
stencilBuffer: true,
|
||||||
colorDepth: 32,
|
colorDepth: 32,
|
||||||
|
failIfMajorPerformanceCaveat: false,
|
||||||
maximized: false,
|
maximized: false,
|
||||||
minimized: false,
|
minimized: false,
|
||||||
hidden: false,
|
hidden: false,
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ typedef WindowData =
|
|||||||
@:optional var requireShaders:Bool;
|
@:optional var requireShaders:Bool;
|
||||||
@:optional var depthBuffer:Bool;
|
@:optional var depthBuffer:Bool;
|
||||||
@:optional var stencilBuffer:Bool;
|
@:optional var stencilBuffer:Bool;
|
||||||
|
@:optional var failIfMajorPerformanceCaveat:Bool;
|
||||||
@:optional var title:String;
|
@:optional var title:String;
|
||||||
#if (js && html5)
|
#if (js && html5)
|
||||||
@:optional var element:js.html.Element;
|
@:optional var element:js.html.Element;
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ import ::APP_MAIN::;
|
|||||||
depth: ::depthBuffer::,
|
depth: ::depthBuffer::,
|
||||||
hardware: ::hardware::,
|
hardware: ::hardware::,
|
||||||
stencil: ::stencilBuffer::,
|
stencil: ::stencilBuffer::,
|
||||||
|
failIfMajorPerformanceCaveat: ::failIfMajorPerformanceCaveat::,
|
||||||
type: null,
|
type: null,
|
||||||
vsync: ::vsync::
|
vsync: ::vsync::
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user