common.bmx 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  1. ' Copyright (c) 2015-2018 Bruce A Henderson
  2. ' All rights reserved.
  3. '
  4. ' Redistribution and use in source and binary forms, with or without
  5. ' modification, are permitted provided that the following conditions are met:
  6. '
  7. ' * Redistributions of source code must retain the above copyright notice, this
  8. ' list of conditions and the following disclaimer.
  9. '
  10. ' * Redistributions in binary form must reproduce the above copyright notice,
  11. ' this list of conditions and the following disclaimer in the documentation
  12. ' and/or other materials provided with the distribution.
  13. '
  14. ' THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  15. ' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  16. ' IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  17. ' DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  18. ' FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  19. ' DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  20. ' SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  21. ' CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  22. ' OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  23. ' OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. '
  25. SuperStrict
  26. Import gfx.bx
  27. Import gfx.bimg
  28. ?linux
  29. Import "-lGL"
  30. Import "-lX11"
  31. Import "-ldl"
  32. Import "-lrt"
  33. ?
  34. Import "source.bmx"
  35. ?macos
  36. 'Import Pub.OpenGL
  37. Import "-framework OpenGL"
  38. ?
  39. Extern
  40. ' Function bgfx_init(renderType:Int, vendorId:Short, deviceId:Short, cb1:Byte Ptr, cb2:Byte Ptr)
  41. Function bmx_bgfx_init:Int(width:Int, height:Int, rendererType:Int)
  42. Function bmx_bgfx_frame:Int(capture:Int)
  43. Function bmx_bgfx_reset(width:Int, height:Int, flags:Int, format:Int)
  44. Function bmx_bgfx_shutdown()
  45. Function bgfx_alloc:Byte Ptr(size:Int)
  46. Function bgfx_copy:Byte Ptr(data:Byte Ptr, size:Int)
  47. Function bmx_bgfx_get_caps:Byte Ptr()
  48. Function bmx_bgfx_set_view_rect(id:Short, x:Int, y:Int, width:Int, height:Int)
  49. Function bmx_bgfx_set_view_clear(id:Short, flags:Short, rgba:Int, depth:Float, stencil:Byte)
  50. Function bmx_bgfx_set_view_transform(id:Short, view:Byte Ptr, proj:Byte Ptr)
  51. Function bmx_bgfx_set_view_scissor(id:Short, x:Short, y:Short, width:Short, height:Short)
  52. Function bmx_bgfx_set_view_rect_auto(id:Short, x:Short, y:Short, ratio:Int)
  53. Function bmx_bgfx_set_view_clear_mrt(id:Short, flags:Short, depth:Float, stencil:Byte, p0:Byte, p1:Byte, p2:Byte, p3:Byte, p4:Byte, p5:Byte, p6:Byte, p7:Byte)
  54. Function bmx_bgfx_set_view_mode(id:Short, viewMode:Int)
  55. Function bmx_bgfx_set_view_order(id:Short, num:Short, order:Short Ptr)
  56. Function bmx_bgfx_set_view_frame_buffer(id:Short, frameBuffer:Short)
  57. Function bmx_bgfx_create_program:Short(vsh:Short, fsh:Short, destroyShaders:Int)
  58. Function bmx_bgfx_create_compute_program:Short(csh:Short, destroyShaders:Int)
  59. Function bmx_bgfx_destroy_program(handle:Short)
  60. Function bmx_bgfx_create_shader:Short(mem:Byte Ptr)
  61. Function bmx_bgfx_get_shader_uniforms:Short(handle:Short, uniforms:Short Ptr, maximum:Short)
  62. Function bmx_bgfx_set_shader_name(handle:Short, name:String)
  63. Function bmx_bgfx_destroy_shader(handle:Short)
  64. Function bmx_bgfx_create_uniform:Short(name:String, uniformType:Int, num:Short)
  65. Function bmx_bgfx_destroy_uniform(handle:Short)
  66. Function bmx_bgfx_get_uniform_info:Byte Ptr(handle:Short)
  67. Function bmx_bgfx_uniform_info_free(handle:Byte Ptr)
  68. ' Function bmx_bgfx_set_transform:Int(matrix:Float Ptr, num:Int)
  69. Function bmx_bgfx_set_clear_color(index:Int, r:Int, g:Int, b:Int, a:Int)
  70. ' Function bmx_bgfx_set_state(state:Long, r:Int, g:Int, b:Int, a:Int)
  71. Function bmx_bgfx_create_index_buffer:Byte Ptr(mem:Byte Ptr, flags:Int)
  72. Function bmx_bgfx_destroy_index_buffer(buffer:Byte Ptr)
  73. Function bmx_bgfx_set_debug(debugFlags:Int)
  74. Function bmx_bgfx_dbg_text_clear(attr:Byte, small:Int)
  75. Function bmx_bgfx_dbg_text_printf(x:Short, y:Short, attr:Byte, Text:String)
  76. Function bmx_bgfx_dbg_text_image(x:Short, y:Short, width:Short, height:Short, data:Byte Ptr, pitch:Short)
  77. ' Function bmx_bgfx_set_index_buffer(buffer:Byte Ptr, firstIndex:Int, numIndices:Int)
  78. Function bmx_bgfx_create_texture:Short(mem:Byte Ptr, flags:Int, skip:Int, info:Byte Ptr)
  79. Function bmx_bgfx_create_texture_2d:Short(width:Short, height:Short, hasMips:Int, numLayers:Short, format:Short, flags:Int, mem:Byte Ptr)
  80. Function bmx_bgfx_create_texture_2d_scaled:Short(ratio:Int, hasMips:Int, numLayers:Short, format:Short, flags:Int)
  81. Function bmx_bgfx_destroy_texture(texture:Short)
  82. Function bmx_bgfx_is_texture_valid:Int(depth:Short, cubeMap:Int, numLayers:Short, format:Short, flags:Int)
  83. Function bmx_bgfx_calc_texture_size(info:Byte Ptr, width:Short, height:Short, depth:Short, cubeMap:Int, hasMips:Int, numLayers:Short, format:Short)
  84. Function bmx_bgfx_texture_info_new:Byte Ptr()
  85. Function bmx_bgfx_texture_info_free(info:Byte Ptr)
  86. Function bmx_bgfx_texture_format:Int(info:Byte Ptr)
  87. Function bmx_bgfx_texture_width:Int(info:Byte Ptr)
  88. Function bmx_bgfx_texture_height:Int(info:Byte Ptr)
  89. Function bmx_bgfx_texture_depth:Int(info:Byte Ptr)
  90. Function bmx_bgfx_texture_mips:Int(info:Byte Ptr)
  91. Function bmx_bgfx_texture_bitsperpixel:Int(info:Byte Ptr)
  92. Function bmx_bgfx_texture_cubemap:Int(info:Byte Ptr)
  93. Function bmx_bgfx_texture_storageSize:Int(info:Byte Ptr)
  94. Function bmx_bgfx_set_marker(marker:String)
  95. Function bmx_bgfx_set_state(state:Long, rgba:Int)
  96. Function bmx_bgfx_set_condition(occlusionQuery:Short, visible:Int)
  97. Function bmx_bgfx_set_stencil(fstencil:Int, bstencil:Int)
  98. Function bmx_bgfx_set_scissor:Short(x:Short, y:Short, width:Short, height:Short)
  99. Function bmx_bgfx_set_scissor_cached(cache:Short)
  100. Function bmx_bgfx_set_transform:Int(matrix:Float Ptr, num:Short)
  101. Function bmx_bgfx_alloc_transform:Int(transform:Byte Ptr, num:Short)
  102. Function bmx_bgfx_set_transform_cached(cache:Int, num:Short)
  103. Function bmx_bgfx_set_uniform(uniform:Short, value:Byte Ptr, num:Short)
  104. Function bmx_bgfx_set_index_buffer(indexBuffer:Int, firstIndex:Int, numIndices:Int)
  105. Function bmx_bgfx_set_dynamic_index_buffer(dynamicIndexBuffer:Short, firstIndex:Int, numIndices:Int)
  106. Function bmx_bgfx_set_transient_index_buffer(transientIndexBuffer:Short, firstIndex:Int, numIndices:Int)
  107. Function bmx_bgfx_set_vertex_buffer(stream:Byte, vertexBuffer:Short, startVertex:Int, numVertices:Int)
  108. Function bmx_bgfx_set_dynamic_vertex_buffer(stream:Byte, dynamicVertexBuffer:Short, startVertex:Int, numVertices:Int)
  109. Function bmx_bgfx_set_transient_vertex_buffer(stream:Byte, transientVertexBuffer:Short, startVertex:Int, numVertices:Int)
  110. Function bmx_bgfx_set_vertex_count(numVertices:Int)
  111. Function bmx_bgfx_set_instance_data_buffer(idb:Byte Ptr, start:Int, num:Int)
  112. Function bmx_bgfx_set_instance_data_from_vertex_buffer(vertexBuffer:Short, startVertex:Int, num:Int)
  113. Function bmx_bgfx_set_instance_data_from_dynamic_vertex_buffer(dynamicVertexBuffer:Short, startVertex:Int, num:Int)
  114. Function bmx_bgfx_set_texture(stage:Byte, uniform:Short, texture:Int, flags:Int)
  115. Function bmx_bgfx_touch(id:Short)
  116. Function bmx_bgfx_submit(id:Short, program:Short, depth:Int, preserveState:Int)
  117. Function bmx_bgfx_submit_occlusion_query(id:Short, program:Short, occlusionQuery:Short, depth:Int, preserveState:Int)
  118. Function bmx_bgfx_submit_indirect(id:Short, program:Short, indirectBuffer:Short, start:Short, num:Short, depth:Int, preserveState:Int)
  119. Function bmx_bgfx_set_image(stage:Byte, texture:Short, mip:Byte, access:Int, format:Int)
  120. Function bmx_bgfx_set_compute_index_buffer(stage:Byte, indexBuffer:Short, access:Int)
  121. Function bmx_bgfx_set_compute_vertex_buffer(stage:Byte, vertexBuffer:Short, access:Int)
  122. Function bmx_bgfx_set_compute_dynamic_index_buffer(stage:Byte, dynamicIndexBuffer:Short, access:Int)
  123. Function bmx_bgfx_set_compute_dynamic_vertex_buffer(stage:Byte, dynamicVertexBuffer:Short, access:Int)
  124. Function bmx_bgfx_set_compute_indirect_buffer(stage:Byte, indirectBuffer:Short, access:Int)
  125. Function bmx_bgfx_dispatch(id:Short, program:Short, numX:Int, numY:Int, numZ:Int, flags:Byte)
  126. Function bmx_bgfx_dispatch_indirect(id:Short, program:Short, indirectBuffer:Short, start:Short, num:Short, flags:Byte)
  127. Function bmx_bgfx_discard()
  128. Function bmx_bgfx_blit(id:Short, dstTexture:Short, dstMip:Byte, dstX:Short, dstY:Short, dstZ:Short, srcTexture:Int, srcMip:Byte, srcX:Short, srcY:Short, srcZ:Short, width:Short, height:Short, depth:Short)
  129. Function bgfx_begin:Byte Ptr()
  130. Function bgfx_end(handle:Byte Ptr)
  131. Function bmx_bgfx_encoder_set_marker(handle:Byte Ptr, marker:String)
  132. Function bmx_bgfx_encoder_set_state(handle:Byte Ptr, state:Long, rgba:Int)
  133. Function bmx_bgfx_encoder_set_condition(handle:Byte Ptr, occlusionQuery:Short, visible:Int)
  134. Function bmx_bgfx_encoder_set_stencil(handle:Byte Ptr, fstencil:Int, bstencil:Int)
  135. Function bmx_bgfx_encoder_set_scissor:Short(handle:Byte Ptr, x:Short, y:Short, width:Short, height:Short)
  136. Function bmx_bgfx_encoder_set_scissor_cached(handle:Byte Ptr, cache:Short)
  137. Function bmx_bgfx_encoder_set_transform:Int(handle:Byte Ptr, matrix:Byte Ptr, num:Short)
  138. Function bmx_bgfx_encoder_alloc_transform:Int(handle:Byte Ptr, transform:Byte Ptr, num:Short)
  139. Function bmx_bgfx_encoder_set_transform_cached(handle:Byte Ptr, cache:Int, num:Short)
  140. Function bmx_bgfx_encoder_set_uniform(handle:Byte Ptr, uniform:Short, value:Byte Ptr, num:Short)
  141. Function bmx_bgfx_encoder_set_index_buffer(handle:Byte Ptr, indexBuffer:Int, firstIndex:Int, numIndices:Int)
  142. Function bmx_bgfx_encoder_set_dynamic_index_buffer(handle:Byte Ptr, dynamicIndexBuffer:Short, firstIndex:Int, numIndices:Int)
  143. Function bmx_bgfx_encoder_set_transient_index_buffer(handle:Byte Ptr, transientIndexBuffer:Short, firstIndex:Int, numIndices:Int)
  144. Function bmx_bgfx_encoder_set_vertex_buffer(handle:Byte Ptr, stream:Byte, vertexBuffer:Short, startVertex:Int, numVertices:Int)
  145. Function bmx_bgfx_encoder_set_dynamic_vertex_buffer(handle:Byte Ptr, stream:Byte, dynamicVertexBuffer:Short, startVertex:Int, numVertices:Int)
  146. Function bmx_bgfx_encoder_set_transient_vertex_buffer(handle:Byte Ptr, stream:Byte, transientVertexBuffer:Short, startVertex:Int, numVertices:Int)
  147. Function bmx_bgfx_encoder_set_vertex_count(handle:Byte Ptr, numVertices:Int)
  148. Function bmx_bgfx_encoder_set_instance_data_buffer(handle:Byte Ptr, idb:Byte Ptr, start:Int, num:Int)
  149. Function bmx_bgfx_encoder_set_instance_data_from_vertex_buffer(handle:Byte Ptr, vertexBuffer:Int, startVertex:Int, num:Int)
  150. Function bmx_bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer(handle:Byte Ptr, dynamicVertexBuffer:Int, startVertex:Int, num:Int)
  151. Function bmx_bgfx_encoder_set_texture(handle:Byte Ptr, stage:Byte, uniform:Int, texture:Int, flags:Int)
  152. Function bmx_bgfx_encoder_touch(handle:Byte Ptr, id:Short)
  153. Function bmx_bgfx_encoder_submit(handle:Byte Ptr, id:Short, program:Int, depth:Int, preserveState:Int)
  154. Function bmx_bgfx_encoder_submit_occlusion_query(handle:Byte Ptr, id:Short, program:Int, occlusionQuery:Int, depth:Int, preserveState:Int)
  155. Function bmx_bgfx_encoder_submit_indirect(handle:Byte Ptr, id:Short, program:Int, indirectBuffer:Int, start:Short, num:Short, depth:Int, preserveState:Int)
  156. Function bmx_bgfx_encoder_set_image(handle:Byte Ptr, stage:Byte, texture:Int, mip:Byte, access:Int, format:Int)
  157. Function bmx_bgfx_encoder_set_compute_index_buffer(handle:Byte Ptr, stage:Byte, indexBuffer:Int, access:Int)
  158. Function bmx_bgfx_encoder_set_compute_vertex_buffer(handle:Byte Ptr, stage:Byte, vertexBuffer:Int, access:Int)
  159. Function bmx_bgfx_encoder_set_compute_dynamic_index_buffer(handle:Byte Ptr, stage:Byte, dynamicIndexBuffer:Int, access:Int)
  160. Function bmx_bgfx_encoder_set_compute_dynamic_vertex_buffer(handle:Byte Ptr, stage:Byte, dynamicVertexBuffer:Int, access:Int)
  161. Function bmx_bgfx_encoder_set_compute_indirect_buffer(handle:Byte Ptr, stage:Byte, indirectBuffer:Int, access:Int)
  162. Function bmx_bgfx_encoder_dispatch(handle:Byte Ptr, id:Short, program:Int, numX:Int, numY:Int, numZ:Int, flags:Byte)
  163. Function bmx_bgfx_encoder_dispatch_indirect(handle:Byte Ptr, id:Short, program:Short, indirectBuffer:Int, start:Short, num:Short, flags:Byte)
  164. Function bmx_bgfx_encoder_discard(handle:Byte Ptr)
  165. Function bmx_bgfx_encoder_blit(handle:Byte Ptr, id:Short, dstTexture:Short, dstMip:Byte, dstX:Short, dstY:Short, dstZ:Short, srcTexture:Int, srcMip:Byte, srcX:Short, srcY:Short, srcZ:Short, width:Short, height:Short, depth:Short)
  166. Function bmx_bgfx_capslimits_maxDrawCalls:Int(handle:Byte Ptr)
  167. Function bmx_bgfx_capslimits_maxBlits:Int(handle:Byte Ptr)
  168. Function bmx_bgfx_capslimits_maxTextureSize:Int(handle:Byte Ptr)
  169. Function bmx_bgfx_capslimits_maxTextureLayers:Int(handle:Byte Ptr)
  170. Function bmx_bgfx_capslimits_maxViews:Int(handle:Byte Ptr)
  171. Function bmx_bgfx_capslimits_maxFrameBuffers:Int(handle:Byte Ptr)
  172. Function bmx_bgfx_capslimits_maxFBAttachments:Int(handle:Byte Ptr)
  173. Function bmx_bgfx_capslimits_maxPrograms:Int(handle:Byte Ptr)
  174. Function bmx_bgfx_capslimits_maxShaders:Int(handle:Byte Ptr)
  175. Function bmx_bgfx_capslimits_maxTextures:Int(handle:Byte Ptr)
  176. Function bmx_bgfx_capslimits_maxTextureSamplers:Int(handle:Byte Ptr)
  177. Function bmx_bgfx_capslimits_maxVertexDecls:Int(handle:Byte Ptr)
  178. Function bmx_bgfx_capslimits_maxVertexStreams:Int(handle:Byte Ptr)
  179. Function bmx_bgfx_capslimits_maxIndexBuffers:Int(handle:Byte Ptr)
  180. Function bmx_bgfx_capslimits_maxVertexBuffers:Int(handle:Byte Ptr)
  181. Function bmx_bgfx_capslimits_maxDynamicIndexBuffers:Int(handle:Byte Ptr)
  182. Function bmx_bgfx_capslimits_maxDynamicVertexBuffers:Int(handle:Byte Ptr)
  183. Function bmx_bgfx_capslimits_maxUniforms:Int(handle:Byte Ptr)
  184. Function bmx_bgfx_capslimits_maxOcclusionQueries:Int(handle:Byte Ptr)
  185. Function bmx_bgfx_capslimits_maxEncoders:Int(handle:Byte Ptr)
  186. Function bmx_bgfx_capslimits_transientVbSize:Int(handle:Byte Ptr)
  187. Function bmx_bgfx_capslimits_transientIbSize:Int(handle:Byte Ptr)
  188. Function bmx_bgfx_caps_limits:Byte Ptr(handle:Byte Ptr)
  189. End Extern
  190. Rem
  191. bbdoc: No reset flags.
  192. End Rem
  193. Const BGFX_RESET_NONE:Int = $00000000
  194. Rem
  195. bbdoc: Not supported yet.
  196. End Rem
  197. Const BGFX_RESET_FULLSCREEN:Int = $00000001
  198. Rem
  199. bbdoc: Fullscreen bit shift.
  200. end rem
  201. Const BGFX_RESET_FULLSCREEN_SHIFT:Int = 0
  202. Rem
  203. bbdoc: Fullscreen bit mask.
  204. end rem
  205. Const BGFX_RESET_FULLSCREEN_MASK:Int = $00000001
  206. Rem
  207. bbdoc: Enable 2x MSAA.
  208. end rem
  209. Const BGFX_RESET_MSAA_X2:Int = $00000010
  210. Rem
  211. bbdoc: Enable 4x MSAA.
  212. end rem
  213. Const BGFX_RESET_MSAA_X4:Int = $00000020
  214. Rem
  215. bbdoc: Enable 8x MSAA.
  216. end rem
  217. Const BGFX_RESET_MSAA_X8:Int = $00000030
  218. Rem
  219. bbdoc: Enable 16x MSAA.
  220. end rem
  221. Const BGFX_RESET_MSAA_X16:Int = $00000040
  222. Rem
  223. bbdoc: MSAA mode bit shift.
  224. end rem
  225. Const BGFX_RESET_MSAA_SHIFT:Int = 4
  226. Rem
  227. bbdoc: MSAA mode bit mask.
  228. end rem
  229. Const BGFX_RESET_MSAA_MASK:Int = $00000070
  230. Rem
  231. bbdoc: Enable V-Sync.
  232. end rem
  233. Const BGFX_RESET_VSYNC:Int = $00000080
  234. Rem
  235. bbdoc: Turn on/off max anisotropy.
  236. end rem
  237. Const BGFX_RESET_MAXANISOTROPY:Int = $00000100
  238. Rem
  239. bbdoc: Begin screen capture.
  240. end rem
  241. Const BGFX_RESET_CAPTURE:Int = $00000200
  242. Rem
  243. bbdoc: HMD stereo rendering.
  244. end rem
  245. Const BGFX_RESET_HMD:Int = $00000400
  246. Rem
  247. bbdoc: HMD stereo rendering debug mode.
  248. End Rem
  249. Const BGFX_RESET_HMD_DEBUG:Int = $00000800
  250. Rem
  251. bbdoc: HMD calibration.
  252. End Rem
  253. Const BGFX_RESET_HMD_RECENTER:Int = $00001000
  254. Rem
  255. bbdoc: Flush rendering after submitting To GPU.
  256. End Rem
  257. Const BGFX_RESET_FLUSH_AFTER_RENDER:Int = $00002000
  258. Rem
  259. bbdoc: This flag specifies where flip occurs.
  260. about: Default behavior is that flip occurs before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
  261. End Rem
  262. Const BGFX_RESET_FLIP_AFTER_RENDER:Int = $00004000
  263. Rem
  264. bbdoc: Enable sRGB backbuffer.
  265. End Rem
  266. Const BGFX_RESET_SRGB_BACKBUFFER:Int = $00008000
  267. Rem
  268. bbdoc: Enable HiDPI rendering.
  269. End Rem
  270. Const BGFX_RESET_HIDPI:Int = $00010000
  271. Rem
  272. bbdoc: Enable depth clamp.
  273. End Rem
  274. Const BGFX_RESET_DEPTH_CLAMP:Int = $00020000
  275. Rem
  276. bbdoc: Suspend rendering.
  277. End Rem
  278. Const BGFX_RESET_SUSPEND:Int = $00040000
  279. Const BGFX_CLEAR_NONE:Int = $0000
  280. Const BGFX_CLEAR_COLOR:Int = $0001
  281. Const BGFX_CLEAR_DEPTH:Int = $0002
  282. Const BGFX_CLEAR_STENCIL:Int = $0004
  283. Const BGFX_CLEAR_DISCARD_COLOR_0:Int = $0008
  284. Const BGFX_CLEAR_DISCARD_COLOR_1:Int = $0010
  285. Const BGFX_CLEAR_DISCARD_COLOR_2:Int = $0020
  286. Const BGFX_CLEAR_DISCARD_COLOR_3:Int = $0040
  287. Const BGFX_CLEAR_DISCARD_COLOR_4:Int = $0080
  288. Const BGFX_CLEAR_DISCARD_COLOR_5:Int = $0100
  289. Const BGFX_CLEAR_DISCARD_COLOR_6:Int = $0200
  290. Const BGFX_CLEAR_DISCARD_COLOR_7:Int = $0400
  291. Const BGFX_CLEAR_DISCARD_DEPTH:Int = $0800
  292. Const BGFX_CLEAR_DISCARD_STENCIL:Int = $1000
  293. Const BGFX_CLEAR_DISCARD_COLOR_MASK:Int = BGFX_CLEAR_DISCARD_COLOR_0 | BGFX_CLEAR_DISCARD_COLOR_1 | BGFX_CLEAR_DISCARD_COLOR_2 ..
  294. | BGFX_CLEAR_DISCARD_COLOR_3 | BGFX_CLEAR_DISCARD_COLOR_4 | BGFX_CLEAR_DISCARD_COLOR_5 | BGFX_CLEAR_DISCARD_COLOR_6 ..
  295. | BGFX_CLEAR_DISCARD_COLOR_7
  296. Const BGFX_CLEAR_DISCARD_MASK:Int = BGFX_CLEAR_DISCARD_COLOR_MASK | BGFX_CLEAR_DISCARD_DEPTH | BGFX_CLEAR_DISCARD_STENCIL
  297. Const BGFX_STATE_RGB_WRITE:Long = $0000000000000001:Long
  298. Const BGFX_STATE_ALPHA_WRITE:Long = $0000000000000002:Long
  299. Const BGFX_STATE_DEPTH_WRITE:Long = $0000000000000004:Long
  300. Const BGFX_STATE_DEPTH_TEST_LESS:Long = $0000000000000010:Long
  301. Const BGFX_STATE_DEPTH_TEST_LEQUAL:Long = $0000000000000020:Long
  302. Const BGFX_STATE_DEPTH_TEST_EQUAL:Long = $0000000000000030:Long
  303. Const BGFX_STATE_DEPTH_TEST_GEQUAL:Long = $0000000000000040:Long
  304. Const BGFX_STATE_DEPTH_TEST_GREATER:Long = $0000000000000050:Long
  305. Const BGFX_STATE_DEPTH_TEST_NOTEQUAL:Long = $0000000000000060:Long
  306. Const BGFX_STATE_DEPTH_TEST_NEVER:Long = $0000000000000070:Long
  307. Const BGFX_STATE_DEPTH_TEST_ALWAYS:Long = $0000000000000080:Long
  308. Const BGFX_STATE_DEPTH_TEST_SHIFT:Long = 4
  309. Const BGFX_STATE_DEPTH_TEST_MASK:Long = $00000000000000f0:Long
  310. Const BGFX_STATE_BLEND_ZERO:Long = $0000000000001000:Long
  311. Const BGFX_STATE_BLEND_ONE:Long = $0000000000002000:Long
  312. Const BGFX_STATE_BLEND_SRC_COLOR:Long = $0000000000003000:Long
  313. Const BGFX_STATE_BLEND_INV_SRC_COLOR:Long = $0000000000004000:Long
  314. Const BGFX_STATE_BLEND_SRC_ALPHA:Long = $0000000000005000:Long
  315. Const BGFX_STATE_BLEND_INV_SRC_ALPHA:Long = $0000000000006000:Long
  316. Const BGFX_STATE_BLEND_DST_ALPHA:Long = $0000000000007000:Long
  317. Const BGFX_STATE_BLEND_INV_DST_ALPHA:Long = $0000000000008000:Long
  318. Const BGFX_STATE_BLEND_DST_COLOR:Long = $0000000000009000:Long
  319. Const BGFX_STATE_BLEND_INV_DST_COLOR:Long = $000000000000a000:Long
  320. Const BGFX_STATE_BLEND_SRC_ALPHA_SAT:Long = $000000000000b000:Long
  321. Const BGFX_STATE_BLEND_FACTOR:Long = $000000000000c000:Long
  322. Const BGFX_STATE_BLEND_INV_FACTOR:Long = $000000000000d000:Long
  323. Const BGFX_STATE_BLEND_SHIFT:Long = 12
  324. Const BGFX_STATE_BLEND_MASK:Long = $000000000ffff000:Long
  325. Const BGFX_STATE_BLEND_EQUATION_ADD:Long = $0000000000000000:Long
  326. Const BGFX_STATE_BLEND_EQUATION_SUB:Long = $0000000010000000:Long
  327. Const BGFX_STATE_BLEND_EQUATION_REVSUB:Long = $0000000020000000:Long
  328. Const BGFX_STATE_BLEND_EQUATION_MIN:Long = $0000000030000000:Long
  329. Const BGFX_STATE_BLEND_EQUATION_MAX:Long = $0000000040000000:Long
  330. Const BGFX_STATE_BLEND_EQUATION_SHIFT:Long = 28
  331. Const BGFX_STATE_BLEND_EQUATION_MASK:Long = $00000003f0000000:Long
  332. Const BGFX_STATE_BLEND_INDEPENDENT:Long = $0000000400000000:Long
  333. Const BGFX_STATE_CULL_CW:Long = $0000001000000000:Long
  334. Const BGFX_STATE_CULL_CCW:Long = $0000002000000000:Long
  335. Const BGFX_STATE_CULL_SHIFT:Long = 36
  336. Const BGFX_STATE_CULL_MASK:Long = $0000003000000000:Long
  337. Const BGFX_STATE_ALPHA_REF_SHIFT:Long = 40
  338. Const BGFX_STATE_ALPHA_REF_MASK:Long = $0000ff0000000000:Long
  339. Const BGFX_STATE_PT_TRISTRIP:Long = $0001000000000000:Long
  340. Const BGFX_STATE_PT_LINES:Long = $0002000000000000:Long
  341. Const BGFX_STATE_PT_LINESTRIP:Long = $0003000000000000:Long
  342. Const BGFX_STATE_PT_POINTS:Long = $0004000000000000:Long
  343. Const BGFX_STATE_PT_SHIFT:Long = 48
  344. Const BGFX_STATE_PT_MASK:Long = $0007000000000000:Long
  345. Const BGFX_STATE_POINT_SIZE_SHIFT:Long = 52
  346. Const BGFX_STATE_POINT_SIZE_MASK:Long = $0ff0000000000000:Long
  347. Const BGFX_STATE_MSAA:Long = $1000000000000000:Long
  348. Const BGFX_STATE_RESERVED_MASK:Long = $e000000000000000:Long
  349. Const BGFX_STATE_NONE:Long = $0000000000000000:Long
  350. Const BGFX_STATE_MASK:Long = $ffffffffffffffff:Long
  351. Const BGFX_STATE_DEFAULT:Long = BGFX_STATE_RGB_WRITE | BGFX_STATE_ALPHA_WRITE ..
  352. | BGFX_STATE_DEPTH_TEST_LESS | BGFX_STATE_DEPTH_WRITE | BGFX_STATE_CULL_CW ..
  353. | BGFX_STATE_MSAA
  354. Const BGFX_BUFFER_NONE:Int = $00
  355. Const BGFX_BUFFER_COMPUTE_READ:Int = $01
  356. Const BGFX_BUFFER_COMPUTE_WRITE:Int = $02
  357. Const BGFX_BUFFER_ALLOW_RESIZE:Int = $04
  358. Const BGFX_BUFFER_INDEX32:Int = $08
  359. Const BGFX_BUFFER_COMPUTE_READ_WRITE:Int = BGFX_BUFFER_COMPUTE_READ | BGFX_BUFFER_COMPUTE_WRITE
  360. Const BGFX_TEXTURE_FORMAT_BC1:Int = 0 ' DXT1
  361. Const BGFX_TEXTURE_FORMAT_BC2:Int = 1 ' DXT3
  362. Const BGFX_TEXTURE_FORMAT_BC3:Int = 2 ' DXT5
  363. Const BGFX_TEXTURE_FORMAT_BC4:Int = 3 ' LATC1/ATI1
  364. Const BGFX_TEXTURE_FORMAT_BC5:Int = 4 ' LATC2/ATI2
  365. Const BGFX_TEXTURE_FORMAT_BC6H:Int = 5 ' BC6H
  366. Const BGFX_TEXTURE_FORMAT_BC7:Int = 6 ' BC7
  367. Const BGFX_TEXTURE_FORMAT_ETC1:Int = 7 ' ETC1 RGB8
  368. Const BGFX_TEXTURE_FORMAT_ETC2:Int = 8 ' ETC2 RGB8
  369. Const BGFX_TEXTURE_FORMAT_ETC2A:Int = 9 ' ETC2 RGBA8
  370. Const BGFX_TEXTURE_FORMAT_ETC2A1:Int = 10 ' ETC2 RGB8A1
  371. Const BGFX_TEXTURE_FORMAT_PTC12:Int = 11 ' PVRTC1 RGB 2BPP
  372. Const BGFX_TEXTURE_FORMAT_PTC14:Int = 12 ' PVRTC1 RGB 4BPP
  373. Const BGFX_TEXTURE_FORMAT_PTC12A:Int = 13 ' PVRTC1 RGBA 2BPP
  374. Const BGFX_TEXTURE_FORMAT_PTC14A:Int = 14 ' PVRTC1 RGBA 4BPP
  375. Const BGFX_TEXTURE_FORMAT_PTC22:Int = 15 ' PVRTC2 RGBA 2BPP
  376. Const BGFX_TEXTURE_FORMAT_PTC24:Int = 16 ' PVRTC2 RGBA 4BPP
  377. Const BGFX_TEXTURE_FORMAT_ATC:Int = 17 ' ATC RGB 4BPP
  378. Const BGFX_TEXTURE_FORMAT_ATCE:Int = 18 ' ATCE RGBA 8 BPP explicit alpha
  379. Const BGFX_TEXTURE_FORMAT_ATCI:Int = 19 ' ATCI RGBA 8 BPP interpolated alpha
  380. Const BGFX_TEXTURE_FORMAT_ASTC4x4:Int = 20 ' ASTC 4x4 8.0 BPP
  381. Const BGFX_TEXTURE_FORMAT_ASTC5x5:Int = 21 ' ASTC 5x5 5.12 BPP
  382. Const BGFX_TEXTURE_FORMAT_ASTC6x6:Int = 22 ' ASTC 6x6 3.56 BPP
  383. Const BGFX_TEXTURE_FORMAT_ASTC8x5:Int = 23 ' ASTC 8x5 3.20 BPP
  384. Const BGFX_TEXTURE_FORMAT_ASTC8x6:Int = 24 ' ASTC 8x6 2.67 BPP
  385. Const BGFX_TEXTURE_FORMAT_ASTC10x5:Int = 25 ' ASTC 10x5 2.56 BPP
  386. Const BGFX_TEXTURE_FORMAT_UNKNOWN:Int = 26 ' Compressed formats above.
  387. Const BGFX_TEXTURE_FORMAT_R1:Int = 27
  388. Const BGFX_TEXTURE_FORMAT_A8:Int = 28
  389. Const BGFX_TEXTURE_FORMAT_R8:Int = 29
  390. Const BGFX_TEXTURE_FORMAT_R8I:Int = 30
  391. Const BGFX_TEXTURE_FORMAT_R8U:Int = 31
  392. Const BGFX_TEXTURE_FORMAT_R8S:Int = 32
  393. Const BGFX_TEXTURE_FORMAT_R16:Int = 33
  394. Const BGFX_TEXTURE_FORMAT_R16I:Int = 34
  395. Const BGFX_TEXTURE_FORMAT_R16U:Int = 35
  396. Const BGFX_TEXTURE_FORMAT_R16F:Int = 36
  397. Const BGFX_TEXTURE_FORMAT_R16S:Int = 37
  398. Const BGFX_TEXTURE_FORMAT_R32I:Int = 38
  399. Const BGFX_TEXTURE_FORMAT_R32U:Int = 39
  400. Const BGFX_TEXTURE_FORMAT_R32F:Int = 40
  401. Const BGFX_TEXTURE_FORMAT_RG8:Int = 41
  402. Const BGFX_TEXTURE_FORMAT_RG8I:Int = 42
  403. Const BGFX_TEXTURE_FORMAT_RG8U:Int = 43
  404. Const BGFX_TEXTURE_FORMAT_RG8S:Int = 44
  405. Const BGFX_TEXTURE_FORMAT_RG16:Int = 45
  406. Const BGFX_TEXTURE_FORMAT_RG16I:Int = 46
  407. Const BGFX_TEXTURE_FORMAT_RG16U:Int = 47
  408. Const BGFX_TEXTURE_FORMAT_RG16F:Int = 48
  409. Const BGFX_TEXTURE_FORMAT_RG16S:Int = 49
  410. Const BGFX_TEXTURE_FORMAT_RG32I:Int = 50
  411. Const BGFX_TEXTURE_FORMAT_RG32U:Int = 51
  412. Const BGFX_TEXTURE_FORMAT_RG32F:Int = 52
  413. Const BGFX_TEXTURE_FORMAT_RGB8:Int = 53
  414. Const BGFX_TEXTURE_FORMAT_RGB8I:Int = 54
  415. Const BGFX_TEXTURE_FORMAT_RGB8U:Int = 55
  416. Const BGFX_TEXTURE_FORMAT_RGB8S:Int = 56
  417. Const BGFX_TEXTURE_FORMAT_RGB9E5F:Int = 57
  418. Const BGFX_TEXTURE_FORMAT_BGRA8:Int = 58
  419. Const BGFX_TEXTURE_FORMAT_RGBA8:Int = 59
  420. Const BGFX_TEXTURE_FORMAT_RGBA8I:Int = 60
  421. Const BGFX_TEXTURE_FORMAT_RGBA8U:Int = 61
  422. Const BGFX_TEXTURE_FORMAT_RGBA8S:Int = 62
  423. Const BGFX_TEXTURE_FORMAT_RGBA16:Int = 63
  424. Const BGFX_TEXTURE_FORMAT_RGBA16I:Int = 64
  425. Const BGFX_TEXTURE_FORMAT_RGBA16U:Int = 65
  426. Const BGFX_TEXTURE_FORMAT_RGBA16F:Int = 66
  427. Const BGFX_TEXTURE_FORMAT_RGBA16S:Int = 67
  428. Const BGFX_TEXTURE_FORMAT_RGBA32I:Int = 68
  429. Const BGFX_TEXTURE_FORMAT_RGBA32U:Int = 69
  430. Const BGFX_TEXTURE_FORMAT_RGBA32F:Int = 70
  431. Const BGFX_TEXTURE_FORMAT_R5G6B5:Int = 71
  432. Const BGFX_TEXTURE_FORMAT_RGBA4:Int = 72
  433. Const BGFX_TEXTURE_FORMAT_RGB5A1:Int = 73
  434. Const BGFX_TEXTURE_FORMAT_RGB10A2:Int = 74
  435. Const BGFX_TEXTURE_FORMAT_RG11B10F:Int = 75
  436. Const BGFX_TEXTURE_FORMAT_UNKNOWNDEPTH:Int = 76 ' Depth formats below.
  437. Const BGFX_TEXTURE_FORMAT_D16:Int = 77
  438. Const BGFX_TEXTURE_FORMAT_D24:Int = 78
  439. Const BGFX_TEXTURE_FORMAT_D24S8:Int = 79
  440. Const BGFX_TEXTURE_FORMAT_D32:Int = 80
  441. Const BGFX_TEXTURE_FORMAT_D16F:Int = 81
  442. Const BGFX_TEXTURE_FORMAT_D24F:Int = 82
  443. Const BGFX_TEXTURE_FORMAT_D32F:Int = 83
  444. Const BGFX_TEXTURE_FORMAT_D0S8:Int = 84
  445. Const BGFX_TEXTURE_FORMAT_COUNT:Int = 85
  446. Const BGFX_ATTRIB_POSITION:Int = 0
  447. Const BGFX_ATTRIB_NORMAL:Int = 1
  448. Const BGFX_ATTRIB_TANGENT:Int = 2
  449. Const BGFX_ATTRIB_BITANGENT:Int = 3
  450. Const BGFX_ATTRIB_COLOR0:Int = 4
  451. Const BGFX_ATTRIB_COLOR1:Int = 5
  452. Const BGFX_ATTRIB_COLOR2:Int = 6
  453. Const BGFX_ATTRIB_COLOR3:Int = 7
  454. Const BGFX_ATTRIB_INDICES:Int = 8
  455. Const BGFX_ATTRIB_WEIGHT:Int = 9
  456. Const BGFX_ATTRIB_TEXCOORD0:Int = 10
  457. Const BGFX_ATTRIB_TEXCOORD1:Int = 11
  458. Const BGFX_ATTRIB_TEXCOORD2:Int = 12
  459. Const BGFX_ATTRIB_TEXCOORD3:Int = 13
  460. Const BGFX_ATTRIB_TEXCOORD4:Int = 14
  461. Const BGFX_ATTRIB_TEXCOORD5:Int = 15
  462. Const BGFX_ATTRIB_TEXCOORD6:Int = 16
  463. Const BGFX_ATTRIB_TEXCOORD7:Int = 17
  464. Const BGFX_RENDERER_TYPE_NOOP:Int = 0
  465. Const BGFX_RENDERER_TYPE_DIRECT3D9:Int = 1
  466. Const BGFX_RENDERER_TYPE_DIRECT3D11:Int = 2
  467. Const BGFX_RENDERER_TYPE_DIRECT3D12:Int = 3
  468. Const BGFX_RENDERER_TYPE_GNM:Int = 4
  469. Const BGFX_RENDERER_TYPE_METAL:Int = 5
  470. Const BGFX_RENDERER_TYPE_OPENGLES:Int = 6
  471. Const BGFX_RENDERER_TYPE_OPENGL:Int = 7
  472. Const BGFX_RENDERER_TYPE_VULKAN:Int = 8
  473. Const BGFX_RENDERER_TYPE_COUNT:Int = 9
  474. Const BGFX_STENCIL_NONE:Int = $00000000
  475. Const BGFX_STENCIL_MASK:Int = $FFFFFFFF
  476. Const BGFX_STENCIL_DEFAULT:Int = $00000000
  477. Rem
  478. bbdoc: Default sort order.
  479. End Rem
  480. Const BGFX_VIEW_MODE_DEFAULT:Int = 0
  481. Rem
  482. bbdoc: Sort in the same order in which submit calls were called.
  483. End Rem
  484. Const BGFX_VIEW_MODE_SEQUENTIAL:Int = 1
  485. Rem
  486. bbdoc: Sort draw call depth in ascending order.
  487. End Rem
  488. Const BGFX_VIEW_MODE_DEPTH_ASCENDING:Int = 2
  489. Rem
  490. bbdoc: Sort draw call depth in descending order.
  491. End Rem
  492. Const BGFX_VIEW_MODE_DEPTH_DESCENDING:Int = 3
  493. Rem
  494. bbdoc: Alpha to coverage is supported.
  495. End Rem
  496. Const BGFX_CAPS_ALPHA_TO_COVERAGE:Long = $0000000000000001:Long
  497. Rem
  498. bbdoc: Blend independent is supported.
  499. End Rem
  500. Const BGFX_CAPS_BLEND_INDEPENDENT:Long = $0000000000000002:Long
  501. Rem
  502. bbdoc: Compute shaders are supported.
  503. End Rem
  504. Const BGFX_CAPS_COMPUTE:Long = $0000000000000004:Long
  505. Rem
  506. bbdoc: Conservative rasterization is supported.
  507. End Rem
  508. Const BGFX_CAPS_CONSERVATIVE_RASTER:Long = $0000000000000008:Long
  509. Rem
  510. bbdoc: Draw indirect is supported.
  511. End Rem
  512. Const BGFX_CAPS_DRAW_INDIRECT:Long = $0000000000000010:Long
  513. Rem
  514. bbdoc: Fragment depth is accessible in fragment shader.
  515. End Rem
  516. Const BGFX_CAPS_FRAGMENT_DEPTH:Long = $0000000000000020:Long
  517. Rem
  518. bbdoc: Fragment ordering is available in fragment shader.
  519. End Rem
  520. Const BGFX_CAPS_FRAGMENT_ORDERING:Long = $0000000000000040:Long
  521. Rem
  522. bbdoc: Graphics debugger is present.
  523. End Rem
  524. Const BGFX_CAPS_GRAPHICS_DEBUGGER:Long = $0000000000000080:Long
  525. Rem
  526. bbdoc: HiDPI rendering is supported.
  527. End Rem
  528. Const BGFX_CAPS_HIDPI:Long = $0000000000000100:Long
  529. Rem
  530. bbdoc: Head Mounted Display is available.
  531. End Rem
  532. Const BGFX_CAPS_HMD:Long = $0000000000000200:Long
  533. Rem
  534. bbdoc: 32-bit indices are supported.
  535. End Rem
  536. Const BGFX_CAPS_INDEX32:Long = $0000000000000400:Long
  537. Rem
  538. bbdoc: Instancing is supported.
  539. End Rem
  540. Const BGFX_CAPS_INSTANCING:Long = $0000000000000800:Long
  541. Rem
  542. bbdoc: Occlusion query is supported.
  543. End Rem
  544. Const BGFX_CAPS_OCCLUSION_QUERY:Long = $0000000000001000:Long
  545. Rem
  546. bbdoc: Renderer is on separate thread.
  547. End Rem
  548. Const BGFX_CAPS_RENDERER_MULTITHREADED:Long = $0000000000002000:Long
  549. Rem
  550. bbdoc: Multiple windows are supported.
  551. End Rem
  552. Const BGFX_CAPS_SWAP_CHAIN:Long = $0000000000004000:Long
  553. Rem
  554. bbdoc: 2D texture array is supported.
  555. End Rem
  556. Const BGFX_CAPS_TEXTURE_2D_ARRAY:Long = $0000000000008000:Long
  557. Rem
  558. bbdoc: 3D textures are supported.
  559. End Rem
  560. Const BGFX_CAPS_TEXTURE_3D:Long = $0000000000010000:Long
  561. Rem
  562. bbdoc: Texture blit is supported.
  563. End Rem
  564. Const BGFX_CAPS_TEXTURE_BLIT:Long = $0000000000020000:Long
  565. Rem
  566. bbdoc: All texture compare modes are supported.
  567. End Rem
  568. Const BGFX_CAPS_TEXTURE_COMPARE_ALL:Long = $00000000000c0000:Long
  569. Rem
  570. bbdoc: Texture compare less equal mode is supported.
  571. End Rem
  572. Const BGFX_CAPS_TEXTURE_COMPARE_LEQUAL:Long = $0000000000080000:Long
  573. Rem
  574. bbdoc: Cubemap texture array is supported.
  575. End Rem
  576. Const BGFX_CAPS_TEXTURE_CUBE_ARRAY:Long = $0000000000100000:Long
  577. Rem
  578. bbdoc: CPU direct access to GPU texture memory.
  579. End Rem
  580. Const BGFX_CAPS_TEXTURE_DIRECT_ACCESS:Long = $0000000000200000:Long
  581. Rem
  582. bbdoc: Read-back texture is supported.
  583. End Rem
  584. Const BGFX_CAPS_TEXTURE_READ_BACK:Long = $0000000000400000:Long
  585. Rem
  586. bbdoc: Vertex attribute half-float is supported.
  587. End Rem
  588. Const BGFX_CAPS_VERTEX_ATTRIB_HALF:Long = $0000000000800000:Long
  589. Rem
  590. bbdoc: Vertex attribute 10_10_10_2 is supported.
  591. End Rem
  592. Const BGFX_CAPS_VERTEX_ATTRIB_UINT10:Long = $0000000000800000:Long
  593. Rem
  594. bbdoc: Rendering with VertexID only is supported.
  595. End Rem
  596. Const BGFX_CAPS_VERTEX_ID:Long = $0000000001000000:Long