-
Notifications
You must be signed in to change notification settings - Fork 439
Added interfaces of WebGL extensions in recommended specification status #301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12138,7 +12138,29 @@ interface WebGLRenderingContext { | |
getBufferParameter(target: number, pname: number): any; | ||
getContextAttributes(): WebGLContextAttributes; | ||
getError(): number; | ||
getExtension(name: string): any; | ||
getExtension(extensionName: "EXT_blend_minmax"): EXT_blend_minmax | null; | ||
getExtension(extensionName: "EXT_texture_filter_anisotropic"): EXT_texture_filter_anisotropic | null; | ||
getExtension(extensionName: "EXT_frag_depth"): EXT_frag_depth | null; | ||
getExtension(extensionName: "EXT_shader_texture_lod"): EXT_shader_texture_lod | null; | ||
getExtension(extensionName: "EXT_sRGB"): EXT_sRGB | null; | ||
getExtension(extensionName: "OES_vertex_array_object"): OES_vertex_array_object | null; | ||
getExtension(extensionName: "WEBGL_color_buffer_float"): WEBGL_color_buffer_float | null; | ||
getExtension(extensionName: "WEBGL_compressed_texture_astc"): WEBGL_compressed_texture_astc | null; | ||
getExtension(extensionName: "WEBGL_compressed_texture_s3tc_srgb"): WEBGL_compressed_texture_s3tc_srgb | null; | ||
getExtension(extensionName: "WEBGL_debug_shaders"): WEBGL_debug_shaders | null; | ||
getExtension(extensionName: "WEBGL_draw_buffers"): WEBGL_draw_buffers | null; | ||
getExtension(extensionName: "WEBGL_lose_context"): WEBGL_lose_context | null; | ||
getExtension(extensionName: "WEBGL_depth_texture"): WEBGL_depth_texture|null; | ||
getExtension(extensionName: "WEBGL_debug_renderer_info"): WEBGL_debug_renderer_info|null; | ||
getExtension(extensionName: "WEBGL_compressed_texture_s3tc"): WEBGL_compressed_texture_s3tc|null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit. can you make sure there is a space before and after There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I fixed this with last commit. |
||
getExtension(extensionName: "OES_texture_half_float_linear"): OES_texture_half_float_linear|null; | ||
getExtension(extensionName: "OES_texture_half_float"): OES_texture_half_float|null; | ||
getExtension(extensionName: "OES_texture_float_linear"): OES_texture_float_linear|null; | ||
getExtension(extensionName: "OES_texture_float"): OES_texture_float|null; | ||
getExtension(extensionName: "OES_standard_derivatives"): OES_standard_derivatives|null; | ||
getExtension(extensionName: "OES_element_index_uint"): OES_element_index_uint|null; | ||
getExtension(extensionName: "ANGLE_instanced_arrays"): ANGLE_instanced_arrays|null; | ||
getExtension(extensionName: string): any; | ||
getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; | ||
getParameter(pname: number): any; | ||
getProgramInfoLog(program: WebGLProgram | null): string | null; | ||
|
@@ -14262,6 +14284,188 @@ declare var HTMLSummaryElement: { | |
new(): HTMLSummaryElement; | ||
}; | ||
|
||
interface EXT_blend_minmax { | ||
readonly MIN_EXT: number; | ||
readonly MAX_EXT: number; | ||
} | ||
|
||
declare var EXT_blend_minmax: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not needed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
prototype: EXT_blend_minmax; | ||
new(): EXT_blend_minmax; | ||
}; | ||
|
||
interface EXT_frag_depth { | ||
} | ||
|
||
declare var EXT_frag_depth: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you do not need all the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed also. |
||
prototype: EXT_frag_depth; | ||
new(): EXT_frag_depth; | ||
}; | ||
|
||
interface EXT_shader_texture_lod { | ||
} | ||
|
||
declare var EXT_shader_texture_lod: { | ||
prototype: EXT_shader_texture_lod; | ||
new(): EXT_shader_texture_lod; | ||
}; | ||
|
||
interface EXT_sRGB { | ||
readonly SRGB_EXT: number; | ||
readonly SRGB_ALPHA_EXT: number; | ||
readonly SRGB8_ALPHA8_EXT: number; | ||
readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: number; | ||
} | ||
|
||
declare var EXT_sRGB: { | ||
prototype: EXT_sRGB; | ||
new(): EXT_sRGB; | ||
}; | ||
|
||
interface OES_vertex_array_object { | ||
readonly VERTEX_ARRAY_BINDING_OES: number; | ||
createVertexArrayOES(): WebGLVertexArrayObjectOES; | ||
deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): void; | ||
isVertexArrayOES(value: any): value is WebGLVertexArrayObjectOES; | ||
bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): void; | ||
} | ||
|
||
declare var OES_vertex_array_object: { | ||
prototype: OES_vertex_array_object; | ||
new(): OES_vertex_array_object; | ||
}; | ||
|
||
interface WebGLVertexArrayObjectOES { | ||
} | ||
|
||
declare var WebGLVertexArrayObjectOES: { | ||
prototype: WebGLVertexArrayObjectOES; | ||
new(): WebGLVertexArrayObjectOES; | ||
}; | ||
|
||
interface WEBGL_color_buffer_float { | ||
readonly RGBA32F_EXT: number; | ||
readonly RGB32F_EXT: number; | ||
readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: number; | ||
readonly UNSIGNED_NORMALIZED_EXT: number; | ||
} | ||
|
||
declare var WEBGL_color_buffer_float: { | ||
prototype: WEBGL_color_buffer_float; | ||
new(): WEBGL_color_buffer_float; | ||
}; | ||
|
||
interface WEBGL_compressed_texture_astc { | ||
readonly COMPRESSED_RGBA_ASTC_4x4_KHR: number; | ||
readonly COMPRESSED_RGBA_ASTC_5x4_KHR: number; | ||
readonly COMPRESSED_RGBA_ASTC_5x5_KHR: number; | ||
readonly COMPRESSED_RGBA_ASTC_6x5_KHR: number; | ||
readonly COMPRESSED_RGBA_ASTC_6x6_KHR: number; | ||
readonly COMPRESSED_RGBA_ASTC_8x5_KHR: number; | ||
readonly COMPRESSED_RGBA_ASTC_8x6_KHR: number; | ||
readonly COMPRESSED_RGBA_ASTC_8x8_KHR: number; | ||
readonly COMPRESSED_RGBA_ASTC_10x5_KHR: number; | ||
readonly COMPRESSED_RGBA_ASTC_10x6_KHR: number; | ||
readonly COMPRESSED_RGBA_ASTC_10x8_KHR: number; | ||
readonly COMPRESSED_RGBA_ASTC_10x10_KHR: number; | ||
readonly COMPRESSED_RGBA_ASTC_12x10_KHR: number; | ||
readonly COMPRESSED_RGBA_ASTC_12x12_KHR: number; | ||
readonly COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: number; | ||
readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: number; | ||
readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: number; | ||
readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: number; | ||
readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: number; | ||
readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: number; | ||
readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: number; | ||
readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: number; | ||
readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: number; | ||
readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: number; | ||
readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: number; | ||
readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: number; | ||
readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: number; | ||
readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: number; | ||
getSupportedProfiles(): string[]; | ||
} | ||
|
||
declare var WEBGL_compressed_texture_astc: { | ||
prototype: WEBGL_compressed_texture_astc; | ||
new(): WEBGL_compressed_texture_astc; | ||
}; | ||
|
||
interface WEBGL_compressed_texture_s3tc_srgb { | ||
readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: number; | ||
readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: number; | ||
readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: number; | ||
readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: number; | ||
} | ||
|
||
declare var WEBGL_compressed_texture_s3tc_srgb: { | ||
prototype: WEBGL_compressed_texture_s3tc_srgb; | ||
new(): WEBGL_compressed_texture_s3tc_srgb; | ||
}; | ||
|
||
interface WEBGL_debug_shaders { | ||
getTranslatedShaderSource(shader: WebGLShader): string; | ||
} | ||
|
||
declare var WEBGL_debug_shaders: { | ||
prototype: WEBGL_debug_shaders; | ||
new(): WEBGL_debug_shaders; | ||
}; | ||
|
||
interface WEBGL_draw_buffers { | ||
readonly COLOR_ATTACHMENT0_WEBGL: number; | ||
readonly COLOR_ATTACHMENT1_WEBGL: number; | ||
readonly COLOR_ATTACHMENT2_WEBGL: number; | ||
readonly COLOR_ATTACHMENT3_WEBGL: number; | ||
readonly COLOR_ATTACHMENT4_WEBGL: number; | ||
readonly COLOR_ATTACHMENT5_WEBGL: number; | ||
readonly COLOR_ATTACHMENT6_WEBGL: number; | ||
readonly COLOR_ATTACHMENT7_WEBGL: number; | ||
readonly COLOR_ATTACHMENT8_WEBGL: number; | ||
readonly COLOR_ATTACHMENT9_WEBGL: number; | ||
readonly COLOR_ATTACHMENT10_WEBGL: number; | ||
readonly COLOR_ATTACHMENT11_WEBGL: number; | ||
readonly COLOR_ATTACHMENT12_WEBGL: number; | ||
readonly COLOR_ATTACHMENT13_WEBGL: number; | ||
readonly COLOR_ATTACHMENT14_WEBGL: number; | ||
readonly COLOR_ATTACHMENT15_WEBGL: number; | ||
readonly DRAW_BUFFER0_WEBGL: number; | ||
readonly DRAW_BUFFER1_WEBGL: number; | ||
readonly DRAW_BUFFER2_WEBGL: number; | ||
readonly DRAW_BUFFER3_WEBGL: number; | ||
readonly DRAW_BUFFER4_WEBGL: number; | ||
readonly DRAW_BUFFER5_WEBGL: number; | ||
readonly DRAW_BUFFER6_WEBGL: number; | ||
readonly DRAW_BUFFER7_WEBGL: number; | ||
readonly DRAW_BUFFER8_WEBGL: number; | ||
readonly DRAW_BUFFER9_WEBGL: number; | ||
readonly DRAW_BUFFER10_WEBGL: number; | ||
readonly DRAW_BUFFER11_WEBGL: number; | ||
readonly DRAW_BUFFER12_WEBGL: number; | ||
readonly DRAW_BUFFER13_WEBGL: number; | ||
readonly DRAW_BUFFER14_WEBGL: number; | ||
readonly DRAW_BUFFER15_WEBGL: number; | ||
readonly MAX_COLOR_ATTACHMENTS_WEBGL: number; | ||
readonly MAX_DRAW_BUFFERS_WEBGL: number; | ||
drawBuffersWEBGL(buffers: number[]): void; | ||
} | ||
|
||
declare var WEBGL_draw_buffers: { | ||
prototype: WEBGL_draw_buffers; | ||
new(): WEBGL_draw_buffers; | ||
}; | ||
|
||
interface WEBGL_lose_context { | ||
loseContext(): void; | ||
restoreContext(): void; | ||
} | ||
|
||
declare var WEBGL_lose_context: { | ||
prototype: WEBGL_lose_context; | ||
new(): WEBGL_lose_context; | ||
}; | ||
|
||
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; | ||
|
||
interface DecodeErrorCallback { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need
| null
? should not all these extensions be supported?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getExtension
can return null if the extension is not supported on the environment.This is not only depends on which browser the user using, but also depends on GPU chips, display drivers or browser extension flags.
Therefore, developer should consider the situation the returned value is null.