pyedge 3.0.0__tar.gz

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 (353) hide show
  1. pyedge-3.0.0/.clang-tidy +18 -0
  2. pyedge-3.0.0/.gitignore +10 -0
  3. pyedge-3.0.0/CHANGELOG.md +8 -0
  4. pyedge-3.0.0/CMakeLists.txt +607 -0
  5. pyedge-3.0.0/CONTRIBUTING.md +7 -0
  6. pyedge-3.0.0/LICENSE.md +21 -0
  7. pyedge-3.0.0/PKG-INFO +159 -0
  8. pyedge-3.0.0/README.md +128 -0
  9. pyedge-3.0.0/SECURITY.md +9 -0
  10. pyedge-3.0.0/THIRD_PARTY.md +25 -0
  11. pyedge-3.0.0/conanfile.py +107 -0
  12. pyedge-3.0.0/etc/cmake/DiscoverBoostTests.cmake +49 -0
  13. pyedge-3.0.0/etc/cmake/EdgeGles.cmake +65 -0
  14. pyedge-3.0.0/etc/cmake/EdgeMetal.cmake +64 -0
  15. pyedge-3.0.0/etc/cmake/EdgeModels.cmake +79 -0
  16. pyedge-3.0.0/etc/cmake/EdgeRuntime.cmake +60 -0
  17. pyedge-3.0.0/etc/cmake/EdgeShaders.cmake +63 -0
  18. pyedge-3.0.0/etc/cmake/edgeConfig.cmake.in +84 -0
  19. pyedge-3.0.0/etc/cmake/edge_convert_model.cmake +67 -0
  20. pyedge-3.0.0/etc/cmake/edge_pipeline.cmake +37 -0
  21. pyedge-3.0.0/etc/patches/fastgltf-0.9.0-scenes-without-nodes.patch +19 -0
  22. pyedge-3.0.0/include/edge/animated_mesh.h +1 -0
  23. pyedge-3.0.0/include/edge/animated_mesh_cache.h +1 -0
  24. pyedge-3.0.0/include/edge/animated_model.h +1 -0
  25. pyedge-3.0.0/include/edge/animation.h +1 -0
  26. pyedge-3.0.0/include/edge/buffer_usage.h +1 -0
  27. pyedge-3.0.0/include/edge/bundled_runtime.h +1 -0
  28. pyedge-3.0.0/include/edge/camera.h +1 -0
  29. pyedge-3.0.0/include/edge/debug_lines.h +1 -0
  30. pyedge-3.0.0/include/edge/draw_call.h +1 -0
  31. pyedge-3.0.0/include/edge/dynamic_mesh.h +1 -0
  32. pyedge-3.0.0/include/edge/font.h +1 -0
  33. pyedge-3.0.0/include/edge/forward.h +1 -0
  34. pyedge-3.0.0/include/edge/frame_presenter.h +1 -0
  35. pyedge-3.0.0/include/edge/fullscreen_copy.h +1 -0
  36. pyedge-3.0.0/include/edge/generic_vertex.h +1 -0
  37. pyedge-3.0.0/include/edge/gles_context.h +1 -0
  38. pyedge-3.0.0/include/edge/gles_renderer.h +1 -0
  39. pyedge-3.0.0/include/edge/gles_sdl_context.h +1 -0
  40. pyedge-3.0.0/include/edge/gltf_loader.h +1 -0
  41. pyedge-3.0.0/include/edge/gpu_timer.h +1 -0
  42. pyedge-3.0.0/include/edge/image.h +1 -0
  43. pyedge-3.0.0/include/edge/image_compress.h +1 -0
  44. pyedge-3.0.0/include/edge/image_mips.h +1 -0
  45. pyedge-3.0.0/include/edge/imgui_renderer.h +1 -0
  46. pyedge-3.0.0/include/edge/index.h +1 -0
  47. pyedge-3.0.0/include/edge/index_array.h +1 -0
  48. pyedge-3.0.0/include/edge/index_buffer.h +1 -0
  49. pyedge-3.0.0/include/edge/joint.h +1 -0
  50. pyedge-3.0.0/include/edge/load_model.h +1 -0
  51. pyedge-3.0.0/include/edge/lod_choice.h +1 -0
  52. pyedge-3.0.0/include/edge/log.h +1 -0
  53. pyedge-3.0.0/include/edge/mapping.h +1 -0
  54. pyedge-3.0.0/include/edge/material.h +1 -0
  55. pyedge-3.0.0/include/edge/mesh.h +1 -0
  56. pyedge-3.0.0/include/edge/mesh_builder.h +1 -0
  57. pyedge-3.0.0/include/edge/mesh_lod.h +1 -0
  58. pyedge-3.0.0/include/edge/mesh_tiles.h +1 -0
  59. pyedge-3.0.0/include/edge/metal_context.h +1 -0
  60. pyedge-3.0.0/include/edge/metal_renderer.h +1 -0
  61. pyedge-3.0.0/include/edge/metal_sdl_surface.h +1 -0
  62. pyedge-3.0.0/include/edge/model.h +1 -0
  63. pyedge-3.0.0/include/edge/model_atlas.h +1 -0
  64. pyedge-3.0.0/include/edge/model_builder.h +1 -0
  65. pyedge-3.0.0/include/edge/model_cache.h +1 -0
  66. pyedge-3.0.0/include/edge/model_convert.h +1 -0
  67. pyedge-3.0.0/include/edge/model_textures.h +1 -0
  68. pyedge-3.0.0/include/edge/motion.h +1 -0
  69. pyedge-3.0.0/include/edge/null_renderer.h +1 -0
  70. pyedge-3.0.0/include/edge/pipeline.h +1 -0
  71. pyedge-3.0.0/include/edge/pixel.h +1 -0
  72. pyedge-3.0.0/include/edge/render_target.h +1 -0
  73. pyedge-3.0.0/include/edge/renderer.h +1 -0
  74. pyedge-3.0.0/include/edge/sampler.h +1 -0
  75. pyedge-3.0.0/include/edge/scheduler.h +1 -0
  76. pyedge-3.0.0/include/edge/serialized_model.h +1 -0
  77. pyedge-3.0.0/include/edge/shader_dirs.h +1 -0
  78. pyedge-3.0.0/include/edge/shader_interface.h +1 -0
  79. pyedge-3.0.0/include/edge/shader_program.h +1 -0
  80. pyedge-3.0.0/include/edge/static_mesh.h +1 -0
  81. pyedge-3.0.0/include/edge/static_model.h +1 -0
  82. pyedge-3.0.0/include/edge/tangent_space.h +1 -0
  83. pyedge-3.0.0/include/edge/texture.h +1 -0
  84. pyedge-3.0.0/include/edge/texture_io.h +1 -0
  85. pyedge-3.0.0/include/edge/tolerance.h +1 -0
  86. pyedge-3.0.0/include/edge/triangle_iterator.h +1 -0
  87. pyedge-3.0.0/include/edge/uber_draw_call.h +1 -0
  88. pyedge-3.0.0/include/edge/vertex.h +1 -0
  89. pyedge-3.0.0/include/edge/vertex_array.h +1 -0
  90. pyedge-3.0.0/include/edge/vertex_buffer.h +1 -0
  91. pyedge-3.0.0/include/edge/vertex_traits.h +1 -0
  92. pyedge-3.0.0/include/edge/vulkan_device_info.h +1 -0
  93. pyedge-3.0.0/include/edge/vulkan_instance.h +1 -0
  94. pyedge-3.0.0/include/edge/vulkan_renderer.h +1 -0
  95. pyedge-3.0.0/include/edge/vulkan_sdl_surface.h +1 -0
  96. pyedge-3.0.0/include/edge/weights_sampler.h +1 -0
  97. pyedge-3.0.0/ports/edge/portfile.cmake +62 -0
  98. pyedge-3.0.0/ports/edge/usage +7 -0
  99. pyedge-3.0.0/ports/edge/vcpkg.json +57 -0
  100. pyedge-3.0.0/pyedge/__init__.py +168 -0
  101. pyedge-3.0.0/pyproject.toml +89 -0
  102. pyedge-3.0.0/requirements.txt +1 -0
  103. pyedge-3.0.0/requirements_tools.txt +6 -0
  104. pyedge-3.0.0/src/CMakeLists.txt +571 -0
  105. pyedge-3.0.0/src/animated_mesh.cc +462 -0
  106. pyedge-3.0.0/src/animated_mesh.h +128 -0
  107. pyedge-3.0.0/src/animated_mesh_cache.cc +59 -0
  108. pyedge-3.0.0/src/animated_mesh_cache.h +64 -0
  109. pyedge-3.0.0/src/animated_model.cc +141 -0
  110. pyedge-3.0.0/src/animated_model.h +42 -0
  111. pyedge-3.0.0/src/animation.cc +25 -0
  112. pyedge-3.0.0/src/animation.h +58 -0
  113. pyedge-3.0.0/src/bind_animation.cc +22 -0
  114. pyedge-3.0.0/src/bind_camera.cc +66 -0
  115. pyedge-3.0.0/src/bind_draw_call.cc +201 -0
  116. pyedge-3.0.0/src/bind_lod.cc +30 -0
  117. pyedge-3.0.0/src/bind_log.cc +34 -0
  118. pyedge-3.0.0/src/bind_material.cc +145 -0
  119. pyedge-3.0.0/src/bind_mesh_builder.cc +193 -0
  120. pyedge-3.0.0/src/bind_model.cc +338 -0
  121. pyedge-3.0.0/src/bind_renderer.cc +495 -0
  122. pyedge-3.0.0/src/bind_shader_program.cc +19 -0
  123. pyedge-3.0.0/src/bind_texture.cc +216 -0
  124. pyedge-3.0.0/src/buffer_usage.h +16 -0
  125. pyedge-3.0.0/src/bundled_runtime.cc +28 -0
  126. pyedge-3.0.0/src/bundled_runtime.h +17 -0
  127. pyedge-3.0.0/src/camera.cc +110 -0
  128. pyedge-3.0.0/src/camera.h +175 -0
  129. pyedge-3.0.0/src/copy_fragment.glsl +21 -0
  130. pyedge-3.0.0/src/copy_vertex.glsl +20 -0
  131. pyedge-3.0.0/src/debug_lines.cc +159 -0
  132. pyedge-3.0.0/src/debug_lines.h +68 -0
  133. pyedge-3.0.0/src/draw_call.cc +285 -0
  134. pyedge-3.0.0/src/draw_call.h +174 -0
  135. pyedge-3.0.0/src/dynamic_mesh.cc +90 -0
  136. pyedge-3.0.0/src/dynamic_mesh.h +64 -0
  137. pyedge-3.0.0/src/edge.glsl +116 -0
  138. pyedge-3.0.0/src/edge_brdf.glsl +64 -0
  139. pyedge-3.0.0/src/edge_cube.glsl +33 -0
  140. pyedge-3.0.0/src/edge_instance.glsl +29 -0
  141. pyedge-3.0.0/src/edge_material.glsl +70 -0
  142. pyedge-3.0.0/src/edge_motion.glsl +69 -0
  143. pyedge-3.0.0/src/edge_skin.glsl +34 -0
  144. pyedge-3.0.0/src/font.cc +255 -0
  145. pyedge-3.0.0/src/font.h +78 -0
  146. pyedge-3.0.0/src/forward.h +53 -0
  147. pyedge-3.0.0/src/fragment.glsl +58 -0
  148. pyedge-3.0.0/src/frame_presenter.cc +89 -0
  149. pyedge-3.0.0/src/frame_presenter.h +42 -0
  150. pyedge-3.0.0/src/fullscreen_copy.cc +59 -0
  151. pyedge-3.0.0/src/fullscreen_copy.h +30 -0
  152. pyedge-3.0.0/src/generic_vertex.h +56 -0
  153. pyedge-3.0.0/src/gles_buffer.cc +59 -0
  154. pyedge-3.0.0/src/gles_buffer.h +87 -0
  155. pyedge-3.0.0/src/gles_context.cc +63 -0
  156. pyedge-3.0.0/src/gles_context.h +63 -0
  157. pyedge-3.0.0/src/gles_draw.cc +210 -0
  158. pyedge-3.0.0/src/gles_gpu_timer.cc +230 -0
  159. pyedge-3.0.0/src/gles_gpu_timer.h +70 -0
  160. pyedge-3.0.0/src/gles_render_target.cc +127 -0
  161. pyedge-3.0.0/src/gles_render_target.h +53 -0
  162. pyedge-3.0.0/src/gles_renderer.cc +668 -0
  163. pyedge-3.0.0/src/gles_renderer.h +183 -0
  164. pyedge-3.0.0/src/gles_sdl_context.cc +89 -0
  165. pyedge-3.0.0/src/gles_sdl_context.h +42 -0
  166. pyedge-3.0.0/src/gles_texture.cc +314 -0
  167. pyedge-3.0.0/src/gles_texture.h +68 -0
  168. pyedge-3.0.0/src/gltf_animation.cc +812 -0
  169. pyedge-3.0.0/src/gltf_loader.cc +28 -0
  170. pyedge-3.0.0/src/gltf_loader.h +77 -0
  171. pyedge-3.0.0/src/gltf_materials.cc +408 -0
  172. pyedge-3.0.0/src/gltf_meshes.cc +631 -0
  173. pyedge-3.0.0/src/gltf_reader.cc +425 -0
  174. pyedge-3.0.0/src/gltf_reader.h +201 -0
  175. pyedge-3.0.0/src/gpu_timer.cc +84 -0
  176. pyedge-3.0.0/src/gpu_timer.h +76 -0
  177. pyedge-3.0.0/src/image.cc +188 -0
  178. pyedge-3.0.0/src/image.h +233 -0
  179. pyedge-3.0.0/src/image_compress.cc +128 -0
  180. pyedge-3.0.0/src/image_compress.h +46 -0
  181. pyedge-3.0.0/src/image_mips.cc +289 -0
  182. pyedge-3.0.0/src/image_mips.h +72 -0
  183. pyedge-3.0.0/src/imgui_renderer.cc +295 -0
  184. pyedge-3.0.0/src/imgui_renderer.h +83 -0
  185. pyedge-3.0.0/src/index.h +19 -0
  186. pyedge-3.0.0/src/index_array.cc +10 -0
  187. pyedge-3.0.0/src/index_array.h +40 -0
  188. pyedge-3.0.0/src/index_buffer.cc +12 -0
  189. pyedge-3.0.0/src/index_buffer.h +44 -0
  190. pyedge-3.0.0/src/joint.h +68 -0
  191. pyedge-3.0.0/src/load_model.cc +87 -0
  192. pyedge-3.0.0/src/load_model.h +22 -0
  193. pyedge-3.0.0/src/lod_choice.cc +87 -0
  194. pyedge-3.0.0/src/lod_choice.h +42 -0
  195. pyedge-3.0.0/src/log.cc +98 -0
  196. pyedge-3.0.0/src/log.h +42 -0
  197. pyedge-3.0.0/src/mapping.cc +28 -0
  198. pyedge-3.0.0/src/mapping.h +121 -0
  199. pyedge-3.0.0/src/material.cc +176 -0
  200. pyedge-3.0.0/src/material.h +187 -0
  201. pyedge-3.0.0/src/mesh.cc +93 -0
  202. pyedge-3.0.0/src/mesh.h +199 -0
  203. pyedge-3.0.0/src/mesh_builder.cc +432 -0
  204. pyedge-3.0.0/src/mesh_builder.h +82 -0
  205. pyedge-3.0.0/src/mesh_lod.cc +282 -0
  206. pyedge-3.0.0/src/mesh_lod.h +39 -0
  207. pyedge-3.0.0/src/mesh_tiles.cc +150 -0
  208. pyedge-3.0.0/src/mesh_tiles.h +23 -0
  209. pyedge-3.0.0/src/metal_buffer.h +91 -0
  210. pyedge-3.0.0/src/metal_buffer.mm +80 -0
  211. pyedge-3.0.0/src/metal_context.h +66 -0
  212. pyedge-3.0.0/src/metal_context.mm +92 -0
  213. pyedge-3.0.0/src/metal_draw.mm +369 -0
  214. pyedge-3.0.0/src/metal_gpu_timer.h +48 -0
  215. pyedge-3.0.0/src/metal_gpu_timer.mm +201 -0
  216. pyedge-3.0.0/src/metal_impl.h +55 -0
  217. pyedge-3.0.0/src/metal_render_target.h +43 -0
  218. pyedge-3.0.0/src/metal_render_target.mm +57 -0
  219. pyedge-3.0.0/src/metal_renderer.h +104 -0
  220. pyedge-3.0.0/src/metal_renderer.mm +560 -0
  221. pyedge-3.0.0/src/metal_renderer_impl.h +104 -0
  222. pyedge-3.0.0/src/metal_sdl_surface.h +36 -0
  223. pyedge-3.0.0/src/metal_sdl_surface.mm +40 -0
  224. pyedge-3.0.0/src/metal_texture.h +68 -0
  225. pyedge-3.0.0/src/metal_texture.mm +223 -0
  226. pyedge-3.0.0/src/model.cc +952 -0
  227. pyedge-3.0.0/src/model.h +244 -0
  228. pyedge-3.0.0/src/model_atlas.cc +281 -0
  229. pyedge-3.0.0/src/model_atlas.h +55 -0
  230. pyedge-3.0.0/src/model_atlas_common.cc +179 -0
  231. pyedge-3.0.0/src/model_atlas_common.h +71 -0
  232. pyedge-3.0.0/src/model_atlas_xatlas.cc +448 -0
  233. pyedge-3.0.0/src/model_atlas_xatlas.h +18 -0
  234. pyedge-3.0.0/src/model_builder.cc +107 -0
  235. pyedge-3.0.0/src/model_builder.h +45 -0
  236. pyedge-3.0.0/src/model_cache.cc +48 -0
  237. pyedge-3.0.0/src/model_cache.h +84 -0
  238. pyedge-3.0.0/src/model_convert.cc +166 -0
  239. pyedge-3.0.0/src/model_convert.h +70 -0
  240. pyedge-3.0.0/src/model_textures.cc +223 -0
  241. pyedge-3.0.0/src/model_textures.h +30 -0
  242. pyedge-3.0.0/src/motion.cc +67 -0
  243. pyedge-3.0.0/src/motion.h +63 -0
  244. pyedge-3.0.0/src/null_index_buffer.cc +24 -0
  245. pyedge-3.0.0/src/null_index_buffer.h +33 -0
  246. pyedge-3.0.0/src/null_render_target.cc +22 -0
  247. pyedge-3.0.0/src/null_render_target.h +29 -0
  248. pyedge-3.0.0/src/null_renderer.cc +127 -0
  249. pyedge-3.0.0/src/null_renderer.h +59 -0
  250. pyedge-3.0.0/src/null_texture.cc +56 -0
  251. pyedge-3.0.0/src/null_texture.h +38 -0
  252. pyedge-3.0.0/src/null_vertex_buffer.cc +25 -0
  253. pyedge-3.0.0/src/null_vertex_buffer.h +33 -0
  254. pyedge-3.0.0/src/pipeline.h +15 -0
  255. pyedge-3.0.0/src/pixel.cc +78 -0
  256. pyedge-3.0.0/src/pixel.h +92 -0
  257. pyedge-3.0.0/src/python_bindings.cc +28 -0
  258. pyedge-3.0.0/src/python_bindings.h +76 -0
  259. pyedge-3.0.0/src/render_target.cc +67 -0
  260. pyedge-3.0.0/src/render_target.h +114 -0
  261. pyedge-3.0.0/src/renderer.cc +338 -0
  262. pyedge-3.0.0/src/renderer.h +286 -0
  263. pyedge-3.0.0/src/sampler.cc +62 -0
  264. pyedge-3.0.0/src/sampler.h +73 -0
  265. pyedge-3.0.0/src/scheduler.cc +90 -0
  266. pyedge-3.0.0/src/scheduler.h +72 -0
  267. pyedge-3.0.0/src/serialized_model.cc +280 -0
  268. pyedge-3.0.0/src/serialized_model.h +428 -0
  269. pyedge-3.0.0/src/shader_dirs.cc +214 -0
  270. pyedge-3.0.0/src/shader_dirs.h +58 -0
  271. pyedge-3.0.0/src/shader_interface.cc +119 -0
  272. pyedge-3.0.0/src/shader_interface.h +103 -0
  273. pyedge-3.0.0/src/shader_program.cc +18 -0
  274. pyedge-3.0.0/src/shader_program.h +26 -0
  275. pyedge-3.0.0/src/static_mesh.cc +520 -0
  276. pyedge-3.0.0/src/static_mesh.h +112 -0
  277. pyedge-3.0.0/src/static_model.cc +29 -0
  278. pyedge-3.0.0/src/static_model.h +30 -0
  279. pyedge-3.0.0/src/stb_impl.cc +11 -0
  280. pyedge-3.0.0/src/tangent_space.cc +126 -0
  281. pyedge-3.0.0/src/tangent_space.h +22 -0
  282. pyedge-3.0.0/src/texture.cc +267 -0
  283. pyedge-3.0.0/src/texture.h +175 -0
  284. pyedge-3.0.0/src/texture_io.cc +290 -0
  285. pyedge-3.0.0/src/texture_io.h +60 -0
  286. pyedge-3.0.0/src/tolerance.h +18 -0
  287. pyedge-3.0.0/src/triangle_iterator.h +137 -0
  288. pyedge-3.0.0/src/uber_draw_call.cc +60 -0
  289. pyedge-3.0.0/src/uber_draw_call.h +38 -0
  290. pyedge-3.0.0/src/ui_fragment.glsl +20 -0
  291. pyedge-3.0.0/src/ui_vertex.glsl +24 -0
  292. pyedge-3.0.0/src/vertex.glsl +49 -0
  293. pyedge-3.0.0/src/vertex.h +363 -0
  294. pyedge-3.0.0/src/vertex_array.cc +18 -0
  295. pyedge-3.0.0/src/vertex_array.h +51 -0
  296. pyedge-3.0.0/src/vertex_blend.glsl +50 -0
  297. pyedge-3.0.0/src/vertex_buffer.cc +12 -0
  298. pyedge-3.0.0/src/vertex_buffer.h +44 -0
  299. pyedge-3.0.0/src/vertex_skin.glsl +60 -0
  300. pyedge-3.0.0/src/vertex_traits.cc +107 -0
  301. pyedge-3.0.0/src/vertex_traits.h +63 -0
  302. pyedge-3.0.0/src/vulkan_commands.h +34 -0
  303. pyedge-3.0.0/src/vulkan_descriptor_cache.cc +432 -0
  304. pyedge-3.0.0/src/vulkan_descriptor_cache.h +127 -0
  305. pyedge-3.0.0/src/vulkan_device.cc +426 -0
  306. pyedge-3.0.0/src/vulkan_device.h +50 -0
  307. pyedge-3.0.0/src/vulkan_device_context.h +91 -0
  308. pyedge-3.0.0/src/vulkan_device_info.cc +182 -0
  309. pyedge-3.0.0/src/vulkan_device_info.h +46 -0
  310. pyedge-3.0.0/src/vulkan_dynamic_uniform_buffer.h +253 -0
  311. pyedge-3.0.0/src/vulkan_error.cc +199 -0
  312. pyedge-3.0.0/src/vulkan_error.h +32 -0
  313. pyedge-3.0.0/src/vulkan_frame_ring.cc +143 -0
  314. pyedge-3.0.0/src/vulkan_frame_ring.h +73 -0
  315. pyedge-3.0.0/src/vulkan_gpu_timer.cc +154 -0
  316. pyedge-3.0.0/src/vulkan_gpu_timer.h +57 -0
  317. pyedge-3.0.0/src/vulkan_image_layout.cc +79 -0
  318. pyedge-3.0.0/src/vulkan_image_layout.h +37 -0
  319. pyedge-3.0.0/src/vulkan_index_buffer.cc +105 -0
  320. pyedge-3.0.0/src/vulkan_index_buffer.h +50 -0
  321. pyedge-3.0.0/src/vulkan_instance.cc +87 -0
  322. pyedge-3.0.0/src/vulkan_instance.h +60 -0
  323. pyedge-3.0.0/src/vulkan_memory.cc +80 -0
  324. pyedge-3.0.0/src/vulkan_memory.h +24 -0
  325. pyedge-3.0.0/src/vulkan_pipeline_builder.cc +469 -0
  326. pyedge-3.0.0/src/vulkan_pipeline_builder.h +78 -0
  327. pyedge-3.0.0/src/vulkan_presenter.cc +620 -0
  328. pyedge-3.0.0/src/vulkan_presenter.h +133 -0
  329. pyedge-3.0.0/src/vulkan_render_pass_cache.cc +150 -0
  330. pyedge-3.0.0/src/vulkan_render_pass_cache.h +39 -0
  331. pyedge-3.0.0/src/vulkan_render_target.cc +304 -0
  332. pyedge-3.0.0/src/vulkan_render_target.h +63 -0
  333. pyedge-3.0.0/src/vulkan_renderer.cc +1113 -0
  334. pyedge-3.0.0/src/vulkan_renderer.h +286 -0
  335. pyedge-3.0.0/src/vulkan_sdl_surface.cc +45 -0
  336. pyedge-3.0.0/src/vulkan_sdl_surface.h +27 -0
  337. pyedge-3.0.0/src/vulkan_texture.cc +610 -0
  338. pyedge-3.0.0/src/vulkan_texture.h +135 -0
  339. pyedge-3.0.0/src/vulkan_uploader.cc +285 -0
  340. pyedge-3.0.0/src/vulkan_uploader.h +113 -0
  341. pyedge-3.0.0/src/vulkan_vertex_buffer.cc +95 -0
  342. pyedge-3.0.0/src/vulkan_vertex_buffer.h +51 -0
  343. pyedge-3.0.0/src/weights_sampler.cc +81 -0
  344. pyedge-3.0.0/src/weights_sampler.h +69 -0
  345. pyedge-3.0.0/test_package/CMakeLists.txt +23 -0
  346. pyedge-3.0.0/test_package/conanfile.py +32 -0
  347. pyedge-3.0.0/test_package/example.cc +25 -0
  348. pyedge-3.0.0/test_package/tint.frag +5 -0
  349. pyedge-3.0.0/tools/edge_convert.cc +213 -0
  350. pyedge-3.0.0/tools/edge_shot.cc +763 -0
  351. pyedge-3.0.0/tools/shader_cross/CMakeLists.txt +30 -0
  352. pyedge-3.0.0/tools/shader_cross/shader_cross.cc +216 -0
  353. pyedge-3.0.0/tools/shaders/lit.frag +36 -0
@@ -0,0 +1,18 @@
1
+ # What new code is held to (run-clang-tidy -p <build> 'edge/(src|test|tools)/'): the C++20 forms of what edge writes.
2
+ Checks: >
3
+ -*,
4
+ modernize-use-override,
5
+ modernize-use-using,
6
+ modernize-loop-convert,
7
+ modernize-make-shared,
8
+ modernize-make-unique,
9
+ modernize-use-nullptr,
10
+ modernize-redundant-void-arg,
11
+ modernize-use-bool-literals,
12
+ modernize-deprecated-headers,
13
+ modernize-use-equals-default,
14
+ modernize-use-equals-delete
15
+ HeaderFilterRegex: '/edge/(src|test|tools)/'
16
+ CheckOptions:
17
+ modernize-loop-convert.MinConfidence: reasonable
18
+ modernize-use-override.IgnoreDestructors: false
@@ -0,0 +1,10 @@
1
+ /CMakeUserPresets.json
2
+ /Testing/
3
+ /build/
4
+ /pyedge.egg-info/
5
+ /test/assets/Testing/
6
+ __pycache__
7
+ /.cache/
8
+ /_rove/
9
+ /test_package/build/
10
+ /test_package/CMakeUserPresets.json
@@ -0,0 +1,8 @@
1
+ # Changelog
2
+
3
+ All notable changes to edge are written here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/);
4
+ versions follow [Semantic Versioning](https://semver.org/).
5
+
6
+ ## [3.0.0]
7
+
8
+ First public release.
@@ -0,0 +1,607 @@
1
+ # SPDX-License-Identifier: MIT
2
+ # Copyright (c) 2004-2026 Manvel Avetisian
3
+
4
+ CMAKE_MINIMUM_REQUIRED(VERSION 3.20)
5
+ # Built by itself on a Mac (its tests): Apple silicon, macOS 13 on, as the games that add it say. (A parent's PROJECT is before this.)
6
+ IF(APPLE AND CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
7
+ IF(NOT CMAKE_OSX_ARCHITECTURES)
8
+ SET(CMAKE_OSX_ARCHITECTURES arm64 CACHE STRING "Apple silicon only" FORCE)
9
+ ENDIF()
10
+ IF(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
11
+ SET(CMAKE_OSX_DEPLOYMENT_TARGET 13.0 CACHE STRING "the oldest macOS edge runs on" FORCE)
12
+ ENDIF()
13
+ ENDIF()
14
+ PROJECT(EDGE VERSION 3.0.0)
15
+
16
+ # (for edge and what it fetches; a parent's targets choose their own)
17
+ SET(CMAKE_CXX_STANDARD 20)
18
+ SET(CMAKE_CXX_STANDARD_REQUIRED ON)
19
+ SET(CMAKE_CXX_EXTENSIONS ON)
20
+
21
+ SET(EDGE_ROOT ${EDGE_SOURCE_DIR})
22
+ SET(EDGE_CMAKE_DIR "${EDGE_ROOT}/etc/cmake")
23
+ LIST(APPEND CMAKE_MODULE_PATH "${EDGE_CMAKE_DIR}")
24
+ INCLUDE(GNUInstallDirs)
25
+
26
+ # (on where edge is built by itself; a parent that adds edge asks for what it uses)
27
+ IF(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
28
+ SET(EDGE_TOP_LEVEL ON)
29
+ ELSE()
30
+ SET(EDGE_TOP_LEVEL OFF)
31
+ ENDIF()
32
+
33
+ # `cmake --install`: the libraries, their headers as <edge/x.h>, edge's shaders, the tools, the CMake helpers and a CMake package
34
+ # (find_package(edge CONFIG): edge::edge, edge::sdl, edge::imgui, edge::asset, edge::convert, edge::shot). Off for a wheel, which
35
+ # installs pyedge's package instead. A parent that turns it on turns rove's ROVE_INSTALL on too: edge's package needs rove's.
36
+ OPTION(EDGE_INSTALL "Generate edge's install rules and CMake package" ${EDGE_TOP_LEVEL})
37
+ IF(SKBUILD)
38
+ SET(EDGE_INSTALL OFF)
39
+ ENDIF()
40
+
41
+
42
+ IF(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR AND NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
43
+ SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Build type (Debug, Release, RelWithDebInfo, MinSizeRel)." FORCE)
44
+ ENDIF()
45
+
46
+ # pyedge, and rove's Python bindings with it. A C++-only consumer turns it
47
+ # off and needs neither Python nor nanobind to build.
48
+ OPTION(EDGE_PYTHON "Build the pyedge Python module." ON)
49
+
50
+ # test_edge and its ctest registrations; a cross build (the phone's) cannot run them. Boost.Test is the one thing of Boost edge needs.
51
+ OPTION(EDGE_TESTS "Build the test_edge executable." ON)
52
+
53
+ IF(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
54
+ # Standalone build — use edge's own binary dir.
55
+ SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
56
+ SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
57
+ ELSE()
58
+ # Subdirectory build — use parent's output dirs so all .so files land together.
59
+ SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
60
+ SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
61
+ ENDIF()
62
+
63
+ ENABLE_TESTING()
64
+
65
+ # Vulkan where it is there (src/CMakeLists.txt builds the backend with it): Vulkan::Vulkan.
66
+ FIND_PACKAGE(Vulkan)
67
+ SET(EDGE_USE_VULKAN ${Vulkan_FOUND})
68
+
69
+ # The OpenGL ES backend (src/gles_*): off unless asked for. The host makes the context and gives it to the
70
+ # renderer (GLESContext, as it makes a Vulkan surface); libGLESv3 (or v2, which exports the same ES 3.0 entry points on the desktop) is the
71
+ # API. Asked for and not there is an error, not a build without it.
72
+ OPTION(EDGE_GLES "Build the OpenGL ES renderer (needs GLES3/gl3.h and libGLESv3)." OFF)
73
+ # edge_sdl, the part of edge that needs SDL3 (edge itself links none): an SDL window's Vulkan surface (vulkan_sdl_surface.h) and a GLES
74
+ # context made with SDL (gles_sdl_context.h), for a host that uses SDL and for the tests. On with the GLES backend, whose tests need it.
75
+ # (on where edge is built by itself, for its tests; a parent asks for what it uses)
76
+ IF(EDGE_TOP_LEVEL OR EDGE_GLES OR EDGE_METAL)
77
+ SET(EDGE_SDL_DEFAULT ON)
78
+ ELSE()
79
+ SET(EDGE_SDL_DEFAULT OFF)
80
+ ENDIF()
81
+ OPTION(EDGE_SDL "Build edge_sdl (SDL3): an SDL window's Vulkan surface, a GLES context made with SDL." ${EDGE_SDL_DEFAULT})
82
+ IF(EDGE_SDL AND NOT TARGET SDL3::SDL3)
83
+ FIND_PACKAGE(SDL3 REQUIRED CONFIG)
84
+ ENDIF()
85
+ # edge_imgui, Dear ImGui drawn through edge (imgui_renderer.h): it links the parent's target imgui, made before edge is added, which
86
+ # has ImGui's core; edge built by itself fetches one.
87
+ OPTION(EDGE_IMGUI "Build edge_imgui: Dear ImGui drawn through edge (the parent's imgui target)." ${EDGE_TOP_LEVEL})
88
+ IF(EDGE_GLES AND EMSCRIPTEN)
89
+ # a browser's WebGL 2, which is OpenGL ES 3.0: Emscripten's own GLES3/gl3.h, and its GL library asked for at the link (no library to find)
90
+ SET(EDGE_USE_GLES TRUE)
91
+ ADD_LIBRARY(edge_gles_api INTERFACE)
92
+ SET_TARGET_PROPERTIES(edge_gles_api PROPERTIES EXPORT_NAME gles_api)
93
+ TARGET_LINK_OPTIONS(edge_gles_api INTERFACE -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2)
94
+ MESSAGE(STATUS "OpenGL ES backend: WebGL 2")
95
+ ELSEIF(EDGE_GLES)
96
+ FIND_LIBRARY(EDGE_GLES_LIBRARY NAMES GLESv3 GLESv2)
97
+ FIND_PATH(EDGE_GLES_INCLUDE_DIR GLES3/gl3.h)
98
+ IF(NOT EDGE_GLES_LIBRARY OR NOT EDGE_GLES_INCLUDE_DIR)
99
+ MESSAGE(FATAL_ERROR "EDGE_GLES needs GLES3/gl3.h and libGLESv3 (or libGLESv2)")
100
+ ENDIF()
101
+ SET(EDGE_USE_GLES TRUE)
102
+ ADD_LIBRARY(edge_gles_api INTERFACE)
103
+ SET_TARGET_PROPERTIES(edge_gles_api PROPERTIES EXPORT_NAME gles_api)
104
+ TARGET_INCLUDE_DIRECTORIES(edge_gles_api SYSTEM INTERFACE ${EDGE_GLES_INCLUDE_DIR})
105
+ TARGET_LINK_LIBRARIES(edge_gles_api INTERFACE ${EDGE_GLES_LIBRARY})
106
+ MESSAGE(STATUS "OpenGL ES backend: ${EDGE_GLES_LIBRARY}")
107
+ ELSE()
108
+ UNSET(EDGE_USE_GLES_SHADERS CACHE) # (src/CMakeLists.txt sets it; a build once configured with the backend keeps it)
109
+ ENDIF()
110
+
111
+ # The Metal backend (src/metal_*, Objective-C++): on by default on Apple platforms, which have no other renderer worth
112
+ # having (Vulkan only through MoltenVK, OpenGL ES not at all on iOS). Apple-silicon Macs and iOS 15 on.
113
+ IF(APPLE)
114
+ SET(EDGE_METAL_DEFAULT ON)
115
+ ELSE()
116
+ SET(EDGE_METAL_DEFAULT OFF)
117
+ ENDIF()
118
+ OPTION(EDGE_METAL "Build the Metal renderer (Apple platforms only)." ${EDGE_METAL_DEFAULT})
119
+ IF(EDGE_METAL)
120
+ IF(NOT APPLE)
121
+ MESSAGE(FATAL_ERROR "EDGE_METAL: Metal is Apple's")
122
+ ENDIF()
123
+ ENABLE_LANGUAGE(OBJCXX)
124
+ SET(EDGE_USE_METAL TRUE)
125
+ ADD_LIBRARY(edge_metal_api INTERFACE)
126
+ SET_TARGET_PROPERTIES(edge_metal_api PROPERTIES EXPORT_NAME metal_api)
127
+ TARGET_LINK_LIBRARIES(edge_metal_api INTERFACE "-framework Metal" "-framework QuartzCore" "-framework Foundation")
128
+ MESSAGE(STATUS "Metal backend")
129
+ ELSE()
130
+ UNSET(EDGE_USE_METAL_SHADERS CACHE)
131
+ ENDIF()
132
+
133
+ # The asset tools: edge_asset (what makes .edge models: conversion, atlases, levels of detail, tiles, BC7 and ASTC), edge_convert,
134
+ # edge_shot and pyedge's convert_gltf_to_edge, with what they need (meshoptimizer, bc7enc_rdo, astc-encoder, xatlas). Off, edge is
135
+ # the runtime alone: it draws and loads models (.edge, glTF) and needs none of them.
136
+ OPTION(EDGE_ASSET_TOOLS "Build edge_asset, edge_convert and edge_shot, and pyedge's conversion (meshoptimizer, the encoders)." ON)
137
+
138
+ # edge_shot, the program that draws a model once (tools/edge_shot.cc): a picture, a contact sheet or, with edge_sdl, a window. On where edge is
139
+ # built by itself with a renderer that draws it (Vulkan or Metal) and the asset tools; a parent asks for it (a phone's build cannot run it).
140
+ IF(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND (EDGE_USE_VULKAN OR EDGE_USE_METAL) AND EDGE_ASSET_TOOLS)
141
+ SET(EDGE_SHOT_DEFAULT ON)
142
+ ELSE()
143
+ SET(EDGE_SHOT_DEFAULT OFF)
144
+ ENDIF()
145
+ OPTION(EDGE_SHOT "Build edge_shot: a model drawn to a PNG, a contact sheet, or a window (with EDGE_SDL)." ${EDGE_SHOT_DEFAULT})
146
+ IF(EDGE_SHOT AND NOT EDGE_ASSET_TOOLS)
147
+ MESSAGE(FATAL_ERROR "EDGE_SHOT: edge_shot links edge_asset, which EDGE_ASSET_TOOLS=OFF leaves out")
148
+ ENDIF()
149
+
150
+ # Dependencies. By default every one is fetched at configure (FetchContent, pinned) and built here. EDGE_SYSTEM_DEPS takes what a
151
+ # package manager (Conan, vcpkg) or the system provides instead, with find_package, and maps its targets onto the ones edge links:
152
+ #
153
+ # spdlog find_package(spdlog CONFIG) spdlog::spdlog
154
+ # cereal find_package(cereal CONFIG) cereal::cereal
155
+ # stb find_package(stb CONFIG) (Conan) stb::stb; else its headers, find_path(STB_INCLUDE_DIRS stb_image.h) (vcpkg,
156
+ # Debian's stb/ under the include directory)
157
+ # meshoptimizer find_package(meshoptimizer CONFIG) meshoptimizer::meshoptimizer
158
+ # Dear ImGui find_package(imgui CONFIG) imgui::imgui (EDGE_IMGUI, unless the parent has a target imgui)
159
+ # nanobind find_package(nanobind CONFIG) pip's (python -m nanobind --cmake_dir), EDGE_PYTHON
160
+ # rove find_package(rove 3 CONFIG) rove::rove (unless the parent has a target rove, or EDGE_ROVE_SOURCE_DIR)
161
+ # SDL3, Vulkan found either way SDL3::SDL3 (EDGE_SDL), Vulkan::Vulkan
162
+ #
163
+ # Fetched either way: fastgltf, which edge patches (etc/patches; ConanCenter's and vcpkg's are not), with the simdjson it pins; and
164
+ # the asset tools' encoders no package manager has (bc7enc_rdo, astc-encoder, xatlas); SPIRV-Cross, for the host's shader_cross
165
+ # (GLES, Metal: tools/shader_cross). Boost.Test (EDGE_TESTS) is found either way.
166
+ OPTION(EDGE_SYSTEM_DEPS "Find edge's dependencies (find_package: Conan, vcpkg, the system) instead of fetching them" OFF)
167
+
168
+ INCLUDE(FetchContent)
169
+ # FetchContent_MakeAvailable without the dependency's own install rules (EXCLUDE_FROM_ALL): what edge links of it privately is installed
170
+ # with edge's package, under edge's names, where edge installs at all. (FetchContent_Declare takes EXCLUDE_FROM_ALL from CMake 3.28.)
171
+ MACRO(EDGE_FETCH_EXCLUDED name)
172
+ IF(CMAKE_VERSION VERSION_GREATER_EQUAL 3.28)
173
+ FetchContent_Declare(${name} ${ARGN} EXCLUDE_FROM_ALL)
174
+ FetchContent_MakeAvailable(${name})
175
+ ELSE()
176
+ FetchContent_Declare(${name} ${ARGN})
177
+ FetchContent_GetProperties(${name})
178
+ IF(NOT ${name}_POPULATED)
179
+ FetchContent_Populate(${name})
180
+ ADD_SUBDIRECTORY(${${name}_SOURCE_DIR} ${${name}_BINARY_DIR} EXCLUDE_FROM_ALL)
181
+ ENDIF()
182
+ ENDIF()
183
+ ENDMACRO()
184
+
185
+ IF(EDGE_IMGUI AND NOT TARGET imgui)
186
+ IF(EDGE_SYSTEM_DEPS)
187
+ FIND_PACKAGE(imgui CONFIG REQUIRED)
188
+ ADD_LIBRARY(imgui ALIAS imgui::imgui)
189
+ ELSEIF(NOT EDGE_TOP_LEVEL)
190
+ MESSAGE(FATAL_ERROR "EDGE_IMGUI: there is no target imgui (make the one the parent uses before adding edge)")
191
+ ELSE()
192
+ # the core alone (no platform backend)
193
+ FetchContent_Declare(imgui GIT_REPOSITORY https://github.com/ocornut/imgui GIT_TAG f1cc2ae15e53a861a874c3034aae6798fde194ab
194
+ SOURCE_SUBDIR no_cmake_here)
195
+ FetchContent_MakeAvailable(imgui)
196
+ ADD_LIBRARY(imgui STATIC ${imgui_SOURCE_DIR}/imgui.cpp ${imgui_SOURCE_DIR}/imgui_draw.cpp ${imgui_SOURCE_DIR}/imgui_tables.cpp
197
+ ${imgui_SOURCE_DIR}/imgui_widgets.cpp)
198
+ TARGET_INCLUDE_DIRECTORIES(imgui SYSTEM PUBLIC $<BUILD_INTERFACE:${imgui_SOURCE_DIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
199
+ # (installed with edge as edge::imgui_core, libedge_imgui_core: the ImGui whose context edge::imgui draws)
200
+ SET_TARGET_PROPERTIES(imgui PROPERTIES POSITION_INDEPENDENT_CODE ON OUTPUT_NAME edge_imgui_core EXPORT_NAME imgui_core)
201
+ SET(EDGE_FETCHED_IMGUI ON)
202
+ ENDIF()
203
+ ENDIF()
204
+
205
+ # Boost.Test, for the tests only (rove finds the Boost headers it uses itself).
206
+ IF(EDGE_TESTS)
207
+ FIND_PACKAGE(Boost 1.74 CONFIG REQUIRED COMPONENTS unit_test_framework)
208
+ ENDIF()
209
+
210
+ # fastgltf, built here with edge's patches (etc/patches): 0.9.0 drops a scene without nodes, which renumbers the scenes after it.
211
+ # Only the loader (gltf_loader.cc) sees it. Fetched whatever EDGE_SYSTEM_DEPS says: a package manager's is not patched.
212
+ # as C++20, as edge: its headers declare other types (std::span) in C++20 than in C++17, which it builds as otherwise
213
+ SET(FASTGLTF_COMPILE_AS_CPP20 ON CACHE BOOL "" FORCE)
214
+ # with the simdjson it pins (its -I comes before every -isystem): not one found elsewhere, whose headers and library may not match
215
+ SET(CMAKE_DISABLE_FIND_PACKAGE_simdjson ON)
216
+ EDGE_FETCH_EXCLUDED(fastgltf
217
+ GIT_REPOSITORY https://github.com/spnda/fastgltf
218
+ GIT_TAG v0.9.0
219
+ GIT_SHALLOW TRUE
220
+ PATCH_COMMAND git reset --hard --quiet && git apply ${EDGE_ROOT}/etc/patches/fastgltf-0.9.0-scenes-without-nodes.patch
221
+ UPDATE_DISCONNECTED TRUE)
222
+ # (installed with edge as edge::fastgltf, libedge_fastgltf: not a fastgltf of the system's, which is not patched)
223
+ SET_TARGET_PROPERTIES(fastgltf PROPERTIES POSITION_INDEPENDENT_CODE ON OUTPUT_NAME edge_fastgltf)
224
+
225
+ # cereal: the .edge file's serialization (serialized_model.h, a public header). Header-only: fetched, not built. edge links edge_cereal.
226
+ IF(EDGE_SYSTEM_DEPS)
227
+ FIND_PACKAGE(cereal CONFIG REQUIRED)
228
+ ADD_LIBRARY(edge_cereal ALIAS cereal::cereal)
229
+ ELSE()
230
+ FetchContent_Declare(
231
+ cereal
232
+ GIT_REPOSITORY https://github.com/USCiLab/cereal
233
+ GIT_TAG v1.3.2
234
+ GIT_SHALLOW TRUE
235
+ SOURCE_SUBDIR no_cmakelists_here)
236
+ FetchContent_MakeAvailable(cereal)
237
+ ADD_LIBRARY(edge_cereal INTERFACE)
238
+ TARGET_INCLUDE_DIRECTORIES(edge_cereal SYSTEM INTERFACE $<BUILD_INTERFACE:${cereal_SOURCE_DIR}/include>
239
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
240
+ SET_TARGET_PROPERTIES(edge_cereal PROPERTIES EXPORT_NAME cereal)
241
+ ENDIF()
242
+
243
+ # stb: image decoding and writing, DXT compression, font rasterising (stb_impl.cc compiles them). Header-only. edge links edge_stb.
244
+ IF(EDGE_SYSTEM_DEPS)
245
+ FIND_PACKAGE(stb CONFIG QUIET)
246
+ IF(TARGET stb::stb)
247
+ ADD_LIBRARY(edge_stb ALIAS stb::stb)
248
+ ELSE()
249
+ FIND_PATH(STB_INCLUDE_DIRS stb_image.h PATH_SUFFIXES stb)
250
+ IF(NOT STB_INCLUDE_DIRS)
251
+ MESSAGE(FATAL_ERROR "EDGE_SYSTEM_DEPS: stb is not found (no package stb, and no stb_image.h: STB_INCLUDE_DIRS)")
252
+ ENDIF()
253
+ ADD_LIBRARY(edge_stb INTERFACE)
254
+ TARGET_INCLUDE_DIRECTORIES(edge_stb SYSTEM INTERFACE ${STB_INCLUDE_DIRS})
255
+ ENDIF()
256
+ ELSE()
257
+ FetchContent_Declare(
258
+ stb
259
+ GIT_REPOSITORY https://github.com/nothings/stb
260
+ GIT_TAG 5736b15f7ea0ffb08dd38af21067c314d6a3aae9
261
+ SOURCE_SUBDIR no_cmakelists_here)
262
+ FetchContent_MakeAvailable(stb)
263
+ ADD_LIBRARY(edge_stb INTERFACE)
264
+ TARGET_INCLUDE_DIRECTORIES(edge_stb SYSTEM INTERFACE ${stb_SOURCE_DIR})
265
+ ENDIF()
266
+
267
+ # rove, the math library. The layout edge is made for has rove and edge side by side, as git submodules of a game (or checkouts):
268
+ #
269
+ # add_subdirectory(rove)
270
+ # add_subdirectory(edge) # takes the parent's target rove: nothing of rove is looked for or fetched
271
+ #
272
+ # Else EDGE_ROVE_SOURCE_DIR when given; else with EDGE_SYSTEM_DEPS an installed rove (find_package(rove 3 CONFIG)); else a checkout
273
+ # beside edge (../rove), else an installed rove, else rove fetched from GitHub at EDGE_ROVE_GIT_TAG. From its sources, edge adds it with
274
+ # its own choice of rove's options (and pyedge's build makes rove's Python module too).
275
+ set(EDGE_ROVE_SOURCE_DIR "" CACHE PATH "Path to rove source tree used by edge.")
276
+ set(EDGE_ROVE_GIT_TAG "v3.0.0" CACHE STRING "The rove version fetched when no rove source tree is found.")
277
+ if(TARGET rove)
278
+ get_target_property(EDGE_ROVE_SOURCE_DIR rove SOURCE_DIR)
279
+ elseif(TARGET rove::rove)
280
+ # (found before edge was added)
281
+ elseif(EDGE_SYSTEM_DEPS AND NOT EDGE_ROVE_SOURCE_DIR)
282
+ find_package(rove 3 CONFIG REQUIRED)
283
+ elseif(NOT EDGE_ROVE_SOURCE_DIR)
284
+ if(EXISTS "${EDGE_SOURCE_DIR}/../rove/CMakeLists.txt")
285
+ set(EDGE_ROVE_SOURCE_DIR "${EDGE_SOURCE_DIR}/../rove")
286
+ else()
287
+ find_package(rove 3 CONFIG QUIET)
288
+ if(NOT rove_FOUND)
289
+ # (fetched only: it is added below, with edge's choice of its options)
290
+ message(STATUS "rove: no ../rove and no installed rove 3: fetching ${EDGE_ROVE_GIT_TAG}")
291
+ FetchContent_Declare(rove GIT_REPOSITORY https://github.com/mnvl/rove GIT_TAG ${EDGE_ROVE_GIT_TAG} GIT_SHALLOW TRUE
292
+ SOURCE_SUBDIR no_cmakelists_here)
293
+ FetchContent_MakeAvailable(rove)
294
+ set(EDGE_ROVE_SOURCE_DIR "${rove_SOURCE_DIR}")
295
+ endif()
296
+ endif()
297
+ endif()
298
+ if(TARGET rove::rove AND NOT TARGET rove)
299
+ message(STATUS "rove: ${rove_DIR}")
300
+ elseif(TARGET rove)
301
+ message(STATUS "rove: the parent's target rove (${EDGE_ROVE_SOURCE_DIR})")
302
+ else()
303
+ message(STATUS "rove: ${EDGE_ROVE_SOURCE_DIR}")
304
+ endif()
305
+ if(TARGET rove OR TARGET rove::rove)
306
+ set(EDGE_ADDS_ROVE OFF)
307
+ if(EDGE_INSTALL AND TARGET rove AND NOT ROVE_INSTALL)
308
+ get_target_property(EDGE_ROVE_IMPORTED rove IMPORTED)
309
+ if(NOT EDGE_ROVE_IMPORTED)
310
+ message(FATAL_ERROR "EDGE_INSTALL: edge's package needs rove's, and the parent's rove has no install rules: turn ROVE_INSTALL on too")
311
+ endif()
312
+ endif()
313
+ else()
314
+ set(EDGE_ADDS_ROVE ON)
315
+ if(NOT EXISTS "${EDGE_ROVE_SOURCE_DIR}/CMakeLists.txt")
316
+ message(FATAL_ERROR "EDGE_ROVE_SOURCE_DIR (${EDGE_ROVE_SOURCE_DIR}) is not a rove source tree")
317
+ endif()
318
+ endif()
319
+ # rove's headers, which edge's pipeline hash covers (src/CMakeLists.txt): its sources', else an installed rove's include/rove
320
+ if(EDGE_ROVE_SOURCE_DIR)
321
+ set(EDGE_ROVE_HASHED_DIR "${EDGE_ROVE_SOURCE_DIR}/src")
322
+ else()
323
+ get_target_property(EDGE_ROVE_INCLUDES rove::rove INTERFACE_INCLUDE_DIRECTORIES)
324
+ list(GET EDGE_ROVE_INCLUDES 0 EDGE_ROVE_INCLUDE)
325
+ set(EDGE_ROVE_HASHED_DIR "${EDGE_ROVE_INCLUDE}/rove")
326
+ endif()
327
+
328
+ # pyedge's nanobind, the version pyrove is built with (2.4.0: the two modules share rove's types only so). A wheel's build and
329
+ # EDGE_SYSTEM_DEPS take the one pip installed (pyproject.toml); else it is fetched, at top level so nanobind_add_module() is there in
330
+ # rove/ and src/ alike (rove's own declaration reuses this one). rove's Python module is built beside pyedge's only where both are
331
+ # built from sources here (not a wheel, which imports pip's pyrove, and not with EDGE_SYSTEM_DEPS).
332
+ if(EDGE_PYTHON)
333
+ find_package(Python 3.8 COMPONENTS Interpreter Development.Module REQUIRED)
334
+ if(SKBUILD OR EDGE_SYSTEM_DEPS)
335
+ if(NOT nanobind_ROOT AND NOT nanobind_DIR)
336
+ execute_process(COMMAND ${Python_EXECUTABLE} -m nanobind --cmake_dir
337
+ OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE nanobind_ROOT ERROR_QUIET)
338
+ endif()
339
+ find_package(nanobind CONFIG REQUIRED)
340
+ set(EDGE_ROVE_PYTHON OFF)
341
+ else()
342
+ FetchContent_Declare(
343
+ nanobind
344
+ GIT_REPOSITORY https://github.com/wjakob/nanobind
345
+ GIT_TAG v2.4.0
346
+ )
347
+ FetchContent_MakeAvailable(nanobind)
348
+ set(EDGE_ROVE_PYTHON ON)
349
+ endif()
350
+ else()
351
+ set(EDGE_ROVE_PYTHON OFF)
352
+ endif()
353
+
354
+ if(EDGE_ADDS_ROVE)
355
+ set(ROVE_TESTS OFF CACHE BOOL "" FORCE)
356
+ set(ROVE_PYTHON ${EDGE_ROVE_PYTHON} CACHE BOOL "" FORCE)
357
+ # (edge's package needs rove's beside it: find_dependency(rove))
358
+ set(ROVE_INSTALL ${EDGE_INSTALL} CACHE BOOL "" FORCE)
359
+ endif()
360
+
361
+ # spdlog: the library's one logger (src/log.h), on the desktop into logs/edge.log. Fetched, compiled (not header-only) so the
362
+ # formatting code is built once, not per translation unit; PIC as it ends up inside the pyedge module like edge itself. A parent that
363
+ # declares spdlog first wins and edge reuses it.
364
+ if(EDGE_SYSTEM_DEPS)
365
+ if(NOT TARGET spdlog::spdlog)
366
+ find_package(spdlog CONFIG REQUIRED)
367
+ endif()
368
+ else()
369
+ FetchContent_Declare(
370
+ spdlog
371
+ GIT_REPOSITORY https://github.com/gabime/spdlog
372
+ GIT_TAG v1.15.3
373
+ )
374
+ set(SPDLOG_BUILD_EXAMPLE OFF CACHE BOOL "" FORCE)
375
+ set(SPDLOG_BUILD_TESTS OFF CACHE BOOL "" FORCE)
376
+ # (installed as itself where edge installs: its headers are edge's public headers')
377
+ set(SPDLOG_INSTALL ${EDGE_INSTALL} CACHE BOOL "" FORCE)
378
+ set(SPDLOG_BUILD_PIC ON CACHE BOOL "" FORCE)
379
+ FetchContent_MakeAvailable(spdlog)
380
+ endif()
381
+
382
+ # What only the asset tools need (EDGE_ASSET_TOOLS).
383
+ if(EDGE_ASSET_TOOLS)
384
+ # meshoptimizer: the edge-collapse simplifier that makes a model's levels of detail (src/mesh_lod.h). edge_asset links
385
+ # meshoptimizer::meshoptimizer.
386
+ if(EDGE_SYSTEM_DEPS)
387
+ # (its package takes no version but its own: meshopt_simplifyWithAttributes takes vertex_lock from 0.21; edge pins 0.22)
388
+ find_package(meshoptimizer CONFIG REQUIRED)
389
+ if(meshoptimizer_VERSION AND meshoptimizer_VERSION VERSION_LESS 0.21)
390
+ message(FATAL_ERROR "EDGE_SYSTEM_DEPS: meshoptimizer ${meshoptimizer_VERSION} (${meshoptimizer_DIR}) is too old: 0.21 or newer is needed")
391
+ endif()
392
+ else()
393
+ set(MESHOPT_BUILD_DEMO OFF CACHE BOOL "" FORCE)
394
+ set(MESHOPT_BUILD_GLTFPACK OFF CACHE BOOL "" FORCE)
395
+ set(MESHOPT_BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
396
+ edge_fetch_excluded(meshoptimizer
397
+ GIT_REPOSITORY https://github.com/zeux/meshoptimizer
398
+ GIT_TAG v0.22
399
+ )
400
+ # (installed with edge as edge::meshoptimizer, libedge_meshoptimizer: edge_asset links it privately)
401
+ set_target_properties(meshoptimizer PROPERTIES POSITION_INDEPENDENT_CODE ON OUTPUT_NAME edge_meshoptimizer)
402
+ if(NOT TARGET meshoptimizer::meshoptimizer)
403
+ add_library(meshoptimizer::meshoptimizer ALIAS meshoptimizer)
404
+ endif()
405
+ endif()
406
+
407
+ # bc7enc: the BC7 encoder of the textures edge_convert makes (src/image_compress.h), and its decoder, which the tests check the
408
+ # encoder against. The repository is fetched for two files each, not built by its own CMakeLists (SOURCE_SUBDIR names none).
409
+ FetchContent_Declare(
410
+ bc7enc_rdo
411
+ GIT_REPOSITORY https://github.com/richgel999/bc7enc_rdo
412
+ GIT_TAG b9438627eef73a1157e84201b6fa6eb2ffd6d9f0
413
+ SOURCE_SUBDIR no_cmakelists_here
414
+ )
415
+ FetchContent_MakeAvailable(bc7enc_rdo)
416
+ add_library(edge_bc7enc STATIC
417
+ ${bc7enc_rdo_SOURCE_DIR}/bc7enc.cpp
418
+ ${bc7enc_rdo_SOURCE_DIR}/bc7decomp.cpp)
419
+ target_include_directories(edge_bc7enc SYSTEM PUBLIC $<BUILD_INTERFACE:${bc7enc_rdo_SOURCE_DIR}>)
420
+ set_target_properties(edge_bc7enc PROPERTIES POSITION_INDEPENDENT_CODE ON EXPORT_NAME bc7enc)
421
+
422
+ # astc-encoder (ARM's, Apache-2.0): the ASTC encoder of the textures edge_convert --astc makes (src/image_compress.h), and the decoder the
423
+ # tests check it with. Its core library's sources built here, not by its own CMakeLists (which builds per instruction set and a CLI);
424
+ # it picks its SIMD from the compiler's target (NEON on arm64, SSE2 on x86-64). Invariant floating point: the same bytes on every build.
425
+ FetchContent_Declare(
426
+ astcenc
427
+ GIT_REPOSITORY https://github.com/ARM-software/astc-encoder
428
+ GIT_TAG 5.3.0
429
+ GIT_SHALLOW TRUE
430
+ SOURCE_SUBDIR no_cmakelists_here
431
+ )
432
+ FetchContent_MakeAvailable(astcenc)
433
+ file(GLOB EDGE_ASTCENC_SOURCES ${astcenc_SOURCE_DIR}/Source/astcenc_*.cpp)
434
+ add_library(edge_astcenc STATIC ${EDGE_ASTCENC_SOURCES})
435
+ target_include_directories(edge_astcenc SYSTEM PUBLIC $<BUILD_INTERFACE:${astcenc_SOURCE_DIR}/Source>)
436
+ target_compile_options(edge_astcenc PRIVATE $<$<CXX_COMPILER_ID:Clang,AppleClang,GNU>:-ffp-contract=off>)
437
+ set_target_properties(edge_astcenc PROPERTIES POSITION_INDEPENDENT_CODE ON EXPORT_NAME astcenc)
438
+
439
+ # xatlas: the unwrapping of a model's meshes into one set of texture coordinates (src/model_atlas.h). Fetched for its two files, as bc7enc is.
440
+ FetchContent_Declare(
441
+ xatlas
442
+ GIT_REPOSITORY https://github.com/jpcy/xatlas
443
+ GIT_TAG f700c7790aaa030e794b52ba7791a05c085faf0c
444
+ SOURCE_SUBDIR no_cmakelists_here
445
+ )
446
+ FetchContent_MakeAvailable(xatlas)
447
+ add_library(edge_xatlas STATIC ${xatlas_SOURCE_DIR}/source/xatlas/xatlas.cpp)
448
+ target_include_directories(edge_xatlas SYSTEM PUBLIC $<BUILD_INTERFACE:${xatlas_SOURCE_DIR}/source/xatlas>)
449
+ set_target_properties(edge_xatlas PROPERTIES POSITION_INDEPENDENT_CODE ON EXPORT_NAME xatlas)
450
+ endif()
451
+
452
+ if(EDGE_ADDS_ROVE)
453
+ add_subdirectory("${EDGE_ROVE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}/rove-build")
454
+ endif()
455
+
456
+ INCLUDE(EdgeShaders)
457
+ INCLUDE(EdgeRuntime)
458
+ INCLUDE(EdgeModels)
459
+ # the version of the .edge files this edge writes and reads (src/serialized_model.h), for a build that keeps models it made
460
+ FILE(STRINGS ${EDGE_ROOT}/src/serialized_model.h EDGE_MODEL_BINARY_VERSION REGEX "MODEL_BINARY_VERSION = [0-9]+U")
461
+ STRING(REGEX REPLACE ".*MODEL_BINARY_VERSION = ([0-9]+)U.*" "\\1" EDGE_MODEL_BINARY_VERSION "${EDGE_MODEL_BINARY_VERSION}")
462
+ IF(NOT EDGE_MODEL_BINARY_VERSION MATCHES "^[0-9]+$")
463
+ MESSAGE(FATAL_ERROR "no MODEL_BINARY_VERSION in src/serialized_model.h")
464
+ ENDIF()
465
+ SET(EDGE_MODEL_BINARY_VERSION ${EDGE_MODEL_BINARY_VERSION} CACHE INTERNAL "the .edge format version")
466
+ SET_PROPERTY(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${EDGE_ROOT}/src/serialized_model.h)
467
+ # the light of edge_shot and of Python model viewers, beside pyedge's module (lib/view_shaders); both find it with edge::view_shader_dir()
468
+ IF(EDGE_USE_VULKAN OR EDGE_USE_METAL)
469
+ SET(EDGE_VIEW_SHADER_BUILD_DIR ${LIBRARY_OUTPUT_PATH}/view_shaders)
470
+ ENDIF()
471
+ ADD_SUBDIRECTORY(src)
472
+ IF(SKBUILD AND NOT (EDGE_USE_VULKAN OR EDGE_USE_METAL))
473
+ MESSAGE(FATAL_ERROR "a wheel of pyedge draws with Vulkan (or Metal): the Vulkan headers, loader and glslangValidator are needed")
474
+ ENDIF()
475
+ IF(EDGE_VIEW_SHADER_BUILD_DIR)
476
+ EDGE_ADD_SHADERS(edge_view_shaders DESTINATION ${EDGE_VIEW_SHADER_BUILD_DIR} SOURCES ${EDGE_ROOT}/tools/shaders/lit.frag)
477
+ # (a wheel's: view_shaders beside the module)
478
+ IF(SKBUILD AND EDGE_PYTHON)
479
+ INSTALL(FILES ${edge_view_shaders_OUTPUTS} DESTINATION pyedge/view_shaders)
480
+ ENDIF()
481
+ IF(EDGE_PYTHON)
482
+ ADD_DEPENDENCIES(pyedge edge_view_shaders)
483
+ ENDIF()
484
+ IF(EDGE_SHOT)
485
+ ADD_DEPENDENCIES(edge_shot edge_view_shaders)
486
+ ENDIF()
487
+ ENDIF()
488
+
489
+ # Installed (EDGE_INSTALL): lib/ the libraries, include/edge/ their headers (the real ones: <edge/x.h> is the header itself, and only
490
+ # include/ is on the path), share/edge/ the shaders (src/CMakeLists.txt) and view shaders, bin/ the tools, lib/cmake/edge/ the package
491
+ # and the helpers. The libraries edge builds of its dependencies and links privately are in edge's package under edge's names
492
+ # (edge::fastgltf, libedge_fastgltf.a, ...): never taken for a system's own. Bundled, what the public headers include is installed as
493
+ # itself: cereal's headers, spdlog (its own install rules, SPDLOG_INSTALL) and ImGui's core (edge::imgui_core); rove's own rules
494
+ # install rove where edge added it (ROVE_INSTALL).
495
+ IF(EDGE_INSTALL)
496
+ INCLUDE(CMakePackageConfigHelpers)
497
+ SET(EDGE_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/edge)
498
+ SET(EDGE_INSTALL_GLSLDIR ${CMAKE_INSTALL_DATADIR}/edge/glsl)
499
+ SET(EDGE_INSTALL_SHADERDIR ${CMAKE_INSTALL_DATADIR}/edge/shaders)
500
+ SET(EDGE_INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR})
501
+
502
+ # (what this build made: not a found package's target, nor an alias of one)
503
+ SET(EDGE_EXPORTED)
504
+ FOREACH(target edge fastgltf edge_cereal edge_asset meshoptimizer edge_bc7enc edge_astcenc edge_xatlas edge_convert edge_shot edge_sdl
505
+ edge_imgui edge_gles_api edge_metal_api)
506
+ IF(TARGET ${target})
507
+ GET_TARGET_PROPERTY(imported ${target} IMPORTED)
508
+ GET_TARGET_PROPERTY(aliased ${target} ALIASED_TARGET)
509
+ IF(NOT imported AND NOT aliased)
510
+ LIST(APPEND EDGE_EXPORTED ${target})
511
+ ENDIF()
512
+ ENDIF()
513
+ ENDFOREACH()
514
+ IF(NOT TARGET edge_asset)
515
+ LIST(REMOVE_ITEM EDGE_EXPORTED meshoptimizer)
516
+ ENDIF()
517
+ IF(cereal_SOURCE_DIR AND NOT EDGE_SYSTEM_DEPS)
518
+ INSTALL(DIRECTORY ${cereal_SOURCE_DIR}/include/cereal DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
519
+ ENDIF()
520
+ IF(EDGE_FETCHED_IMGUI)
521
+ LIST(APPEND EDGE_EXPORTED imgui)
522
+ FOREACH(header imgui.h imconfig.h imgui_internal.h imstb_rectpack.h imstb_textedit.h imstb_truetype.h)
523
+ INSTALL(FILES ${imgui_SOURCE_DIR}/${header} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
524
+ ENDFOREACH()
525
+ ENDIF()
526
+ INSTALL(TARGETS ${EDGE_EXPORTED} EXPORT edgeTargets
527
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
528
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
529
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
530
+ INSTALL(EXPORT edgeTargets NAMESPACE edge:: DESTINATION ${EDGE_INSTALL_CMAKEDIR})
531
+
532
+ # The public headers, those include/edge has a shim of, and the headers of src/ they include (#include "x.h"), but those of what
533
+ # this build has not (a backend, edge_sdl, edge_imgui, edge_asset).
534
+ FILE(GLOB EDGE_HEADERS RELATIVE ${EDGE_ROOT}/include/edge ${EDGE_ROOT}/include/edge/*.h)
535
+ SET(EDGE_HEADERS_TO_SCAN ${EDGE_HEADERS})
536
+ WHILE(EDGE_HEADERS_TO_SCAN)
537
+ LIST(POP_FRONT EDGE_HEADERS_TO_SCAN header)
538
+ FILE(STRINGS ${EDGE_ROOT}/src/${header} includes REGEX "^#include \"[^\"/]+\"")
539
+ FOREACH(line ${includes})
540
+ STRING(REGEX REPLACE "^#include \"([^\"]+)\".*" "\\1" included "${line}")
541
+ IF(EXISTS ${EDGE_ROOT}/src/${included} AND NOT included IN_LIST EDGE_HEADERS)
542
+ LIST(APPEND EDGE_HEADERS ${included})
543
+ LIST(APPEND EDGE_HEADERS_TO_SCAN ${included})
544
+ ENDIF()
545
+ ENDFOREACH()
546
+ ENDWHILE()
547
+ IF(NOT EDGE_USE_VULKAN)
548
+ LIST(FILTER EDGE_HEADERS EXCLUDE REGEX "^(vulkan_.*|frame_presenter|bundled_runtime)\\.h$")
549
+ ENDIF()
550
+ IF(NOT EDGE_USE_GLES)
551
+ LIST(FILTER EDGE_HEADERS EXCLUDE REGEX "^gles_")
552
+ ENDIF()
553
+ IF(NOT EDGE_USE_METAL)
554
+ LIST(FILTER EDGE_HEADERS EXCLUDE REGEX "^metal_")
555
+ ENDIF()
556
+ IF(NOT TARGET edge_sdl)
557
+ LIST(FILTER EDGE_HEADERS EXCLUDE REGEX "_sdl_")
558
+ ENDIF()
559
+ IF(NOT TARGET edge_imgui)
560
+ LIST(FILTER EDGE_HEADERS EXCLUDE REGEX "^imgui_")
561
+ ENDIF()
562
+ IF(NOT TARGET edge_asset)
563
+ LIST(FILTER EDGE_HEADERS EXCLUDE REGEX "^(image_compress|image_mips|mesh_lod|mesh_tiles|model_atlas.*|model_convert|model_textures)\\.h$")
564
+ ENDIF()
565
+ LIST(TRANSFORM EDGE_HEADERS PREPEND ${EDGE_ROOT}/src/)
566
+ INSTALL(FILES ${EDGE_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/edge)
567
+
568
+ IF(EDGE_VIEW_SHADER_BUILD_DIR)
569
+ INSTALL(FILES ${edge_view_shaders_OUTPUTS} DESTINATION ${CMAKE_INSTALL_DATADIR}/edge/view_shaders)
570
+ ENDIF()
571
+ INSTALL(FILES ${EDGE_CMAKE_DIR}/EdgeShaders.cmake ${EDGE_CMAKE_DIR}/EdgeGles.cmake ${EDGE_CMAKE_DIR}/EdgeMetal.cmake
572
+ ${EDGE_CMAKE_DIR}/EdgeRuntime.cmake ${EDGE_CMAKE_DIR}/EdgeModels.cmake ${EDGE_CMAKE_DIR}/edge_convert_model.cmake
573
+ DESTINATION ${EDGE_INSTALL_CMAKEDIR})
574
+ INSTALL(FILES ${EDGE_ROOT}/LICENSE.md ${EDGE_ROOT}/THIRD_PARTY.md DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/edge)
575
+
576
+ # the package: what it was built with, for edgeConfig.cmake.in
577
+ FOREACH(flag EDGE_USE_VULKAN EDGE_USE_GLES EDGE_USE_METAL EDGE_SYSTEM_DEPS)
578
+ IF(${flag})
579
+ SET(${flag}_BOOL ON)
580
+ ELSE()
581
+ SET(${flag}_BOOL OFF)
582
+ ENDIF()
583
+ ENDFOREACH()
584
+ FOREACH(part sdl imgui asset)
585
+ IF(TARGET edge_${part})
586
+ STRING(TOUPPER ${part} PART)
587
+ SET(EDGE_INSTALLED_${PART} ON)
588
+ ELSE()
589
+ STRING(TOUPPER ${part} PART)
590
+ SET(EDGE_INSTALLED_${PART} OFF)
591
+ ENDIF()
592
+ ENDFOREACH()
593
+ SET(EDGE_RUNTIME_SHADER_NAMES)
594
+ FOREACH(shader ${EDGE_RUNTIME_SHADERS})
595
+ GET_FILENAME_COMPONENT(name ${shader} NAME)
596
+ LIST(APPEND EDGE_RUNTIME_SHADER_NAMES ${name})
597
+ ENDFOREACH()
598
+ CONFIGURE_PACKAGE_CONFIG_FILE(${EDGE_CMAKE_DIR}/edgeConfig.cmake.in ${PROJECT_BINARY_DIR}/edgeConfig.cmake
599
+ INSTALL_DESTINATION ${EDGE_INSTALL_CMAKEDIR}
600
+ PATH_VARS EDGE_INSTALL_GLSLDIR EDGE_INSTALL_SHADERDIR EDGE_INSTALL_BINDIR)
601
+ WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/edgeConfigVersion.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion)
602
+ INSTALL(FILES ${PROJECT_BINARY_DIR}/edgeConfig.cmake ${PROJECT_BINARY_DIR}/edgeConfigVersion.cmake DESTINATION ${EDGE_INSTALL_CMAKEDIR})
603
+ ENDIF()
604
+
605
+ IF(EDGE_TESTS)
606
+ ADD_SUBDIRECTORY(test)
607
+ ENDIF()
@@ -0,0 +1,7 @@
1
+ # Contributing
2
+
3
+ Contributions are welcome as GitHub pull requests.
4
+
5
+ You are also welcome to fork the project under the terms of its [license](LICENSE.md).
6
+
7
+ For a security problem, see [SECURITY.md](SECURITY.md).
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2004-2026 Manvel Avetisian
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.