@defold-typescript/types 0.52.0 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (521) hide show
  1. package/api-signatures.json +2074 -1964
  2. package/dist/cli-runtime.js +8966 -0
  3. package/dist/identity-vocabulary.json +660 -0
  4. package/dist/src/index.d.ts +18 -0
  5. package/examples/translations.json +15 -15
  6. package/fixtures/defold-1.12.4/b2d_body_doc.json +1327 -0
  7. package/fixtures/defold-1.12.4/b2d_doc.json +107 -0
  8. package/fixtures/defold-1.12.4/base_doc.json +758 -0
  9. package/fixtures/defold-1.12.4/bit_doc.json +404 -0
  10. package/fixtures/defold-1.12.4/buffer_doc.json +422 -0
  11. package/fixtures/defold-1.12.4/camera_doc.json +664 -0
  12. package/fixtures/defold-1.12.4/collectionfactory_doc.json +219 -0
  13. package/fixtures/defold-1.12.4/collectionproxy_doc.json +289 -0
  14. package/fixtures/defold-1.12.4/coroutine_doc.json +151 -0
  15. package/fixtures/defold-1.12.4/crash_doc.json +497 -0
  16. package/fixtures/defold-1.12.4/debug_doc.json +410 -0
  17. package/fixtures/defold-1.12.4/factory_doc.json +219 -0
  18. package/fixtures/defold-1.12.4/font_doc.json +141 -0
  19. package/fixtures/defold-1.12.4/globals_doc.json +42 -0
  20. package/fixtures/defold-1.12.4/go-instance-functions.json +111 -0
  21. package/fixtures/defold-1.12.4/go_doc.json +1901 -0
  22. package/fixtures/defold-1.12.4/graphics_doc.json +1634 -0
  23. package/fixtures/defold-1.12.4/gui_doc.json +5249 -0
  24. package/fixtures/defold-1.12.4/html5_doc.json +64 -0
  25. package/fixtures/defold-1.12.4/http_doc.json +66 -0
  26. package/fixtures/defold-1.12.4/image_doc.json +170 -0
  27. package/fixtures/defold-1.12.4/io_doc.json +399 -0
  28. package/fixtures/defold-1.12.4/json_doc.json +97 -0
  29. package/fixtures/defold-1.12.4/label_doc.json +220 -0
  30. package/fixtures/defold-1.12.4/liveupdate_doc.json +308 -0
  31. package/fixtures/defold-1.12.4/math_doc.json +702 -0
  32. package/fixtures/defold-1.12.4/messages_doc.json +579 -0
  33. package/fixtures/defold-1.12.4/model_doc.json +315 -0
  34. package/fixtures/defold-1.12.4/msg_doc.json +137 -0
  35. package/fixtures/defold-1.12.4/os_doc.json +266 -0
  36. package/fixtures/defold-1.12.4/package_doc.json +139 -0
  37. package/fixtures/defold-1.12.4/particlefx_doc.json +249 -0
  38. package/fixtures/defold-1.12.4/physics_doc.json +1120 -0
  39. package/fixtures/defold-1.12.4/profiler_doc.json +375 -0
  40. package/fixtures/defold-1.12.4/render_doc.json +1167 -0
  41. package/fixtures/defold-1.12.4/resource_doc.json +762 -0
  42. package/fixtures/defold-1.12.4/socket_doc.json +2194 -0
  43. package/fixtures/defold-1.12.4/sound_doc.json +582 -0
  44. package/fixtures/defold-1.12.4/sprite_doc.json +245 -0
  45. package/fixtures/defold-1.12.4/string_doc.json +412 -0
  46. package/fixtures/defold-1.12.4/sys_doc.json +853 -0
  47. package/fixtures/defold-1.12.4/table_doc.json +166 -0
  48. package/fixtures/defold-1.12.4/tilemap_doc.json +374 -0
  49. package/fixtures/defold-1.12.4/timer_doc.json +153 -0
  50. package/fixtures/defold-1.12.4/types_doc.json +212 -0
  51. package/fixtures/defold-1.12.4/vmath_doc.json +1814 -0
  52. package/fixtures/defold-1.12.4/window_doc.json +388 -0
  53. package/fixtures/defold-1.12.4/zlib_doc.json +70 -0
  54. package/fixtures/defold-1.13.0/b2d_body_doc.json +2428 -0
  55. package/fixtures/defold-1.13.0/b2d_chain_doc.json +394 -0
  56. package/fixtures/defold-1.13.0/b2d_doc.json +128 -0
  57. package/fixtures/defold-1.13.0/b2d_fixture_doc.json +594 -0
  58. package/fixtures/defold-1.13.0/b2d_joint_doc.json +3315 -0
  59. package/fixtures/defold-1.13.0/b2d_shape_doc.json +802 -0
  60. package/fixtures/defold-1.13.0/b2d_world_doc.json +1314 -0
  61. package/fixtures/defold-1.13.0/base_doc.json +758 -0
  62. package/fixtures/defold-1.13.0/bit_doc.json +404 -0
  63. package/fixtures/defold-1.13.0/buffer_doc.json +422 -0
  64. package/fixtures/defold-1.13.0/camera_doc.json +900 -0
  65. package/fixtures/defold-1.13.0/collectionfactory_doc.json +219 -0
  66. package/fixtures/defold-1.13.0/collectionproxy_doc.json +289 -0
  67. package/fixtures/defold-1.13.0/compute_doc.json +182 -0
  68. package/fixtures/defold-1.13.0/coroutine_doc.json +151 -0
  69. package/fixtures/defold-1.13.0/crash_doc.json +497 -0
  70. package/fixtures/defold-1.13.0/debug_doc.json +410 -0
  71. package/fixtures/defold-1.13.0/editor_doc.json +3665 -0
  72. package/fixtures/defold-1.13.0/editor_http_doc.json +273 -0
  73. package/fixtures/defold-1.13.0/editor_json_doc.json +59 -0
  74. package/fixtures/defold-1.13.0/editor_localization_doc.json +138 -0
  75. package/fixtures/defold-1.13.0/editor_pprint_doc.json +36 -0
  76. package/fixtures/defold-1.13.0/editor_tilemap_tiles_doc.json +235 -0
  77. package/fixtures/defold-1.13.0/editor_zip_doc.json +163 -0
  78. package/fixtures/defold-1.13.0/editor_zlib_doc.json +48 -0
  79. package/fixtures/defold-1.13.0/factory_doc.json +219 -0
  80. package/fixtures/defold-1.13.0/font_doc.json +141 -0
  81. package/fixtures/defold-1.13.0/globals_doc.json +42 -0
  82. package/fixtures/defold-1.13.0/go-instance-functions.json +101 -0
  83. package/fixtures/defold-1.13.0/go_doc.json +1989 -0
  84. package/fixtures/defold-1.13.0/graphics_doc.json +1886 -0
  85. package/fixtures/defold-1.13.0/gui_doc.json +5277 -0
  86. package/fixtures/defold-1.13.0/html5_doc.json +64 -0
  87. package/fixtures/defold-1.13.0/http_doc.json +66 -0
  88. package/fixtures/defold-1.13.0/image_doc.json +170 -0
  89. package/fixtures/defold-1.13.0/import-manifest.json +10558 -0
  90. package/fixtures/defold-1.13.0/io_doc.json +399 -0
  91. package/fixtures/defold-1.13.0/json_doc.json +97 -0
  92. package/fixtures/defold-1.13.0/label_doc.json +220 -0
  93. package/fixtures/defold-1.13.0/liveupdate_doc.json +330 -0
  94. package/fixtures/defold-1.13.0/material_doc.json +238 -0
  95. package/fixtures/defold-1.13.0/math_doc.json +702 -0
  96. package/fixtures/defold-1.13.0/model_doc.json +412 -0
  97. package/fixtures/defold-1.13.0/msg_doc.json +137 -0
  98. package/fixtures/defold-1.13.0/os_doc.json +266 -0
  99. package/fixtures/defold-1.13.0/package_doc.json +139 -0
  100. package/fixtures/defold-1.13.0/particlefx_doc.json +249 -0
  101. package/fixtures/defold-1.13.0/physics_doc.json +1492 -0
  102. package/fixtures/defold-1.13.0/profiler_doc.json +375 -0
  103. package/fixtures/defold-1.13.0/render_doc.json +1381 -0
  104. package/fixtures/defold-1.13.0/resource_doc.json +762 -0
  105. package/fixtures/defold-1.13.0/socket_doc.json +2194 -0
  106. package/fixtures/defold-1.13.0/sound_doc.json +582 -0
  107. package/fixtures/defold-1.13.0/sprite_doc.json +335 -0
  108. package/fixtures/defold-1.13.0/string_doc.json +412 -0
  109. package/fixtures/defold-1.13.0/sys_doc.json +1142 -0
  110. package/fixtures/defold-1.13.0/table_doc.json +166 -0
  111. package/fixtures/defold-1.13.0/tilemap_doc.json +402 -0
  112. package/fixtures/defold-1.13.0/timer_doc.json +153 -0
  113. package/fixtures/defold-1.13.0/types_doc.json +212 -0
  114. package/fixtures/defold-1.13.0/vmath_doc.json +1814 -0
  115. package/fixtures/defold-1.13.0/window_doc.json +388 -0
  116. package/fixtures/defold-1.13.0/zlib_doc.json +70 -0
  117. package/fixtures/defold-1.13.1/b2d_body_doc.json +2428 -0
  118. package/fixtures/defold-1.13.1/b2d_chain_doc.json +394 -0
  119. package/fixtures/defold-1.13.1/b2d_doc.json +128 -0
  120. package/fixtures/defold-1.13.1/b2d_fixture_doc.json +594 -0
  121. package/fixtures/defold-1.13.1/b2d_joint_doc.json +3315 -0
  122. package/fixtures/defold-1.13.1/b2d_shape_doc.json +802 -0
  123. package/fixtures/defold-1.13.1/b2d_world_doc.json +1314 -0
  124. package/fixtures/defold-1.13.1/base_doc.json +758 -0
  125. package/fixtures/defold-1.13.1/bit_doc.json +404 -0
  126. package/fixtures/defold-1.13.1/buffer_doc.json +422 -0
  127. package/fixtures/defold-1.13.1/camera_doc.json +900 -0
  128. package/fixtures/defold-1.13.1/collectionfactory_doc.json +219 -0
  129. package/fixtures/defold-1.13.1/collectionproxy_doc.json +323 -0
  130. package/fixtures/defold-1.13.1/compute_doc.json +182 -0
  131. package/fixtures/defold-1.13.1/coroutine_doc.json +151 -0
  132. package/fixtures/defold-1.13.1/crash_doc.json +497 -0
  133. package/fixtures/defold-1.13.1/debug_doc.json +410 -0
  134. package/fixtures/defold-1.13.1/editor_doc.json +3880 -0
  135. package/fixtures/defold-1.13.1/editor_http_doc.json +273 -0
  136. package/fixtures/defold-1.13.1/editor_image_doc.json +128 -0
  137. package/fixtures/defold-1.13.1/editor_json_doc.json +59 -0
  138. package/fixtures/defold-1.13.1/editor_localization_doc.json +138 -0
  139. package/fixtures/defold-1.13.1/editor_pprint_doc.json +36 -0
  140. package/fixtures/defold-1.13.1/editor_tilemap_tiles_doc.json +235 -0
  141. package/fixtures/defold-1.13.1/editor_zip_doc.json +163 -0
  142. package/fixtures/defold-1.13.1/editor_zlib_doc.json +48 -0
  143. package/fixtures/defold-1.13.1/factory_doc.json +219 -0
  144. package/fixtures/defold-1.13.1/font_doc.json +141 -0
  145. package/fixtures/defold-1.13.1/globals_doc.json +42 -0
  146. package/fixtures/defold-1.13.1/go-instance-functions.json +102 -0
  147. package/fixtures/defold-1.13.1/go_doc.json +1989 -0
  148. package/fixtures/defold-1.13.1/graphics_doc.json +1886 -0
  149. package/fixtures/defold-1.13.1/gui_doc.json +5277 -0
  150. package/fixtures/defold-1.13.1/html5_doc.json +64 -0
  151. package/fixtures/defold-1.13.1/http_doc.json +66 -0
  152. package/fixtures/defold-1.13.1/image_doc.json +170 -0
  153. package/fixtures/defold-1.13.1/import-manifest.json +10091 -0
  154. package/fixtures/defold-1.13.1/io_doc.json +399 -0
  155. package/fixtures/defold-1.13.1/json_doc.json +97 -0
  156. package/fixtures/defold-1.13.1/label_doc.json +220 -0
  157. package/fixtures/defold-1.13.1/liveupdate_doc.json +330 -0
  158. package/fixtures/defold-1.13.1/material_doc.json +238 -0
  159. package/fixtures/defold-1.13.1/math_doc.json +702 -0
  160. package/fixtures/defold-1.13.1/model_doc.json +412 -0
  161. package/fixtures/defold-1.13.1/msg_doc.json +137 -0
  162. package/fixtures/defold-1.13.1/os_doc.json +266 -0
  163. package/fixtures/defold-1.13.1/package_doc.json +139 -0
  164. package/fixtures/defold-1.13.1/particlefx_doc.json +249 -0
  165. package/fixtures/defold-1.13.1/physics_doc.json +1492 -0
  166. package/fixtures/defold-1.13.1/profiler_doc.json +375 -0
  167. package/fixtures/defold-1.13.1/render_doc.json +1381 -0
  168. package/fixtures/defold-1.13.1/resource_doc.json +762 -0
  169. package/fixtures/defold-1.13.1/socket_doc.json +2194 -0
  170. package/fixtures/defold-1.13.1/sound_doc.json +582 -0
  171. package/fixtures/defold-1.13.1/sprite_doc.json +335 -0
  172. package/fixtures/defold-1.13.1/string_doc.json +412 -0
  173. package/fixtures/defold-1.13.1/sys_doc.json +1142 -0
  174. package/fixtures/defold-1.13.1/table_doc.json +166 -0
  175. package/fixtures/defold-1.13.1/tilemap_doc.json +402 -0
  176. package/fixtures/defold-1.13.1/timer_doc.json +153 -0
  177. package/fixtures/defold-1.13.1/types_doc.json +212 -0
  178. package/fixtures/defold-1.13.1/vmath_doc.json +1814 -0
  179. package/fixtures/defold-1.13.1/window_doc.json +388 -0
  180. package/fixtures/defold-1.13.1/zlib_doc.json +70 -0
  181. package/fixtures/defold-1.13.2/b2d_body_doc.json +2359 -0
  182. package/fixtures/defold-1.13.2/b2d_chain_doc.json +395 -0
  183. package/fixtures/defold-1.13.2/b2d_doc.json +1945 -0
  184. package/fixtures/defold-1.13.2/b2d_fixture_doc.json +595 -0
  185. package/fixtures/defold-1.13.2/b2d_joint_doc.json +3178 -0
  186. package/fixtures/defold-1.13.2/b2d_shape_doc.json +767 -0
  187. package/fixtures/defold-1.13.2/b2d_world_doc.json +1315 -0
  188. package/fixtures/defold-1.13.2/base_doc.json +759 -0
  189. package/fixtures/defold-1.13.2/bit_doc.json +405 -0
  190. package/fixtures/defold-1.13.2/buffer_doc.json +393 -0
  191. package/fixtures/defold-1.13.2/bullet3d_collision_object_doc.json +1206 -0
  192. package/fixtures/defold-1.13.2/bullet3d_constraint_doc.json +2455 -0
  193. package/fixtures/defold-1.13.2/bullet3d_doc.json +215 -0
  194. package/fixtures/defold-1.13.2/bullet3d_rigid_body_doc.json +1376 -0
  195. package/fixtures/defold-1.13.2/bullet3d_shape_doc.json +430 -0
  196. package/fixtures/defold-1.13.2/bullet3d_world_doc.json +855 -0
  197. package/fixtures/defold-1.13.2/camera_doc.json +887 -0
  198. package/fixtures/defold-1.13.2/collectionfactory_doc.json +206 -0
  199. package/fixtures/defold-1.13.2/collectionproxy_doc.json +397 -0
  200. package/fixtures/defold-1.13.2/compute_doc.json +183 -0
  201. package/fixtures/defold-1.13.2/coroutine_doc.json +152 -0
  202. package/fixtures/defold-1.13.2/crash_doc.json +483 -0
  203. package/fixtures/defold-1.13.2/debug_doc.json +411 -0
  204. package/fixtures/defold-1.13.2/editor_doc.json +6320 -0
  205. package/fixtures/defold-1.13.2/editor_http_doc.json +476 -0
  206. package/fixtures/defold-1.13.2/editor_image_doc.json +129 -0
  207. package/fixtures/defold-1.13.2/editor_json_doc.json +81 -0
  208. package/fixtures/defold-1.13.2/editor_localization_doc.json +139 -0
  209. package/fixtures/defold-1.13.2/editor_pprint_doc.json +37 -0
  210. package/fixtures/defold-1.13.2/editor_tilemap_tiles_doc.json +292 -0
  211. package/fixtures/defold-1.13.2/editor_zip_doc.json +237 -0
  212. package/fixtures/defold-1.13.2/editor_zlib_doc.json +49 -0
  213. package/fixtures/defold-1.13.2/factory_doc.json +206 -0
  214. package/fixtures/defold-1.13.2/font_doc.json +230 -0
  215. package/fixtures/defold-1.13.2/globals_doc.json +64 -0
  216. package/fixtures/defold-1.13.2/go-instance-functions.json +106 -0
  217. package/fixtures/defold-1.13.2/go_doc.json +1789 -0
  218. package/fixtures/defold-1.13.2/graphics_doc.json +1211 -0
  219. package/fixtures/defold-1.13.2/gui_doc.json +4735 -0
  220. package/fixtures/defold-1.13.2/html5_doc.json +65 -0
  221. package/fixtures/defold-1.13.2/http_doc.json +174 -0
  222. package/fixtures/defold-1.13.2/image_doc.json +298 -0
  223. package/fixtures/defold-1.13.2/import-manifest.json +10902 -0
  224. package/fixtures/defold-1.13.2/io_doc.json +400 -0
  225. package/fixtures/defold-1.13.2/json_doc.json +140 -0
  226. package/fixtures/defold-1.13.2/label_doc.json +427 -0
  227. package/fixtures/defold-1.13.2/liveupdate_doc.json +221 -0
  228. package/fixtures/defold-1.13.2/material_doc.json +773 -0
  229. package/fixtures/defold-1.13.2/math_doc.json +703 -0
  230. package/fixtures/defold-1.13.2/model_doc.json +472 -0
  231. package/fixtures/defold-1.13.2/msg_doc.json +169 -0
  232. package/fixtures/defold-1.13.2/os_doc.json +269 -0
  233. package/fixtures/defold-1.13.2/package_doc.json +140 -0
  234. package/fixtures/defold-1.13.2/particlefx_doc.json +249 -0
  235. package/fixtures/defold-1.13.2/physics_doc.json +1624 -0
  236. package/fixtures/defold-1.13.2/profiler_doc.json +348 -0
  237. package/fixtures/defold-1.13.2/render_doc.json +1623 -0
  238. package/fixtures/defold-1.13.2/resource_doc.json +1539 -0
  239. package/fixtures/defold-1.13.2/socket_doc.json +2335 -0
  240. package/fixtures/defold-1.13.2/sound_doc.json +673 -0
  241. package/fixtures/defold-1.13.2/sprite_doc.json +364 -0
  242. package/fixtures/defold-1.13.2/string_doc.json +413 -0
  243. package/fixtures/defold-1.13.2/sys_doc.json +1347 -0
  244. package/fixtures/defold-1.13.2/table_doc.json +167 -0
  245. package/fixtures/defold-1.13.2/tilemap_doc.json +369 -0
  246. package/fixtures/defold-1.13.2/timer_doc.json +214 -0
  247. package/fixtures/defold-1.13.2/types_doc.json +213 -0
  248. package/fixtures/defold-1.13.2/vmath_doc.json +2056 -0
  249. package/fixtures/defold-1.13.2/window_doc.json +426 -0
  250. package/fixtures/defold-1.13.2/zlib_doc.json +71 -0
  251. package/fixtures/defold-1.14.0/b2d_body_doc.json +2359 -0
  252. package/fixtures/defold-1.14.0/b2d_chain_doc.json +395 -0
  253. package/fixtures/defold-1.14.0/b2d_doc.json +1973 -0
  254. package/fixtures/defold-1.14.0/b2d_fixture_doc.json +595 -0
  255. package/fixtures/defold-1.14.0/b2d_joint_doc.json +3178 -0
  256. package/fixtures/defold-1.14.0/b2d_shape_doc.json +767 -0
  257. package/fixtures/defold-1.14.0/b2d_world_doc.json +1315 -0
  258. package/fixtures/defold-1.14.0/base_doc.json +759 -0
  259. package/fixtures/defold-1.14.0/bit_doc.json +405 -0
  260. package/fixtures/defold-1.14.0/buffer_doc.json +393 -0
  261. package/fixtures/defold-1.14.0/bullet3d_collision_object_doc.json +1206 -0
  262. package/fixtures/defold-1.14.0/bullet3d_constraint_doc.json +2455 -0
  263. package/fixtures/defold-1.14.0/bullet3d_doc.json +243 -0
  264. package/fixtures/defold-1.14.0/bullet3d_rigid_body_doc.json +1376 -0
  265. package/fixtures/defold-1.14.0/bullet3d_shape_doc.json +430 -0
  266. package/fixtures/defold-1.14.0/bullet3d_world_doc.json +855 -0
  267. package/fixtures/defold-1.14.0/camera_doc.json +887 -0
  268. package/fixtures/defold-1.14.0/collectionfactory_doc.json +206 -0
  269. package/fixtures/defold-1.14.0/collectionproxy_doc.json +397 -0
  270. package/fixtures/defold-1.14.0/compute_doc.json +183 -0
  271. package/fixtures/defold-1.14.0/coroutine_doc.json +152 -0
  272. package/fixtures/defold-1.14.0/crash_doc.json +483 -0
  273. package/fixtures/defold-1.14.0/debug_doc.json +411 -0
  274. package/fixtures/defold-1.14.0/editor_doc.json +6320 -0
  275. package/fixtures/defold-1.14.0/editor_http_doc.json +476 -0
  276. package/fixtures/defold-1.14.0/editor_image_doc.json +129 -0
  277. package/fixtures/defold-1.14.0/editor_json_doc.json +81 -0
  278. package/fixtures/defold-1.14.0/editor_localization_doc.json +139 -0
  279. package/fixtures/defold-1.14.0/editor_pprint_doc.json +37 -0
  280. package/fixtures/defold-1.14.0/editor_tilemap_tiles_doc.json +292 -0
  281. package/fixtures/defold-1.14.0/editor_zip_doc.json +237 -0
  282. package/fixtures/defold-1.14.0/editor_zlib_doc.json +49 -0
  283. package/fixtures/defold-1.14.0/factory_doc.json +206 -0
  284. package/fixtures/defold-1.14.0/font_doc.json +230 -0
  285. package/fixtures/defold-1.14.0/globals_doc.json +64 -0
  286. package/fixtures/defold-1.14.0/go-instance-functions.json +106 -0
  287. package/fixtures/defold-1.14.0/go_doc.json +1789 -0
  288. package/fixtures/defold-1.14.0/graphics_doc.json +1257 -0
  289. package/fixtures/defold-1.14.0/gui_doc.json +4735 -0
  290. package/fixtures/defold-1.14.0/html5_doc.json +65 -0
  291. package/fixtures/defold-1.14.0/http_doc.json +174 -0
  292. package/fixtures/defold-1.14.0/image_doc.json +298 -0
  293. package/fixtures/defold-1.14.0/import-manifest.json +10260 -0
  294. package/fixtures/defold-1.14.0/io_doc.json +400 -0
  295. package/fixtures/defold-1.14.0/json_doc.json +140 -0
  296. package/fixtures/defold-1.14.0/label_doc.json +427 -0
  297. package/fixtures/defold-1.14.0/liveupdate_doc.json +221 -0
  298. package/fixtures/defold-1.14.0/material_doc.json +773 -0
  299. package/fixtures/defold-1.14.0/math_doc.json +703 -0
  300. package/fixtures/defold-1.14.0/model_doc.json +472 -0
  301. package/fixtures/defold-1.14.0/msg_doc.json +169 -0
  302. package/fixtures/defold-1.14.0/os_doc.json +269 -0
  303. package/fixtures/defold-1.14.0/package_doc.json +140 -0
  304. package/fixtures/defold-1.14.0/particlefx_doc.json +249 -0
  305. package/fixtures/defold-1.14.0/physics_doc.json +1624 -0
  306. package/fixtures/defold-1.14.0/profiler_doc.json +348 -0
  307. package/fixtures/defold-1.14.0/render_doc.json +1628 -0
  308. package/fixtures/defold-1.14.0/resource_doc.json +1539 -0
  309. package/fixtures/defold-1.14.0/socket_doc.json +2335 -0
  310. package/fixtures/defold-1.14.0/sound_doc.json +673 -0
  311. package/fixtures/defold-1.14.0/sprite_doc.json +364 -0
  312. package/fixtures/defold-1.14.0/string_doc.json +413 -0
  313. package/fixtures/defold-1.14.0/sys_doc.json +1347 -0
  314. package/fixtures/defold-1.14.0/table_doc.json +167 -0
  315. package/fixtures/defold-1.14.0/tilemap_doc.json +369 -0
  316. package/fixtures/defold-1.14.0/timer_doc.json +214 -0
  317. package/fixtures/defold-1.14.0/types_doc.json +213 -0
  318. package/fixtures/defold-1.14.0/vmath_doc.json +2056 -0
  319. package/fixtures/defold-1.14.0/window_doc.json +426 -0
  320. package/fixtures/defold-1.14.0/zlib_doc.json +71 -0
  321. package/generated/b2d.d.ts +39 -39
  322. package/generated/b2d_body.d.ts +11 -11
  323. package/generated/b2d_chain.d.ts +3 -3
  324. package/generated/b2d_fixture.d.ts +5 -5
  325. package/generated/b2d_joint.d.ts +29 -29
  326. package/generated/b2d_shape.d.ts +13 -13
  327. package/generated/b2d_world.d.ts +15 -15
  328. package/generated/buffer.d.ts +5 -6
  329. package/generated/bullet3d.d.ts +6 -6
  330. package/generated/bullet3d_collision_object.d.ts +9 -9
  331. package/generated/bullet3d_constraint.d.ts +78 -78
  332. package/generated/bullet3d_rigid_body.d.ts +3 -3
  333. package/generated/bullet3d_shape.d.ts +11 -11
  334. package/generated/bullet3d_world.d.ts +20 -20
  335. package/generated/camera.d.ts +4 -4
  336. package/generated/collectionfactory.d.ts +2 -3
  337. package/generated/collectionproxy.d.ts +5 -5
  338. package/generated/compute.d.ts +5 -5
  339. package/generated/crash.d.ts +7 -7
  340. package/generated/editor-vm/http.d.ts +13 -13
  341. package/generated/editor-vm/image.d.ts +4 -4
  342. package/generated/editor-vm/json.d.ts +1 -1
  343. package/generated/editor-vm/tilemap_tiles.d.ts +9 -9
  344. package/generated/editor-vm/zip.d.ts +4 -4
  345. package/generated/editor.d.ts +183 -183
  346. package/generated/factory.d.ts +2 -3
  347. package/generated/font.d.ts +4 -4
  348. package/generated/go.d.ts +10 -12
  349. package/generated/graphics.d.ts +23 -26
  350. package/generated/gui.d.ts +44 -58
  351. package/generated/http.d.ts +2 -2
  352. package/generated/image.d.ts +12 -12
  353. package/generated/json.d.ts +4 -4
  354. package/generated/label.d.ts +5 -5
  355. package/generated/liveupdate.d.ts +3 -3
  356. package/generated/material.d.ts +48 -48
  357. package/generated/model.d.ts +46 -14
  358. package/generated/particlefx.d.ts +5 -5
  359. package/generated/physics.d.ts +19 -19
  360. package/generated/profiler.d.ts +3 -5
  361. package/generated/render-script-modules/b2d.d.ts +39 -39
  362. package/generated/render-script-modules/bullet3d.d.ts +5 -5
  363. package/generated/render-script-modules/collectionfactory.d.ts +1 -2
  364. package/generated/render-script-modules/collectionproxy.d.ts +3 -3
  365. package/generated/render-script-modules/factory.d.ts +1 -2
  366. package/generated/render-script-modules/go.d.ts +8 -10
  367. package/generated/render-script-modules/label.d.ts +2 -2
  368. package/generated/render-script-modules/model.d.ts +43 -11
  369. package/generated/render-script-modules/particlefx.d.ts +3 -3
  370. package/generated/render-script-modules/physics.d.ts +12 -12
  371. package/generated/render-script-modules/resource.d.ts +52 -53
  372. package/generated/render-script-modules/sound.d.ts +4 -4
  373. package/generated/render-script-modules/sprite.d.ts +2 -2
  374. package/generated/render-script-modules/tilemap.d.ts +2 -2
  375. package/generated/render.d.ts +44 -45
  376. package/generated/resource.d.ts +58 -59
  377. package/generated/socket.d.ts +18 -23
  378. package/generated/sound.d.ts +6 -6
  379. package/generated/sprite.d.ts +3 -3
  380. package/generated/sys.d.ts +20 -21
  381. package/generated/tilemap.d.ts +3 -3
  382. package/generated/timer.d.ts +3 -3
  383. package/generated/versions/defold-1.12.4/b2d.d.ts +2 -2
  384. package/generated/versions/defold-1.12.4/b2d_body.d.ts +2 -2
  385. package/generated/versions/defold-1.12.4/go.d.ts +2 -2
  386. package/generated/versions/defold-1.12.4/graphics.d.ts +1 -1
  387. package/generated/versions/defold-1.12.4/gui.d.ts +18 -19
  388. package/generated/versions/defold-1.12.4/label.d.ts +1 -1
  389. package/generated/versions/defold-1.12.4/model.d.ts +42 -10
  390. package/generated/versions/defold-1.12.4/particlefx.d.ts +1 -1
  391. package/generated/versions/defold-1.12.4/physics.d.ts +1 -1
  392. package/generated/versions/defold-1.12.4/render.d.ts +5 -5
  393. package/generated/versions/defold-1.12.4/resource.d.ts +8 -8
  394. package/generated/versions/defold-1.12.4/socket.d.ts +12 -12
  395. package/generated/versions/defold-1.12.4/sound.d.ts +1 -1
  396. package/generated/versions/defold-1.12.4/sprite.d.ts +1 -1
  397. package/generated/versions/defold-1.12.4/sys.d.ts +2 -2
  398. package/generated/versions/defold-1.12.4/tilemap.d.ts +1 -1
  399. package/generated/versions/defold-1.12.4/window.d.ts +3 -4
  400. package/generated/versions/defold-1.13.0/b2d.d.ts +2 -2
  401. package/generated/versions/defold-1.13.0/b2d_body.d.ts +2 -2
  402. package/generated/versions/defold-1.13.0/b2d_chain.d.ts +1 -1
  403. package/generated/versions/defold-1.13.0/b2d_joint.d.ts +1 -1
  404. package/generated/versions/defold-1.13.0/b2d_shape.d.ts +1 -1
  405. package/generated/versions/defold-1.13.0/camera.d.ts +1 -1
  406. package/generated/versions/defold-1.13.0/go.d.ts +2 -2
  407. package/generated/versions/defold-1.13.0/graphics.d.ts +1 -1
  408. package/generated/versions/defold-1.13.0/gui.d.ts +18 -19
  409. package/generated/versions/defold-1.13.0/label.d.ts +1 -1
  410. package/generated/versions/defold-1.13.0/model.d.ts +42 -10
  411. package/generated/versions/defold-1.13.0/particlefx.d.ts +1 -1
  412. package/generated/versions/defold-1.13.0/physics.d.ts +1 -1
  413. package/generated/versions/defold-1.13.0/render.d.ts +5 -5
  414. package/generated/versions/defold-1.13.0/resource.d.ts +8 -8
  415. package/generated/versions/defold-1.13.0/socket.d.ts +12 -12
  416. package/generated/versions/defold-1.13.0/sound.d.ts +1 -1
  417. package/generated/versions/defold-1.13.0/sprite.d.ts +1 -1
  418. package/generated/versions/defold-1.13.0/sys.d.ts +2 -2
  419. package/generated/versions/defold-1.13.0/tilemap.d.ts +1 -1
  420. package/generated/versions/defold-1.13.0/window.d.ts +3 -4
  421. package/generated/versions/defold-1.13.1/b2d.d.ts +2 -2
  422. package/generated/versions/defold-1.13.1/b2d_body.d.ts +2 -2
  423. package/generated/versions/defold-1.13.1/b2d_chain.d.ts +1 -1
  424. package/generated/versions/defold-1.13.1/b2d_joint.d.ts +1 -1
  425. package/generated/versions/defold-1.13.1/b2d_shape.d.ts +1 -1
  426. package/generated/versions/defold-1.13.1/camera.d.ts +1 -1
  427. package/generated/versions/defold-1.13.1/go.d.ts +2 -2
  428. package/generated/versions/defold-1.13.1/graphics.d.ts +1 -1
  429. package/generated/versions/defold-1.13.1/gui.d.ts +18 -19
  430. package/generated/versions/defold-1.13.1/label.d.ts +1 -1
  431. package/generated/versions/defold-1.13.1/model.d.ts +42 -10
  432. package/generated/versions/defold-1.13.1/particlefx.d.ts +1 -1
  433. package/generated/versions/defold-1.13.1/physics.d.ts +1 -1
  434. package/generated/versions/defold-1.13.1/render.d.ts +5 -5
  435. package/generated/versions/defold-1.13.1/resource.d.ts +8 -8
  436. package/generated/versions/defold-1.13.1/socket.d.ts +12 -12
  437. package/generated/versions/defold-1.13.1/sound.d.ts +1 -1
  438. package/generated/versions/defold-1.13.1/sprite.d.ts +1 -1
  439. package/generated/versions/defold-1.13.1/sys.d.ts +2 -2
  440. package/generated/versions/defold-1.13.1/tilemap.d.ts +1 -1
  441. package/generated/versions/defold-1.13.1/window.d.ts +3 -4
  442. package/generated/versions/defold-1.13.2/b2d.d.ts +39 -39
  443. package/generated/versions/defold-1.13.2/b2d_body.d.ts +11 -11
  444. package/generated/versions/defold-1.13.2/b2d_chain.d.ts +3 -3
  445. package/generated/versions/defold-1.13.2/b2d_fixture.d.ts +5 -5
  446. package/generated/versions/defold-1.13.2/b2d_joint.d.ts +29 -29
  447. package/generated/versions/defold-1.13.2/b2d_shape.d.ts +13 -13
  448. package/generated/versions/defold-1.13.2/b2d_world.d.ts +15 -15
  449. package/generated/versions/defold-1.13.2/buffer.d.ts +5 -6
  450. package/generated/versions/defold-1.13.2/bullet3d.d.ts +6 -6
  451. package/generated/versions/defold-1.13.2/bullet3d_collision_object.d.ts +9 -9
  452. package/generated/versions/defold-1.13.2/bullet3d_constraint.d.ts +78 -78
  453. package/generated/versions/defold-1.13.2/bullet3d_rigid_body.d.ts +3 -3
  454. package/generated/versions/defold-1.13.2/bullet3d_shape.d.ts +11 -11
  455. package/generated/versions/defold-1.13.2/bullet3d_world.d.ts +20 -20
  456. package/generated/versions/defold-1.13.2/camera.d.ts +4 -4
  457. package/generated/versions/defold-1.13.2/collectionfactory.d.ts +2 -3
  458. package/generated/versions/defold-1.13.2/collectionproxy.d.ts +5 -5
  459. package/generated/versions/defold-1.13.2/compute.d.ts +5 -5
  460. package/generated/versions/defold-1.13.2/crash.d.ts +7 -7
  461. package/generated/versions/defold-1.13.2/editor-vm/http.d.ts +13 -13
  462. package/generated/versions/defold-1.13.2/editor-vm/image.d.ts +4 -4
  463. package/generated/versions/defold-1.13.2/editor-vm/json.d.ts +1 -1
  464. package/generated/versions/defold-1.13.2/editor-vm/tilemap_tiles.d.ts +9 -9
  465. package/generated/versions/defold-1.13.2/editor-vm/zip.d.ts +4 -4
  466. package/generated/versions/defold-1.13.2/editor.d.ts +183 -183
  467. package/generated/versions/defold-1.13.2/factory.d.ts +2 -3
  468. package/generated/versions/defold-1.13.2/font.d.ts +4 -4
  469. package/generated/versions/defold-1.13.2/go.d.ts +10 -12
  470. package/generated/versions/defold-1.13.2/graphics.d.ts +22 -25
  471. package/generated/versions/defold-1.13.2/gui.d.ts +44 -58
  472. package/generated/versions/defold-1.13.2/http.d.ts +2 -2
  473. package/generated/versions/defold-1.13.2/image.d.ts +12 -12
  474. package/generated/versions/defold-1.13.2/json.d.ts +4 -4
  475. package/generated/versions/defold-1.13.2/label.d.ts +5 -5
  476. package/generated/versions/defold-1.13.2/liveupdate.d.ts +3 -3
  477. package/generated/versions/defold-1.13.2/material.d.ts +48 -48
  478. package/generated/versions/defold-1.13.2/model.d.ts +46 -14
  479. package/generated/versions/defold-1.13.2/particlefx.d.ts +5 -5
  480. package/generated/versions/defold-1.13.2/physics.d.ts +19 -19
  481. package/generated/versions/defold-1.13.2/profiler.d.ts +3 -5
  482. package/generated/versions/defold-1.13.2/render.d.ts +43 -44
  483. package/generated/versions/defold-1.13.2/resource.d.ts +58 -59
  484. package/generated/versions/defold-1.13.2/socket.d.ts +18 -23
  485. package/generated/versions/defold-1.13.2/sound.d.ts +6 -6
  486. package/generated/versions/defold-1.13.2/sprite.d.ts +3 -3
  487. package/generated/versions/defold-1.13.2/sys.d.ts +20 -21
  488. package/generated/versions/defold-1.13.2/tilemap.d.ts +3 -3
  489. package/generated/versions/defold-1.13.2/timer.d.ts +3 -3
  490. package/generated/versions/defold-1.13.2/vmath.d.ts +0 -1
  491. package/generated/versions/defold-1.13.2/window.d.ts +8 -10
  492. package/generated/vmath.d.ts +0 -1
  493. package/generated/window.d.ts +8 -10
  494. package/identity-vocabulary.json +41 -34
  495. package/package.json +13 -5
  496. package/scripts/cli-runtime.ts +18 -0
  497. package/scripts/example-store-io.ts +2 -2
  498. package/scripts/extension-goldens.ts +9 -5
  499. package/scripts/generate-api-availability.ts +10 -4
  500. package/scripts/generate-api-signatures.ts +1 -1
  501. package/scripts/import-defold-release.ts +1 -1
  502. package/scripts/regen.ts +35 -9
  503. package/scripts/shared-handle-methods.ts +3 -2
  504. package/scripts/signature-store-fs.ts +37 -17
  505. package/scripts/sync-api-docs.ts +127 -20
  506. package/src/api-doc.ts +19 -4
  507. package/src/api-identity.ts +32 -1
  508. package/src/component-properties.d.ts +8 -8
  509. package/src/core-types.ts +29 -13
  510. package/src/doc-corrections.ts +9 -0
  511. package/src/emit-dts.ts +770 -214
  512. package/src/engine-type-name.ts +33 -0
  513. package/src/go-overloads.d.ts +10 -10
  514. package/src/gui-overloads.d.ts +11 -11
  515. package/src/index-slot-classifications.ts +75 -9
  516. package/src/index.ts +4 -1
  517. package/src/lifecycle.ts +2 -2
  518. package/src/publish-dts.ts +16 -0
  519. package/src/script-api.ts +36 -38
  520. package/src/socket-types.d.ts +3 -3
  521. package/src/library-index-slot-classifications.ts +0 -332
@@ -0,0 +1,1623 @@
1
+ {
2
+ "elements": [
3
+ {
4
+ "type": "MESSAGE",
5
+ "name": "draw_debug_text",
6
+ "brief": "draw a text on the screen",
7
+ "description": "Draw a text on the screen. This should be used for debugging purposes only.",
8
+ "returnvalues": [],
9
+ "parameters": [
10
+ {
11
+ "name": "position",
12
+ "doc": "position of the text",
13
+ "types": ["vector3"],
14
+ "is_optional": "False"
15
+ },
16
+ {
17
+ "name": "text",
18
+ "doc": "the text to draw",
19
+ "types": ["string"],
20
+ "is_optional": "False"
21
+ },
22
+ {
23
+ "name": "color",
24
+ "doc": "color of the text",
25
+ "types": ["vector4"],
26
+ "is_optional": "False"
27
+ }
28
+ ],
29
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">&quot;@render:&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;draw_debug_text&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">text</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;Hello world!&quot;</span><span class=\"p\">,</span> <span class=\"n\">position</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector3</span><span class=\"p\">(</span><span class=\"mi\">200</span><span class=\"p\">,</span> <span class=\"mi\">200</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">),</span> <span class=\"n\">color</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span> <span class=\"p\">}</span> <span class=\"p\">)</span>\n</code></pre></div>",
30
+ "replaces": "",
31
+ "error": "",
32
+ "tparams": [],
33
+ "members": [],
34
+ "notes": [],
35
+ "language": ""
36
+ },
37
+ {
38
+ "type": "MESSAGE",
39
+ "name": "draw_line",
40
+ "brief": "draw a line on the screen",
41
+ "description": "Draw a line on the screen. This should mostly be used for debugging purposes.",
42
+ "returnvalues": [],
43
+ "parameters": [
44
+ {
45
+ "name": "start_point",
46
+ "doc": "start point of the line",
47
+ "types": ["vector3"],
48
+ "is_optional": "False"
49
+ },
50
+ {
51
+ "name": "end_point",
52
+ "doc": "end point of the line",
53
+ "types": ["vector3"],
54
+ "is_optional": "False"
55
+ },
56
+ {
57
+ "name": "color",
58
+ "doc": "color of the line",
59
+ "types": ["vector4"],
60
+ "is_optional": "False"
61
+ }
62
+ ],
63
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- draw a white line from (200, 200) to (200, 300)</span>\n<span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">&quot;@render:&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;draw_line&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">start_point</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector3</span><span class=\"p\">(</span><span class=\"mi\">200</span><span class=\"p\">,</span> <span class=\"mi\">200</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">),</span> <span class=\"n\">end_point</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector3</span><span class=\"p\">(</span><span class=\"mi\">200</span><span class=\"p\">,</span> <span class=\"mi\">300</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">),</span> <span class=\"n\">color</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span> <span class=\"p\">}</span> <span class=\"p\">)</span>\n</code></pre></div>",
64
+ "replaces": "",
65
+ "error": "",
66
+ "tparams": [],
67
+ "members": [],
68
+ "notes": [],
69
+ "language": ""
70
+ },
71
+ {
72
+ "type": "MESSAGE",
73
+ "name": "window_resized",
74
+ "brief": "reports a window size change",
75
+ "description": "Reports a change in window size. This is initiated on window resize on desktop or by orientation changes\non mobile devices.",
76
+ "returnvalues": [],
77
+ "parameters": [
78
+ {
79
+ "name": "height",
80
+ "doc": "the new window height",
81
+ "types": ["number"],
82
+ "is_optional": "False"
83
+ },
84
+ {
85
+ "name": "width",
86
+ "doc": "the new window width",
87
+ "types": ["number"],
88
+ "is_optional": "False"
89
+ }
90
+ ],
91
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">on_message</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">message_id</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">)</span>\n <span class=\"c1\">-- check for the message</span>\n <span class=\"kr\">if</span> <span class=\"n\">message_id</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;window_resized&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- the window was resized.</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
92
+ "replaces": "",
93
+ "error": "",
94
+ "tparams": [],
95
+ "members": [],
96
+ "notes": [],
97
+ "language": ""
98
+ },
99
+ {
100
+ "type": "MESSAGE",
101
+ "name": "resize",
102
+ "brief": "resizes the window",
103
+ "description": "Set the size of the game window. Only works on desktop platforms.",
104
+ "returnvalues": [],
105
+ "parameters": [
106
+ {
107
+ "name": "height",
108
+ "doc": "the new window height",
109
+ "types": ["number"],
110
+ "is_optional": "False"
111
+ },
112
+ {
113
+ "name": "width",
114
+ "doc": "the new window width",
115
+ "types": ["number"],
116
+ "is_optional": "False"
117
+ }
118
+ ],
119
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">&quot;@render:&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;resize&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">width</span> <span class=\"o\">=</span> <span class=\"mi\">1024</span><span class=\"p\">,</span> <span class=\"n\">height</span> <span class=\"o\">=</span> <span class=\"mi\">768</span> <span class=\"p\">}</span> <span class=\"p\">)</span>\n</code></pre></div>",
120
+ "replaces": "",
121
+ "error": "",
122
+ "tparams": [],
123
+ "members": [],
124
+ "notes": [],
125
+ "language": ""
126
+ },
127
+ {
128
+ "type": "MESSAGE",
129
+ "name": "clear_color",
130
+ "brief": "set clear color",
131
+ "description": "Set render clear color. This is the color that appears on the screen where nothing is rendered, i.e. background.",
132
+ "returnvalues": [],
133
+ "parameters": [
134
+ {
135
+ "name": "color",
136
+ "doc": "color to use as clear color",
137
+ "types": ["vector4"],
138
+ "is_optional": "False"
139
+ }
140
+ ],
141
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">&quot;@render:&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;clear_color&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">color</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">)</span> <span class=\"p\">}</span> <span class=\"p\">)</span>\n</code></pre></div>",
142
+ "replaces": "",
143
+ "error": "",
144
+ "tparams": [],
145
+ "members": [],
146
+ "notes": [],
147
+ "language": ""
148
+ },
149
+ {
150
+ "type": "ENUM",
151
+ "name": "render.CONTEXT_EVENT",
152
+ "brief": "Render context events",
153
+ "description": "Render context events",
154
+ "returnvalues": [],
155
+ "parameters": [],
156
+ "examples": "",
157
+ "replaces": "",
158
+ "error": "",
159
+ "tparams": [],
160
+ "members": [
161
+ {
162
+ "name": "render.CONTEXT_EVENT_CONTEXT_LOST",
163
+ "doc": "rendering context was lost; rendering pauses and graphics resources become invalid",
164
+ "type": ""
165
+ },
166
+ {
167
+ "name": "render.CONTEXT_EVENT_CONTEXT_RESTORED",
168
+ "doc": "rendering context was restored; rendering remains paused while resources can be reloaded",
169
+ "type": ""
170
+ }
171
+ ],
172
+ "notes": [],
173
+ "language": ""
174
+ },
175
+ {
176
+ "type": "ENUM",
177
+ "name": "render.FRUSTUM_PLANES",
178
+ "brief": "Frustum plane selections",
179
+ "description": "Frustum plane selections",
180
+ "returnvalues": [],
181
+ "parameters": [],
182
+ "examples": "",
183
+ "replaces": "",
184
+ "error": "",
185
+ "tparams": [],
186
+ "members": [
187
+ {
188
+ "name": "render.FRUSTUM_PLANES_ALL",
189
+ "doc": "All six frustum planes.",
190
+ "type": ""
191
+ },
192
+ {
193
+ "name": "render.FRUSTUM_PLANES_SIDES",
194
+ "doc": "Left, right, top, and bottom frustum planes.",
195
+ "type": ""
196
+ }
197
+ ],
198
+ "notes": [],
199
+ "language": ""
200
+ },
201
+ {
202
+ "type": "ENUM",
203
+ "name": "render.SORT",
204
+ "brief": "Render sort orders",
205
+ "description": "Render sort orders",
206
+ "returnvalues": [],
207
+ "parameters": [],
208
+ "examples": "",
209
+ "replaces": "",
210
+ "error": "",
211
+ "tparams": [],
212
+ "members": [
213
+ {
214
+ "name": "render.SORT_BACK_TO_FRONT",
215
+ "doc": "Depth sort far-to-near (default; good for transparent passes).",
216
+ "type": ""
217
+ },
218
+ {
219
+ "name": "render.SORT_FRONT_TO_BACK",
220
+ "doc": "Depth sort near-to-far (good for opaque passes to reduce overdraw).",
221
+ "type": ""
222
+ },
223
+ {
224
+ "name": "render.SORT_NONE",
225
+ "doc": "No per-call sorting; draw entries in insertion order.",
226
+ "type": ""
227
+ }
228
+ ],
229
+ "notes": [],
230
+ "language": ""
231
+ },
232
+ {
233
+ "type": "ENUM",
234
+ "name": "render.RENDER_TARGET_FLAG",
235
+ "brief": "Render-target creation flags",
236
+ "description": "Render-target creation flags",
237
+ "returnvalues": [],
238
+ "parameters": [],
239
+ "examples": "",
240
+ "replaces": "",
241
+ "error": "",
242
+ "tparams": [],
243
+ "members": [
244
+ {
245
+ "name": "render.TEXTURE_BIT",
246
+ "doc": "Create a texture-backed depth or stencil attachment.",
247
+ "type": "render.RENDER_TARGET_FLAG"
248
+ }
249
+ ],
250
+ "notes": [],
251
+ "language": ""
252
+ },
253
+ {
254
+ "type": "STRUCT",
255
+ "name": "render.render_target_buffer_params",
256
+ "brief": "Render-target attachment parameters",
257
+ "description": "Render-target attachment parameters",
258
+ "returnvalues": [],
259
+ "parameters": [],
260
+ "examples": "",
261
+ "replaces": "",
262
+ "error": "",
263
+ "tparams": [],
264
+ "members": [
265
+ {
266
+ "name": "format",
267
+ "doc": "Attachment texture format.",
268
+ "type": "graphics.TEXTURE_FORMAT"
269
+ },
270
+ {
271
+ "name": "width",
272
+ "doc": "Attachment width.",
273
+ "type": "integer"
274
+ },
275
+ {
276
+ "name": "height",
277
+ "doc": "Attachment height.",
278
+ "type": "integer"
279
+ },
280
+ {
281
+ "name": "min_filter?",
282
+ "doc": "Minification filter.",
283
+ "type": "graphics.TEXTURE_FILTER"
284
+ },
285
+ {
286
+ "name": "mag_filter?",
287
+ "doc": "Magnification filter.",
288
+ "type": "graphics.TEXTURE_FILTER"
289
+ },
290
+ {
291
+ "name": "u_wrap?",
292
+ "doc": "Horizontal wrap mode.",
293
+ "type": "graphics.TEXTURE_WRAP"
294
+ },
295
+ {
296
+ "name": "v_wrap?",
297
+ "doc": "Vertical wrap mode.",
298
+ "type": "graphics.TEXTURE_WRAP"
299
+ },
300
+ {
301
+ "name": "w_wrap?",
302
+ "doc": "Depth wrap mode.",
303
+ "type": "graphics.TEXTURE_WRAP"
304
+ },
305
+ {
306
+ "name": "flags?",
307
+ "doc": "Attachment creation flags, applicable only to depth and stencil buffers.",
308
+ "type": "render.RENDER_TARGET_FLAG"
309
+ }
310
+ ],
311
+ "notes": [],
312
+ "language": ""
313
+ },
314
+ {
315
+ "type": "TYPEDEF",
316
+ "name": "render.render_target_params",
317
+ "brief": "Render-target parameters",
318
+ "description": "<code>sample_count</code> defaults to 1 and is normalized by the graphics adapter to\na supported power-of-two value.",
319
+ "returnvalues": [],
320
+ "parameters": [
321
+ {
322
+ "name": "value",
323
+ "doc": "Attachments keyed by buffer type, with an optional multisample count.",
324
+ "types": [
325
+ "{ sample_count?:integer, [graphics.BUFFER_TYPE]:render.render_target_buffer_params }"
326
+ ],
327
+ "is_optional": "False"
328
+ }
329
+ ],
330
+ "examples": "",
331
+ "replaces": "",
332
+ "error": "",
333
+ "tparams": [],
334
+ "members": [],
335
+ "notes": [],
336
+ "language": ""
337
+ },
338
+ {
339
+ "type": "STRUCT",
340
+ "name": "render.set_render_target_options",
341
+ "brief": "Render-target activation options",
342
+ "description": "Render-target activation options",
343
+ "returnvalues": [],
344
+ "parameters": [],
345
+ "examples": "",
346
+ "replaces": "",
347
+ "error": "",
348
+ "tparams": [],
349
+ "members": [
350
+ {
351
+ "name": "transient?",
352
+ "doc": "Buffers whose contents become undefined after the target is deactivated. Missing buffers are ignored; combined depth-stencil buffers remain non-transient unless both are selected.",
353
+ "type": "graphics.BUFFER_TYPE[]"
354
+ }
355
+ ],
356
+ "notes": [],
357
+ "language": ""
358
+ },
359
+ {
360
+ "type": "STRUCT",
361
+ "name": "render.draw_options",
362
+ "brief": "Render draw options",
363
+ "description": "Render draw options",
364
+ "returnvalues": [],
365
+ "parameters": [],
366
+ "examples": "",
367
+ "replaces": "",
368
+ "error": "",
369
+ "tparams": [],
370
+ "members": [
371
+ {
372
+ "name": "frustum?",
373
+ "doc": "Frustum matrix used for culling renderable items.",
374
+ "type": "matrix4"
375
+ },
376
+ {
377
+ "name": "frustum_planes?",
378
+ "doc": "Frustum planes used for culling. The default is <a href=\"/ref/render#render.FRUSTUM_PLANES_SIDES\">render.FRUSTUM_PLANES_SIDES</a>.",
379
+ "type": "render.FRUSTUM_PLANES"
380
+ },
381
+ {
382
+ "name": "constants?",
383
+ "doc": "Constants used while rendering. The values are copied when <code>render.draw()</code> is called.",
384
+ "type": "constant_buffer"
385
+ },
386
+ {
387
+ "name": "sort_order?",
388
+ "doc": "World-entry sort order. The default is the renderer's preferred back-to-front order.",
389
+ "type": "render.SORT"
390
+ }
391
+ ],
392
+ "notes": [],
393
+ "language": ""
394
+ },
395
+ {
396
+ "type": "STRUCT",
397
+ "name": "render.debug_draw_options",
398
+ "brief": "Debug-draw options",
399
+ "description": "Debug-draw options",
400
+ "returnvalues": [],
401
+ "parameters": [],
402
+ "examples": "",
403
+ "replaces": "",
404
+ "error": "",
405
+ "tparams": [],
406
+ "members": [
407
+ {
408
+ "name": "frustum?",
409
+ "doc": "Frustum matrix used for culling renderable items.",
410
+ "type": "matrix4"
411
+ },
412
+ {
413
+ "name": "frustum_planes?",
414
+ "doc": "Frustum planes used for culling. The default is <a href=\"/ref/render#render.FRUSTUM_PLANES_SIDES\">render.FRUSTUM_PLANES_SIDES</a>.",
415
+ "type": "render.FRUSTUM_PLANES"
416
+ }
417
+ ],
418
+ "notes": [],
419
+ "language": ""
420
+ },
421
+ {
422
+ "type": "STRUCT",
423
+ "name": "render.camera_options",
424
+ "brief": "Render-camera options",
425
+ "description": "Render-camera options",
426
+ "returnvalues": [],
427
+ "parameters": [],
428
+ "examples": "",
429
+ "replaces": "",
430
+ "error": "",
431
+ "tparams": [],
432
+ "members": [
433
+ {
434
+ "name": "use_frustum?",
435
+ "doc": "Use the camera view-projection matrix for frustum culling. The default is false.",
436
+ "type": "boolean"
437
+ }
438
+ ],
439
+ "notes": [],
440
+ "language": ""
441
+ },
442
+ {
443
+ "type": "STRUCT",
444
+ "name": "render.dispatch_options",
445
+ "brief": "Compute-dispatch options",
446
+ "description": "Compute-dispatch options",
447
+ "returnvalues": [],
448
+ "parameters": [],
449
+ "examples": "",
450
+ "replaces": "",
451
+ "error": "",
452
+ "tparams": [],
453
+ "members": [
454
+ {
455
+ "name": "constants?",
456
+ "doc": "Constants used by the compute program. The values are copied when <code>render.dispatch_compute()</code> is called.",
457
+ "type": "constant_buffer"
458
+ }
459
+ ],
460
+ "notes": [],
461
+ "language": ""
462
+ },
463
+ {
464
+ "type": "TYPEDEF",
465
+ "name": "constant_buffer",
466
+ "brief": "Constant buffer",
467
+ "description": "A mutable collection of shader constants created with\n<a href=\"/ref/render#render.constant_buffer\">render.constant_buffer</a>. Assign constants by name using <span class=\"type\">vector4</span>\nor <span class=\"type\">matrix4</span> values, or arrays of those values, then pass the buffer in\nthe <code>constants</code> option to <a href=\"/ref/render#render.draw\">render.draw</a>. Constant buffers are Lua\nuserdata and cannot be iterated with <code>pairs()</code> or <code>ipairs()</code>.",
468
+ "returnvalues": [],
469
+ "parameters": [
470
+ {
471
+ "name": "value",
472
+ "doc": "shader constant buffer",
473
+ "types": ["userdata"],
474
+ "is_optional": "False"
475
+ }
476
+ ],
477
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">constant_buffer</span><span class=\"p\">()</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">tint</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mf\">0.5</span><span class=\"p\">,</span> <span class=\"mf\">0.5</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">model_predicate</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">constants</span> <span class=\"p\">})</span>\n</code></pre></div>",
478
+ "replaces": "",
479
+ "error": "",
480
+ "tparams": [],
481
+ "members": [],
482
+ "notes": [],
483
+ "language": ""
484
+ },
485
+ {
486
+ "type": "TYPEDEF",
487
+ "name": "render_target",
488
+ "brief": "Render target",
489
+ "description": "An opaque graphics handle identifying an off-screen render target. Create\none with <a href=\"/ref/render#render.render_target\">render.render_target</a>, draw into it with\n<a href=\"/ref/render#render.set_render_target\">render.set_render_target</a>, and release dynamically created targets with\n<a href=\"/ref/render#render.delete_render_target\">render.delete_render_target</a>. A render-target resource handle can also\nbe obtained from <a href=\"/ref/resource#resource.get_render_target_info\">resource.get_render_target_info</a>.",
490
+ "returnvalues": [],
491
+ "parameters": [
492
+ {
493
+ "name": "value",
494
+ "doc": "opaque render-target handle",
495
+ "types": ["number"],
496
+ "is_optional": "False"
497
+ }
498
+ ],
499
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"kd\">local</span> <span class=\"n\">color_params</span> <span class=\"o\">=</span> <span class=\"p\">{</span>\n <span class=\"n\">format</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FORMAT_RGBA</span><span class=\"p\">,</span>\n <span class=\"n\">width</span> <span class=\"o\">=</span> <span class=\"mi\">320</span><span class=\"p\">,</span>\n <span class=\"n\">height</span> <span class=\"o\">=</span> <span class=\"mi\">180</span><span class=\"p\">,</span>\n <span class=\"p\">}</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">target</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">render_target</span><span class=\"p\">({</span>\n <span class=\"p\">[</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">color_params</span><span class=\"p\">,</span>\n <span class=\"p\">})</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"kr\">if</span> <span class=\"ow\">not</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">target</span> <span class=\"kr\">then</span>\n <span class=\"kr\">return</span>\n <span class=\"kr\">end</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">target</span><span class=\"p\">)</span>\n <span class=\"c1\">-- Draw off-screen content here.</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">RENDER_TARGET_DEFAULT</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">on_message</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">message_id</span><span class=\"p\">)</span>\n <span class=\"kr\">if</span> <span class=\"n\">message_id</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;release_render_target&quot;</span><span class=\"p\">)</span> <span class=\"ow\">and</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">target</span> <span class=\"kr\">then</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">delete_render_target</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">target</span><span class=\"p\">)</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">target</span> <span class=\"o\">=</span> <span class=\"kc\">nil</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
500
+ "replaces": "",
501
+ "error": "",
502
+ "tparams": [],
503
+ "members": [],
504
+ "notes": [],
505
+ "language": ""
506
+ },
507
+ {
508
+ "type": "TYPEDEF",
509
+ "name": "texture",
510
+ "brief": "Texture handle",
511
+ "description": "An opaque graphics handle identifying a texture. Texture handles are\nreturned by APIs such as <a href=\"/ref/resource#resource.get_texture_info\">resource.get_texture_info</a>,\n<a href=\"/ref/material#material.get_textures\">material.get_textures</a>, and <a href=\"/ref/compute#compute.get_textures\">compute.get_textures</a>. Pass a handle\nto <a href=\"/ref/render#render.enable_texture\">render.enable_texture</a> to bind the texture in a render script. The\nresource or render target that owns the texture controls its lifetime.",
512
+ "returnvalues": [],
513
+ "parameters": [
514
+ {
515
+ "name": "value",
516
+ "doc": "opaque texture handle",
517
+ "types": ["number"],
518
+ "is_optional": "False"
519
+ }
520
+ ],
521
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">texture_info</span> <span class=\"o\">=</span> <span class=\"n\">resource</span><span class=\"p\">.</span><span class=\"n\">get_texture_info</span><span class=\"p\">(</span><span class=\"s2\">&quot;/assets/logo.texturec&quot;</span><span class=\"p\">)</span>\n<span class=\"kd\">local</span> <span class=\"n\">texture_handle</span> <span class=\"o\">=</span> <span class=\"n\">texture_info</span><span class=\"p\">.</span><span class=\"n\">handle</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_texture</span><span class=\"p\">(</span><span class=\"s2\">&quot;texture_sampler&quot;</span><span class=\"p\">,</span> <span class=\"n\">texture_handle</span><span class=\"p\">)</span>\n</code></pre></div>",
522
+ "replaces": "",
523
+ "error": "",
524
+ "tparams": [],
525
+ "members": [],
526
+ "notes": [],
527
+ "language": ""
528
+ },
529
+ {
530
+ "type": "TYPEDEF",
531
+ "name": "render_predicate",
532
+ "brief": "Material-tag render filter",
533
+ "description": "An opaque filter that selects renderable objects by material tag. Create a\npredicate with <a href=\"/ref/render#render.predicate\">render.predicate</a> and pass it to <a href=\"/ref/render#render.draw\">render.draw</a>. When\nmultiple tags are supplied, an object's material must contain all of them.\nPredicates are intended for use in render scripts.",
534
+ "returnvalues": [],
535
+ "parameters": [
536
+ {
537
+ "name": "value",
538
+ "doc": "material-tag render filter",
539
+ "types": ["userdata"],
540
+ "is_optional": "False"
541
+ }
542
+ ],
543
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">opaque</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">predicate</span><span class=\"p\">({</span> <span class=\"s2\">&quot;opaque&quot;</span> <span class=\"p\">})</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">opaque</span><span class=\"p\">)</span>\n</code></pre></div>",
544
+ "replaces": "",
545
+ "error": "",
546
+ "tparams": [],
547
+ "members": [],
548
+ "notes": [],
549
+ "language": ""
550
+ },
551
+ {
552
+ "type": "FUNCTION",
553
+ "name": "render.constant_buffer",
554
+ "brief": "create a new constant buffer.",
555
+ "description": "Constant buffers are used to set shader program variables and are optionally passed to the <code>render.draw()</code> function.\nThe buffer's constant elements can be indexed like an ordinary Lua table, but you can't iterate over them with pairs() or ipairs().",
556
+ "returnvalues": [
557
+ {
558
+ "name": "buffer",
559
+ "doc": "new constant buffer",
560
+ "types": ["constant_buffer"]
561
+ }
562
+ ],
563
+ "parameters": [],
564
+ "examples": "Set a \"tint\" constant in a constant buffer in the render script:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">constant_buffer</span><span class=\"p\">()</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">tint</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n</code></pre></div>\n\nThen use the constant buffer when drawing a predicate:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">constants</span><span class=\"p\">})</span>\n</code></pre></div>\n\nThe constant buffer also supports array values by specifying constants in a table:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">constant_buffer</span><span class=\"p\">()</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">light_colors</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">light_colors</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">light_colors</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">light_colors</span><span class=\"p\">[</span><span class=\"mi\">3</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n</code></pre></div>\n\nYou can also create the table by passing the vectors directly when creating the table:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">constant_buffer</span><span class=\"p\">()</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">light_colors</span> <span class=\"o\">=</span> <span class=\"p\">{</span>\n <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n\n<span class=\"c1\">-- Add more constant to the array</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">light_colors</span><span class=\"p\">[</span><span class=\"mi\">4</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n</code></pre></div>",
565
+ "replaces": "",
566
+ "error": "",
567
+ "tparams": [],
568
+ "members": [],
569
+ "notes": [],
570
+ "language": ""
571
+ },
572
+ {
573
+ "type": "FUNCTION",
574
+ "name": "render.enable_state",
575
+ "brief": "enables a render state",
576
+ "description": "Enables a particular render state. The state will be enabled until disabled.",
577
+ "returnvalues": [],
578
+ "parameters": [
579
+ {
580
+ "name": "state",
581
+ "doc": "state to enable\n<ul>\n<li><code>graphics.STATE_DEPTH_TEST</code></li>\n<li><code>graphics.STATE_STENCIL_TEST</code></li>\n<li><code>graphics.STATE_BLEND</code></li>\n<li><code>graphics.STATE_ALPHA_TEST</code> (<span class=\"icon-ios\"></span><span class=\"icon-android\"></span> not available on iOS and Android)</li>\n<li><code>graphics.STATE_CULL_FACE</code></li>\n<li><code>graphics.STATE_POLYGON_OFFSET_FILL</code></li>\n</ul>",
582
+ "types": ["graphics.STATE"],
583
+ "is_optional": "False"
584
+ }
585
+ ],
586
+ "examples": "Enable stencil test when drawing the gui predicate, then disable it:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_state</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STATE_STENCIL_TEST</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">gui_pred</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">disable_state</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STATE_STENCIL_TEST</span><span class=\"p\">)</span>\n</code></pre></div>",
587
+ "replaces": "",
588
+ "error": "",
589
+ "tparams": [],
590
+ "members": [],
591
+ "notes": [],
592
+ "language": ""
593
+ },
594
+ {
595
+ "type": "FUNCTION",
596
+ "name": "render.disable_state",
597
+ "brief": "disables a render state",
598
+ "description": "Disables a render state.",
599
+ "returnvalues": [],
600
+ "parameters": [
601
+ {
602
+ "name": "state",
603
+ "doc": "state to disable\n<ul>\n<li><code>graphics.STATE_DEPTH_TEST</code></li>\n<li><code>graphics.STATE_STENCIL_TEST</code></li>\n<li><code>graphics.STATE_BLEND</code></li>\n<li><code>graphics.STATE_ALPHA_TEST</code> (<span class=\"icon-ios\"></span><span class=\"icon-android\"></span> not available on iOS and Android)</li>\n<li><code>graphics.STATE_CULL_FACE</code></li>\n<li><code>graphics.STATE_POLYGON_OFFSET_FILL</code></li>\n</ul>",
604
+ "types": ["graphics.STATE"],
605
+ "is_optional": "False"
606
+ }
607
+ ],
608
+ "examples": "Disable face culling when drawing the tile predicate:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">disable_state</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STATE_CULL_FACE</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">tile_pred</span><span class=\"p\">)</span>\n</code></pre></div>",
609
+ "replaces": "",
610
+ "error": "",
611
+ "tparams": [],
612
+ "members": [],
613
+ "notes": [],
614
+ "language": ""
615
+ },
616
+ {
617
+ "type": "FUNCTION",
618
+ "name": "render.set_viewport",
619
+ "brief": "sets the render viewport",
620
+ "description": "Set the render viewport to the specified rectangle.",
621
+ "returnvalues": [],
622
+ "parameters": [
623
+ {
624
+ "name": "x",
625
+ "doc": "left corner",
626
+ "types": ["integer"],
627
+ "is_optional": "False"
628
+ },
629
+ {
630
+ "name": "y",
631
+ "doc": "bottom corner",
632
+ "types": ["integer"],
633
+ "is_optional": "False"
634
+ },
635
+ {
636
+ "name": "width",
637
+ "doc": "viewport width",
638
+ "types": ["integer"],
639
+ "is_optional": "False"
640
+ },
641
+ {
642
+ "name": "height",
643
+ "doc": "viewport height",
644
+ "types": ["integer"],
645
+ "is_optional": "False"
646
+ }
647
+ ],
648
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- Set the viewport to the window dimensions.</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_viewport</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">(),</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">())</span>\n</code></pre></div>",
649
+ "replaces": "",
650
+ "error": "",
651
+ "tparams": [],
652
+ "members": [],
653
+ "notes": [],
654
+ "language": ""
655
+ },
656
+ {
657
+ "type": "FUNCTION",
658
+ "name": "render.render_target",
659
+ "brief": "creates a new render target",
660
+ "description": "Creates a new render target according to the supplied\nspecification table.\nThe render target can be created to support multiple color attachments. Each attachment can have different format settings and texture filters,\nbut attachments must be added in sequence, meaning you cannot create a render target at slot 0 and 3.\nInstead it has to be created with all four buffer types ranging from [0..3] (as denoted by graphics.BUFFER_TYPE_COLORX_BIT where 'X' is the attachment you want to create).\nIt is not guaranteed that the device running the script can support creating render targets with multiple color attachments. To check if the device can support multiple attachments,\nyou can check if the <code>render</code> table contains any of the <code>BUFFER_TYPE_COLOR1_BIT</code>, <code>BUFFER_TYPE_COLOR2_BIT</code> or <code>BUFFER_TYPE_COLOR3_BIT</code> constants:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"kr\">if</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR1_BIT</span> <span class=\"o\">==</span> <span class=\"kc\">nil</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- this devices does not support multiple color attachments</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
661
+ "returnvalues": [
662
+ {
663
+ "name": "render_target",
664
+ "doc": "new render target",
665
+ "types": ["render_target"]
666
+ }
667
+ ],
668
+ "parameters": [
669
+ {
670
+ "name": "parameters",
671
+ "doc": "render-target parameters",
672
+ "types": ["render.render_target_params"],
673
+ "is_optional": "False"
674
+ }
675
+ ],
676
+ "examples": "How to create a new render target and draw to it:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- render target buffer parameters</span>\n <span class=\"kd\">local</span> <span class=\"n\">color_params</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">format</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FORMAT_RGBA</span><span class=\"p\">,</span>\n <span class=\"n\">width</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">(),</span>\n <span class=\"n\">height</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">(),</span>\n <span class=\"n\">min_filter</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FILTER_LINEAR</span><span class=\"p\">,</span>\n <span class=\"n\">mag_filter</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FILTER_LINEAR</span><span class=\"p\">,</span>\n <span class=\"n\">u_wrap</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_WRAP_CLAMP_TO_EDGE</span><span class=\"p\">,</span>\n <span class=\"n\">v_wrap</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_WRAP_CLAMP_TO_EDGE</span> <span class=\"p\">}</span>\n <span class=\"kd\">local</span> <span class=\"n\">depth_params</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">format</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FORMAT_DEPTH</span><span class=\"p\">,</span>\n <span class=\"n\">width</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">(),</span>\n <span class=\"n\">height</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">(),</span>\n <span class=\"n\">u_wrap</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_WRAP_CLAMP_TO_EDGE</span><span class=\"p\">,</span>\n <span class=\"n\">v_wrap</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_WRAP_CLAMP_TO_EDGE</span> <span class=\"p\">}</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">render_target</span><span class=\"p\">({</span><span class=\"n\">sample_count</span> <span class=\"o\">=</span> <span class=\"mi\">4</span><span class=\"p\">,</span> <span class=\"p\">[</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">color_params</span><span class=\"p\">,</span> <span class=\"p\">[</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_DEPTH_BIT</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">depth_params</span> <span class=\"p\">})</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- enable target so all drawing is done to it</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span><span class=\"p\">)</span>\n\n <span class=\"c1\">-- draw a predicate to the render target</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>\n\nHow to create a render target with multiple outputs:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- render target buffer parameters</span>\n <span class=\"kd\">local</span> <span class=\"n\">color_params_rgba</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">format</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FORMAT_RGBA</span><span class=\"p\">,</span>\n <span class=\"n\">width</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">(),</span>\n <span class=\"n\">height</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">(),</span>\n <span class=\"n\">min_filter</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FILTER_LINEAR</span><span class=\"p\">,</span>\n <span class=\"n\">mag_filter</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FILTER_LINEAR</span><span class=\"p\">,</span>\n <span class=\"n\">u_wrap</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_WRAP_CLAMP_TO_EDGE</span><span class=\"p\">,</span>\n <span class=\"n\">v_wrap</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_WRAP_CLAMP_TO_EDGE</span> <span class=\"p\">}</span>\n <span class=\"kd\">local</span> <span class=\"n\">color_params_float</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">format</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FORMAT_RG32F</span><span class=\"p\">,</span>\n <span class=\"n\">width</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">(),</span>\n <span class=\"n\">height</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">(),</span>\n <span class=\"n\">min_filter</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FILTER_LINEAR</span><span class=\"p\">,</span>\n <span class=\"n\">mag_filter</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FILTER_LINEAR</span><span class=\"p\">,</span>\n <span class=\"n\">u_wrap</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_WRAP_CLAMP_TO_EDGE</span><span class=\"p\">,</span>\n <span class=\"n\">v_wrap</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_WRAP_CLAMP_TO_EDGE</span> <span class=\"p\">}</span>\n\n\n <span class=\"c1\">-- Create a render target with three color attachments</span>\n <span class=\"c1\">-- Note: No depth buffer is attached here</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">render_target</span><span class=\"p\">({</span>\n <span class=\"p\">[</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">color_params_rgba</span><span class=\"p\">,</span>\n <span class=\"p\">[</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR1_BIT</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">color_params_rgba</span><span class=\"p\">,</span>\n <span class=\"p\">[</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR2_BIT</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">color_params_float</span><span class=\"p\">,</span> <span class=\"p\">})</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- set target so all drawing is done to it</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span><span class=\"p\">)</span>\n\n <span class=\"c1\">-- draw a predicate to the render target</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
677
+ "replaces": "",
678
+ "error": "",
679
+ "tparams": [],
680
+ "members": [],
681
+ "notes": [],
682
+ "language": ""
683
+ },
684
+ {
685
+ "type": "FUNCTION",
686
+ "name": "render.delete_render_target",
687
+ "brief": "deletes a render target",
688
+ "description": "Deletes a render target created by a render script.\nYou cannot delete a render target resource.",
689
+ "returnvalues": [],
690
+ "parameters": [
691
+ {
692
+ "name": "render_target",
693
+ "doc": "render target to delete",
694
+ "types": ["render_target"],
695
+ "is_optional": "False"
696
+ }
697
+ ],
698
+ "examples": "How to delete a render target:\n<div class=\"codehilite\"><pre><span></span><code> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">delete_render_target</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span><span class=\"p\">)</span>\n</code></pre></div>",
699
+ "replaces": "",
700
+ "error": "",
701
+ "tparams": [],
702
+ "members": [],
703
+ "notes": [],
704
+ "language": ""
705
+ },
706
+ {
707
+ "type": "CONSTANT",
708
+ "name": "render.RENDER_TARGET_DEFAULT",
709
+ "brief": "",
710
+ "description": "",
711
+ "returnvalues": [],
712
+ "parameters": [
713
+ {
714
+ "name": "value",
715
+ "doc": "",
716
+ "types": ["render_target"],
717
+ "is_optional": "False"
718
+ }
719
+ ],
720
+ "examples": "",
721
+ "replaces": "",
722
+ "error": "",
723
+ "tparams": [],
724
+ "members": [],
725
+ "notes": [],
726
+ "language": ""
727
+ },
728
+ {
729
+ "type": "FUNCTION",
730
+ "name": "render.set_render_target",
731
+ "brief": "sets a render target",
732
+ "description": "Sets a render target. Subsequent draw operations will be to the\nrender target until it is replaced by a subsequent call to set_render_target.\nThis function supports render targets created by a render script, or a render target resource.",
733
+ "returnvalues": [],
734
+ "parameters": [
735
+ {
736
+ "name": "render_target",
737
+ "doc": "render target to set. Omit it, pass <code>nil</code>, or use render.RENDER_TARGET_DEFAULT to set the default render target",
738
+ "types": ["render_target", "string", "hash", "nil"],
739
+ "is_optional": "True"
740
+ },
741
+ {
742
+ "name": "options",
743
+ "doc": "optional render-target activation options",
744
+ "types": ["render.set_render_target_options"],
745
+ "is_optional": "True"
746
+ }
747
+ ],
748
+ "examples": "How to set a render target and draw to it and then switch back to the default render target\nThe render target defines the depth/stencil buffers as transient, when set_render_target is called the next time the buffers may be invalidated and allow for optimisations depending on driver support\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- set render target so all drawing is done to it</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">transient</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_DEPTH_BIT</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_STENCIL_BIT</span> <span class=\"p\">}</span> <span class=\"p\">}</span> <span class=\"p\">)</span>\n\n <span class=\"c1\">-- draw a predicate to the render target</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n\n <span class=\"c1\">-- set default render target. This also invalidates the depth and stencil buffers of the current target (self.my_render_target)</span>\n <span class=\"c1\">-- which can be an optimisation on some hardware</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">RENDER_TARGET_DEFAULT</span><span class=\"p\">)</span>\n\n<span class=\"kr\">end</span>\n</code></pre></div>\n\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- set render target by a render target resource identifier</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"s1\">&#39;my_rt_resource&#39;</span><span class=\"p\">)</span>\n\n <span class=\"c1\">-- draw a predicate to the render target</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n\n <span class=\"c1\">-- reset the render target to the default backbuffer</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">RENDER_TARGET_DEFAULT</span><span class=\"p\">)</span>\n\n<span class=\"kr\">end</span>\n</code></pre></div>",
749
+ "replaces": "",
750
+ "error": "",
751
+ "tparams": [],
752
+ "members": [],
753
+ "notes": [],
754
+ "language": ""
755
+ },
756
+ {
757
+ "type": "FUNCTION",
758
+ "name": "render.set_render_target_size",
759
+ "brief": "sets the render target size",
760
+ "description": "Sets the render target size for a render target created from\neither a render script, or from a render target resource.",
761
+ "returnvalues": [],
762
+ "parameters": [
763
+ {
764
+ "name": "render_target",
765
+ "doc": "render target to set size for",
766
+ "types": ["render_target", "string", "hash"],
767
+ "is_optional": "False"
768
+ },
769
+ {
770
+ "name": "width",
771
+ "doc": "new render target width",
772
+ "types": ["integer"],
773
+ "is_optional": "False"
774
+ },
775
+ {
776
+ "name": "height",
777
+ "doc": "new render target height",
778
+ "types": ["integer"],
779
+ "is_optional": "False"
780
+ }
781
+ ],
782
+ "examples": "Resize render targets to the current window size:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target_size</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span><span class=\"p\">,</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">(),</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">())</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target_size</span><span class=\"p\">(</span><span class=\"s1\">&#39;my_rt_resource&#39;</span><span class=\"p\">,</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">(),</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">())</span>\n</code></pre></div>",
783
+ "replaces": "",
784
+ "error": "",
785
+ "tparams": [],
786
+ "members": [],
787
+ "notes": [],
788
+ "language": ""
789
+ },
790
+ {
791
+ "type": "FUNCTION",
792
+ "name": "render.enable_texture",
793
+ "brief": "sets a texture to the render state",
794
+ "description": "Sets the specified texture handle for a render target attachment or a regular texture\nthat should be used for rendering. The texture can be bound to either a texture unit\nor to a sampler name by a hash or a string.\nA texture can be bound to multiple units and sampler names at the same time,\nthe actual binding will be applied to the shaders when a shader program is bound.\nWhen mixing binding using both units and sampler names, you might end up in situations\nwhere two different textures will be applied to the same bind location in the shader.\nIn this case, the texture set to the named sampler will take precedence over the unit.\nNote that you can bind multiple sampler names to the same texture, in case you want to reuse\nthe same texture for differnt use-cases. It is however recommended that you use the same name\neverywhere for the textures that should be shared across different materials.",
795
+ "returnvalues": [],
796
+ "parameters": [
797
+ {
798
+ "name": "binding",
799
+ "doc": "texture binding, either by texture unit, string or hash for the sampler name that the texture should be bound to",
800
+ "types": ["number", "string", "hash"],
801
+ "is_optional": "False"
802
+ },
803
+ {
804
+ "name": "handle_or_name",
805
+ "doc": "render target or texture handle that should be bound, or a named resource in the \"Render Resource\" table in the currently assigned .render file",
806
+ "types": ["texture", "string", "hash"],
807
+ "is_optional": "False"
808
+ },
809
+ {
810
+ "name": "buffer_type",
811
+ "doc": "optional render-target attachment. Defaults to <code>graphics.BUFFER_TYPE_COLOR0_BIT</code>. Depth and stencil attachments must have been created as textures; color attachments beyond the first require a render target with multiple color attachments (up to four are supported).",
812
+ "types": ["graphics.BUFFER_TYPE"],
813
+ "is_optional": "True"
814
+ }
815
+ ],
816
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- enable target so all drawing is done to it</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span><span class=\"p\">)</span>\n\n <span class=\"c1\">-- draw a predicate to the render target</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n\n <span class=\"c1\">-- disable target</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">RENDER_TARGET_DEFAULT</span><span class=\"p\">)</span>\n\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_texture</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">)</span>\n <span class=\"c1\">-- draw a predicate with the render target available as texture 0 in the predicate</span>\n <span class=\"c1\">-- material shader.</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>\n\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- enable render target by resource id</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"s1\">&#39;my_rt_resource&#39;</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">RENDER_TARGET_DEFAULT</span><span class=\"p\">)</span>\n\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_texture</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"s1\">&#39;my_rt_resource&#39;</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">)</span>\n <span class=\"c1\">-- draw a predicate with the render target available as texture 0 in the predicate</span>\n <span class=\"c1\">-- material shader.</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>\n\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- bind a texture to the texture unit 0</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_texture</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_texture_handle</span><span class=\"p\">)</span>\n <span class=\"c1\">-- bind the same texture to a named sampler</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_texture</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_texture_sampler&quot;</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_texture_handle</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
817
+ "replaces": "",
818
+ "error": "",
819
+ "tparams": [],
820
+ "members": [],
821
+ "notes": [],
822
+ "language": ""
823
+ },
824
+ {
825
+ "type": "FUNCTION",
826
+ "name": "render.disable_texture",
827
+ "brief": "disables a texture on the render state",
828
+ "description": "Disables a texture that has previourly been enabled.",
829
+ "returnvalues": [],
830
+ "parameters": [
831
+ {
832
+ "name": "binding",
833
+ "doc": "texture binding, either by texture unit, string or hash that should be disabled",
834
+ "types": ["texture", "string", "hash"],
835
+ "is_optional": "False"
836
+ }
837
+ ],
838
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_texture</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">)</span>\n <span class=\"c1\">-- draw a predicate with the render target available as texture 0 in the predicate</span>\n <span class=\"c1\">-- material shader.</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n <span class=\"c1\">-- done, disable the texture</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">disable_texture</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
839
+ "replaces": "",
840
+ "error": "",
841
+ "tparams": [],
842
+ "members": [],
843
+ "notes": [],
844
+ "language": ""
845
+ },
846
+ {
847
+ "type": "FUNCTION",
848
+ "name": "render.get_render_target_width",
849
+ "brief": "retrieve the buffer width from a render target",
850
+ "description": "Returns the specified buffer width from a render target.",
851
+ "returnvalues": [
852
+ {
853
+ "name": "width",
854
+ "doc": "the width of the render target buffer texture",
855
+ "types": ["integer"]
856
+ }
857
+ ],
858
+ "parameters": [
859
+ {
860
+ "name": "render_target",
861
+ "doc": "render target from which to retrieve the buffer width",
862
+ "types": ["render_target", "string", "hash"],
863
+ "is_optional": "False"
864
+ },
865
+ {
866
+ "name": "buffer_type",
867
+ "doc": "which type of buffer to retrieve the width from\n<ul>\n<li><code>graphics.BUFFER_TYPE_COLOR0_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_COLOR[x]_BIT</code> (x: [0..3], if supported!)</li>\n<li><code>graphics.BUFFER_TYPE_DEPTH_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_STENCIL_BIT</code></li>\n</ul>",
868
+ "types": ["graphics.BUFFER_TYPE"],
869
+ "is_optional": "False"
870
+ }
871
+ ],
872
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- get the width of the render target color buffer</span>\n<span class=\"kd\">local</span> <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_render_target_width</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">target_right</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">)</span>\n<span class=\"c1\">-- get the width of a render target resource</span>\n<span class=\"kd\">local</span> <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_render_target_width</span><span class=\"p\">(</span><span class=\"s1\">&#39;my_rt_resource&#39;</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">)</span>\n</code></pre></div>",
873
+ "replaces": "",
874
+ "error": "",
875
+ "tparams": [],
876
+ "members": [],
877
+ "notes": [],
878
+ "language": ""
879
+ },
880
+ {
881
+ "type": "FUNCTION",
882
+ "name": "render.get_render_target_height",
883
+ "brief": "retrieve a buffer height from a render target",
884
+ "description": "Returns the specified buffer height from a render target.",
885
+ "returnvalues": [
886
+ {
887
+ "name": "height",
888
+ "doc": "the height of the render target buffer texture",
889
+ "types": ["integer"]
890
+ }
891
+ ],
892
+ "parameters": [
893
+ {
894
+ "name": "render_target",
895
+ "doc": "render target from which to retrieve the buffer height",
896
+ "types": ["render_target", "string", "hash"],
897
+ "is_optional": "False"
898
+ },
899
+ {
900
+ "name": "buffer_type",
901
+ "doc": "which type of buffer to retrieve the height from\n<ul>\n<li><code>graphics.BUFFER_TYPE_COLOR0_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_DEPTH_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_STENCIL_BIT</code></li>\n</ul>",
902
+ "types": ["graphics.BUFFER_TYPE"],
903
+ "is_optional": "False"
904
+ }
905
+ ],
906
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- get the height of the render target color buffer</span>\n<span class=\"kd\">local</span> <span class=\"n\">h</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_render_target_height</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">target_right</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">)</span>\n<span class=\"c1\">-- get the height of a render target resource</span>\n<span class=\"kd\">local</span> <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_render_target_height</span><span class=\"p\">(</span><span class=\"s1\">&#39;my_rt_resource&#39;</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">)</span>\n</code></pre></div>",
907
+ "replaces": "",
908
+ "error": "",
909
+ "tparams": [],
910
+ "members": [],
911
+ "notes": [],
912
+ "language": ""
913
+ },
914
+ {
915
+ "type": "FUNCTION",
916
+ "name": "render.clear",
917
+ "brief": "clears the active render target",
918
+ "description": "Clear buffers in the currently enabled render target with specified value. If the render target has been created with multiple\ncolor attachments, all buffers will be cleared with the same value.",
919
+ "returnvalues": [],
920
+ "parameters": [
921
+ {
922
+ "name": "buffers",
923
+ "doc": "table with keys specifying which buffers to clear and values set to clear values. Available keys are:\n<ul>\n<li><code>graphics.BUFFER_TYPE_COLOR0_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_DEPTH_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_STENCIL_BIT</code></li>\n</ul>",
924
+ "types": ["table<graphics.BUFFER_TYPE, number|vector4>"],
925
+ "is_optional": "False"
926
+ }
927
+ ],
928
+ "examples": "Clear the color buffer and the depth buffer.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">clear</span><span class=\"p\">({[</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">),</span> <span class=\"p\">[</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_DEPTH_BIT</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"mi\">1</span><span class=\"p\">})</span>\n</code></pre></div>",
929
+ "replaces": "",
930
+ "error": "",
931
+ "tparams": [],
932
+ "members": [],
933
+ "notes": [],
934
+ "language": ""
935
+ },
936
+ {
937
+ "type": "FUNCTION",
938
+ "name": "render.draw",
939
+ "brief": "draws all objects matching a predicate",
940
+ "description": "Draws all objects that match a specified predicate. An optional constant buffer can be\nprovided to override the default constants. If no constants buffer is provided, a default\nsystem constants buffer is used containing constants as defined in materials and set through\n<a href=\"/ref/go#go.set\">go.set</a> (or <a href=\"/ref/particlefx#particlefx.set_constant\">particlefx.set_constant</a>) on visual components.",
941
+ "returnvalues": [],
942
+ "parameters": [
943
+ {
944
+ "name": "predicate",
945
+ "doc": "predicate to draw for",
946
+ "types": ["render_predicate"],
947
+ "is_optional": "False"
948
+ },
949
+ {
950
+ "name": "options",
951
+ "doc": "optional draw options",
952
+ "types": ["render.draw_options"],
953
+ "is_optional": "True"
954
+ }
955
+ ],
956
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- define a predicate matching anything with material tag &quot;my_tag&quot;</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">predicate</span><span class=\"p\">({</span><span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_tag&quot;</span><span class=\"p\">)})</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- draw everything in the my_pred predicate</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>\n\nDraw predicate with constants:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">constant_buffer</span><span class=\"p\">()</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">tint</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">constants</span><span class=\"p\">})</span>\n</code></pre></div>\n\nDraw with predicate and frustum culling (without near+far planes):\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">frustum</span> <span class=\"o\">=</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">proj</span> <span class=\"o\">*</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">view</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">frustum</span> <span class=\"o\">=</span> <span class=\"n\">frustum</span><span class=\"p\">})</span>\n</code></pre></div>\n\nDraw with predicate and frustum culling (with near+far planes):\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">frustum</span> <span class=\"o\">=</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">proj</span> <span class=\"o\">*</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">view</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">frustum</span> <span class=\"o\">=</span> <span class=\"n\">frustum</span><span class=\"p\">,</span> <span class=\"n\">frustum_planes</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">FRUSTUM_PLANES_ALL</span><span class=\"p\">})</span>\n</code></pre></div>",
957
+ "replaces": "",
958
+ "error": "",
959
+ "tparams": [],
960
+ "members": [],
961
+ "notes": [],
962
+ "language": ""
963
+ },
964
+ {
965
+ "type": "FUNCTION",
966
+ "name": "render.draw_debug3d",
967
+ "brief": "draws all 3d debug graphics",
968
+ "description": "Draws all 3d debug graphics such as lines drawn with \"draw_line\" messages and physics visualization.",
969
+ "returnvalues": [],
970
+ "parameters": [
971
+ {
972
+ "name": "options",
973
+ "doc": "optional debug-draw options",
974
+ "types": ["render.debug_draw_options"],
975
+ "is_optional": "True"
976
+ }
977
+ ],
978
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- draw debug visualization</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw_debug3d</span><span class=\"p\">()</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
979
+ "replaces": "",
980
+ "error": "",
981
+ "tparams": [],
982
+ "members": [],
983
+ "notes": [],
984
+ "language": ""
985
+ },
986
+ {
987
+ "type": "FUNCTION",
988
+ "name": "render.set_view",
989
+ "brief": "sets the view matrix",
990
+ "description": "Sets the view matrix to use when rendering.",
991
+ "returnvalues": [],
992
+ "parameters": [
993
+ {
994
+ "name": "matrix",
995
+ "doc": "view matrix to set",
996
+ "types": ["matrix4"],
997
+ "is_optional": "False"
998
+ }
999
+ ],
1000
+ "examples": "How to set the view and projection matrices according to\nthe values supplied by a camera.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">view</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">matrix4</span><span class=\"p\">()</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">projection</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">matrix4</span><span class=\"p\">()</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- set the view to the stored view value</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_view</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">view</span><span class=\"p\">)</span>\n <span class=\"c1\">-- now we can draw with this view</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">on_message</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">message_id</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">)</span>\n <span class=\"kr\">if</span> <span class=\"n\">message_id</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;set_view_projection&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- camera view and projection arrives here.</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">view</span> <span class=\"o\">=</span> <span class=\"n\">message</span><span class=\"p\">.</span><span class=\"n\">view</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">projection</span> <span class=\"o\">=</span> <span class=\"n\">message</span><span class=\"p\">.</span><span class=\"n\">projection</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1001
+ "replaces": "",
1002
+ "error": "",
1003
+ "tparams": [],
1004
+ "members": [],
1005
+ "notes": [],
1006
+ "language": ""
1007
+ },
1008
+ {
1009
+ "type": "FUNCTION",
1010
+ "name": "render.set_projection",
1011
+ "brief": "sets the projection matrix",
1012
+ "description": "Sets the projection matrix to use when rendering.",
1013
+ "returnvalues": [],
1014
+ "parameters": [
1015
+ {
1016
+ "name": "matrix",
1017
+ "doc": "projection matrix",
1018
+ "types": ["matrix4"],
1019
+ "is_optional": "False"
1020
+ }
1021
+ ],
1022
+ "examples": "How to set the projection to orthographic with world origo at lower left,\nwidth and height as set in project settings and depth (z) between -1 and 1:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_projection</span><span class=\"p\">(</span><span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">matrix4_orthographic</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_width</span><span class=\"p\">(),</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_height</span><span class=\"p\">(),</span> <span class=\"o\">-</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">))</span>\n</code></pre></div>",
1023
+ "replaces": "",
1024
+ "error": "",
1025
+ "tparams": [],
1026
+ "members": [],
1027
+ "notes": [],
1028
+ "language": ""
1029
+ },
1030
+ {
1031
+ "type": "FUNCTION",
1032
+ "name": "render.set_blend_func",
1033
+ "brief": "sets the blending function",
1034
+ "description": "Specifies the arithmetic used when computing pixel values that are written to the frame\nbuffer. In RGBA mode, pixels can be drawn using a function that blends the source RGBA\npixel values with the destination pixel values already in the frame buffer.\nBlending is initially disabled.\n<code>source_factor</code> specifies which method is used to scale the source color components.\n<code>destination_factor</code> specifies which method is used to scale the destination color\ncomponents.\nSource color components are referred to as (R<sub>s</sub>,G<sub>s</sub>,B<sub>s</sub>,A<sub>s</sub>).\nDestination color components are referred to as (R<sub>d</sub>,G<sub>d</sub>,B<sub>d</sub>,A<sub>d</sub>).\nThe color specified by setting the blendcolor is referred to as (R<sub>c</sub>,G<sub>c</sub>,B<sub>c</sub>,A<sub>c</sub>).\nThe source scale factor is referred to as (s<sub>R</sub>,s<sub>G</sub>,s<sub>B</sub>,s<sub>A</sub>).\nThe destination scale factor is referred to as (d<sub>R</sub>,d<sub>G</sub>,d<sub>B</sub>,d<sub>A</sub>).\nThe color values have integer values between 0 and (k<sub>R</sub>,k<sub>G</sub>,k<sub>B</sub>,k<sub>A</sub>), where k<sub>c</sub> = 2<sup>m<sub>c</sub></sup> - 1 and m<sub>c</sub> is the number of bitplanes for that color. I.e for 8 bit color depth, color values are between <code>0</code> and <code>255</code>.\nThe blended RGBA values of a pixel comes from the following equations:\n<ul>\n<li>R<sub>d</sub> = min(k<sub>R</sub>, R<sub>s</sub> * s<sub>R</sub> + R<sub>d</sub> * d<sub>R</sub>)</li>\n<li>G<sub>d</sub> = min(k<sub>G</sub>, G<sub>s</sub> * s<sub>G</sub> + G<sub>d</sub> * d<sub>G</sub>)</li>\n<li>B<sub>d</sub> = min(k<sub>B</sub>, B<sub>s</sub> * s<sub>B</sub> + B<sub>d</sub> * d<sub>B</sub>)</li>\n<li>A<sub>d</sub> = min(k<sub>A</sub>, A<sub>s</sub> * s<sub>A</sub> + A<sub>d</sub> * d<sub>A</sub>)</li>\n</ul>\nBlend function <code>(graphics.BLEND_FACTOR_SRC_ALPHA, graphics.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA)</code> is useful for\ndrawing with transparency when the drawn objects are sorted from farthest to nearest.\nIt is also useful for drawing antialiased points and lines in arbitrary order.",
1035
+ "returnvalues": [],
1036
+ "parameters": [
1037
+ {
1038
+ "name": "source_factor",
1039
+ "doc": "source factor",
1040
+ "types": ["graphics.BLEND_FACTOR"],
1041
+ "is_optional": "False"
1042
+ },
1043
+ {
1044
+ "name": "destination_factor",
1045
+ "doc": "destination factor",
1046
+ "types": ["graphics.BLEND_FACTOR"],
1047
+ "is_optional": "False"
1048
+ }
1049
+ ],
1050
+ "examples": "Set the blend func to the most common one:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_blend_func</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BLEND_FACTOR_SRC_ALPHA</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BLEND_FACTOR_ONE_MINUS_SRC_ALPHA</span><span class=\"p\">)</span>\n</code></pre></div>",
1051
+ "replaces": "",
1052
+ "error": "",
1053
+ "tparams": [],
1054
+ "members": [],
1055
+ "notes": [],
1056
+ "language": ""
1057
+ },
1058
+ {
1059
+ "type": "FUNCTION",
1060
+ "name": "render.set_blend_func_separate",
1061
+ "brief": "sets the blend function with separate factors for color and alpha",
1062
+ "description": "Sets the blend function with separate blend factors for the color and alpha channels.",
1063
+ "returnvalues": [],
1064
+ "parameters": [
1065
+ {
1066
+ "name": "source_factor_color",
1067
+ "doc": "source color blend factor",
1068
+ "types": ["number"],
1069
+ "is_optional": "False"
1070
+ },
1071
+ {
1072
+ "name": "destination_factor_color",
1073
+ "doc": "destination color blend factor",
1074
+ "types": ["number"],
1075
+ "is_optional": "False"
1076
+ },
1077
+ {
1078
+ "name": "source_factor_alpha",
1079
+ "doc": "source alpha blend factor",
1080
+ "types": ["number"],
1081
+ "is_optional": "False"
1082
+ },
1083
+ {
1084
+ "name": "destination_factor_alpha",
1085
+ "doc": "destination alpha blend factor",
1086
+ "types": ["number"],
1087
+ "is_optional": "False"
1088
+ }
1089
+ ],
1090
+ "examples": "Set standard alpha blending with separate alpha:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_blend_func_separate</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BLEND_FACTOR_SRC_ALPHA</span><span class=\"p\">,</span>\n <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BLEND_FACTOR_ONE_MINUS_SRC_ALPHA</span><span class=\"p\">,</span>\n <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BLEND_FACTOR_ONE</span><span class=\"p\">,</span>\n <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BLEND_FACTOR_ONE_MINUS_SRC_ALPHA</span><span class=\"p\">)</span>\n</code></pre></div>",
1091
+ "replaces": "",
1092
+ "error": "",
1093
+ "tparams": [],
1094
+ "members": [],
1095
+ "notes": [],
1096
+ "language": ""
1097
+ },
1098
+ {
1099
+ "type": "FUNCTION",
1100
+ "name": "render.set_blend_equation_separate",
1101
+ "brief": "sets the blend equation with separate equations for color and alpha",
1102
+ "description": "Sets the blend equation with separate equations for the color and alpha channels.",
1103
+ "returnvalues": [],
1104
+ "parameters": [
1105
+ {
1106
+ "name": "equation_color",
1107
+ "doc": "color blend equation",
1108
+ "types": ["graphics.BLEND_EQUATION"],
1109
+ "is_optional": "False"
1110
+ },
1111
+ {
1112
+ "name": "equation_alpha",
1113
+ "doc": "alpha blend equation",
1114
+ "types": ["graphics.BLEND_EQUATION"],
1115
+ "is_optional": "False"
1116
+ }
1117
+ ],
1118
+ "examples": "Set add for color and reverse subtract for alpha:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_blend_equation_separate</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BLEND_EQUATION_ADD</span><span class=\"p\">,</span>\n <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BLEND_EQUATION_REVERSE_SUBTRACT</span><span class=\"p\">)</span>\n</code></pre></div>",
1119
+ "replaces": "",
1120
+ "error": "",
1121
+ "tparams": [],
1122
+ "members": [],
1123
+ "notes": [],
1124
+ "language": ""
1125
+ },
1126
+ {
1127
+ "type": "FUNCTION",
1128
+ "name": "render.set_color_mask",
1129
+ "brief": "sets the color mask",
1130
+ "description": "Specifies whether the individual color components in the frame buffer is enabled for writing (<code>true</code>) or disabled (<code>false</code>). For example, if <code>blue</code> is <code>false</code>, nothing is written to the blue component of any pixel in any of the color buffers, regardless of the drawing operation attempted. Note that writing are either enabled or disabled for entire color components, not the individual bits of a component.\nThe component masks are all initially <code>true</code>.",
1131
+ "returnvalues": [],
1132
+ "parameters": [
1133
+ {
1134
+ "name": "red",
1135
+ "doc": "red mask",
1136
+ "types": ["boolean"],
1137
+ "is_optional": "False"
1138
+ },
1139
+ {
1140
+ "name": "green",
1141
+ "doc": "green mask",
1142
+ "types": ["boolean"],
1143
+ "is_optional": "False"
1144
+ },
1145
+ {
1146
+ "name": "blue",
1147
+ "doc": "blue mask",
1148
+ "types": ["boolean"],
1149
+ "is_optional": "False"
1150
+ },
1151
+ {
1152
+ "name": "alpha",
1153
+ "doc": "alpha mask",
1154
+ "types": ["boolean"],
1155
+ "is_optional": "False"
1156
+ }
1157
+ ],
1158
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- alpha cannot be written to frame buffer</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_color_mask</span><span class=\"p\">(</span><span class=\"kc\">true</span><span class=\"p\">,</span> <span class=\"kc\">true</span><span class=\"p\">,</span> <span class=\"kc\">true</span><span class=\"p\">,</span> <span class=\"kc\">false</span><span class=\"p\">)</span>\n</code></pre></div>",
1159
+ "replaces": "",
1160
+ "error": "",
1161
+ "tparams": [],
1162
+ "members": [],
1163
+ "notes": [],
1164
+ "language": ""
1165
+ },
1166
+ {
1167
+ "type": "FUNCTION",
1168
+ "name": "render.set_depth_mask",
1169
+ "brief": "sets the depth mask",
1170
+ "description": "Specifies whether the depth buffer is enabled for writing. The supplied mask governs\nif depth buffer writing is enabled (<code>true</code>) or disabled (<code>false</code>).\nThe mask is initially <code>true</code>.",
1171
+ "returnvalues": [],
1172
+ "parameters": [
1173
+ {
1174
+ "name": "depth",
1175
+ "doc": "depth mask",
1176
+ "types": ["boolean"],
1177
+ "is_optional": "False"
1178
+ }
1179
+ ],
1180
+ "examples": "How to turn off writing to the depth buffer:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_depth_mask</span><span class=\"p\">(</span><span class=\"kc\">false</span><span class=\"p\">)</span>\n</code></pre></div>",
1181
+ "replaces": "",
1182
+ "error": "",
1183
+ "tparams": [],
1184
+ "members": [],
1185
+ "notes": [],
1186
+ "language": ""
1187
+ },
1188
+ {
1189
+ "type": "FUNCTION",
1190
+ "name": "render.set_stencil_mask",
1191
+ "brief": "sets the stencil mask",
1192
+ "description": "The stencil mask controls the writing of individual bits in the stencil buffer.\nThe least significant <code>n</code> bits of the parameter <code>mask</code>, where <code>n</code> is the number of\nbits in the stencil buffer, specify the mask.\nWhere a <code>1</code> bit appears in the mask, the corresponding\nbit in the stencil buffer can be written. Where a <code>0</code> bit appears in the mask,\nthe corresponding bit in the stencil buffer is never written.\nThe mask is initially all <code>1</code>'s.",
1193
+ "returnvalues": [],
1194
+ "parameters": [
1195
+ {
1196
+ "name": "mask",
1197
+ "doc": "stencil mask",
1198
+ "types": ["number"],
1199
+ "is_optional": "False"
1200
+ }
1201
+ ],
1202
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- set the stencil mask to all 1:s</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_stencil_mask</span><span class=\"p\">(</span><span class=\"mh\">0xff</span><span class=\"p\">)</span>\n</code></pre></div>",
1203
+ "replaces": "",
1204
+ "error": "",
1205
+ "tparams": [],
1206
+ "members": [],
1207
+ "notes": [],
1208
+ "language": ""
1209
+ },
1210
+ {
1211
+ "type": "FUNCTION",
1212
+ "name": "render.set_depth_func",
1213
+ "brief": "sets the depth test function",
1214
+ "description": "Specifies the function that should be used to compare each incoming pixel\ndepth value with the value present in the depth buffer.\nThe comparison is performed only if depth testing is enabled and specifies\nthe conditions under which a pixel will be drawn.\nThe depth function is initially set to <code>graphics.COMPARE_FUNC_LESS</code>.",
1215
+ "returnvalues": [],
1216
+ "parameters": [
1217
+ {
1218
+ "name": "func",
1219
+ "doc": "depth test function, see the description for available values",
1220
+ "types": ["graphics.COMPARE_FUNC"],
1221
+ "is_optional": "False"
1222
+ }
1223
+ ],
1224
+ "examples": "Enable depth test and set the depth test function to \"not equal\".\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_state</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STATE_DEPTH_TEST</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_depth_func</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">COMPARE_FUNC_NOTEQUAL</span><span class=\"p\">)</span>\n</code></pre></div>",
1225
+ "replaces": "",
1226
+ "error": "",
1227
+ "tparams": [],
1228
+ "members": [],
1229
+ "notes": [],
1230
+ "language": ""
1231
+ },
1232
+ {
1233
+ "type": "FUNCTION",
1234
+ "name": "render.set_stencil_func",
1235
+ "brief": "sets the stencil test function",
1236
+ "description": "Stenciling is similar to depth-buffering as it enables and disables drawing on a\nper-pixel basis. First, GL drawing primitives are drawn into the stencil planes.\nSecond, geometry and images are rendered but using the stencil planes to mask out\nwhere to draw.\nThe stencil test discards a pixel based on the outcome of a comparison between the\nreference value <code>ref</code> and the corresponding value in the stencil buffer.\n<code>func</code> specifies the comparison function.\nThe initial value is <code>graphics.COMPARE_FUNC_ALWAYS</code>.\n<code>ref</code> specifies the reference value for the stencil test. The value is clamped to\nthe range [0, 2<sup>n</sup>-1], where n is the number of bitplanes in the stencil buffer.\nThe initial value is <code>0</code>.\n<code>mask</code> is ANDed with both the reference value and the stored stencil value when the test\nis done. The initial value is all <code>1</code>'s.",
1237
+ "returnvalues": [],
1238
+ "parameters": [
1239
+ {
1240
+ "name": "func",
1241
+ "doc": "stencil test function, see the description for available values",
1242
+ "types": ["graphics.COMPARE_FUNC"],
1243
+ "is_optional": "False"
1244
+ },
1245
+ {
1246
+ "name": "ref",
1247
+ "doc": "reference value for the stencil test",
1248
+ "types": ["number"],
1249
+ "is_optional": "False"
1250
+ },
1251
+ {
1252
+ "name": "mask",
1253
+ "doc": "mask that is ANDed with both the reference value and the stored stencil value when the test is done",
1254
+ "types": ["number"],
1255
+ "is_optional": "False"
1256
+ }
1257
+ ],
1258
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- let only 0&#39;s pass the stencil test</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_stencil_func</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">COMPARE_FUNC_EQUAL</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n</code></pre></div>",
1259
+ "replaces": "",
1260
+ "error": "",
1261
+ "tparams": [],
1262
+ "members": [],
1263
+ "notes": [],
1264
+ "language": ""
1265
+ },
1266
+ {
1267
+ "type": "FUNCTION",
1268
+ "name": "render.set_stencil_op",
1269
+ "brief": "sets the stencil operator",
1270
+ "description": "The stencil test discards a pixel based on the outcome of a comparison between the\nreference value <code>ref</code> and the corresponding value in the stencil buffer.\nTo control the test, call <a href=\"/ref/render#render.set_stencil_func\">render.set_stencil_func</a>.\nThis function takes three arguments that control what happens to the stored stencil\nvalue while stenciling is enabled. If the stencil test fails, no change is made to the\npixel's color or depth buffers, and <code>sfail</code> specifies what happens to the stencil buffer\ncontents.\n<code>dppass</code> and <code>dpfail</code> specify the stencil buffer actions depending on whether subsequent\ndepth buffer tests succeed (dppass) or fail (dpfail).\nThe initial value for all operators is <code>graphics.STENCIL_OP_KEEP</code>.",
1271
+ "returnvalues": [],
1272
+ "parameters": [
1273
+ {
1274
+ "name": "sfail",
1275
+ "doc": "action to take when the stencil test fails",
1276
+ "types": ["graphics.STENCIL_OP"],
1277
+ "is_optional": "False"
1278
+ },
1279
+ {
1280
+ "name": "dpfail",
1281
+ "doc": "the stencil action when the stencil test passes",
1282
+ "types": ["graphics.STENCIL_OP"],
1283
+ "is_optional": "False"
1284
+ },
1285
+ {
1286
+ "name": "dppass",
1287
+ "doc": "the stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled",
1288
+ "types": ["graphics.STENCIL_OP"],
1289
+ "is_optional": "False"
1290
+ }
1291
+ ],
1292
+ "examples": "Set the stencil function to never pass and operator to always draw 1's\non test fail.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_stencil_func</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">COMPARE_FUNC_NEVER</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mh\">0xFF</span><span class=\"p\">)</span>\n<span class=\"c1\">-- always draw 1&#39;s on test fail</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_stencil_op</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STENCIL_OP_REPLACE</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STENCIL_OP_KEEP</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STENCIL_OP_KEEP</span><span class=\"p\">)</span>\n</code></pre></div>",
1293
+ "replaces": "",
1294
+ "error": "",
1295
+ "tparams": [],
1296
+ "members": [],
1297
+ "notes": [],
1298
+ "language": ""
1299
+ },
1300
+ {
1301
+ "type": "FUNCTION",
1302
+ "name": "render.set_cull_face",
1303
+ "brief": "sets the cull face",
1304
+ "description": "Specifies whether front- or back-facing polygons can be culled\nwhen polygon culling is enabled. Polygon culling is initially disabled.\nIf mode is <code>graphics.FACE_TYPE_FRONT_AND_BACK</code>, no polygons are drawn, but other\nprimitives such as points and lines are drawn. The initial value for\n<code>face_type</code> is <code>graphics.FACE_TYPE_BACK</code>.",
1305
+ "returnvalues": [],
1306
+ "parameters": [
1307
+ {
1308
+ "name": "face_type",
1309
+ "doc": "face type",
1310
+ "types": ["graphics.FACE_TYPE"],
1311
+ "is_optional": "False"
1312
+ }
1313
+ ],
1314
+ "examples": "How to enable polygon culling and set front face culling:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_state</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STATE_CULL_FACE</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_cull_face</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">FACE_TYPE_FRONT</span><span class=\"p\">)</span>\n</code></pre></div>",
1315
+ "replaces": "",
1316
+ "error": "",
1317
+ "tparams": [],
1318
+ "members": [],
1319
+ "notes": [],
1320
+ "language": ""
1321
+ },
1322
+ {
1323
+ "type": "FUNCTION",
1324
+ "name": "render.set_polygon_offset",
1325
+ "brief": "sets the polygon offset",
1326
+ "description": "Sets the scale and units used to calculate depth values.\nIf <code>graphics.STATE_POLYGON_OFFSET_FILL</code> is enabled, each fragment's depth value\nis offset from its interpolated value (depending on the depth value of the\nappropriate vertices). Polygon offset can be used when drawing decals, rendering\nhidden-line images etc.\n<code>factor</code> specifies a scale factor that is used to create a variable depth\noffset for each polygon. The initial value is <code>0</code>.\n<code>units</code> is multiplied by an implementation-specific value to create a\nconstant depth offset. The initial value is <code>0</code>.\nThe value of the offset is computed as <code>factor</code> &times; <code>DZ</code> + <code>r</code> &times; <code>units</code>\n<code>DZ</code> is a measurement of the depth slope of the polygon which is the change in z (depth)\nvalues divided by the change in either x or y coordinates, as you traverse a polygon.\nThe depth values are in window coordinates, clamped to the range [0, 1].\n<code>r</code> is the smallest value that is guaranteed to produce a resolvable difference.\nIt's value is an implementation-specific constant.\nThe offset is added before the depth test is performed and before the\nvalue is written into the depth buffer.",
1327
+ "returnvalues": [],
1328
+ "parameters": [
1329
+ {
1330
+ "name": "factor",
1331
+ "doc": "polygon offset factor",
1332
+ "types": ["number"],
1333
+ "is_optional": "False"
1334
+ },
1335
+ {
1336
+ "name": "units",
1337
+ "doc": "polygon offset units",
1338
+ "types": ["number"],
1339
+ "is_optional": "False"
1340
+ }
1341
+ ],
1342
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_state</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STATE_POLYGON_OFFSET_FILL</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_polygon_offset</span><span class=\"p\">(</span><span class=\"mf\">1.0</span><span class=\"p\">,</span> <span class=\"mf\">1.0</span><span class=\"p\">)</span>\n</code></pre></div>",
1343
+ "replaces": "",
1344
+ "error": "",
1345
+ "tparams": [],
1346
+ "members": [],
1347
+ "notes": [],
1348
+ "language": ""
1349
+ },
1350
+ {
1351
+ "type": "FUNCTION",
1352
+ "name": "render.get_width",
1353
+ "brief": "gets the window width, as specified for the project",
1354
+ "description": "Returns the logical window width that is set in the \"game.project\" settings.\nNote that the actual window pixel size can change, either by device constraints\nor user input.",
1355
+ "returnvalues": [
1356
+ {
1357
+ "name": "width",
1358
+ "doc": "specified window width",
1359
+ "types": ["integer"]
1360
+ }
1361
+ ],
1362
+ "parameters": [],
1363
+ "examples": "Get the width of the window.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_width</span><span class=\"p\">()</span>\n</code></pre></div>",
1364
+ "replaces": "",
1365
+ "error": "",
1366
+ "tparams": [],
1367
+ "members": [],
1368
+ "notes": [],
1369
+ "language": ""
1370
+ },
1371
+ {
1372
+ "type": "FUNCTION",
1373
+ "name": "render.get_height",
1374
+ "brief": "gets the window height, as specified for the project",
1375
+ "description": "Returns the logical window height that is set in the \"game.project\" settings.\nNote that the actual window pixel size can change, either by device constraints\nor user input.",
1376
+ "returnvalues": [
1377
+ {
1378
+ "name": "height",
1379
+ "doc": "specified window height",
1380
+ "types": ["integer"]
1381
+ }
1382
+ ],
1383
+ "parameters": [],
1384
+ "examples": "Get the height of the window\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">h</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_height</span><span class=\"p\">()</span>\n</code></pre></div>",
1385
+ "replaces": "",
1386
+ "error": "",
1387
+ "tparams": [],
1388
+ "members": [],
1389
+ "notes": [],
1390
+ "language": ""
1391
+ },
1392
+ {
1393
+ "type": "FUNCTION",
1394
+ "name": "render.get_window_width",
1395
+ "brief": "gets the actual window width",
1396
+ "description": "Returns the actual physical window width.\nNote that this value might differ from the logical width that is set in the\n\"game.project\" settings.",
1397
+ "returnvalues": [
1398
+ {
1399
+ "name": "width",
1400
+ "doc": "actual window width",
1401
+ "types": ["integer"]
1402
+ }
1403
+ ],
1404
+ "parameters": [],
1405
+ "examples": "Get the actual width of the window\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">()</span>\n</code></pre></div>",
1406
+ "replaces": "",
1407
+ "error": "",
1408
+ "tparams": [],
1409
+ "members": [],
1410
+ "notes": [],
1411
+ "language": ""
1412
+ },
1413
+ {
1414
+ "type": "FUNCTION",
1415
+ "name": "render.get_window_height",
1416
+ "brief": "gets the actual window height",
1417
+ "description": "Returns the actual physical window height.\nNote that this value might differ from the logical height that is set in the\n\"game.project\" settings.",
1418
+ "returnvalues": [
1419
+ {
1420
+ "name": "height",
1421
+ "doc": "actual window height",
1422
+ "types": ["integer"]
1423
+ }
1424
+ ],
1425
+ "parameters": [],
1426
+ "examples": "Get the actual height of the window\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">h</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">()</span>\n</code></pre></div>",
1427
+ "replaces": "",
1428
+ "error": "",
1429
+ "tparams": [],
1430
+ "members": [],
1431
+ "notes": [],
1432
+ "language": ""
1433
+ },
1434
+ {
1435
+ "type": "FUNCTION",
1436
+ "name": "render.predicate",
1437
+ "brief": "creates a new render predicate",
1438
+ "description": "This function returns a new render predicate for objects with materials matching\nthe provided material tags. The provided tags are combined into a bit mask\nfor the predicate. If multiple tags are provided, the predicate matches materials\nwith all tags ANDed together.\nThe current limit to the number of tags that can be defined is <code>64</code>.",
1439
+ "returnvalues": [
1440
+ {
1441
+ "name": "predicate",
1442
+ "doc": "new predicate",
1443
+ "types": ["render_predicate"]
1444
+ }
1445
+ ],
1446
+ "parameters": [
1447
+ {
1448
+ "name": "tags",
1449
+ "doc": "table of tags that the predicate should match. The tags can be of either hash or string type",
1450
+ "types": ["(string|hash)[]"],
1451
+ "is_optional": "False"
1452
+ }
1453
+ ],
1454
+ "examples": "Create a new render predicate containing all visual objects that\nhave a material with material tags \"opaque\" AND \"smoke\".\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">p</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">predicate</span><span class=\"p\">({</span><span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;opaque&quot;</span><span class=\"p\">),</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;smoke&quot;</span><span class=\"p\">)})</span>\n</code></pre></div>",
1455
+ "replaces": "",
1456
+ "error": "",
1457
+ "tparams": [],
1458
+ "members": [],
1459
+ "notes": [],
1460
+ "language": ""
1461
+ },
1462
+ {
1463
+ "type": "FUNCTION",
1464
+ "name": "render.enable_material",
1465
+ "brief": "enables a material",
1466
+ "description": "If another material was already enabled, it will be automatically disabled\nand the specified material is used instead.\nThe name of the material must be specified in the \".render\" resource set\nin the \"game.project\" setting.",
1467
+ "returnvalues": [],
1468
+ "parameters": [
1469
+ {
1470
+ "name": "material_id",
1471
+ "doc": "material id to enable",
1472
+ "types": ["string", "hash"],
1473
+ "is_optional": "False"
1474
+ }
1475
+ ],
1476
+ "examples": "Enable material named \"glow\", then draw my_pred with it.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_material</span><span class=\"p\">(</span><span class=\"s2\">&quot;glow&quot;</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">disable_material</span><span class=\"p\">()</span>\n</code></pre></div>",
1477
+ "replaces": "",
1478
+ "error": "",
1479
+ "tparams": [],
1480
+ "members": [],
1481
+ "notes": [],
1482
+ "language": ""
1483
+ },
1484
+ {
1485
+ "type": "FUNCTION",
1486
+ "name": "render.disable_material",
1487
+ "brief": "disables the currently enabled material",
1488
+ "description": "If a material is currently enabled, disable it.\nThe name of the material must be specified in the \".render\" resource set\nin the \"game.project\" setting.",
1489
+ "returnvalues": [],
1490
+ "parameters": [],
1491
+ "examples": "Enable material named \"glow\", then draw my_pred with it.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_material</span><span class=\"p\">(</span><span class=\"s2\">&quot;glow&quot;</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">disable_material</span><span class=\"p\">()</span>\n</code></pre></div>",
1492
+ "replaces": "",
1493
+ "error": "",
1494
+ "tparams": [],
1495
+ "members": [],
1496
+ "notes": [],
1497
+ "language": ""
1498
+ },
1499
+ {
1500
+ "type": "FUNCTION",
1501
+ "name": "render.set_camera",
1502
+ "brief": "sets the current render camera to be used for rendering",
1503
+ "description": "Sets the current render camera to be used for rendering. If a render camera\nhas been set by the render script, the renderer will be using its projection and view matrix\nduring rendering. If a projection and/or view matrix has been set by the render script,\nthey will not be used until the current render camera has been reset by calling <code>render.set_camera()</code>.\nIf the 'use_frustum' flag in the options table has been set to true, the renderer will automatically use the\ncamera frustum for frustum culling regardless of what frustum is being passed into the render.draw() function.\nNote that the frustum plane option in render.draw can still be used together with the camera.",
1504
+ "returnvalues": [],
1505
+ "parameters": [
1506
+ {
1507
+ "name": "camera",
1508
+ "doc": "camera id to use, or nil to reset",
1509
+ "types": ["url", "number", "nil"],
1510
+ "is_optional": "False"
1511
+ },
1512
+ {
1513
+ "name": "options",
1514
+ "doc": "optional camera options",
1515
+ "types": ["render.camera_options"],
1516
+ "is_optional": "True"
1517
+ }
1518
+ ],
1519
+ "examples": "Set the current camera to be used for rendering\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_camera</span><span class=\"p\">(</span><span class=\"s2\">&quot;main:/my_go#camera&quot;</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_camera</span><span class=\"p\">(</span><span class=\"kc\">nil</span><span class=\"p\">)</span>\n</code></pre></div>\n\nUse the camera frustum for frustum culling together with a specific frustum plane option for the draw command\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- The camera frustum will take precedence over the frustum plane option in render.draw</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_camera</span><span class=\"p\">(</span><span class=\"s2\">&quot;main:/my_go#camera&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">use_frustum</span> <span class=\"o\">=</span> <span class=\"kc\">true</span> <span class=\"p\">})</span>\n<span class=\"c1\">-- However, we can still customize the frustum planes regardless of the camera option!</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">frustum_planes</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">FRUSTUM_PLANES_ALL</span> <span class=\"p\">})</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_camera</span><span class=\"p\">()</span>\n</code></pre></div>",
1520
+ "replaces": "",
1521
+ "error": "",
1522
+ "tparams": [],
1523
+ "members": [],
1524
+ "notes": [],
1525
+ "language": ""
1526
+ },
1527
+ {
1528
+ "type": "FUNCTION",
1529
+ "name": "render.set_compute",
1530
+ "brief": "set the current compute program",
1531
+ "description": "The name of the compute program must be specified in the \".render\" resource set\nin the \"game.project\" setting. If nil (or no arguments) are passed to this function,\nthe current compute program will instead be disabled.",
1532
+ "returnvalues": [],
1533
+ "parameters": [
1534
+ {
1535
+ "name": "compute",
1536
+ "doc": "compute id to use, or nil to disable",
1537
+ "types": ["string", "hash", "nil"],
1538
+ "is_optional": "False"
1539
+ }
1540
+ ],
1541
+ "examples": "Enable compute program named \"fractals\", then dispatch it.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_compute</span><span class=\"p\">(</span><span class=\"s2\">&quot;fractals&quot;</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_texture</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">backing_texture</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">dispatch_compute</span><span class=\"p\">(</span><span class=\"mi\">128</span><span class=\"p\">,</span> <span class=\"mi\">128</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_compute</span><span class=\"p\">()</span>\n</code></pre></div>",
1542
+ "replaces": "",
1543
+ "error": "",
1544
+ "tparams": [],
1545
+ "members": [],
1546
+ "notes": [],
1547
+ "language": ""
1548
+ },
1549
+ {
1550
+ "type": "FUNCTION",
1551
+ "name": "render.dispatch_compute",
1552
+ "brief": "dispatches the currently enabled compute program",
1553
+ "description": "Dispatches the currently enabled compute program. The dispatch call takes three arguments x,y,z which constitutes\nthe 'global working group' of the compute dispatch. Together with the 'local working group' specified in the compute shader\nas a layout qualifier, these two sets of parameters forms the number of invocations the compute shader will execute.\nAn optional constant buffer can be provided to override the default constants. If no constants buffer is provided, a default\nsystem constants buffer is used containing constants as defined in the compute program.",
1554
+ "returnvalues": [],
1555
+ "parameters": [
1556
+ {
1557
+ "name": "x",
1558
+ "doc": "global work group size X",
1559
+ "types": ["integer"],
1560
+ "is_optional": "False"
1561
+ },
1562
+ {
1563
+ "name": "y",
1564
+ "doc": "global work group size Y",
1565
+ "types": ["integer"],
1566
+ "is_optional": "False"
1567
+ },
1568
+ {
1569
+ "name": "z",
1570
+ "doc": "global work group size Z",
1571
+ "types": ["integer"],
1572
+ "is_optional": "False"
1573
+ },
1574
+ {
1575
+ "name": "options",
1576
+ "doc": "optional compute-dispatch options",
1577
+ "types": ["render.dispatch_options"],
1578
+ "is_optional": "True"
1579
+ }
1580
+ ],
1581
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"kd\">local</span> <span class=\"n\">color_params</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">format</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FORMAT_RGBA</span><span class=\"p\">,</span>\n <span class=\"n\">width</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">(),</span>\n <span class=\"n\">height</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">()}</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">scene_rt</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">render_target</span><span class=\"p\">({[</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">color_params</span><span class=\"p\">})</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_compute</span><span class=\"p\">(</span><span class=\"s2\">&quot;bloom&quot;</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_texture</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">backing_texture</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_texture</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">scene_rt</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">dispatch_compute</span><span class=\"p\">(</span><span class=\"mi\">128</span><span class=\"p\">,</span> <span class=\"mi\">128</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_compute</span><span class=\"p\">()</span>\n<span class=\"kr\">end</span>\n</code></pre></div>\n\nDispatch a compute program with a constant buffer:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">constant_buffer</span><span class=\"p\">()</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">tint</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">dispatch_compute</span><span class=\"p\">(</span><span class=\"mi\">32</span><span class=\"p\">,</span> <span class=\"mi\">32</span><span class=\"p\">,</span> <span class=\"mi\">32</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">constants</span><span class=\"p\">})</span>\n</code></pre></div>",
1582
+ "replaces": "",
1583
+ "error": "",
1584
+ "tparams": [],
1585
+ "members": [],
1586
+ "notes": [],
1587
+ "language": ""
1588
+ },
1589
+ {
1590
+ "type": "FUNCTION",
1591
+ "name": "render.set_listener",
1592
+ "brief": "set render's event listener",
1593
+ "description": "Set or remove the rendering-context event listener.",
1594
+ "returnvalues": [],
1595
+ "parameters": [
1596
+ {
1597
+ "name": "callback",
1598
+ "doc": "A callback that receives all render related events.\nPass <code>nil</code> if want to remove listener.",
1599
+ "types": ["fun(self:script_instance, event_type:render.CONTEXT_EVENT)", "nil"],
1600
+ "is_optional": "False"
1601
+ }
1602
+ ],
1603
+ "examples": "Set listener and handle render context events.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">--- custom.render_script</span>\n<span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_listener</span><span class=\"p\">(</span><span class=\"kr\">function</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">event_type</span><span class=\"p\">)</span>\n <span class=\"kr\">if</span> <span class=\"n\">event_type</span> <span class=\"o\">==</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">CONTEXT_EVENT_CONTEXT_LOST</span> <span class=\"kr\">then</span>\n <span class=\"c1\">--- Some stuff when rendering context is lost</span>\n <span class=\"kr\">elseif</span> <span class=\"n\">event_type</span> <span class=\"o\">==</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">CONTEXT_EVENT_CONTEXT_RESTORED</span> <span class=\"kr\">then</span>\n <span class=\"c1\">--- Start reload resources, reload game, etc.</span>\n <span class=\"kr\">end</span>\n <span class=\"kr\">end</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1604
+ "replaces": "",
1605
+ "error": "",
1606
+ "tparams": [],
1607
+ "members": [],
1608
+ "notes": [],
1609
+ "language": ""
1610
+ }
1611
+ ],
1612
+ "info": {
1613
+ "namespace": "render",
1614
+ "name": "Render",
1615
+ "brief": "Rendering API documentation",
1616
+ "description": "Rendering API documentation",
1617
+ "path": "engine/render/proto/render/render_ddf.proto",
1618
+ "file": "",
1619
+ "notes": [],
1620
+ "language": "Lua"
1621
+ },
1622
+ "format_version": 2
1623
+ }