RenderingContext.hx 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948
  1. /*
  2. * Copyright (C)2005-2019 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. // This file is generated from mozilla\WebGLRenderingContext.webidl. Do not edit!
  23. package js.html.webgl;
  24. /**
  25. The `WebGLRenderingContext` interface provides the OpenGL ES 2.0 rendering context for the drawing surface of an HTML `canvas` element.
  26. Documentation [WebGLRenderingContext](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/).
  27. @see <https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext>
  28. **/
  29. @:native("WebGLRenderingContext")
  30. extern class RenderingContext {
  31. static inline var DEPTH_BUFFER_BIT : Int = 256;
  32. static inline var STENCIL_BUFFER_BIT : Int = 1024;
  33. static inline var COLOR_BUFFER_BIT : Int = 16384;
  34. static inline var POINTS : Int = 0;
  35. static inline var LINES : Int = 1;
  36. static inline var LINE_LOOP : Int = 2;
  37. static inline var LINE_STRIP : Int = 3;
  38. static inline var TRIANGLES : Int = 4;
  39. static inline var TRIANGLE_STRIP : Int = 5;
  40. static inline var TRIANGLE_FAN : Int = 6;
  41. static inline var ZERO : Int = 0;
  42. static inline var ONE : Int = 1;
  43. static inline var SRC_COLOR : Int = 768;
  44. static inline var ONE_MINUS_SRC_COLOR : Int = 769;
  45. static inline var SRC_ALPHA : Int = 770;
  46. static inline var ONE_MINUS_SRC_ALPHA : Int = 771;
  47. static inline var DST_ALPHA : Int = 772;
  48. static inline var ONE_MINUS_DST_ALPHA : Int = 773;
  49. static inline var DST_COLOR : Int = 774;
  50. static inline var ONE_MINUS_DST_COLOR : Int = 775;
  51. static inline var SRC_ALPHA_SATURATE : Int = 776;
  52. static inline var FUNC_ADD : Int = 32774;
  53. static inline var BLEND_EQUATION : Int = 32777;
  54. static inline var BLEND_EQUATION_RGB : Int = 32777;
  55. static inline var BLEND_EQUATION_ALPHA : Int = 34877;
  56. static inline var FUNC_SUBTRACT : Int = 32778;
  57. static inline var FUNC_REVERSE_SUBTRACT : Int = 32779;
  58. static inline var BLEND_DST_RGB : Int = 32968;
  59. static inline var BLEND_SRC_RGB : Int = 32969;
  60. static inline var BLEND_DST_ALPHA : Int = 32970;
  61. static inline var BLEND_SRC_ALPHA : Int = 32971;
  62. static inline var CONSTANT_COLOR : Int = 32769;
  63. static inline var ONE_MINUS_CONSTANT_COLOR : Int = 32770;
  64. static inline var CONSTANT_ALPHA : Int = 32771;
  65. static inline var ONE_MINUS_CONSTANT_ALPHA : Int = 32772;
  66. static inline var BLEND_COLOR : Int = 32773;
  67. static inline var ARRAY_BUFFER : Int = 34962;
  68. static inline var ELEMENT_ARRAY_BUFFER : Int = 34963;
  69. static inline var ARRAY_BUFFER_BINDING : Int = 34964;
  70. static inline var ELEMENT_ARRAY_BUFFER_BINDING : Int = 34965;
  71. static inline var STREAM_DRAW : Int = 35040;
  72. static inline var STATIC_DRAW : Int = 35044;
  73. static inline var DYNAMIC_DRAW : Int = 35048;
  74. static inline var BUFFER_SIZE : Int = 34660;
  75. static inline var BUFFER_USAGE : Int = 34661;
  76. static inline var CURRENT_VERTEX_ATTRIB : Int = 34342;
  77. static inline var FRONT : Int = 1028;
  78. static inline var BACK : Int = 1029;
  79. static inline var FRONT_AND_BACK : Int = 1032;
  80. static inline var CULL_FACE : Int = 2884;
  81. static inline var BLEND : Int = 3042;
  82. static inline var DITHER : Int = 3024;
  83. static inline var STENCIL_TEST : Int = 2960;
  84. static inline var DEPTH_TEST : Int = 2929;
  85. static inline var SCISSOR_TEST : Int = 3089;
  86. static inline var POLYGON_OFFSET_FILL : Int = 32823;
  87. static inline var SAMPLE_ALPHA_TO_COVERAGE : Int = 32926;
  88. static inline var SAMPLE_COVERAGE : Int = 32928;
  89. static inline var NO_ERROR : Int = 0;
  90. static inline var INVALID_ENUM : Int = 1280;
  91. static inline var INVALID_VALUE : Int = 1281;
  92. static inline var INVALID_OPERATION : Int = 1282;
  93. static inline var OUT_OF_MEMORY : Int = 1285;
  94. static inline var CW : Int = 2304;
  95. static inline var CCW : Int = 2305;
  96. static inline var LINE_WIDTH : Int = 2849;
  97. static inline var ALIASED_POINT_SIZE_RANGE : Int = 33901;
  98. static inline var ALIASED_LINE_WIDTH_RANGE : Int = 33902;
  99. static inline var CULL_FACE_MODE : Int = 2885;
  100. static inline var FRONT_FACE : Int = 2886;
  101. static inline var DEPTH_RANGE : Int = 2928;
  102. static inline var DEPTH_WRITEMASK : Int = 2930;
  103. static inline var DEPTH_CLEAR_VALUE : Int = 2931;
  104. static inline var DEPTH_FUNC : Int = 2932;
  105. static inline var STENCIL_CLEAR_VALUE : Int = 2961;
  106. static inline var STENCIL_FUNC : Int = 2962;
  107. static inline var STENCIL_FAIL : Int = 2964;
  108. static inline var STENCIL_PASS_DEPTH_FAIL : Int = 2965;
  109. static inline var STENCIL_PASS_DEPTH_PASS : Int = 2966;
  110. static inline var STENCIL_REF : Int = 2967;
  111. static inline var STENCIL_VALUE_MASK : Int = 2963;
  112. static inline var STENCIL_WRITEMASK : Int = 2968;
  113. static inline var STENCIL_BACK_FUNC : Int = 34816;
  114. static inline var STENCIL_BACK_FAIL : Int = 34817;
  115. static inline var STENCIL_BACK_PASS_DEPTH_FAIL : Int = 34818;
  116. static inline var STENCIL_BACK_PASS_DEPTH_PASS : Int = 34819;
  117. static inline var STENCIL_BACK_REF : Int = 36003;
  118. static inline var STENCIL_BACK_VALUE_MASK : Int = 36004;
  119. static inline var STENCIL_BACK_WRITEMASK : Int = 36005;
  120. static inline var VIEWPORT : Int = 2978;
  121. static inline var SCISSOR_BOX : Int = 3088;
  122. static inline var COLOR_CLEAR_VALUE : Int = 3106;
  123. static inline var COLOR_WRITEMASK : Int = 3107;
  124. static inline var UNPACK_ALIGNMENT : Int = 3317;
  125. static inline var PACK_ALIGNMENT : Int = 3333;
  126. static inline var MAX_TEXTURE_SIZE : Int = 3379;
  127. static inline var MAX_VIEWPORT_DIMS : Int = 3386;
  128. static inline var SUBPIXEL_BITS : Int = 3408;
  129. static inline var RED_BITS : Int = 3410;
  130. static inline var GREEN_BITS : Int = 3411;
  131. static inline var BLUE_BITS : Int = 3412;
  132. static inline var ALPHA_BITS : Int = 3413;
  133. static inline var DEPTH_BITS : Int = 3414;
  134. static inline var STENCIL_BITS : Int = 3415;
  135. static inline var POLYGON_OFFSET_UNITS : Int = 10752;
  136. static inline var POLYGON_OFFSET_FACTOR : Int = 32824;
  137. static inline var TEXTURE_BINDING_2D : Int = 32873;
  138. static inline var SAMPLE_BUFFERS : Int = 32936;
  139. static inline var SAMPLES : Int = 32937;
  140. static inline var SAMPLE_COVERAGE_VALUE : Int = 32938;
  141. static inline var SAMPLE_COVERAGE_INVERT : Int = 32939;
  142. static inline var COMPRESSED_TEXTURE_FORMATS : Int = 34467;
  143. static inline var DONT_CARE : Int = 4352;
  144. static inline var FASTEST : Int = 4353;
  145. static inline var NICEST : Int = 4354;
  146. static inline var GENERATE_MIPMAP_HINT : Int = 33170;
  147. static inline var BYTE : Int = 5120;
  148. static inline var UNSIGNED_BYTE : Int = 5121;
  149. static inline var SHORT : Int = 5122;
  150. static inline var UNSIGNED_SHORT : Int = 5123;
  151. static inline var INT : Int = 5124;
  152. static inline var UNSIGNED_INT : Int = 5125;
  153. static inline var FLOAT : Int = 5126;
  154. static inline var DEPTH_COMPONENT : Int = 6402;
  155. static inline var ALPHA : Int = 6406;
  156. static inline var RGB : Int = 6407;
  157. static inline var RGBA : Int = 6408;
  158. static inline var LUMINANCE : Int = 6409;
  159. static inline var LUMINANCE_ALPHA : Int = 6410;
  160. static inline var UNSIGNED_SHORT_4_4_4_4 : Int = 32819;
  161. static inline var UNSIGNED_SHORT_5_5_5_1 : Int = 32820;
  162. static inline var UNSIGNED_SHORT_5_6_5 : Int = 33635;
  163. static inline var FRAGMENT_SHADER : Int = 35632;
  164. static inline var VERTEX_SHADER : Int = 35633;
  165. static inline var MAX_VERTEX_ATTRIBS : Int = 34921;
  166. static inline var MAX_VERTEX_UNIFORM_VECTORS : Int = 36347;
  167. static inline var MAX_VARYING_VECTORS : Int = 36348;
  168. static inline var MAX_COMBINED_TEXTURE_IMAGE_UNITS : Int = 35661;
  169. static inline var MAX_VERTEX_TEXTURE_IMAGE_UNITS : Int = 35660;
  170. static inline var MAX_TEXTURE_IMAGE_UNITS : Int = 34930;
  171. static inline var MAX_FRAGMENT_UNIFORM_VECTORS : Int = 36349;
  172. static inline var SHADER_TYPE : Int = 35663;
  173. static inline var DELETE_STATUS : Int = 35712;
  174. static inline var LINK_STATUS : Int = 35714;
  175. static inline var VALIDATE_STATUS : Int = 35715;
  176. static inline var ATTACHED_SHADERS : Int = 35717;
  177. static inline var ACTIVE_UNIFORMS : Int = 35718;
  178. static inline var ACTIVE_ATTRIBUTES : Int = 35721;
  179. static inline var SHADING_LANGUAGE_VERSION : Int = 35724;
  180. static inline var CURRENT_PROGRAM : Int = 35725;
  181. static inline var NEVER : Int = 512;
  182. static inline var LESS : Int = 513;
  183. static inline var EQUAL : Int = 514;
  184. static inline var LEQUAL : Int = 515;
  185. static inline var GREATER : Int = 516;
  186. static inline var NOTEQUAL : Int = 517;
  187. static inline var GEQUAL : Int = 518;
  188. static inline var ALWAYS : Int = 519;
  189. static inline var KEEP : Int = 7680;
  190. static inline var REPLACE : Int = 7681;
  191. static inline var INCR : Int = 7682;
  192. static inline var DECR : Int = 7683;
  193. static inline var INVERT : Int = 5386;
  194. static inline var INCR_WRAP : Int = 34055;
  195. static inline var DECR_WRAP : Int = 34056;
  196. static inline var VENDOR : Int = 7936;
  197. static inline var RENDERER : Int = 7937;
  198. static inline var VERSION : Int = 7938;
  199. static inline var NEAREST : Int = 9728;
  200. static inline var LINEAR : Int = 9729;
  201. static inline var NEAREST_MIPMAP_NEAREST : Int = 9984;
  202. static inline var LINEAR_MIPMAP_NEAREST : Int = 9985;
  203. static inline var NEAREST_MIPMAP_LINEAR : Int = 9986;
  204. static inline var LINEAR_MIPMAP_LINEAR : Int = 9987;
  205. static inline var TEXTURE_MAG_FILTER : Int = 10240;
  206. static inline var TEXTURE_MIN_FILTER : Int = 10241;
  207. static inline var TEXTURE_WRAP_S : Int = 10242;
  208. static inline var TEXTURE_WRAP_T : Int = 10243;
  209. static inline var TEXTURE_2D : Int = 3553;
  210. static inline var TEXTURE : Int = 5890;
  211. static inline var TEXTURE_CUBE_MAP : Int = 34067;
  212. static inline var TEXTURE_BINDING_CUBE_MAP : Int = 34068;
  213. static inline var TEXTURE_CUBE_MAP_POSITIVE_X : Int = 34069;
  214. static inline var TEXTURE_CUBE_MAP_NEGATIVE_X : Int = 34070;
  215. static inline var TEXTURE_CUBE_MAP_POSITIVE_Y : Int = 34071;
  216. static inline var TEXTURE_CUBE_MAP_NEGATIVE_Y : Int = 34072;
  217. static inline var TEXTURE_CUBE_MAP_POSITIVE_Z : Int = 34073;
  218. static inline var TEXTURE_CUBE_MAP_NEGATIVE_Z : Int = 34074;
  219. static inline var MAX_CUBE_MAP_TEXTURE_SIZE : Int = 34076;
  220. static inline var TEXTURE0 : Int = 33984;
  221. static inline var TEXTURE1 : Int = 33985;
  222. static inline var TEXTURE2 : Int = 33986;
  223. static inline var TEXTURE3 : Int = 33987;
  224. static inline var TEXTURE4 : Int = 33988;
  225. static inline var TEXTURE5 : Int = 33989;
  226. static inline var TEXTURE6 : Int = 33990;
  227. static inline var TEXTURE7 : Int = 33991;
  228. static inline var TEXTURE8 : Int = 33992;
  229. static inline var TEXTURE9 : Int = 33993;
  230. static inline var TEXTURE10 : Int = 33994;
  231. static inline var TEXTURE11 : Int = 33995;
  232. static inline var TEXTURE12 : Int = 33996;
  233. static inline var TEXTURE13 : Int = 33997;
  234. static inline var TEXTURE14 : Int = 33998;
  235. static inline var TEXTURE15 : Int = 33999;
  236. static inline var TEXTURE16 : Int = 34000;
  237. static inline var TEXTURE17 : Int = 34001;
  238. static inline var TEXTURE18 : Int = 34002;
  239. static inline var TEXTURE19 : Int = 34003;
  240. static inline var TEXTURE20 : Int = 34004;
  241. static inline var TEXTURE21 : Int = 34005;
  242. static inline var TEXTURE22 : Int = 34006;
  243. static inline var TEXTURE23 : Int = 34007;
  244. static inline var TEXTURE24 : Int = 34008;
  245. static inline var TEXTURE25 : Int = 34009;
  246. static inline var TEXTURE26 : Int = 34010;
  247. static inline var TEXTURE27 : Int = 34011;
  248. static inline var TEXTURE28 : Int = 34012;
  249. static inline var TEXTURE29 : Int = 34013;
  250. static inline var TEXTURE30 : Int = 34014;
  251. static inline var TEXTURE31 : Int = 34015;
  252. static inline var ACTIVE_TEXTURE : Int = 34016;
  253. static inline var REPEAT : Int = 10497;
  254. static inline var CLAMP_TO_EDGE : Int = 33071;
  255. static inline var MIRRORED_REPEAT : Int = 33648;
  256. static inline var FLOAT_VEC2 : Int = 35664;
  257. static inline var FLOAT_VEC3 : Int = 35665;
  258. static inline var FLOAT_VEC4 : Int = 35666;
  259. static inline var INT_VEC2 : Int = 35667;
  260. static inline var INT_VEC3 : Int = 35668;
  261. static inline var INT_VEC4 : Int = 35669;
  262. static inline var BOOL : Int = 35670;
  263. static inline var BOOL_VEC2 : Int = 35671;
  264. static inline var BOOL_VEC3 : Int = 35672;
  265. static inline var BOOL_VEC4 : Int = 35673;
  266. static inline var FLOAT_MAT2 : Int = 35674;
  267. static inline var FLOAT_MAT3 : Int = 35675;
  268. static inline var FLOAT_MAT4 : Int = 35676;
  269. static inline var SAMPLER_2D : Int = 35678;
  270. static inline var SAMPLER_CUBE : Int = 35680;
  271. static inline var VERTEX_ATTRIB_ARRAY_ENABLED : Int = 34338;
  272. static inline var VERTEX_ATTRIB_ARRAY_SIZE : Int = 34339;
  273. static inline var VERTEX_ATTRIB_ARRAY_STRIDE : Int = 34340;
  274. static inline var VERTEX_ATTRIB_ARRAY_TYPE : Int = 34341;
  275. static inline var VERTEX_ATTRIB_ARRAY_NORMALIZED : Int = 34922;
  276. static inline var VERTEX_ATTRIB_ARRAY_POINTER : Int = 34373;
  277. static inline var VERTEX_ATTRIB_ARRAY_BUFFER_BINDING : Int = 34975;
  278. static inline var IMPLEMENTATION_COLOR_READ_TYPE : Int = 35738;
  279. static inline var IMPLEMENTATION_COLOR_READ_FORMAT : Int = 35739;
  280. static inline var COMPILE_STATUS : Int = 35713;
  281. static inline var LOW_FLOAT : Int = 36336;
  282. static inline var MEDIUM_FLOAT : Int = 36337;
  283. static inline var HIGH_FLOAT : Int = 36338;
  284. static inline var LOW_INT : Int = 36339;
  285. static inline var MEDIUM_INT : Int = 36340;
  286. static inline var HIGH_INT : Int = 36341;
  287. static inline var FRAMEBUFFER : Int = 36160;
  288. static inline var RENDERBUFFER : Int = 36161;
  289. static inline var RGBA4 : Int = 32854;
  290. static inline var RGB5_A1 : Int = 32855;
  291. static inline var RGB565 : Int = 36194;
  292. static inline var DEPTH_COMPONENT16 : Int = 33189;
  293. static inline var STENCIL_INDEX8 : Int = 36168;
  294. static inline var DEPTH_STENCIL : Int = 34041;
  295. static inline var RENDERBUFFER_WIDTH : Int = 36162;
  296. static inline var RENDERBUFFER_HEIGHT : Int = 36163;
  297. static inline var RENDERBUFFER_INTERNAL_FORMAT : Int = 36164;
  298. static inline var RENDERBUFFER_RED_SIZE : Int = 36176;
  299. static inline var RENDERBUFFER_GREEN_SIZE : Int = 36177;
  300. static inline var RENDERBUFFER_BLUE_SIZE : Int = 36178;
  301. static inline var RENDERBUFFER_ALPHA_SIZE : Int = 36179;
  302. static inline var RENDERBUFFER_DEPTH_SIZE : Int = 36180;
  303. static inline var RENDERBUFFER_STENCIL_SIZE : Int = 36181;
  304. static inline var FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE : Int = 36048;
  305. static inline var FRAMEBUFFER_ATTACHMENT_OBJECT_NAME : Int = 36049;
  306. static inline var FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL : Int = 36050;
  307. static inline var FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE : Int = 36051;
  308. static inline var COLOR_ATTACHMENT0 : Int = 36064;
  309. static inline var DEPTH_ATTACHMENT : Int = 36096;
  310. static inline var STENCIL_ATTACHMENT : Int = 36128;
  311. static inline var DEPTH_STENCIL_ATTACHMENT : Int = 33306;
  312. static inline var NONE : Int = 0;
  313. static inline var FRAMEBUFFER_COMPLETE : Int = 36053;
  314. static inline var FRAMEBUFFER_INCOMPLETE_ATTACHMENT : Int = 36054;
  315. static inline var FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT : Int = 36055;
  316. static inline var FRAMEBUFFER_INCOMPLETE_DIMENSIONS : Int = 36057;
  317. static inline var FRAMEBUFFER_UNSUPPORTED : Int = 36061;
  318. static inline var FRAMEBUFFER_BINDING : Int = 36006;
  319. static inline var RENDERBUFFER_BINDING : Int = 36007;
  320. static inline var MAX_RENDERBUFFER_SIZE : Int = 34024;
  321. static inline var INVALID_FRAMEBUFFER_OPERATION : Int = 1286;
  322. static inline var UNPACK_FLIP_Y_WEBGL : Int = 37440;
  323. static inline var UNPACK_PREMULTIPLY_ALPHA_WEBGL : Int = 37441;
  324. static inline var CONTEXT_LOST_WEBGL : Int = 37442;
  325. static inline var UNPACK_COLORSPACE_CONVERSION_WEBGL : Int = 37443;
  326. static inline var BROWSER_DEFAULT_WEBGL : Int = 37444;
  327. /**
  328. A read-only back-reference to the `HTMLCanvasElement`. Might be `null` if it is not associated with a `canvas` element.
  329. **/
  330. var canvas(default,null) : js.html.CanvasElement;
  331. /**
  332. The read-only width of the current drawing buffer. Should match the width of the canvas element associated with this context.
  333. **/
  334. var drawingBufferWidth(default,null) : Int;
  335. /**
  336. The read-only height of the current drawing buffer. Should match the height of the canvas element associated with this context.
  337. **/
  338. var drawingBufferHeight(default,null) : Int;
  339. /**
  340. Updates buffer data.
  341. **/
  342. @:overload( function( target : Int, size : Int, usage : Int ) : Void {} )
  343. @:overload( function( target : Int, data : js.lib.ArrayBuffer, usage : Int ) : Void {} )
  344. function bufferData( target : Int, data : js.lib.ArrayBufferView, usage : Int ) : Void;
  345. /**
  346. Updates buffer data starting at a passed offset.
  347. **/
  348. @:overload( function( target : Int, offset : Int, data : js.lib.ArrayBuffer ) : Void {} )
  349. function bufferSubData( target : Int, offset : Int, data : js.lib.ArrayBufferView ) : Void;
  350. /**
  351. Specifies a 2D texture image in a compressed format.
  352. **/
  353. function compressedTexImage2D( target : Int, level : Int, internalformat : Int, width : Int, height : Int, border : Int, data : js.lib.ArrayBufferView ) : Void;
  354. /**
  355. Specifies a 2D texture sub-image in a compressed format.
  356. **/
  357. function compressedTexSubImage2D( target : Int, level : Int, xoffset : Int, yoffset : Int, width : Int, height : Int, format : Int, data : js.lib.ArrayBufferView ) : Void;
  358. /**
  359. Reads a block of pixels from the `WebGLFrameBuffer`.
  360. @throws DOMError
  361. **/
  362. function readPixels( x : Int, y : Int, width : Int, height : Int, format : Int, type : Int, pixels : js.lib.ArrayBufferView ) : Void;
  363. /**
  364. Specifies a 2D texture image.
  365. @throws DOMError
  366. **/
  367. @:overload( function( target : Int, level : Int, internalformat : Int, width : Int, height : Int, border : Int, format : Int, type : Int, pixels : js.lib.ArrayBufferView ) : Void {} )
  368. @:overload( function( target : Int, level : Int, internalformat : Int, format : Int, type : Int, pixels : js.html.ImageBitmap ) : Void {} )
  369. @:overload( function( target : Int, level : Int, internalformat : Int, format : Int, type : Int, pixels : js.html.ImageData ) : Void {} )
  370. @:overload( function( target : Int, level : Int, internalformat : Int, format : Int, type : Int, image : js.html.ImageElement ) : Void {} )
  371. @:overload( function( target : Int, level : Int, internalformat : Int, format : Int, type : Int, canvas : js.html.CanvasElement ) : Void {} )
  372. function texImage2D( target : Int, level : Int, internalformat : Int, format : Int, type : Int, video : js.html.VideoElement ) : Void;
  373. /**
  374. Updates a sub-rectangle of the current `WebGLTexture`.
  375. @throws DOMError
  376. **/
  377. @:overload( function( target : Int, level : Int, xoffset : Int, yoffset : Int, width : Int, height : Int, format : Int, type : Int, pixels : js.lib.ArrayBufferView ) : Void {} )
  378. @:overload( function( target : Int, level : Int, xoffset : Int, yoffset : Int, format : Int, type : Int, pixels : js.html.ImageBitmap ) : Void {} )
  379. @:overload( function( target : Int, level : Int, xoffset : Int, yoffset : Int, format : Int, type : Int, pixels : js.html.ImageData ) : Void {} )
  380. @:overload( function( target : Int, level : Int, xoffset : Int, yoffset : Int, format : Int, type : Int, image : js.html.ImageElement ) : Void {} )
  381. @:overload( function( target : Int, level : Int, xoffset : Int, yoffset : Int, format : Int, type : Int, canvas : js.html.CanvasElement ) : Void {} )
  382. function texSubImage2D( target : Int, level : Int, xoffset : Int, yoffset : Int, format : Int, type : Int, video : js.html.VideoElement ) : Void;
  383. @:overload( function( location : UniformLocation, data : Array<Float>) : Void {} )
  384. function uniform1fv( location : UniformLocation, data : js.lib.Float32Array ) : Void;
  385. @:overload( function( location : UniformLocation, data : Array<Float>) : Void {} )
  386. function uniform2fv( location : UniformLocation, data : js.lib.Float32Array ) : Void;
  387. @:overload( function( location : UniformLocation, data : Array<Float>) : Void {} )
  388. function uniform3fv( location : UniformLocation, data : js.lib.Float32Array ) : Void;
  389. @:overload( function( location : UniformLocation, data : Array<Float>) : Void {} )
  390. function uniform4fv( location : UniformLocation, data : js.lib.Float32Array ) : Void;
  391. @:overload( function( location : UniformLocation, data : Array<Int>) : Void {} )
  392. function uniform1iv( location : UniformLocation, data : js.lib.Int32Array ) : Void;
  393. @:overload( function( location : UniformLocation, data : Array<Int>) : Void {} )
  394. function uniform2iv( location : UniformLocation, data : js.lib.Int32Array ) : Void;
  395. @:overload( function( location : UniformLocation, data : Array<Int>) : Void {} )
  396. function uniform3iv( location : UniformLocation, data : js.lib.Int32Array ) : Void;
  397. @:overload( function( location : UniformLocation, data : Array<Int>) : Void {} )
  398. function uniform4iv( location : UniformLocation, data : js.lib.Int32Array ) : Void;
  399. @:overload( function( location : UniformLocation, transpose : Bool, data : Array<Float>) : Void {} )
  400. function uniformMatrix2fv( location : UniformLocation, transpose : Bool, data : js.lib.Float32Array ) : Void;
  401. @:overload( function( location : UniformLocation, transpose : Bool, data : Array<Float>) : Void {} )
  402. function uniformMatrix3fv( location : UniformLocation, transpose : Bool, data : js.lib.Float32Array ) : Void;
  403. @:overload( function( location : UniformLocation, transpose : Bool, data : Array<Float>) : Void {} )
  404. function uniformMatrix4fv( location : UniformLocation, transpose : Bool, data : js.lib.Float32Array ) : Void;
  405. /**
  406. Returns a `WebGLContextAttributes` object that contains the actual context parameters. Might return `null`, if the context is lost.
  407. **/
  408. function getContextAttributes() : ContextAttributes;
  409. /**
  410. Returns `true` if the context is lost, otherwise returns `false`.
  411. **/
  412. function isContextLost() : Bool;
  413. /**
  414. Returns an `Array` of `DOMString` elements with all the supported WebGL extensions.
  415. **/
  416. function getSupportedExtensions() : Array<String>;
  417. /**
  418. Returns an extension object.
  419. @throws DOMError
  420. **/
  421. function getExtension<T>( name : Extension<T> ) : T;
  422. /**
  423. Selects the active texture unit.
  424. **/
  425. function activeTexture( texture : Int ) : Void;
  426. /**
  427. Attaches a `WebGLShader` to a `WebGLProgram`.
  428. **/
  429. function attachShader( program : Program, shader : Shader ) : Void;
  430. /**
  431. Binds a generic vertex index to a named attribute variable.
  432. **/
  433. function bindAttribLocation( program : Program, index : Int, name : String ) : Void;
  434. /**
  435. Binds a `WebGLBuffer` object to a given target.
  436. **/
  437. function bindBuffer( target : Int, buffer : Buffer ) : Void;
  438. /**
  439. Binds a `WebGLFrameBuffer` object to a given target.
  440. **/
  441. function bindFramebuffer( target : Int, framebuffer : Framebuffer ) : Void;
  442. /**
  443. Binds a `WebGLRenderBuffer` object to a given target.
  444. **/
  445. function bindRenderbuffer( target : Int, renderbuffer : Renderbuffer ) : Void;
  446. /**
  447. Binds a `WebGLTexture` object to a given target.
  448. **/
  449. function bindTexture( target : Int, texture : Texture ) : Void;
  450. /**
  451. Sets the source and destination blending factors.
  452. **/
  453. function blendColor( red : Float, green : Float, blue : Float, alpha : Float ) : Void;
  454. /**
  455. Sets both the RGB blend equation and alpha blend equation to a single equation.
  456. **/
  457. function blendEquation( mode : Int ) : Void;
  458. /**
  459. Sets the RGB blend equation and alpha blend equation separately.
  460. **/
  461. function blendEquationSeparate( modeRGB : Int, modeAlpha : Int ) : Void;
  462. /**
  463. Defines which function is used for blending pixel arithmetic.
  464. **/
  465. function blendFunc( sfactor : Int, dfactor : Int ) : Void;
  466. /**
  467. Defines which function is used for blending pixel arithmetic for RGB and alpha components separately.
  468. **/
  469. function blendFuncSeparate( srcRGB : Int, dstRGB : Int, srcAlpha : Int, dstAlpha : Int ) : Void;
  470. /**
  471. Returns the status of the framebuffer.
  472. **/
  473. function checkFramebufferStatus( target : Int ) : Int;
  474. /**
  475. Clears specified buffers to preset values.
  476. **/
  477. function clear( mask : Int ) : Void;
  478. /**
  479. Specifies the color values used when clearing color buffers.
  480. **/
  481. function clearColor( red : Float, green : Float, blue : Float, alpha : Float ) : Void;
  482. /**
  483. Specifies the depth value used when clearing the depth buffer.
  484. **/
  485. function clearDepth( depth : Float ) : Void;
  486. /**
  487. Specifies the stencil value used when clearing the stencil buffer.
  488. **/
  489. function clearStencil( s : Int ) : Void;
  490. /**
  491. Sets which color components to enable or to disable when drawing or rendering to a `WebGLFramebuffer`.
  492. **/
  493. function colorMask( red : Bool, green : Bool, blue : Bool, alpha : Bool ) : Void;
  494. /**
  495. Compiles a `WebGLShader`.
  496. **/
  497. function compileShader( shader : Shader ) : Void;
  498. /**
  499. Copies a 2D texture image.
  500. **/
  501. function copyTexImage2D( target : Int, level : Int, internalformat : Int, x : Int, y : Int, width : Int, height : Int, border : Int ) : Void;
  502. /**
  503. Copies a 2D texture sub-image.
  504. **/
  505. function copyTexSubImage2D( target : Int, level : Int, xoffset : Int, yoffset : Int, x : Int, y : Int, width : Int, height : Int ) : Void;
  506. /**
  507. Creates a `WebGLBuffer` object.
  508. **/
  509. function createBuffer() : Buffer;
  510. /**
  511. Creates a `WebGLFrameBuffer` object.
  512. **/
  513. function createFramebuffer() : Framebuffer;
  514. /**
  515. Creates a `WebGLProgram`.
  516. **/
  517. function createProgram() : Program;
  518. /**
  519. Creates a `WebGLRenderBuffer` object.
  520. **/
  521. function createRenderbuffer() : Renderbuffer;
  522. /**
  523. Creates a `WebGLShader`.
  524. **/
  525. function createShader( type : Int ) : Shader;
  526. /**
  527. Creates a `WebGLTexture` object.
  528. **/
  529. function createTexture() : Texture;
  530. /**
  531. Specifies whether or not front- and/or back-facing polygons can be culled.
  532. **/
  533. function cullFace( mode : Int ) : Void;
  534. /**
  535. Deletes a `WebGLBuffer` object.
  536. **/
  537. function deleteBuffer( buffer : Buffer ) : Void;
  538. /**
  539. Deletes a `WebGLFrameBuffer` object.
  540. **/
  541. function deleteFramebuffer( framebuffer : Framebuffer ) : Void;
  542. /**
  543. Deletes a `WebGLProgram`.
  544. **/
  545. function deleteProgram( program : Program ) : Void;
  546. /**
  547. Deletes a `WebGLRenderBuffer` object.
  548. **/
  549. function deleteRenderbuffer( renderbuffer : Renderbuffer ) : Void;
  550. /**
  551. Deletes a `WebGLShader`.
  552. **/
  553. function deleteShader( shader : Shader ) : Void;
  554. /**
  555. Deletes a `WebGLTexture` object.
  556. **/
  557. function deleteTexture( texture : Texture ) : Void;
  558. /**
  559. Specifies a function that compares incoming pixel depth to the current depth buffer value.
  560. **/
  561. function depthFunc( func : Int ) : Void;
  562. /**
  563. Sets whether writing into the depth buffer is enabled or disabled.
  564. **/
  565. function depthMask( flag : Bool ) : Void;
  566. /**
  567. Specifies the depth range mapping from normalized device coordinates to window or viewport coordinates.
  568. **/
  569. function depthRange( zNear : Float, zFar : Float ) : Void;
  570. /**
  571. Detaches a `WebGLShader`.
  572. **/
  573. function detachShader( program : Program, shader : Shader ) : Void;
  574. /**
  575. Disables specific WebGL capabilities for this context.
  576. **/
  577. function disable( cap : Int ) : Void;
  578. /**
  579. Disables a vertex attribute array at a given position.
  580. **/
  581. function disableVertexAttribArray( index : Int ) : Void;
  582. /**
  583. Renders primitives from array data.
  584. **/
  585. function drawArrays( mode : Int, first : Int, count : Int ) : Void;
  586. /**
  587. Renders primitives from element array data.
  588. **/
  589. function drawElements( mode : Int, count : Int, type : Int, offset : Int ) : Void;
  590. /**
  591. Enables specific WebGL capabilities for this context.
  592. **/
  593. function enable( cap : Int ) : Void;
  594. /**
  595. Enables a vertex attribute array at a given position.
  596. **/
  597. function enableVertexAttribArray( index : Int ) : Void;
  598. /**
  599. Blocks execution until all previously called commands are finished.
  600. **/
  601. function finish() : Void;
  602. /**
  603. Empties different buffer commands, causing all commands to be executed as quickly as possible.
  604. **/
  605. function flush() : Void;
  606. /**
  607. Attaches a `WebGLRenderingBuffer` object to a `WebGLFrameBuffer` object.
  608. **/
  609. function framebufferRenderbuffer( target : Int, attachment : Int, renderbuffertarget : Int, renderbuffer : Renderbuffer ) : Void;
  610. /**
  611. Attaches a textures image to a `WebGLFrameBuffer` object.
  612. **/
  613. function framebufferTexture2D( target : Int, attachment : Int, textarget : Int, texture : Texture, level : Int ) : Void;
  614. /**
  615. Specifies whether polygons are front- or back-facing by setting a winding orientation.
  616. **/
  617. function frontFace( mode : Int ) : Void;
  618. /**
  619. Generates a set of mipmaps for a `WebGLTexture` object.
  620. **/
  621. function generateMipmap( target : Int ) : Void;
  622. /**
  623. Returns information about an active attribute variable.
  624. **/
  625. function getActiveAttrib( program : Program, index : Int ) : ActiveInfo;
  626. /**
  627. Returns information about an active uniform variable.
  628. **/
  629. function getActiveUniform( program : Program, index : Int ) : ActiveInfo;
  630. /**
  631. Returns a list of `WebGLShader` objects attached to a `WebGLProgram`.
  632. **/
  633. function getAttachedShaders( program : Program ) : Array<Shader>;
  634. /**
  635. Returns the location of an attribute variable.
  636. **/
  637. function getAttribLocation( program : Program, name : String ) : Int;
  638. /**
  639. Returns information about the buffer.
  640. **/
  641. function getBufferParameter( target : Int, pname : Int ) : Dynamic;
  642. /**
  643. Returns a value for the passed parameter name.
  644. @throws DOMError
  645. **/
  646. function getParameter( pname : Int ) : Dynamic;
  647. /**
  648. Returns error information.
  649. **/
  650. function getError() : Int;
  651. /**
  652. Returns information about the framebuffer.
  653. @throws DOMError
  654. **/
  655. function getFramebufferAttachmentParameter( target : Int, attachment : Int, pname : Int ) : Dynamic;
  656. /**
  657. Returns information about the program.
  658. **/
  659. function getProgramParameter( program : Program, pname : Int ) : Dynamic;
  660. /**
  661. Returns the information log for a `WebGLProgram` object.
  662. **/
  663. function getProgramInfoLog( program : Program ) : String;
  664. /**
  665. Returns information about the renderbuffer.
  666. **/
  667. function getRenderbufferParameter( target : Int, pname : Int ) : Dynamic;
  668. /**
  669. Returns information about the shader.
  670. **/
  671. function getShaderParameter( shader : Shader, pname : Int ) : Dynamic;
  672. /**
  673. Returns a `WebGLShaderPrecisionFormat` object describing the precision for the numeric format of the shader.
  674. **/
  675. function getShaderPrecisionFormat( shadertype : Int, precisiontype : Int ) : ShaderPrecisionFormat;
  676. /**
  677. Returns the information log for a `WebGLShader` object.
  678. **/
  679. function getShaderInfoLog( shader : Shader ) : String;
  680. /**
  681. Returns the source code of a `WebGLShader` as a string.
  682. **/
  683. function getShaderSource( shader : Shader ) : String;
  684. /**
  685. Returns information about the texture.
  686. **/
  687. function getTexParameter( target : Int, pname : Int ) : Dynamic;
  688. /**
  689. Returns the value of a uniform variable at a given location.
  690. **/
  691. function getUniform( program : Program, location : UniformLocation ) : Dynamic;
  692. /**
  693. Returns the location of a uniform variable.
  694. **/
  695. function getUniformLocation( program : Program, name : String ) : UniformLocation;
  696. /**
  697. Returns information about a vertex attribute at a given position.
  698. @throws DOMError
  699. **/
  700. function getVertexAttrib( index : Int, pname : Int ) : Dynamic;
  701. /**
  702. Returns the address of a given vertex attribute.
  703. **/
  704. function getVertexAttribOffset( index : Int, pname : Int ) : Int;
  705. /**
  706. Specifies hints for certain behaviors. The interpretation of these hints depend on the implementation.
  707. **/
  708. function hint( target : Int, mode : Int ) : Void;
  709. /**
  710. Returns a Boolean indicating if the passed buffer is valid.
  711. **/
  712. function isBuffer( buffer : Buffer ) : Bool;
  713. /**
  714. Tests whether a specific WebGL capability is enabled or not for this context.
  715. **/
  716. function isEnabled( cap : Int ) : Bool;
  717. /**
  718. Returns a Boolean indicating if the passed `WebGLFrameBuffer` object is valid.
  719. **/
  720. function isFramebuffer( framebuffer : Framebuffer ) : Bool;
  721. /**
  722. Returns a Boolean indicating if the passed `WebGLProgram` is valid.
  723. **/
  724. function isProgram( program : Program ) : Bool;
  725. /**
  726. Returns a Boolean indicating if the passed `WebGLRenderingBuffer` is valid.
  727. **/
  728. function isRenderbuffer( renderbuffer : Renderbuffer ) : Bool;
  729. /**
  730. Returns a Boolean indicating if the passed `WebGLShader` is valid.
  731. **/
  732. function isShader( shader : Shader ) : Bool;
  733. /**
  734. Returns a Boolean indicating if the passed `WebGLTexture` is valid.
  735. **/
  736. function isTexture( texture : Texture ) : Bool;
  737. /**
  738. Sets the line width of rasterized lines.
  739. **/
  740. function lineWidth( width : Float ) : Void;
  741. /**
  742. Links the passed `WebGLProgram` object.
  743. **/
  744. function linkProgram( program : Program ) : Void;
  745. /**
  746. Specifies the pixel storage modes
  747. **/
  748. function pixelStorei( pname : Int, param : Int ) : Void;
  749. /**
  750. Specifies the scale factors and units to calculate depth values.
  751. **/
  752. function polygonOffset( factor : Float, units : Float ) : Void;
  753. /**
  754. Creates a renderbuffer data store.
  755. **/
  756. function renderbufferStorage( target : Int, internalformat : Int, width : Int, height : Int ) : Void;
  757. /**
  758. Specifies multi-sample coverage parameters for anti-aliasing effects.
  759. **/
  760. function sampleCoverage( value : Float, invert : Bool ) : Void;
  761. /**
  762. Defines the scissor box.
  763. **/
  764. function scissor( x : Int, y : Int, width : Int, height : Int ) : Void;
  765. /**
  766. Sets the source code in a `WebGLShader`.
  767. **/
  768. function shaderSource( shader : Shader, source : String ) : Void;
  769. /**
  770. Sets the both front and back function and reference value for stencil testing.
  771. **/
  772. function stencilFunc( func : Int, ref : Int, mask : Int ) : Void;
  773. /**
  774. Sets the front and/or back function and reference value for stencil testing.
  775. **/
  776. function stencilFuncSeparate( face : Int, func : Int, ref : Int, mask : Int ) : Void;
  777. /**
  778. Controls enabling and disabling of both the front and back writing of individual bits in the stencil planes.
  779. **/
  780. function stencilMask( mask : Int ) : Void;
  781. /**
  782. Controls enabling and disabling of front and/or back writing of individual bits in the stencil planes.
  783. **/
  784. function stencilMaskSeparate( face : Int, mask : Int ) : Void;
  785. /**
  786. Sets both the front and back-facing stencil test actions.
  787. **/
  788. function stencilOp( fail : Int, zfail : Int, zpass : Int ) : Void;
  789. /**
  790. Sets the front and/or back-facing stencil test actions.
  791. **/
  792. function stencilOpSeparate( face : Int, fail : Int, zfail : Int, zpass : Int ) : Void;
  793. function texParameterf( target : Int, pname : Int, param : Float ) : Void;
  794. function texParameteri( target : Int, pname : Int, param : Int ) : Void;
  795. function uniform1f( location : UniformLocation, x : Float ) : Void;
  796. function uniform2f( location : UniformLocation, x : Float, y : Float ) : Void;
  797. function uniform3f( location : UniformLocation, x : Float, y : Float, z : Float ) : Void;
  798. function uniform4f( location : UniformLocation, x : Float, y : Float, z : Float, w : Float ) : Void;
  799. function uniform1i( location : UniformLocation, x : Int ) : Void;
  800. function uniform2i( location : UniformLocation, x : Int, y : Int ) : Void;
  801. function uniform3i( location : UniformLocation, x : Int, y : Int, z : Int ) : Void;
  802. function uniform4i( location : UniformLocation, x : Int, y : Int, z : Int, w : Int ) : Void;
  803. /**
  804. Uses the specified `WebGLProgram` as part the current rendering state.
  805. **/
  806. function useProgram( program : Program ) : Void;
  807. /**
  808. Validates a `WebGLProgram`.
  809. **/
  810. function validateProgram( program : Program ) : Void;
  811. function vertexAttrib1f( indx : Int, x : Float ) : Void;
  812. @:overload( function( indx : Int, values : Array<Float>) : Void {} )
  813. function vertexAttrib1fv( indx : Int, values : js.lib.Float32Array ) : Void;
  814. function vertexAttrib2f( indx : Int, x : Float, y : Float ) : Void;
  815. @:overload( function( indx : Int, values : Array<Float>) : Void {} )
  816. function vertexAttrib2fv( indx : Int, values : js.lib.Float32Array ) : Void;
  817. function vertexAttrib3f( indx : Int, x : Float, y : Float, z : Float ) : Void;
  818. @:overload( function( indx : Int, values : Array<Float>) : Void {} )
  819. function vertexAttrib3fv( indx : Int, values : js.lib.Float32Array ) : Void;
  820. function vertexAttrib4f( indx : Int, x : Float, y : Float, z : Float, w : Float ) : Void;
  821. @:overload( function( indx : Int, values : Array<Float>) : Void {} )
  822. function vertexAttrib4fv( indx : Int, values : js.lib.Float32Array ) : Void;
  823. /**
  824. Specifies the data formats and locations of vertex attributes in a vertex attributes array.
  825. **/
  826. function vertexAttribPointer( indx : Int, size : Int, type : Int, normalized : Bool, stride : Int, offset : Int ) : Void;
  827. /**
  828. Sets the viewport.
  829. **/
  830. function viewport( x : Int, y : Int, width : Int, height : Int ) : Void;
  831. }