From b3d5f7e64a34a6637198502c58b4b63bb8d114fb Mon Sep 17 00:00:00 2001 From: Arthur Langereis Date: Tue, 6 Oct 2015 14:50:10 +0200 Subject: [PATCH] add missing optional attributes parameter for getContext() and missing context attribute defs, thanks to @ander-nz --- webgl-ext/webgl-ext.d.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/webgl-ext/webgl-ext.d.ts b/webgl-ext/webgl-ext.d.ts index c6a8cb34a1..42a4ee21b8 100644 --- a/webgl-ext/webgl-ext.d.ts +++ b/webgl-ext/webgl-ext.d.ts @@ -6,9 +6,19 @@ // These definitions go beyond those already defined in TS 1.6.2 stdlib // All non-draft WebGL 1.0 extensions and prefixed extension names are // covered. +// Some missing parameters for getContext and fields for +// WebGLContextAttributes are added as well, copied over from +// Shane Anderson's webgl interfaces. + + +interface WebGLContextAttributes { + preferLowPowerToHighPerformance?: boolean; + failIfMajorPerformanceCaveat?: boolean; +} interface HTMLCanvasElement { - getContext(contextId: "webgl"): WebGLRenderingContext; + getContext(contextId: "experimental-webgl", attributes?: WebGLContextAttributes): WebGLRenderingContext; + getContext(contextId: "webgl", attributes?: WebGLContextAttributes): WebGLRenderingContext; } interface WebGLRenderingContext {