RenderingContext.hx 36 KB

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