From 700894246fbac2889ee32b6f5f656968b05feb5e Mon Sep 17 00:00:00 2001 From: Clark Stevenson Date: Tue, 24 Mar 2015 21:27:20 +0000 Subject: [PATCH 1/6] Pixi Minor change for 2.2.8 --- typescript/pixi.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/typescript/pixi.d.ts b/typescript/pixi.d.ts index f5e5f2c30..3f55ff817 100644 --- a/typescript/pixi.d.ts +++ b/typescript/pixi.d.ts @@ -1,4 +1,4 @@ -// Type definitions for PIXI 2.2.7 2015-03-03 +// Type definitions for PIXI 2.2.8 2015-03-24 // Project: https://github.com/GoodBoyDigital/pixi.js/ declare module PIXI { @@ -134,6 +134,7 @@ declare module PIXI { dropShadowDistance?: number; fill?: string; font?: string; + lineJoin?: string; stroke?: string; strokeThickness?: number; wordWrap?: boolean; @@ -677,7 +678,7 @@ declare module PIXI { target: Sprite; originalEvent: Event; - getLocalPosition(displayObject: DisplayObject): Point; + getLocalPosition(displayObject: DisplayObject, point?: Point, globalPos?: Point): Point; } From c299213994ffa82f11478533ca2f74c9585860ee Mon Sep 17 00:00:00 2001 From: Clark Stevenson Date: Tue, 24 Mar 2015 21:28:24 +0000 Subject: [PATCH 2/6] Phaser Minor Changes for 2.3.0 RC1 Review --- typescript/phaser.d.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/typescript/phaser.d.ts b/typescript/phaser.d.ts index f60218f38..3a6fd4a10 100644 --- a/typescript/phaser.d.ts +++ b/typescript/phaser.d.ts @@ -1,6 +1,6 @@ /// -// Type definitions for Phaser 2.3.0 2015-03-03 +// Type definitions for Phaser 2.3.0 RC1 2015-03-24 // Project: https://github.com/photonstorm/phaser declare class Phaser { @@ -165,6 +165,7 @@ declare module Phaser { exists(item: any): boolean; reset(): void; remove(item: any): any; + removeAll(destoy?: boolean): void; setAll(key: any, value: any): void; callAll(key: string, ...parameter: any[]): void; @@ -290,6 +291,7 @@ declare module Phaser { input: Phaser.InputHandler; inputEnabled: boolean; name: string; + physicsType: number; previousPosition: Phaser.Point; previousRotation: Phaser.Point; position: Phaser.Point; @@ -328,6 +330,7 @@ declare module Phaser { onOverMouseOnly: boolean; onUpSound: Phaser.Sound|Phaser.AudioSprite; onUpSoundMaker: string; + physicsType: number; type: number; clearFrames(): void; @@ -1390,6 +1393,7 @@ declare module Phaser { game: Phaser.Game; height: number; name: string; + physicsType: number; position: Phaser.Point; previousPosition: Point; previousRotation: number; @@ -1433,6 +1437,7 @@ declare module Phaser { name: string; onDestroy: Phaser.Signal; physicsBodyType: number; + physicsType: number; position: Phaser.Point; rotation: number; scale: Phaser.Point; @@ -1661,6 +1666,7 @@ declare module Phaser { dragOffset: Phaser.Point; dragFromCenter: boolean; draggable: boolean; + dragStartPoint: Phaser.Point; enabled: boolean; game: Phaser.Game; globalToLocalX(x: number): number; @@ -2305,6 +2311,7 @@ declare module Phaser { particleSendToBack: boolean; particleClass: Phaser.Sprite; particleDrag: Phaser.Point; + physicsType: number; position: Phaser.Point; right: number; scaleData: any[]; @@ -2356,6 +2363,7 @@ declare module Phaser { enable(object: any, system?: number, debug?: boolean): void; parseConfig(): void; preUpdate(): void; + reset(): void; setBoundsToWorld(): void; startSystem(system: number): void; update(): void; @@ -2366,6 +2374,7 @@ declare module Phaser { class Arcade { + static SORT_NONE: number; static LEFT_RIGHT: number; static RIGHT_LEFT: number; static TOP_BOTTOM: number; @@ -3901,6 +3910,7 @@ declare module Phaser { previousRotation: number; position: Phaser.Point; physicsEnabled: boolean; + physicsType: number; renderOrderID: number; right: number; scale: Phaser.Point; @@ -4091,6 +4101,7 @@ declare module Phaser { camera: Phaser.Camera; game: Phaser.Game; input: Phaser.Input; + key: string; load: Phaser.Loader; make: Phaser.GameObjectCreator; math: Phaser.Math; @@ -4192,6 +4203,8 @@ declare module Phaser { inputEnabled: boolean; lineSpacing: number; name: string; + padding: Phaser.Point; + physicsType: number; position: Phaser.Point; previousPosition: Phaser.Point; previousRotation: number; @@ -4380,6 +4393,7 @@ declare module Phaser { layer: Phaser.TilemapLayer; map: Phaser.Tilemap; name: string; + physicsType: number; rayStepRate: number; renderSettings: { enableScrollDelta: boolean; overdrawRatio: number; copyCanvas: any; }; scrollFactorX: number; From 3f47f8a3c888e92591eab31ccd783163025c7f6f Mon Sep 17 00:00:00 2001 From: Clark Stevenson Date: Tue, 24 Mar 2015 21:31:27 +0000 Subject: [PATCH 3/6] Updated TypeScript Readme to recommend TypeScript 1.4, and removed webgl.d.ts for that reason. --- typescript/readme.md | 6 +- typescript/webgl.d.ts | 687 ------------------------------------------ 2 files changed, 3 insertions(+), 690 deletions(-) delete mode 100644 typescript/webgl.d.ts diff --git a/typescript/readme.md b/typescript/readme.md index 89370c1a6..32d685afb 100644 --- a/typescript/readme.md +++ b/typescript/readme.md @@ -2,10 +2,10 @@ If you are a phaser dev then reference the `phaser.d.ts` in your project. -- `phaser.d.ts` contains a reference to `pixi.d.ts` and so both these files must remain siblings in the same directory. -- `pixi.d.ts` has no dependencies and can be used by pixi devs standalone* +Please use TypeScript 1.4 -*Versions of TypeScript lower than version 1.0 may experience errors in `pixi.d.ts` due to missing WebGL definitions. If you fall into this category and cannot upgrade your version, then a `webgl.d.ts` has been provided but is disabled by default. Add this line to the top of the `pixi.d.ts` file `/// ` +- `phaser.d.ts` contains a reference to `pixi.d.ts` and so both these files must remain siblings in the same directory. +- `pixi.d.ts` has no dependencies and can be used by pixi devs standalone. ## Contributing ## diff --git a/typescript/webgl.d.ts b/typescript/webgl.d.ts deleted file mode 100644 index 0a2b6599e..000000000 --- a/typescript/webgl.d.ts +++ /dev/null @@ -1,687 +0,0 @@ -// -// Copr. (c) 2012 Piers Haken -// -// see: http://www.khronos.org/registry/webgl/specs/latest/ -// - -interface WebGLObject -{ -} - -interface WebGLBuffer extends WebGLObject -{ -} - -interface WebGLFramebuffer extends WebGLObject -{ -} - -interface WebGLProgram extends WebGLObject -{ -} - -interface WebGLRenderbuffer extends WebGLObject -{ -} - -interface WebGLShader extends WebGLObject -{ -} - -interface WebGLTexture extends WebGLObject -{ -} - -interface WebGLUniformLocation -{ -} - -interface WebGLActiveInfo -{ - size: number; - type: number; - name: string; -} - -interface WebGLShaderPrecisionFormat -{ - rangeMin: number; - rangeMax: number; - precision: number; -} - - -interface WebGLContextAttributes -{ - alpha: boolean; - depth: boolean; - stencil: boolean; - antialias: boolean; - premultipliedAlpha: boolean; - preserveDrawingBuffer: boolean; -} - -interface WebGLRenderingContext -{ - /* ClearBufferMask */ - DEPTH_BUFFER_BIT: number; - STENCIL_BUFFER_BIT: number; - COLOR_BUFFER_BIT: number; - - /* BeginMode */ - POINTS: number; - LINES: number; - LINE_LOOP: number; - LINE_STRIP: number; - TRIANGLES: number; - TRIANGLE_STRIP: number; - TRIANGLE_FAN: number; - - /* AlphaFunction (not supported in ES20) */ - /* NEVER */ - /* LESS */ - /* EQUAL */ - /* LEQUAL */ - /* GREATER */ - /* NOTEQUAL */ - /* GEQUAL */ - /* ALWAYS */ - - /* BlendingFactorDest */ - ZERO: number; - ONE: number; - SRC_COLOR: number; - ONE_MINUS_SRC_COLOR: number; - SRC_ALPHA: number; - ONE_MINUS_SRC_ALPHA: number; - DST_ALPHA: number; - ONE_MINUS_DST_ALPHA: number; - - /* BlendingFactorSrc */ - /* ZERO */ - /* ONE */ - DST_COLOR: number; - ONE_MINUS_DST_COLOR: number; - SRC_ALPHA_SATURATE: number; - /* SRC_ALPHA */ - /* ONE_MINUS_SRC_ALPHA */ - /* DST_ALPHA */ - /* ONE_MINUS_DST_ALPHA */ - - /* BlendEquationSeparate */ - FUNC_ADD: number; - BLEND_EQUATION: number; - BLEND_EQUATION_RGB: number; - BLEND_EQUATION_ALPHA: number; - - /* BlendSubtract */ - FUNC_SUBTRACT: number; - FUNC_REVERSE_SUBTRACT: number; - - /* Separate Blend Functions */ - BLEND_DST_RGB: number; - BLEND_SRC_RGB: number; - BLEND_DST_ALPHA: number; - BLEND_SRC_ALPHA: number; - CONSTANT_COLOR: number; - ONE_MINUS_CONSTANT_COLOR: number; - CONSTANT_ALPHA: number; - ONE_MINUS_CONSTANT_ALPHA: number; - BLEND_COLOR: number; - - /* Buffer Objects */ - ARRAY_BUFFER: number; - ELEMENT_ARRAY_BUFFER: number; - ARRAY_BUFFER_BINDING: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - - STREAM_DRAW: number; - STATIC_DRAW: number; - DYNAMIC_DRAW: number; - - BUFFER_SIZE: number; - BUFFER_USAGE: number; - - CURRENT_VERTEX_ATTRIB: number; - - /* CullFaceMode */ - FRONT: number; - BACK: number; - FRONT_AND_BACK: number; - - /* DepthFunction */ - /* NEVER */ - /* LESS */ - /* EQUAL */ - /* LEQUAL */ - /* GREATER */ - /* NOTEQUAL */ - /* GEQUAL */ - /* ALWAYS */ - - /* EnableCap */ - /* TEXTURE_2D */ - CULL_FACE: number; - BLEND: number; - DITHER: number; - STENCIL_TEST: number; - DEPTH_TEST: number; - SCISSOR_TEST: number; - POLYGON_OFFSET_FILL: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - SAMPLE_COVERAGE: number; - - /* ErrorCode */ - NO_ERROR: number; - INVALID_ENUM: number; - INVALID_VALUE: number; - INVALID_OPERATION: number; - OUT_OF_MEMORY: number; - - /* FrontFaceDirection */ - CW: number; - CCW: number; - - /* GetPName */ - LINE_WIDTH: number; - ALIASED_POINT_SIZE_RANGE: number; - ALIASED_LINE_WIDTH_RANGE: number; - CULL_FACE_MODE: number; - FRONT_FACE: number; - DEPTH_RANGE: number; - DEPTH_WRITEMASK: number; - DEPTH_CLEAR_VALUE: number; - DEPTH_FUNC: number; - STENCIL_CLEAR_VALUE: number; - STENCIL_FUNC: number; - STENCIL_FAIL: number; - STENCIL_PASS_DEPTH_FAIL: number; - STENCIL_PASS_DEPTH_PASS: number; - STENCIL_REF: number; - STENCIL_VALUE_MASK: number; - STENCIL_WRITEMASK: number; - STENCIL_BACK_FUNC: number; - STENCIL_BACK_FAIL: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - STENCIL_BACK_REF: number; - STENCIL_BACK_VALUE_MASK: number; - STENCIL_BACK_WRITEMASK: number; - VIEWPORT: number; - SCISSOR_BOX: number; - /* SCISSOR_TEST */ - COLOR_CLEAR_VALUE: number; - COLOR_WRITEMASK: number; - UNPACK_ALIGNMENT: number; - PACK_ALIGNMENT: number; - MAX_TEXTURE_SIZE: number; - MAX_VIEWPORT_DIMS: number; - SUBPIXEL_BITS: number; - RED_BITS: number; - GREEN_BITS: number; - BLUE_BITS: number; - ALPHA_BITS: number; - DEPTH_BITS: number; - STENCIL_BITS: number; - POLYGON_OFFSET_UNITS: number; - /* POLYGON_OFFSET_FILL */ - POLYGON_OFFSET_FACTOR: number; - TEXTURE_BINDING_2D: number; - SAMPLE_BUFFERS: number; - SAMPLES: number; - SAMPLE_COVERAGE_VALUE: number; - SAMPLE_COVERAGE_INVERT: number; - - /* GetTextureParameter */ - /* TEXTURE_MAG_FILTER */ - /* TEXTURE_MIN_FILTER */ - /* TEXTURE_WRAP_S */ - /* TEXTURE_WRAP_T */ - - COMPRESSED_TEXTURE_FORMATS: number; - - /* HintMode */ - DONT_CARE: number; - FASTEST: number; - NICEST: number; - - /* HintTarget */ - GENERATE_MIPMAP_HINT: number; - - /* DataType */ - BYTE: number; - UNSIGNED_BYTE: number; - SHORT: number; - UNSIGNED_SHORT: number; - INT: number; - UNSIGNED_INT: number; - FLOAT: number; - - /* PixelFormat */ - DEPTH_COMPONENT: number; - ALPHA: number; - RGB: number; - RGBA: number; - LUMINANCE: number; - LUMINANCE_ALPHA: number; - - /* PixelType */ - /* UNSIGNED_BYTE */ - UNSIGNED_SHORT_4_4_4_4: number; - UNSIGNED_SHORT_5_5_5_1: number; - UNSIGNED_SHORT_5_6_5: number; - - /* Shaders */ - FRAGMENT_SHADER: number; - VERTEX_SHADER: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - MAX_VARYING_VECTORS: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - MAX_TEXTURE_IMAGE_UNITS: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - SHADER_TYPE: number; - DELETE_STATUS: number; - LINK_STATUS: number; - VALIDATE_STATUS: number; - ATTACHED_SHADERS: number; - ACTIVE_UNIFORMS: number; - ACTIVE_ATTRIBUTES: number; - SHADING_LANGUAGE_VERSION: number; - CURRENT_PROGRAM: number; - - /* StencilFunction */ - NEVER: number; - LESS: number; - EQUAL: number; - LEQUAL: number; - GREATER: number; - NOTEQUAL: number; - GEQUAL: number; - ALWAYS: number; - - /* StencilOp */ - /* ZERO */ - KEEP: number; - REPLACE: number; - INCR: number; - DECR: number; - INVERT: number; - INCR_WRAP: number; - DECR_WRAP: number; - - /* StringName */ - VENDOR: number; - RENDERER: number; - VERSION: number; - - /* TextureMagFilter */ - NEAREST: number; - LINEAR: number; - - /* TextureMinFilter */ - /* NEAREST */ - /* LINEAR */ - NEAREST_MIPMAP_NEAREST: number; - LINEAR_MIPMAP_NEAREST: number; - NEAREST_MIPMAP_LINEAR: number; - LINEAR_MIPMAP_LINEAR: number; - - /* TextureParameterName */ - TEXTURE_MAG_FILTER: number; - TEXTURE_MIN_FILTER: number; - TEXTURE_WRAP_S: number; - TEXTURE_WRAP_T: number; - - /* TextureTarget */ - TEXTURE_2D: number; - TEXTURE: number; - - TEXTURE_CUBE_MAP: number; - TEXTURE_BINDING_CUBE_MAP: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - - /* TextureUnit */ - TEXTURE0: number; - TEXTURE1: number; - TEXTURE2: number; - TEXTURE3: number; - TEXTURE4: number; - TEXTURE5: number; - TEXTURE6: number; - TEXTURE7: number; - TEXTURE8: number; - TEXTURE9: number; - TEXTURE10: number; - TEXTURE11: number; - TEXTURE12: number; - TEXTURE13: number; - TEXTURE14: number; - TEXTURE15: number; - TEXTURE16: number; - TEXTURE17: number; - TEXTURE18: number; - TEXTURE19: number; - TEXTURE20: number; - TEXTURE21: number; - TEXTURE22: number; - TEXTURE23: number; - TEXTURE24: number; - TEXTURE25: number; - TEXTURE26: number; - TEXTURE27: number; - TEXTURE28: number; - TEXTURE29: number; - TEXTURE30: number; - TEXTURE31: number; - ACTIVE_TEXTURE: number; - - /* TextureWrapMode */ - REPEAT: number; - CLAMP_TO_EDGE: number; - MIRRORED_REPEAT: number; - - /* Uniform Types */ - FLOAT_VEC2: number; - FLOAT_VEC3: number; - FLOAT_VEC4: number; - INT_VEC2: number; - INT_VEC3: number; - INT_VEC4: number; - BOOL: number; - BOOL_VEC2: number; - BOOL_VEC3: number; - BOOL_VEC4: number; - FLOAT_MAT2: number; - FLOAT_MAT3: number; - FLOAT_MAT4: number; - SAMPLER_2D: number; - SAMPLER_CUBE: number; - - /* Vertex Arrays */ - VERTEX_ATTRIB_ARRAY_ENABLED: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - - /* Shader Source */ - COMPILE_STATUS: number; - - /* Shader Precision-Specified Types */ - LOW_FLOAT: number; - MEDIUM_FLOAT: number; - HIGH_FLOAT: number; - LOW_INT: number; - MEDIUM_INT: number; - HIGH_INT: number; - - /* Framebuffer Object. */ - FRAMEBUFFER: number; - RENDERBUFFER: number; - - RGBA4: number; - RGB5_A1: number; - RGB565: number; - DEPTH_COMPONENT16: number; - STENCIL_INDEX: number; - STENCIL_INDEX8: number; - DEPTH_STENCIL: number; - - RENDERBUFFER_WIDTH: number; - RENDERBUFFER_HEIGHT: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - RENDERBUFFER_RED_SIZE: number; - RENDERBUFFER_GREEN_SIZE: number; - RENDERBUFFER_BLUE_SIZE: number; - RENDERBUFFER_ALPHA_SIZE: number; - RENDERBUFFER_DEPTH_SIZE: number; - RENDERBUFFER_STENCIL_SIZE: number; - - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - - COLOR_ATTACHMENT0: number; - DEPTH_ATTACHMENT: number; - STENCIL_ATTACHMENT: number; - DEPTH_STENCIL_ATTACHMENT: number; - - NONE: number; - - FRAMEBUFFER_COMPLETE: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - FRAMEBUFFER_UNSUPPORTED: number; - - FRAMEBUFFER_BINDING: number; - RENDERBUFFER_BINDING: number; - MAX_RENDERBUFFER_SIZE: number; - - INVALID_FRAMEBUFFER_OPERATION: number; - - /* WebGL-specific enums */ - UNPACK_FLIP_Y_WEBGL: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - CONTEXT_LOST_WEBGL: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - BROWSER_DEFAULT_WEBGL: number; - - - - - canvas: HTMLCanvasElement; - drawingBufferWidth: number; - drawingBufferHeight: number; - - getContextAttributes(): WebGLContextAttributes; - isContextLost(): boolean; - - getSupportedExtensions(): string[]; - getExtension(name: string): any; - - activeTexture(texture: number): void; - attachShader(program: WebGLProgram, shader: WebGLShader): void; - bindAttribLocation(program: WebGLProgram, index: number, name: string): void; - bindBuffer(target: number, buffer: WebGLBuffer): void; - bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; - bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; - bindTexture(target: number, texture: WebGLTexture): void; - blendColor(red: number, green: number, blue: number, alpha: number): void; - blendEquation(mode: number): void; - blendEquationSeparate(modeRGB: number, modeAlpha: number): void; - blendFunc(sfactor: number, dfactor: number): void; - blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; - - bufferData(target: number, size: number, usage: number): void; - bufferData(target: number, data: ArrayBufferView, usage: number): void; - bufferData(target: number, data: ArrayBuffer, usage: number): void; - bufferSubData(target: number, offset: number, data: ArrayBufferView): void; - bufferSubData(target: number, offset: number, data: ArrayBuffer): void; - - checkFramebufferStatus(target: number): number; - clear(mask: number): void; - clearColor(red: number, green: number, blue: number, alpha: number): void; - clearDepth(depth: number): void; - clearStencil(s: number): void; - colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; - compileShader(shader: WebGLShader): void; - - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; - - copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; - copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; - - createBuffer(): WebGLBuffer; - createFramebuffer(): WebGLFramebuffer; - createProgram(): WebGLProgram; - createRenderbuffer(): WebGLRenderbuffer; - createShader(type: number): WebGLShader; - createTexture(): WebGLTexture; - - cullFace(mode: number): void; - - deleteBuffer(buffer: WebGLBuffer): void; - deleteFramebuffer(framebuffer: WebGLFramebuffer): void; - deleteProgram(program: WebGLProgram): void; - deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; - deleteShader(shader: WebGLShader): void; - deleteTexture(texture: WebGLTexture): void; - - depthFunc(func: number): void; - depthMask(flag: boolean): void; - depthRange(zNear: number, zFar: number): void; - detachShader(program: WebGLProgram, shader: WebGLShader): void; - disable(cap: number): void; - disableVertexAttribArray(index: number): void; - drawArrays(mode: number, first: number, count: number): void; - drawElements(mode: number, count: number, type: number, offset: number): void; - - enable(cap: number): void; - enableVertexAttribArray(index: number): void; - finish(): void; - flush(): void; - framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; - framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; - frontFace(mode: number): void; - - generateMipmap(target: number): void; - - getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; - getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; - getAttachedShaders(program: WebGLProgram): WebGLShader[]; - - getAttribLocation(program: WebGLProgram, name: string): number; - - getBufferParameter(target: number, pname: number): any; - getParameter(pname: number): any; - - getError(): number; - - getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; - getProgramParameter(program: WebGLProgram, pname: number): any; - getProgramInfoLog(program: WebGLProgram): string; - getRenderbufferParameter(target: number, pname: number): any; - getShaderParameter(shader: WebGLShader, pname: number): any; - getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; - getShaderInfoLog(shader: WebGLShader): string; - - getShaderSource(shader: WebGLShader): string; - - getTexParameter(target: number, pname: number): any; - - getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; - - getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; - - getVertexAttrib(index: number, pname: number): any; - - getVertexAttribOffset(index: number, pname: number): number; - - hint(target: number, mode: number): void; - isBuffer(buffer: WebGLBuffer): boolean; - isEnabled(cap: number): boolean; - isFramebuffer(framebuffer: WebGLFramebuffer): boolean; - isProgram(program: WebGLProgram): boolean; - isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; - isShader(shader: WebGLShader): boolean; - isTexture(texture: WebGLTexture): boolean; - lineWidth(width: number): void; - linkProgram(program: WebGLProgram): void; - pixelStorei(pname: number, param: number): void; - polygonOffset(factor: number, units: number): void; - - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - - renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; - sampleCoverage(value: number, invert: boolean): void; - scissor(x: number, y: number, width: number, height: number): void; - - shaderSource(shader: WebGLShader, source: string): void; - - stencilFunc(func: number, ref: number, mask: number): void; - stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; - stencilMask(mask: number): void; - stencilMaskSeparate(face: number, mask: number): void; - stencilOp(fail: number, zfail: number, zpass: number): void; - stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; - - texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void; // May throw DOMException - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void; // May throw DOMException - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void; // May throw DOMException - - texParameterf(target: number, pname: number, param: number): void; - texParameteri(target: number, pname: number, param: number): void; - - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void; // May throw DOMException - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void; // May throw DOMException - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void; // May throw DOMException - - uniform1f(location: WebGLUniformLocation, x: number): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array): void; - uniform1fv(location: WebGLUniformLocation, v: number[]): void; - uniform1i(location: WebGLUniformLocation, x: number): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; - uniform1iv(location: WebGLUniformLocation, v: number[]): void; - uniform2f(location: WebGLUniformLocation, x: number, y: number): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array): void; - uniform2fv(location: WebGLUniformLocation, v: number[]): void; - uniform2i(location: WebGLUniformLocation, x: number, y: number): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; - uniform2iv(location: WebGLUniformLocation, v: number[]): void; - uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array): void; - uniform3fv(location: WebGLUniformLocation, v: number[]): void; - uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; - uniform3iv(location: WebGLUniformLocation, v: number[]): void; - uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array): void; - uniform4fv(location: WebGLUniformLocation, v: number[]): void; - uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; - uniform4iv(location: WebGLUniformLocation, v: number[]): void; - - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - - useProgram(program: WebGLProgram): void; - validateProgram(program: WebGLProgram): void; - - vertexAttrib1f(indx: number, x: number): void; - vertexAttrib1fv(indx: number, values: Float32Array): void; - vertexAttrib1fv(indx: number, value: number[]): void; - vertexAttrib2f(indx: number, x: number, y: number): void; - vertexAttrib2fv(indx: number, values: Float32Array): void; - vertexAttrib2fv(indx: number, value: number[]): void; - vertexAttrib3f(indx: number, x: number, y: number, z: number): void; - vertexAttrib3fv(indx: number, values: Float32Array): void; - vertexAttrib3fv(indx: number, value: number[]): void; - vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; - vertexAttrib4fv(indx: number, values: Float32Array): void; - vertexAttrib4fv(indx: number, value: number[]): void; - vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; - - viewport(x: number, y: number, width: number, height: number): void; -} - From cb8a7c467ee5f69f6661790b624722ecbef58f07 Mon Sep 17 00:00:00 2001 From: Clark Stevenson Date: Tue, 24 Mar 2015 21:27:20 +0000 Subject: [PATCH 4/6] Pixi Minor change for 2.2.8 --- typescript/pixi.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/typescript/pixi.d.ts b/typescript/pixi.d.ts index 163b43616..c8405e961 100644 --- a/typescript/pixi.d.ts +++ b/typescript/pixi.d.ts @@ -1,4 +1,4 @@ -// Type definitions for PIXI 2.2.7 2015-03-03 +// Type definitions for PIXI 2.2.8 2015-03-24 // Project: https://github.com/GoodBoyDigital/pixi.js/ declare module PIXI { @@ -134,6 +134,7 @@ declare module PIXI { dropShadowDistance?: number; fill?: string; font?: string; + lineJoin?: string; stroke?: string; strokeThickness?: number; wordWrap?: boolean; @@ -677,7 +678,7 @@ declare module PIXI { target: Sprite; originalEvent: Event; - getLocalPosition(displayObject: DisplayObject): Point; + getLocalPosition(displayObject: DisplayObject, point?: Point, globalPos?: Point): Point; } From 421ed4a715d7fc5a49b6fd1b41fcd706ebd36eb9 Mon Sep 17 00:00:00 2001 From: Clark Stevenson Date: Tue, 24 Mar 2015 21:28:24 +0000 Subject: [PATCH 5/6] Phaser Minor Changes for 2.3.0 RC1 Review --- typescript/phaser.d.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/typescript/phaser.d.ts b/typescript/phaser.d.ts index a15e66bd2..9b23afe8f 100644 --- a/typescript/phaser.d.ts +++ b/typescript/phaser.d.ts @@ -1,7 +1,7 @@ /// /// -// Type definitions for Phaser 2.3.0 2015-03-03 +// Type definitions for Phaser 2.3.0 RC1 2015-03-24 // Project: https://github.com/photonstorm/phaser declare class Phaser { @@ -166,6 +166,7 @@ declare module Phaser { exists(item: any): boolean; reset(): void; remove(item: any): any; + removeAll(destoy?: boolean): void; setAll(key: any, value: any): void; callAll(key: string, ...parameter: any[]): void; @@ -291,6 +292,7 @@ declare module Phaser { input: Phaser.InputHandler; inputEnabled: boolean; name: string; + physicsType: number; previousPosition: Phaser.Point; previousRotation: Phaser.Point; position: Phaser.Point; @@ -329,6 +331,7 @@ declare module Phaser { onOverMouseOnly: boolean; onUpSound: Phaser.Sound|Phaser.AudioSprite; onUpSoundMaker: string; + physicsType: number; type: number; clearFrames(): void; @@ -1391,6 +1394,7 @@ declare module Phaser { game: Phaser.Game; height: number; name: string; + physicsType: number; position: Phaser.Point; previousPosition: Point; previousRotation: number; @@ -1434,6 +1438,7 @@ declare module Phaser { name: string; onDestroy: Phaser.Signal; physicsBodyType: number; + physicsType: number; position: Phaser.Point; rotation: number; scale: Phaser.Point; @@ -1662,6 +1667,7 @@ declare module Phaser { dragOffset: Phaser.Point; dragFromCenter: boolean; draggable: boolean; + dragStartPoint: Phaser.Point; enabled: boolean; game: Phaser.Game; globalToLocalX(x: number): number; @@ -2306,6 +2312,7 @@ declare module Phaser { particleSendToBack: boolean; particleClass: Phaser.Sprite; particleDrag: Phaser.Point; + physicsType: number; position: Phaser.Point; right: number; scaleData: any[]; @@ -2357,6 +2364,7 @@ declare module Phaser { enable(object: any, system?: number, debug?: boolean): void; parseConfig(): void; preUpdate(): void; + reset(): void; setBoundsToWorld(): void; startSystem(system: number): void; update(): void; @@ -2367,6 +2375,7 @@ declare module Phaser { class Arcade { + static SORT_NONE: number; static LEFT_RIGHT: number; static RIGHT_LEFT: number; static TOP_BOTTOM: number; @@ -3902,6 +3911,7 @@ declare module Phaser { previousRotation: number; position: Phaser.Point; physicsEnabled: boolean; + physicsType: number; renderOrderID: number; right: number; scale: Phaser.Point; @@ -4092,6 +4102,7 @@ declare module Phaser { camera: Phaser.Camera; game: Phaser.Game; input: Phaser.Input; + key: string; load: Phaser.Loader; make: Phaser.GameObjectCreator; math: Phaser.Math; @@ -4193,6 +4204,8 @@ declare module Phaser { inputEnabled: boolean; lineSpacing: number; name: string; + padding: Phaser.Point; + physicsType: number; position: Phaser.Point; previousPosition: Phaser.Point; previousRotation: number; @@ -4381,6 +4394,7 @@ declare module Phaser { layer: Phaser.TilemapLayer; map: Phaser.Tilemap; name: string; + physicsType: number; rayStepRate: number; renderSettings: { enableScrollDelta: boolean; overdrawRatio: number; copyCanvas: any; }; scrollFactorX: number; From e5dc470a596f3a4e1c46e04e311f479815827900 Mon Sep 17 00:00:00 2001 From: Clark Stevenson Date: Tue, 24 Mar 2015 21:31:27 +0000 Subject: [PATCH 6/6] Updated TypeScript Readme to recommend TypeScript 1.4, and removed webgl.d.ts for that reason. --- typescript/readme.md | 6 +- typescript/webgl.d.ts | 687 ------------------------------------------ 2 files changed, 3 insertions(+), 690 deletions(-) delete mode 100644 typescript/webgl.d.ts diff --git a/typescript/readme.md b/typescript/readme.md index 89370c1a6..32d685afb 100644 --- a/typescript/readme.md +++ b/typescript/readme.md @@ -2,10 +2,10 @@ If you are a phaser dev then reference the `phaser.d.ts` in your project. -- `phaser.d.ts` contains a reference to `pixi.d.ts` and so both these files must remain siblings in the same directory. -- `pixi.d.ts` has no dependencies and can be used by pixi devs standalone* +Please use TypeScript 1.4 -*Versions of TypeScript lower than version 1.0 may experience errors in `pixi.d.ts` due to missing WebGL definitions. If you fall into this category and cannot upgrade your version, then a `webgl.d.ts` has been provided but is disabled by default. Add this line to the top of the `pixi.d.ts` file `/// ` +- `phaser.d.ts` contains a reference to `pixi.d.ts` and so both these files must remain siblings in the same directory. +- `pixi.d.ts` has no dependencies and can be used by pixi devs standalone. ## Contributing ## diff --git a/typescript/webgl.d.ts b/typescript/webgl.d.ts deleted file mode 100644 index 0a2b6599e..000000000 --- a/typescript/webgl.d.ts +++ /dev/null @@ -1,687 +0,0 @@ -// -// Copr. (c) 2012 Piers Haken -// -// see: http://www.khronos.org/registry/webgl/specs/latest/ -// - -interface WebGLObject -{ -} - -interface WebGLBuffer extends WebGLObject -{ -} - -interface WebGLFramebuffer extends WebGLObject -{ -} - -interface WebGLProgram extends WebGLObject -{ -} - -interface WebGLRenderbuffer extends WebGLObject -{ -} - -interface WebGLShader extends WebGLObject -{ -} - -interface WebGLTexture extends WebGLObject -{ -} - -interface WebGLUniformLocation -{ -} - -interface WebGLActiveInfo -{ - size: number; - type: number; - name: string; -} - -interface WebGLShaderPrecisionFormat -{ - rangeMin: number; - rangeMax: number; - precision: number; -} - - -interface WebGLContextAttributes -{ - alpha: boolean; - depth: boolean; - stencil: boolean; - antialias: boolean; - premultipliedAlpha: boolean; - preserveDrawingBuffer: boolean; -} - -interface WebGLRenderingContext -{ - /* ClearBufferMask */ - DEPTH_BUFFER_BIT: number; - STENCIL_BUFFER_BIT: number; - COLOR_BUFFER_BIT: number; - - /* BeginMode */ - POINTS: number; - LINES: number; - LINE_LOOP: number; - LINE_STRIP: number; - TRIANGLES: number; - TRIANGLE_STRIP: number; - TRIANGLE_FAN: number; - - /* AlphaFunction (not supported in ES20) */ - /* NEVER */ - /* LESS */ - /* EQUAL */ - /* LEQUAL */ - /* GREATER */ - /* NOTEQUAL */ - /* GEQUAL */ - /* ALWAYS */ - - /* BlendingFactorDest */ - ZERO: number; - ONE: number; - SRC_COLOR: number; - ONE_MINUS_SRC_COLOR: number; - SRC_ALPHA: number; - ONE_MINUS_SRC_ALPHA: number; - DST_ALPHA: number; - ONE_MINUS_DST_ALPHA: number; - - /* BlendingFactorSrc */ - /* ZERO */ - /* ONE */ - DST_COLOR: number; - ONE_MINUS_DST_COLOR: number; - SRC_ALPHA_SATURATE: number; - /* SRC_ALPHA */ - /* ONE_MINUS_SRC_ALPHA */ - /* DST_ALPHA */ - /* ONE_MINUS_DST_ALPHA */ - - /* BlendEquationSeparate */ - FUNC_ADD: number; - BLEND_EQUATION: number; - BLEND_EQUATION_RGB: number; - BLEND_EQUATION_ALPHA: number; - - /* BlendSubtract */ - FUNC_SUBTRACT: number; - FUNC_REVERSE_SUBTRACT: number; - - /* Separate Blend Functions */ - BLEND_DST_RGB: number; - BLEND_SRC_RGB: number; - BLEND_DST_ALPHA: number; - BLEND_SRC_ALPHA: number; - CONSTANT_COLOR: number; - ONE_MINUS_CONSTANT_COLOR: number; - CONSTANT_ALPHA: number; - ONE_MINUS_CONSTANT_ALPHA: number; - BLEND_COLOR: number; - - /* Buffer Objects */ - ARRAY_BUFFER: number; - ELEMENT_ARRAY_BUFFER: number; - ARRAY_BUFFER_BINDING: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - - STREAM_DRAW: number; - STATIC_DRAW: number; - DYNAMIC_DRAW: number; - - BUFFER_SIZE: number; - BUFFER_USAGE: number; - - CURRENT_VERTEX_ATTRIB: number; - - /* CullFaceMode */ - FRONT: number; - BACK: number; - FRONT_AND_BACK: number; - - /* DepthFunction */ - /* NEVER */ - /* LESS */ - /* EQUAL */ - /* LEQUAL */ - /* GREATER */ - /* NOTEQUAL */ - /* GEQUAL */ - /* ALWAYS */ - - /* EnableCap */ - /* TEXTURE_2D */ - CULL_FACE: number; - BLEND: number; - DITHER: number; - STENCIL_TEST: number; - DEPTH_TEST: number; - SCISSOR_TEST: number; - POLYGON_OFFSET_FILL: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - SAMPLE_COVERAGE: number; - - /* ErrorCode */ - NO_ERROR: number; - INVALID_ENUM: number; - INVALID_VALUE: number; - INVALID_OPERATION: number; - OUT_OF_MEMORY: number; - - /* FrontFaceDirection */ - CW: number; - CCW: number; - - /* GetPName */ - LINE_WIDTH: number; - ALIASED_POINT_SIZE_RANGE: number; - ALIASED_LINE_WIDTH_RANGE: number; - CULL_FACE_MODE: number; - FRONT_FACE: number; - DEPTH_RANGE: number; - DEPTH_WRITEMASK: number; - DEPTH_CLEAR_VALUE: number; - DEPTH_FUNC: number; - STENCIL_CLEAR_VALUE: number; - STENCIL_FUNC: number; - STENCIL_FAIL: number; - STENCIL_PASS_DEPTH_FAIL: number; - STENCIL_PASS_DEPTH_PASS: number; - STENCIL_REF: number; - STENCIL_VALUE_MASK: number; - STENCIL_WRITEMASK: number; - STENCIL_BACK_FUNC: number; - STENCIL_BACK_FAIL: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - STENCIL_BACK_REF: number; - STENCIL_BACK_VALUE_MASK: number; - STENCIL_BACK_WRITEMASK: number; - VIEWPORT: number; - SCISSOR_BOX: number; - /* SCISSOR_TEST */ - COLOR_CLEAR_VALUE: number; - COLOR_WRITEMASK: number; - UNPACK_ALIGNMENT: number; - PACK_ALIGNMENT: number; - MAX_TEXTURE_SIZE: number; - MAX_VIEWPORT_DIMS: number; - SUBPIXEL_BITS: number; - RED_BITS: number; - GREEN_BITS: number; - BLUE_BITS: number; - ALPHA_BITS: number; - DEPTH_BITS: number; - STENCIL_BITS: number; - POLYGON_OFFSET_UNITS: number; - /* POLYGON_OFFSET_FILL */ - POLYGON_OFFSET_FACTOR: number; - TEXTURE_BINDING_2D: number; - SAMPLE_BUFFERS: number; - SAMPLES: number; - SAMPLE_COVERAGE_VALUE: number; - SAMPLE_COVERAGE_INVERT: number; - - /* GetTextureParameter */ - /* TEXTURE_MAG_FILTER */ - /* TEXTURE_MIN_FILTER */ - /* TEXTURE_WRAP_S */ - /* TEXTURE_WRAP_T */ - - COMPRESSED_TEXTURE_FORMATS: number; - - /* HintMode */ - DONT_CARE: number; - FASTEST: number; - NICEST: number; - - /* HintTarget */ - GENERATE_MIPMAP_HINT: number; - - /* DataType */ - BYTE: number; - UNSIGNED_BYTE: number; - SHORT: number; - UNSIGNED_SHORT: number; - INT: number; - UNSIGNED_INT: number; - FLOAT: number; - - /* PixelFormat */ - DEPTH_COMPONENT: number; - ALPHA: number; - RGB: number; - RGBA: number; - LUMINANCE: number; - LUMINANCE_ALPHA: number; - - /* PixelType */ - /* UNSIGNED_BYTE */ - UNSIGNED_SHORT_4_4_4_4: number; - UNSIGNED_SHORT_5_5_5_1: number; - UNSIGNED_SHORT_5_6_5: number; - - /* Shaders */ - FRAGMENT_SHADER: number; - VERTEX_SHADER: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - MAX_VARYING_VECTORS: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - MAX_TEXTURE_IMAGE_UNITS: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - SHADER_TYPE: number; - DELETE_STATUS: number; - LINK_STATUS: number; - VALIDATE_STATUS: number; - ATTACHED_SHADERS: number; - ACTIVE_UNIFORMS: number; - ACTIVE_ATTRIBUTES: number; - SHADING_LANGUAGE_VERSION: number; - CURRENT_PROGRAM: number; - - /* StencilFunction */ - NEVER: number; - LESS: number; - EQUAL: number; - LEQUAL: number; - GREATER: number; - NOTEQUAL: number; - GEQUAL: number; - ALWAYS: number; - - /* StencilOp */ - /* ZERO */ - KEEP: number; - REPLACE: number; - INCR: number; - DECR: number; - INVERT: number; - INCR_WRAP: number; - DECR_WRAP: number; - - /* StringName */ - VENDOR: number; - RENDERER: number; - VERSION: number; - - /* TextureMagFilter */ - NEAREST: number; - LINEAR: number; - - /* TextureMinFilter */ - /* NEAREST */ - /* LINEAR */ - NEAREST_MIPMAP_NEAREST: number; - LINEAR_MIPMAP_NEAREST: number; - NEAREST_MIPMAP_LINEAR: number; - LINEAR_MIPMAP_LINEAR: number; - - /* TextureParameterName */ - TEXTURE_MAG_FILTER: number; - TEXTURE_MIN_FILTER: number; - TEXTURE_WRAP_S: number; - TEXTURE_WRAP_T: number; - - /* TextureTarget */ - TEXTURE_2D: number; - TEXTURE: number; - - TEXTURE_CUBE_MAP: number; - TEXTURE_BINDING_CUBE_MAP: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - - /* TextureUnit */ - TEXTURE0: number; - TEXTURE1: number; - TEXTURE2: number; - TEXTURE3: number; - TEXTURE4: number; - TEXTURE5: number; - TEXTURE6: number; - TEXTURE7: number; - TEXTURE8: number; - TEXTURE9: number; - TEXTURE10: number; - TEXTURE11: number; - TEXTURE12: number; - TEXTURE13: number; - TEXTURE14: number; - TEXTURE15: number; - TEXTURE16: number; - TEXTURE17: number; - TEXTURE18: number; - TEXTURE19: number; - TEXTURE20: number; - TEXTURE21: number; - TEXTURE22: number; - TEXTURE23: number; - TEXTURE24: number; - TEXTURE25: number; - TEXTURE26: number; - TEXTURE27: number; - TEXTURE28: number; - TEXTURE29: number; - TEXTURE30: number; - TEXTURE31: number; - ACTIVE_TEXTURE: number; - - /* TextureWrapMode */ - REPEAT: number; - CLAMP_TO_EDGE: number; - MIRRORED_REPEAT: number; - - /* Uniform Types */ - FLOAT_VEC2: number; - FLOAT_VEC3: number; - FLOAT_VEC4: number; - INT_VEC2: number; - INT_VEC3: number; - INT_VEC4: number; - BOOL: number; - BOOL_VEC2: number; - BOOL_VEC3: number; - BOOL_VEC4: number; - FLOAT_MAT2: number; - FLOAT_MAT3: number; - FLOAT_MAT4: number; - SAMPLER_2D: number; - SAMPLER_CUBE: number; - - /* Vertex Arrays */ - VERTEX_ATTRIB_ARRAY_ENABLED: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - - /* Shader Source */ - COMPILE_STATUS: number; - - /* Shader Precision-Specified Types */ - LOW_FLOAT: number; - MEDIUM_FLOAT: number; - HIGH_FLOAT: number; - LOW_INT: number; - MEDIUM_INT: number; - HIGH_INT: number; - - /* Framebuffer Object. */ - FRAMEBUFFER: number; - RENDERBUFFER: number; - - RGBA4: number; - RGB5_A1: number; - RGB565: number; - DEPTH_COMPONENT16: number; - STENCIL_INDEX: number; - STENCIL_INDEX8: number; - DEPTH_STENCIL: number; - - RENDERBUFFER_WIDTH: number; - RENDERBUFFER_HEIGHT: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - RENDERBUFFER_RED_SIZE: number; - RENDERBUFFER_GREEN_SIZE: number; - RENDERBUFFER_BLUE_SIZE: number; - RENDERBUFFER_ALPHA_SIZE: number; - RENDERBUFFER_DEPTH_SIZE: number; - RENDERBUFFER_STENCIL_SIZE: number; - - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - - COLOR_ATTACHMENT0: number; - DEPTH_ATTACHMENT: number; - STENCIL_ATTACHMENT: number; - DEPTH_STENCIL_ATTACHMENT: number; - - NONE: number; - - FRAMEBUFFER_COMPLETE: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - FRAMEBUFFER_UNSUPPORTED: number; - - FRAMEBUFFER_BINDING: number; - RENDERBUFFER_BINDING: number; - MAX_RENDERBUFFER_SIZE: number; - - INVALID_FRAMEBUFFER_OPERATION: number; - - /* WebGL-specific enums */ - UNPACK_FLIP_Y_WEBGL: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - CONTEXT_LOST_WEBGL: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - BROWSER_DEFAULT_WEBGL: number; - - - - - canvas: HTMLCanvasElement; - drawingBufferWidth: number; - drawingBufferHeight: number; - - getContextAttributes(): WebGLContextAttributes; - isContextLost(): boolean; - - getSupportedExtensions(): string[]; - getExtension(name: string): any; - - activeTexture(texture: number): void; - attachShader(program: WebGLProgram, shader: WebGLShader): void; - bindAttribLocation(program: WebGLProgram, index: number, name: string): void; - bindBuffer(target: number, buffer: WebGLBuffer): void; - bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; - bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; - bindTexture(target: number, texture: WebGLTexture): void; - blendColor(red: number, green: number, blue: number, alpha: number): void; - blendEquation(mode: number): void; - blendEquationSeparate(modeRGB: number, modeAlpha: number): void; - blendFunc(sfactor: number, dfactor: number): void; - blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; - - bufferData(target: number, size: number, usage: number): void; - bufferData(target: number, data: ArrayBufferView, usage: number): void; - bufferData(target: number, data: ArrayBuffer, usage: number): void; - bufferSubData(target: number, offset: number, data: ArrayBufferView): void; - bufferSubData(target: number, offset: number, data: ArrayBuffer): void; - - checkFramebufferStatus(target: number): number; - clear(mask: number): void; - clearColor(red: number, green: number, blue: number, alpha: number): void; - clearDepth(depth: number): void; - clearStencil(s: number): void; - colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; - compileShader(shader: WebGLShader): void; - - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; - - copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; - copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; - - createBuffer(): WebGLBuffer; - createFramebuffer(): WebGLFramebuffer; - createProgram(): WebGLProgram; - createRenderbuffer(): WebGLRenderbuffer; - createShader(type: number): WebGLShader; - createTexture(): WebGLTexture; - - cullFace(mode: number): void; - - deleteBuffer(buffer: WebGLBuffer): void; - deleteFramebuffer(framebuffer: WebGLFramebuffer): void; - deleteProgram(program: WebGLProgram): void; - deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; - deleteShader(shader: WebGLShader): void; - deleteTexture(texture: WebGLTexture): void; - - depthFunc(func: number): void; - depthMask(flag: boolean): void; - depthRange(zNear: number, zFar: number): void; - detachShader(program: WebGLProgram, shader: WebGLShader): void; - disable(cap: number): void; - disableVertexAttribArray(index: number): void; - drawArrays(mode: number, first: number, count: number): void; - drawElements(mode: number, count: number, type: number, offset: number): void; - - enable(cap: number): void; - enableVertexAttribArray(index: number): void; - finish(): void; - flush(): void; - framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; - framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; - frontFace(mode: number): void; - - generateMipmap(target: number): void; - - getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; - getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; - getAttachedShaders(program: WebGLProgram): WebGLShader[]; - - getAttribLocation(program: WebGLProgram, name: string): number; - - getBufferParameter(target: number, pname: number): any; - getParameter(pname: number): any; - - getError(): number; - - getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; - getProgramParameter(program: WebGLProgram, pname: number): any; - getProgramInfoLog(program: WebGLProgram): string; - getRenderbufferParameter(target: number, pname: number): any; - getShaderParameter(shader: WebGLShader, pname: number): any; - getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; - getShaderInfoLog(shader: WebGLShader): string; - - getShaderSource(shader: WebGLShader): string; - - getTexParameter(target: number, pname: number): any; - - getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; - - getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; - - getVertexAttrib(index: number, pname: number): any; - - getVertexAttribOffset(index: number, pname: number): number; - - hint(target: number, mode: number): void; - isBuffer(buffer: WebGLBuffer): boolean; - isEnabled(cap: number): boolean; - isFramebuffer(framebuffer: WebGLFramebuffer): boolean; - isProgram(program: WebGLProgram): boolean; - isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; - isShader(shader: WebGLShader): boolean; - isTexture(texture: WebGLTexture): boolean; - lineWidth(width: number): void; - linkProgram(program: WebGLProgram): void; - pixelStorei(pname: number, param: number): void; - polygonOffset(factor: number, units: number): void; - - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - - renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; - sampleCoverage(value: number, invert: boolean): void; - scissor(x: number, y: number, width: number, height: number): void; - - shaderSource(shader: WebGLShader, source: string): void; - - stencilFunc(func: number, ref: number, mask: number): void; - stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; - stencilMask(mask: number): void; - stencilMaskSeparate(face: number, mask: number): void; - stencilOp(fail: number, zfail: number, zpass: number): void; - stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; - - texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void; // May throw DOMException - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void; // May throw DOMException - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void; // May throw DOMException - - texParameterf(target: number, pname: number, param: number): void; - texParameteri(target: number, pname: number, param: number): void; - - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void; // May throw DOMException - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void; // May throw DOMException - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void; // May throw DOMException - - uniform1f(location: WebGLUniformLocation, x: number): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array): void; - uniform1fv(location: WebGLUniformLocation, v: number[]): void; - uniform1i(location: WebGLUniformLocation, x: number): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; - uniform1iv(location: WebGLUniformLocation, v: number[]): void; - uniform2f(location: WebGLUniformLocation, x: number, y: number): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array): void; - uniform2fv(location: WebGLUniformLocation, v: number[]): void; - uniform2i(location: WebGLUniformLocation, x: number, y: number): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; - uniform2iv(location: WebGLUniformLocation, v: number[]): void; - uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array): void; - uniform3fv(location: WebGLUniformLocation, v: number[]): void; - uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; - uniform3iv(location: WebGLUniformLocation, v: number[]): void; - uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array): void; - uniform4fv(location: WebGLUniformLocation, v: number[]): void; - uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; - uniform4iv(location: WebGLUniformLocation, v: number[]): void; - - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - - useProgram(program: WebGLProgram): void; - validateProgram(program: WebGLProgram): void; - - vertexAttrib1f(indx: number, x: number): void; - vertexAttrib1fv(indx: number, values: Float32Array): void; - vertexAttrib1fv(indx: number, value: number[]): void; - vertexAttrib2f(indx: number, x: number, y: number): void; - vertexAttrib2fv(indx: number, values: Float32Array): void; - vertexAttrib2fv(indx: number, value: number[]): void; - vertexAttrib3f(indx: number, x: number, y: number, z: number): void; - vertexAttrib3fv(indx: number, values: Float32Array): void; - vertexAttrib3fv(indx: number, value: number[]): void; - vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; - vertexAttrib4fv(indx: number, values: Float32Array): void; - vertexAttrib4fv(indx: number, value: number[]): void; - vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; - - viewport(x: number, y: number, width: number, height: number): void; -} -