koffi 2.1.1 → 2.1.3

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 (312) hide show
  1. package/ChangeLog.md +12 -0
  2. package/build/qemu/2.1.3/koffi_darwin_arm64.tar.gz +0 -0
  3. package/build/qemu/2.1.3/koffi_darwin_x64.tar.gz +0 -0
  4. package/build/qemu/2.1.3/koffi_freebsd_arm64.tar.gz +0 -0
  5. package/build/qemu/2.1.3/koffi_freebsd_ia32.tar.gz +0 -0
  6. package/build/qemu/2.1.3/koffi_freebsd_x64.tar.gz +0 -0
  7. package/build/qemu/2.1.3/koffi_linux_arm32hf.tar.gz +0 -0
  8. package/build/qemu/2.1.3/koffi_linux_arm64.tar.gz +0 -0
  9. package/build/qemu/2.1.3/koffi_linux_ia32.tar.gz +0 -0
  10. package/build/qemu/2.1.3/koffi_linux_riscv64hf64.tar.gz +0 -0
  11. package/build/qemu/2.1.3/koffi_linux_x64.tar.gz +0 -0
  12. package/build/qemu/2.1.3/koffi_openbsd_ia32.tar.gz +0 -0
  13. package/build/qemu/2.1.3/koffi_openbsd_x64.tar.gz +0 -0
  14. package/build/qemu/2.1.3/koffi_win32_arm64.tar.gz +0 -0
  15. package/build/qemu/2.1.3/koffi_win32_ia32.tar.gz +0 -0
  16. package/build/qemu/2.1.3/koffi_win32_x64.tar.gz +0 -0
  17. package/doc/templates/badges.html +3 -0
  18. package/package.json +2 -2
  19. package/src/abi_arm64.cc +35 -1
  20. package/src/abi_x64_win.cc +2 -8
  21. package/src/abi_x86.cc +1 -7
  22. package/src/ffi.cc +2 -2
  23. package/src/ffi.hh +1 -1
  24. package/src/util.hh +6 -0
  25. package/test/raylib.js +37 -5
  26. package/vendor/libcc/libcc.cc +430 -196
  27. package/vendor/libcc/libcc.hh +1417 -1283
  28. package/vendor/raylib/BINDINGS.md +87 -70
  29. package/vendor/raylib/CHANGELOG +263 -50
  30. package/vendor/raylib/CMakeLists.txt +12 -0
  31. package/vendor/raylib/CMakeOptions.txt +8 -1
  32. package/vendor/raylib/CONVENTIONS.md +2 -3
  33. package/vendor/raylib/FAQ.md +137 -0
  34. package/vendor/raylib/HISTORY.md +62 -29
  35. package/vendor/raylib/LICENSE +1 -1
  36. package/vendor/raylib/README.md +22 -17
  37. package/vendor/raylib/ROADMAP.md +8 -7
  38. package/vendor/raylib/cmake/CompileDefinitions.cmake +19 -15
  39. package/vendor/raylib/cmake/GlfwImport.cmake +2 -0
  40. package/vendor/raylib/cmake/LibraryConfigurations.cmake +22 -16
  41. package/vendor/raylib/cmake/raylib-config.cmake +52 -49
  42. package/vendor/raylib/examples/CMakeLists.txt +14 -9
  43. package/vendor/raylib/examples/Makefile +112 -125
  44. package/vendor/raylib/examples/Makefile.Android +1 -1
  45. package/vendor/raylib/examples/Makefile.Web +145 -158
  46. package/vendor/raylib/examples/README.md +141 -141
  47. package/vendor/raylib/examples/audio/audio_module_playing.c +9 -4
  48. package/vendor/raylib/examples/audio/audio_multichannel_sound.c +8 -3
  49. package/vendor/raylib/examples/audio/audio_music_stream.c +16 -11
  50. package/vendor/raylib/examples/audio/audio_raw_stream.c +57 -9
  51. package/vendor/raylib/examples/audio/audio_sound_loading.c +8 -3
  52. package/vendor/raylib/examples/audio/audio_stream_effects.c +179 -0
  53. package/vendor/raylib/examples/audio/audio_stream_effects.png +0 -0
  54. package/vendor/raylib/examples/build.zig +17 -6
  55. package/vendor/raylib/examples/core/core_2d_camera.c +8 -4
  56. package/vendor/raylib/examples/core/core_2d_camera_mouse_zoom.c +105 -0
  57. package/vendor/raylib/examples/core/core_2d_camera_mouse_zoom.png +0 -0
  58. package/vendor/raylib/examples/core/core_2d_camera_platformer.c +11 -6
  59. package/vendor/raylib/examples/core/core_3d_camera_first_person.c +9 -4
  60. package/vendor/raylib/examples/core/core_3d_camera_free.c +9 -4
  61. package/vendor/raylib/examples/core/core_3d_camera_mode.c +8 -3
  62. package/vendor/raylib/examples/core/core_3d_picking.c +9 -4
  63. package/vendor/raylib/examples/core/core_basic_screen_manager.c +9 -7
  64. package/vendor/raylib/examples/core/core_basic_window.c +8 -3
  65. package/vendor/raylib/examples/core/core_basic_window_web.c +13 -11
  66. package/vendor/raylib/examples/core/core_custom_frame_control.c +9 -4
  67. package/vendor/raylib/examples/core/core_custom_logging.c +12 -8
  68. package/vendor/raylib/examples/core/core_drop_files.c +20 -12
  69. package/vendor/raylib/examples/core/core_input_gamepad.c +20 -15
  70. package/vendor/raylib/examples/core/core_input_gestures.c +19 -15
  71. package/vendor/raylib/examples/core/core_input_keys.c +8 -3
  72. package/vendor/raylib/examples/core/core_input_mouse.c +8 -3
  73. package/vendor/raylib/examples/core/core_input_mouse_wheel.c +8 -3
  74. package/vendor/raylib/examples/core/core_input_multitouch.c +8 -3
  75. package/vendor/raylib/examples/core/core_loading_thread.c +10 -6
  76. package/vendor/raylib/examples/core/core_random_values.c +8 -3
  77. package/vendor/raylib/examples/core/core_scissor_test.c +8 -3
  78. package/vendor/raylib/examples/core/core_smooth_pixelperfect.c +9 -4
  79. package/vendor/raylib/examples/core/core_split_screen.c +8 -3
  80. package/vendor/raylib/examples/core/core_storage_values.c +109 -3
  81. package/vendor/raylib/examples/core/core_vr_simulator.c +15 -7
  82. package/vendor/raylib/examples/core/core_window_flags.c +8 -3
  83. package/vendor/raylib/examples/core/core_window_letterbox.c +13 -18
  84. package/vendor/raylib/examples/core/core_window_should_close.c +77 -0
  85. package/vendor/raylib/examples/core/core_window_should_close.png +0 -0
  86. package/vendor/raylib/examples/core/core_world_screen.c +9 -4
  87. package/vendor/raylib/examples/examples_template.c +8 -3
  88. package/vendor/raylib/examples/models/models_animation.c +11 -7
  89. package/vendor/raylib/examples/models/models_billboard.c +9 -4
  90. package/vendor/raylib/examples/models/models_box_collisions.c +8 -3
  91. package/vendor/raylib/examples/models/models_cubicmap.c +9 -4
  92. package/vendor/raylib/examples/models/models_first_person_maze.c +9 -4
  93. package/vendor/raylib/examples/models/models_geometric_shapes.c +8 -3
  94. package/vendor/raylib/examples/models/models_heightmap.c +9 -4
  95. package/vendor/raylib/examples/models/models_loading.c +21 -17
  96. package/vendor/raylib/examples/models/models_loading_gltf.c +15 -41
  97. package/vendor/raylib/examples/models/models_loading_vox.c +9 -4
  98. package/vendor/raylib/examples/models/models_mesh_generation.c +71 -58
  99. package/vendor/raylib/examples/models/models_mesh_picking.c +25 -7
  100. package/vendor/raylib/examples/models/models_orthographic_projection.c +8 -5
  101. package/vendor/raylib/examples/models/models_rlgl_solar_system.c +6 -4
  102. package/vendor/raylib/examples/models/models_skybox.c +16 -12
  103. package/vendor/raylib/examples/models/models_waving_cubes.c +9 -4
  104. package/vendor/raylib/examples/models/models_yaw_pitch_roll.c +12 -7
  105. package/vendor/raylib/examples/models/resources/LICENSE.md +9 -10
  106. package/vendor/raylib/examples/models/resources/models/gltf/LICENSE +2 -23
  107. package/vendor/raylib/examples/models/resources/models/gltf/{raylib_32x32.glb → raylib_logo_3d.glb} +0 -0
  108. package/vendor/raylib/examples/models/resources/models/gltf/robot.blend +0 -0
  109. package/vendor/raylib/examples/models/resources/models/gltf/robot.glb +0 -0
  110. package/vendor/raylib/examples/others/easings_testbed.c +10 -8
  111. package/vendor/raylib/examples/others/easings_testbed.png +0 -0
  112. package/vendor/raylib/examples/others/embedded_files_loading.c +10 -5
  113. package/vendor/raylib/examples/others/embedded_files_loading.png +0 -0
  114. package/vendor/raylib/examples/others/raylib_opengl_interop.c +10 -6
  115. package/vendor/raylib/{src/extras/easings.h → examples/others/reasings.h} +38 -38
  116. package/vendor/raylib/examples/others/rlgl_compute_shader.c +21 -20
  117. package/vendor/raylib/examples/others/rlgl_compute_shader.png +0 -0
  118. package/vendor/raylib/examples/others/rlgl_standalone.c +4 -4
  119. package/vendor/raylib/examples/others/rlgl_standalone.png +0 -0
  120. package/vendor/raylib/examples/raylib_compile_execute.bat +2 -2
  121. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/lighting.fs +1 -1
  122. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/{base_lighting_instanced.vs → lighting_instancing.vs} +2 -2
  123. package/vendor/raylib/examples/shaders/rlights.h +14 -27
  124. package/vendor/raylib/examples/shaders/shaders_basic_lighting.c +24 -26
  125. package/vendor/raylib/examples/shaders/shaders_custom_uniform.c +10 -5
  126. package/vendor/raylib/examples/shaders/shaders_eratosthenes.c +13 -8
  127. package/vendor/raylib/examples/shaders/shaders_fog.c +8 -12
  128. package/vendor/raylib/examples/shaders/shaders_hot_reloading.c +10 -5
  129. package/vendor/raylib/examples/shaders/shaders_julia_set.c +9 -4
  130. package/vendor/raylib/examples/shaders/shaders_mesh_instancing.c +45 -119
  131. package/vendor/raylib/examples/shaders/shaders_model_shader.c +10 -5
  132. package/vendor/raylib/examples/shaders/shaders_multi_sample2d.c +8 -3
  133. package/vendor/raylib/examples/shaders/shaders_palette_switch.c +8 -3
  134. package/vendor/raylib/examples/shaders/shaders_postprocessing.c +9 -4
  135. package/vendor/raylib/examples/shaders/shaders_raymarching.c +14 -11
  136. package/vendor/raylib/examples/shaders/shaders_shapes_textures.c +8 -3
  137. package/vendor/raylib/examples/shaders/shaders_simple_mask.c +10 -5
  138. package/vendor/raylib/examples/shaders/shaders_spotlight.c +10 -6
  139. package/vendor/raylib/examples/shaders/shaders_texture_drawing.c +9 -4
  140. package/vendor/raylib/examples/shaders/shaders_texture_outline.c +8 -3
  141. package/vendor/raylib/examples/shaders/shaders_texture_waves.c +8 -3
  142. package/vendor/raylib/{src/extras → examples/shapes}/raygui.h +1290 -1141
  143. package/vendor/raylib/examples/{others/easings.h → shapes/reasings.h} +40 -40
  144. package/vendor/raylib/examples/shapes/shapes_basic_shapes.c +8 -3
  145. package/vendor/raylib/examples/shapes/shapes_bouncing_ball.c +8 -3
  146. package/vendor/raylib/examples/shapes/shapes_collision_area.c +10 -4
  147. package/vendor/raylib/examples/shapes/shapes_colors_palette.c +8 -3
  148. package/vendor/raylib/examples/shapes/shapes_draw_circle_sector.c +9 -4
  149. package/vendor/raylib/examples/shapes/shapes_draw_rectangle_rounded.c +9 -4
  150. package/vendor/raylib/examples/shapes/shapes_draw_ring.c +10 -6
  151. package/vendor/raylib/examples/shapes/shapes_easings_ball_anim.c +9 -4
  152. package/vendor/raylib/examples/shapes/shapes_easings_box_anim.c +9 -4
  153. package/vendor/raylib/examples/shapes/shapes_easings_rectangle_array.c +9 -4
  154. package/vendor/raylib/examples/shapes/shapes_following_eyes.c +8 -3
  155. package/vendor/raylib/examples/shapes/shapes_lines_bezier.c +8 -3
  156. package/vendor/raylib/examples/shapes/shapes_logo_raylib.c +8 -3
  157. package/vendor/raylib/examples/shapes/shapes_logo_raylib_anim.c +8 -3
  158. package/vendor/raylib/examples/shapes/shapes_rectangle_scaling.c +14 -5
  159. package/vendor/raylib/examples/shapes/shapes_top_down_lights.c +355 -0
  160. package/vendor/raylib/examples/shapes/shapes_top_down_lights.png +0 -0
  161. package/vendor/raylib/examples/text/resources/DotGothic16-Regular.ttf +0 -0
  162. package/vendor/raylib/examples/text/resources/DotGothic16-Regular_OFL.txt +93 -0
  163. package/vendor/raylib/examples/text/resources/LICENSE.md +1 -1
  164. package/vendor/raylib/examples/text/text_codepoints_loading.c +138 -0
  165. package/vendor/raylib/examples/text/text_codepoints_loading.png +0 -0
  166. package/vendor/raylib/examples/text/text_draw_3d.c +42 -33
  167. package/vendor/raylib/examples/text/text_font_filters.c +14 -11
  168. package/vendor/raylib/examples/text/text_font_loading.c +9 -4
  169. package/vendor/raylib/examples/text/text_font_sdf.c +9 -4
  170. package/vendor/raylib/examples/text/text_font_spritefont.c +12 -6
  171. package/vendor/raylib/examples/text/text_format_text.c +8 -3
  172. package/vendor/raylib/examples/text/text_input_box.c +8 -3
  173. package/vendor/raylib/examples/text/text_raylib_fonts.c +9 -4
  174. package/vendor/raylib/examples/text/text_rectangle_bounds.c +9 -5
  175. package/vendor/raylib/examples/text/text_unicode.c +9 -7
  176. package/vendor/raylib/examples/text/text_writing_anim.c +8 -3
  177. package/vendor/raylib/examples/textures/resources/scarfy_run.gif +0 -0
  178. package/vendor/raylib/examples/textures/textures_background_scrolling.c +8 -3
  179. package/vendor/raylib/examples/textures/textures_blend_modes.c +8 -3
  180. package/vendor/raylib/examples/textures/textures_bunnymark.c +8 -3
  181. package/vendor/raylib/examples/textures/textures_draw_tiled.c +14 -10
  182. package/vendor/raylib/examples/textures/textures_fog_of_war.c +154 -0
  183. package/vendor/raylib/examples/textures/textures_fog_of_war.png +0 -0
  184. package/vendor/raylib/examples/textures/textures_gif_player.c +121 -0
  185. package/vendor/raylib/examples/textures/textures_gif_player.png +0 -0
  186. package/vendor/raylib/examples/textures/textures_image_drawing.c +8 -3
  187. package/vendor/raylib/examples/textures/textures_image_generation.c +8 -3
  188. package/vendor/raylib/examples/textures/textures_image_loading.c +8 -3
  189. package/vendor/raylib/examples/textures/textures_image_processing.c +8 -3
  190. package/vendor/raylib/examples/textures/textures_image_text.c +8 -3
  191. package/vendor/raylib/examples/textures/textures_logo_raylib.c +8 -3
  192. package/vendor/raylib/examples/textures/textures_mouse_painting.c +9 -4
  193. package/vendor/raylib/examples/textures/textures_npatch_drawing.c +8 -3
  194. package/vendor/raylib/examples/textures/textures_particles_blending.c +8 -3
  195. package/vendor/raylib/examples/textures/textures_polygon.c +9 -5
  196. package/vendor/raylib/examples/textures/textures_raw_data.c +8 -3
  197. package/vendor/raylib/examples/textures/{textures_rectangle.c → textures_sprite_anim.c} +11 -5
  198. package/vendor/raylib/examples/textures/{textures_rectangle.png → textures_sprite_anim.png} +0 -0
  199. package/vendor/raylib/examples/textures/textures_sprite_button.c +8 -3
  200. package/vendor/raylib/examples/textures/textures_sprite_explosion.c +8 -3
  201. package/vendor/raylib/examples/textures/textures_srcrec_dstrec.c +8 -3
  202. package/vendor/raylib/examples/textures/textures_to_image.c +8 -3
  203. package/vendor/raylib/parser/LICENSE +1 -1
  204. package/vendor/raylib/parser/Makefile +28 -0
  205. package/vendor/raylib/parser/README.md +49 -5
  206. package/vendor/raylib/parser/output/raylib_api.json +10717 -0
  207. package/vendor/raylib/parser/output/raylib_api.lua +7435 -0
  208. package/vendor/raylib/parser/{raylib_api.txt → output/raylib_api.txt} +1371 -824
  209. package/vendor/raylib/parser/{raylib_api.xml → output/raylib_api.xml} +827 -595
  210. package/vendor/raylib/parser/raylib_parser.c +1174 -196
  211. package/vendor/raylib/projects/4coder/Makefile +2 -4
  212. package/vendor/raylib/projects/4coder/main.c +0 -1
  213. package/vendor/raylib/projects/CMake/CMakeLists.txt +13 -16
  214. package/vendor/raylib/projects/CMake/README.md +27 -0
  215. package/vendor/raylib/projects/CMake/core_basic_window.c +52 -31
  216. package/vendor/raylib/projects/CodeBlocks/README.md +4 -4
  217. package/vendor/raylib/projects/Geany/core_basic_window.c +1 -1
  218. package/vendor/raylib/projects/Notepad++/c_raylib.xml +168 -128
  219. package/vendor/raylib/projects/Notepad++/npes_saved_tcc.txt +0 -0
  220. package/vendor/raylib/projects/Notepad++/npes_saved_w64devkit.txt +0 -0
  221. package/vendor/raylib/projects/Notepad++/npes_saved_zig.txt +0 -0
  222. package/vendor/raylib/projects/Notepad++/raylib_npp_parser/raylib_npp.xml +168 -84
  223. package/vendor/raylib/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +67 -51
  224. package/vendor/raylib/projects/README.md +1 -1
  225. package/vendor/raylib/projects/VSCode/.vscode/c_cpp_properties.json +1 -1
  226. package/vendor/raylib/projects/VSCode/Makefile +8 -11
  227. package/vendor/raylib/projects/VSCode/main.c +53 -26
  228. package/vendor/raylib/projects/VSCode/resources/LICENSE +1 -0
  229. package/vendor/raylib/projects/scripts/build-linux.sh +6 -6
  230. package/vendor/raylib/projects/scripts/build-osx.sh +6 -6
  231. package/vendor/raylib/projects/scripts/build-rpi.sh +6 -6
  232. package/vendor/raylib/projects/scripts/build-windows.bat +2 -2
  233. package/vendor/raylib/src/CMakeLists.txt +6 -7
  234. package/vendor/raylib/src/Makefile +209 -103
  235. package/vendor/raylib/src/build.zig +56 -20
  236. package/vendor/raylib/src/config.h +32 -27
  237. package/vendor/raylib/src/external/cgltf.h +342 -104
  238. package/vendor/raylib/src/external/dr_wav.h +487 -225
  239. package/vendor/raylib/src/external/glfw/src/posix_time.c +1 -3
  240. package/vendor/raylib/src/external/glfw/src/wl_init.c +1 -3
  241. package/vendor/raylib/src/external/jar_xm.h +2 -1
  242. package/vendor/raylib/src/external/miniaudio.h +62251 -42061
  243. package/vendor/raylib/src/external/qoi.h +671 -0
  244. package/vendor/raylib/src/external/stb_vorbis.h +1 -1
  245. package/vendor/raylib/src/external/vox_loader.h +30 -25
  246. package/vendor/raylib/src/minshell.html +82 -0
  247. package/vendor/raylib/src/raudio.c +359 -201
  248. package/vendor/raylib/src/raylib.dll.rc +5 -5
  249. package/vendor/raylib/src/raylib.dll.rc.data +0 -0
  250. package/vendor/raylib/src/raylib.h +95 -63
  251. package/vendor/raylib/src/raylib.rc +5 -5
  252. package/vendor/raylib/src/raylib.rc.data +0 -0
  253. package/vendor/raylib/src/raymath.h +391 -133
  254. package/vendor/raylib/src/rcamera.h +32 -41
  255. package/vendor/raylib/src/rcore.c +775 -471
  256. package/vendor/raylib/src/rgestures.h +5 -5
  257. package/vendor/raylib/src/rglfw.c +3 -3
  258. package/vendor/raylib/src/rlgl.h +184 -144
  259. package/vendor/raylib/src/rmodels.c +207 -144
  260. package/vendor/raylib/src/rshapes.c +105 -47
  261. package/vendor/raylib/src/rtext.c +255 -38
  262. package/vendor/raylib/src/rtextures.c +167 -71
  263. package/vendor/raylib/src/shell.html +63 -63
  264. package/vendor/raylib/src/utils.c +49 -3
  265. package/vendor/raylib/src/utils.h +3 -3
  266. package/build/qemu/2.1.1/koffi_darwin_arm64.tar.gz +0 -0
  267. package/build/qemu/2.1.1/koffi_darwin_x64.tar.gz +0 -0
  268. package/build/qemu/2.1.1/koffi_freebsd_arm64.tar.gz +0 -0
  269. package/build/qemu/2.1.1/koffi_freebsd_ia32.tar.gz +0 -0
  270. package/build/qemu/2.1.1/koffi_freebsd_x64.tar.gz +0 -0
  271. package/build/qemu/2.1.1/koffi_linux_arm32hf.tar.gz +0 -0
  272. package/build/qemu/2.1.1/koffi_linux_arm64.tar.gz +0 -0
  273. package/build/qemu/2.1.1/koffi_linux_ia32.tar.gz +0 -0
  274. package/build/qemu/2.1.1/koffi_linux_riscv64hf64.tar.gz +0 -0
  275. package/build/qemu/2.1.1/koffi_linux_x64.tar.gz +0 -0
  276. package/build/qemu/2.1.1/koffi_openbsd_ia32.tar.gz +0 -0
  277. package/build/qemu/2.1.1/koffi_openbsd_x64.tar.gz +0 -0
  278. package/build/qemu/2.1.1/koffi_win32_arm64.tar.gz +0 -0
  279. package/build/qemu/2.1.1/koffi_win32_ia32.tar.gz +0 -0
  280. package/build/qemu/2.1.1/koffi_win32_x64.tar.gz +0 -0
  281. package/vendor/raylib/CONTRIBUTORS.md +0 -63
  282. package/vendor/raylib/SPONSORS.md +0 -68
  283. package/vendor/raylib/examples/core/core_quat_conversion.c +0 -132
  284. package/vendor/raylib/examples/core/core_quat_conversion.png +0 -0
  285. package/vendor/raylib/examples/models/resources/models/gltf/AnimatedMorphCube.glb +0 -0
  286. package/vendor/raylib/examples/models/resources/models/gltf/AnimatedTriangle.gltf +0 -118
  287. package/vendor/raylib/examples/models/resources/models/gltf/BoxAnimated.glb +0 -0
  288. package/vendor/raylib/examples/models/resources/models/gltf/girl.glb +0 -0
  289. package/vendor/raylib/examples/models/resources/models/gltf/rigged_figure.glb +0 -0
  290. package/vendor/raylib/examples/models/resources/models/gltf/vertex_colored_object.glb +0 -0
  291. package/vendor/raylib/examples/models/resources/models/iqm/vertex_colored_object.iqm +0 -0
  292. package/vendor/raylib/examples/models/rlights.h +0 -183
  293. package/vendor/raylib/examples/others/raudio_standalone.c +0 -152
  294. package/vendor/raylib/examples/others/resources/audio/country.mp3 +0 -0
  295. package/vendor/raylib/examples/others/resources/audio/target.ogg +0 -0
  296. package/vendor/raylib/examples/others/resources/audio/weird.wav +0 -0
  297. package/vendor/raylib/examples/physics/physics_demo.c +0 -128
  298. package/vendor/raylib/examples/physics/physics_demo.png +0 -0
  299. package/vendor/raylib/examples/physics/physics_friction.c +0 -142
  300. package/vendor/raylib/examples/physics/physics_friction.png +0 -0
  301. package/vendor/raylib/examples/physics/physics_movement.c +0 -128
  302. package/vendor/raylib/examples/physics/physics_movement.png +0 -0
  303. package/vendor/raylib/examples/physics/physics_restitution.c +0 -129
  304. package/vendor/raylib/examples/physics/physics_restitution.png +0 -0
  305. package/vendor/raylib/examples/physics/physics_shatter.c +0 -111
  306. package/vendor/raylib/examples/physics/physics_shatter.png +0 -0
  307. package/vendor/raylib/parser/raylib_api.json +0 -6668
  308. package/vendor/raylib/projects/VS2019/raylib/raylib.rc +0 -0
  309. package/vendor/raylib/projects/VS2019/raylib/resource.h +0 -14
  310. package/vendor/raylib/src/extras/physac.h +0 -1977
  311. package/vendor/raylib/src/extras/rmem.h +0 -751
  312. package/vendor/raylib/src/raudio.h +0 -198
@@ -1,128 +0,0 @@
1
- /*******************************************************************************************
2
- *
3
- * raylib [physac] example - physics demo
4
- *
5
- * This example has been created using raylib 1.5 (www.raylib.com)
6
- * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
7
- *
8
- * This example uses physac 1.1 (https://github.com/raysan5/raylib/blob/master/src/physac.h)
9
- *
10
- * Copyright (c) 2016-2021 Victor Fisac (@victorfisac) and Ramon Santamaria (@raysan5)
11
- *
12
- ********************************************************************************************/
13
-
14
- #include "raylib.h"
15
-
16
- #define PHYSAC_IMPLEMENTATION
17
- #include "extras/physac.h"
18
-
19
- int main(void)
20
- {
21
- // Initialization
22
- //--------------------------------------------------------------------------------------
23
- const int screenWidth = 800;
24
- const int screenHeight = 450;
25
-
26
- SetConfigFlags(FLAG_MSAA_4X_HINT);
27
- InitWindow(screenWidth, screenHeight, "raylib [physac] example - physics demo");
28
-
29
- // Physac logo drawing position
30
- int logoX = screenWidth - MeasureText("Physac", 30) - 10;
31
- int logoY = 15;
32
-
33
- // Initialize physics and default physics bodies
34
- InitPhysics();
35
-
36
- // Create floor rectangle physics body
37
- PhysicsBody floor = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2.0f, (float)screenHeight }, 500, 100, 10);
38
- floor->enabled = false; // Disable body state to convert it to static (no dynamics, but collisions)
39
-
40
- // Create obstacle circle physics body
41
- PhysicsBody circle = CreatePhysicsBodyCircle((Vector2){ screenWidth/2.0f, screenHeight/2.0f }, 45, 10);
42
- circle->enabled = false; // Disable body state to convert it to static (no dynamics, but collisions)
43
-
44
- SetTargetFPS(60); // Set our game to run at 60 frames-per-second
45
- //--------------------------------------------------------------------------------------
46
-
47
- // Main game loop
48
- while (!WindowShouldClose()) // Detect window close button or ESC key
49
- {
50
- // Update
51
- //----------------------------------------------------------------------------------
52
- UpdatePhysics(); // Update physics system
53
-
54
- if (IsKeyPressed(KEY_R)) // Reset physics system
55
- {
56
- ResetPhysics();
57
-
58
- floor = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2.0f, (float)screenHeight }, 500, 100, 10);
59
- floor->enabled = false;
60
-
61
- circle = CreatePhysicsBodyCircle((Vector2){ screenWidth/2.0f, screenHeight/2.0f }, 45, 10);
62
- circle->enabled = false;
63
- }
64
-
65
- // Physics body creation inputs
66
- if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) CreatePhysicsBodyPolygon(GetMousePosition(), (float)GetRandomValue(20, 80), GetRandomValue(3, 8), 10);
67
- else if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT)) CreatePhysicsBodyCircle(GetMousePosition(), (float)GetRandomValue(10, 45), 10);
68
-
69
- // Destroy falling physics bodies
70
- int bodiesCount = GetPhysicsBodiesCount();
71
- for (int i = bodiesCount - 1; i >= 0; i--)
72
- {
73
- PhysicsBody body = GetPhysicsBody(i);
74
- if (body != NULL && (body->position.y > screenHeight*2)) DestroyPhysicsBody(body);
75
- }
76
- //----------------------------------------------------------------------------------
77
-
78
- // Draw
79
- //----------------------------------------------------------------------------------
80
- BeginDrawing();
81
-
82
- ClearBackground(BLACK);
83
-
84
- DrawFPS(screenWidth - 90, screenHeight - 30);
85
-
86
- // Draw created physics bodies
87
- bodiesCount = GetPhysicsBodiesCount();
88
- for (int i = 0; i < bodiesCount; i++)
89
- {
90
- PhysicsBody body = GetPhysicsBody(i);
91
-
92
- if (body != NULL)
93
- {
94
- int vertexCount = GetPhysicsShapeVerticesCount(i);
95
- for (int j = 0; j < vertexCount; j++)
96
- {
97
- // Get physics bodies shape vertices to draw lines
98
- // Note: GetPhysicsShapeVertex() already calculates rotation transformations
99
- Vector2 vertexA = GetPhysicsShapeVertex(body, j);
100
-
101
- int jj = (((j + 1) < vertexCount) ? (j + 1) : 0); // Get next vertex or first to close the shape
102
- Vector2 vertexB = GetPhysicsShapeVertex(body, jj);
103
-
104
- DrawLineV(vertexA, vertexB, GREEN); // Draw a line between two vertex positions
105
- }
106
- }
107
- }
108
-
109
- DrawText("Left mouse button to create a polygon", 10, 10, 10, WHITE);
110
- DrawText("Right mouse button to create a circle", 10, 25, 10, WHITE);
111
- DrawText("Press 'R' to reset example", 10, 40, 10, WHITE);
112
-
113
- DrawText("Physac", logoX, logoY, 30, WHITE);
114
- DrawText("Powered by", logoX + 50, logoY - 7, 10, WHITE);
115
-
116
- EndDrawing();
117
- //----------------------------------------------------------------------------------
118
- }
119
-
120
- // De-Initialization
121
- //--------------------------------------------------------------------------------------
122
- ClosePhysics(); // Unitialize physics
123
-
124
- CloseWindow(); // Close window and OpenGL context
125
- //--------------------------------------------------------------------------------------
126
-
127
- return 0;
128
- }
@@ -1,142 +0,0 @@
1
- /*******************************************************************************************
2
- *
3
- * raylib [physac] example - physics friction
4
- *
5
- * This example has been created using raylib 1.5 (www.raylib.com)
6
- * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
7
- *
8
- * This example uses physac 1.1 (https://github.com/raysan5/raylib/blob/master/src/physac.h)
9
- *
10
- * Copyright (c) 2016-2021 Victor Fisac (@victorfisac) and Ramon Santamaria (@raysan5)
11
- *
12
- ********************************************************************************************/
13
-
14
- #include "raylib.h"
15
-
16
- #define PHYSAC_IMPLEMENTATION
17
- #include "extras/physac.h"
18
-
19
- int main(void)
20
- {
21
- // Initialization
22
- //--------------------------------------------------------------------------------------
23
- const int screenWidth = 800;
24
- const int screenHeight = 450;
25
-
26
- SetConfigFlags(FLAG_MSAA_4X_HINT);
27
- InitWindow(screenWidth, screenHeight, "raylib [physac] example - physics friction");
28
-
29
- // Physac logo drawing position
30
- int logoX = screenWidth - MeasureText("Physac", 30) - 10;
31
- int logoY = 15;
32
-
33
- // Initialize physics and default physics bodies
34
- InitPhysics();
35
-
36
- // Create floor rectangle physics body
37
- PhysicsBody floor = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2.0f, (float)screenHeight }, (float)screenWidth, 100, 10);
38
- floor->enabled = false; // Disable body state to convert it to static (no dynamics, but collisions)
39
- PhysicsBody wall = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2.0f, screenHeight*0.8f }, 10, 80, 10);
40
- wall->enabled = false; // Disable body state to convert it to static (no dynamics, but collisions)
41
-
42
- // Create left ramp physics body
43
- PhysicsBody rectLeft = CreatePhysicsBodyRectangle((Vector2){ 25, (float)screenHeight - 5 }, 250, 250, 10);
44
- rectLeft->enabled = false; // Disable body state to convert it to static (no dynamics, but collisions)
45
- SetPhysicsBodyRotation(rectLeft, 30*DEG2RAD);
46
-
47
- // Create right ramp physics body
48
- PhysicsBody rectRight = CreatePhysicsBodyRectangle((Vector2){ (float)screenWidth - 25, (float)screenHeight - 5 }, 250, 250, 10);
49
- rectRight->enabled = false; // Disable body state to convert it to static (no dynamics, but collisions)
50
- SetPhysicsBodyRotation(rectRight, 330*DEG2RAD);
51
-
52
- // Create dynamic physics bodies
53
- PhysicsBody bodyA = CreatePhysicsBodyRectangle((Vector2){ 35, screenHeight*0.6f }, 40, 40, 10);
54
- bodyA->staticFriction = 0.1f;
55
- bodyA->dynamicFriction = 0.1f;
56
- SetPhysicsBodyRotation(bodyA, 30*DEG2RAD);
57
-
58
- PhysicsBody bodyB = CreatePhysicsBodyRectangle((Vector2){ (float)screenWidth - 35, (float)screenHeight*0.6f }, 40, 40, 10);
59
- bodyB->staticFriction = 1.0f;
60
- bodyB->dynamicFriction = 1.0f;
61
- SetPhysicsBodyRotation(bodyB, 330*DEG2RAD);
62
-
63
- SetTargetFPS(60); // Set our game to run at 60 frames-per-second
64
- //--------------------------------------------------------------------------------------
65
-
66
- // Main game loop
67
- while (!WindowShouldClose()) // Detect window close button or ESC key
68
- {
69
- // Update
70
- //----------------------------------------------------------------------------------
71
- UpdatePhysics(); // Update physics system
72
-
73
- if (IsKeyPressed(KEY_R)) // Reset physics system
74
- {
75
- // Reset dynamic physics bodies position, velocity and rotation
76
- bodyA->position = (Vector2){ 35, screenHeight*0.6f };
77
- bodyA->velocity = (Vector2){ 0, 0 };
78
- bodyA->angularVelocity = 0;
79
- SetPhysicsBodyRotation(bodyA, 30*DEG2RAD);
80
-
81
- bodyB->position = (Vector2){ (float)screenWidth - 35, screenHeight * 0.6f };
82
- bodyB->velocity = (Vector2){ 0, 0 };
83
- bodyB->angularVelocity = 0;
84
- SetPhysicsBodyRotation(bodyB, 330*DEG2RAD);
85
- }
86
- //----------------------------------------------------------------------------------
87
-
88
- // Draw
89
- //----------------------------------------------------------------------------------
90
- BeginDrawing();
91
-
92
- ClearBackground(BLACK);
93
-
94
- DrawFPS(screenWidth - 90, screenHeight - 30);
95
-
96
- // Draw created physics bodies
97
- int bodiesCount = GetPhysicsBodiesCount();
98
- for (int i = 0; i < bodiesCount; i++)
99
- {
100
- PhysicsBody body = GetPhysicsBody(i);
101
-
102
- if (body != NULL)
103
- {
104
- int vertexCount = GetPhysicsShapeVerticesCount(i);
105
- for (int j = 0; j < vertexCount; j++)
106
- {
107
- // Get physics bodies shape vertices to draw lines
108
- // Note: GetPhysicsShapeVertex() already calculates rotation transformations
109
- Vector2 vertexA = GetPhysicsShapeVertex(body, j);
110
-
111
- int jj = (((j + 1) < vertexCount) ? (j + 1) : 0); // Get next vertex or first to close the shape
112
- Vector2 vertexB = GetPhysicsShapeVertex(body, jj);
113
-
114
- DrawLineV(vertexA, vertexB, GREEN); // Draw a line between two vertex positions
115
- }
116
- }
117
- }
118
-
119
- DrawRectangle(0, screenHeight - 49, screenWidth, 49, BLACK);
120
-
121
- DrawText("Friction amount", (screenWidth - MeasureText("Friction amount", 30))/2.0f, 75, 30, WHITE);
122
- DrawText("0.1", (int)bodyA->position.x - MeasureText("0.1", 20)/2, (int)bodyA->position.y - 7, 20, WHITE);
123
- DrawText("1", (int)bodyB->position.x - MeasureText("1", 20)/2, (int)bodyB->position.y - 7, 20, WHITE);
124
-
125
- DrawText("Press 'R' to reset example", 10, 10, 10, WHITE);
126
-
127
- DrawText("Physac", logoX, logoY, 30, WHITE);
128
- DrawText("Powered by", logoX + 50, logoY - 7, 10, WHITE);
129
-
130
- EndDrawing();
131
- //----------------------------------------------------------------------------------
132
- }
133
-
134
- // De-Initialization
135
- //--------------------------------------------------------------------------------------
136
- ClosePhysics(); // Unitialize physics
137
-
138
- CloseWindow(); // Close window and OpenGL context
139
- //--------------------------------------------------------------------------------------
140
-
141
- return 0;
142
- }
@@ -1,128 +0,0 @@
1
- /*******************************************************************************************
2
- *
3
- * raylib [physac] example - physics movement
4
- *
5
- * This example has been created using raylib 1.5 (www.raylib.com)
6
- * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
7
- *
8
- * This example uses physac 1.1 (https://github.com/raysan5/raylib/blob/master/src/physac.h)
9
- *
10
- * Copyright (c) 2016-2021 Victor Fisac (@victorfisac) and Ramon Santamaria (@raysan5)
11
- *
12
- ********************************************************************************************/
13
-
14
- #include "raylib.h"
15
-
16
- #define PHYSAC_IMPLEMENTATION
17
- #include "extras/physac.h"
18
-
19
- #define VELOCITY 0.5f
20
-
21
- int main(void)
22
- {
23
- // Initialization
24
- //--------------------------------------------------------------------------------------
25
- const int screenWidth = 800;
26
- const int screenHeight = 450;
27
-
28
- SetConfigFlags(FLAG_MSAA_4X_HINT);
29
- InitWindow(screenWidth, screenHeight, "raylib [physac] example - physics movement");
30
-
31
- // Physac logo drawing position
32
- int logoX = screenWidth - MeasureText("Physac", 30) - 10;
33
- int logoY = 15;
34
-
35
- // Initialize physics and default physics bodies
36
- InitPhysics();
37
-
38
- // Create floor and walls rectangle physics body
39
- PhysicsBody floor = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2.0f, (float)screenHeight }, (float)screenWidth, 100, 10);
40
- PhysicsBody platformLeft = CreatePhysicsBodyRectangle((Vector2){ screenWidth*0.25f, screenHeight*0.6f }, screenWidth*0.25f, 10, 10);
41
- PhysicsBody platformRight = CreatePhysicsBodyRectangle((Vector2){ screenWidth*0.75f, screenHeight*0.6f }, screenWidth*0.25f, 10, 10);
42
- PhysicsBody wallLeft = CreatePhysicsBodyRectangle((Vector2){ -5, screenHeight/2.0f }, 10, (float)screenHeight, 10);
43
- PhysicsBody wallRight = CreatePhysicsBodyRectangle((Vector2){ (float)screenWidth + 5, screenHeight/2.0f }, 10, (float)screenHeight, 10);
44
-
45
- // Disable dynamics to floor and walls physics bodies
46
- floor->enabled = false;
47
- platformLeft->enabled = false;
48
- platformRight->enabled = false;
49
- wallLeft->enabled = false;
50
- wallRight->enabled = false;
51
-
52
- // Create movement physics body
53
- PhysicsBody body = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2.0f, screenHeight/2.0f }, 50, 50, 1);
54
- body->freezeOrient = true; // Constrain body rotation to avoid little collision torque amounts
55
-
56
- SetTargetFPS(60); // Set our game to run at 60 frames-per-second
57
- //--------------------------------------------------------------------------------------
58
-
59
- // Main game loop
60
- while (!WindowShouldClose()) // Detect window close button or ESC key
61
- {
62
- // Update
63
- //----------------------------------------------------------------------------------
64
- UpdatePhysics(); // Update physics system
65
-
66
- if (IsKeyPressed(KEY_R)) // Reset physics input
67
- {
68
- // Reset movement physics body position, velocity and rotation
69
- body->position = (Vector2){ screenWidth/2.0f, screenHeight/2.0f };
70
- body->velocity = (Vector2){ 0, 0 };
71
- SetPhysicsBodyRotation(body, 0);
72
- }
73
-
74
- // Horizontal movement input
75
- if (IsKeyDown(KEY_RIGHT)) body->velocity.x = VELOCITY;
76
- else if (IsKeyDown(KEY_LEFT)) body->velocity.x = -VELOCITY;
77
-
78
- // Vertical movement input checking if player physics body is grounded
79
- if (IsKeyDown(KEY_UP) && body->isGrounded) body->velocity.y = -VELOCITY*4;
80
- //----------------------------------------------------------------------------------
81
-
82
- // Draw
83
- //----------------------------------------------------------------------------------
84
- BeginDrawing();
85
-
86
- ClearBackground(BLACK);
87
-
88
- DrawFPS(screenWidth - 90, screenHeight - 30);
89
-
90
- // Draw created physics bodies
91
- int bodiesCount = GetPhysicsBodiesCount();
92
- for (int i = 0; i < bodiesCount; i++)
93
- {
94
- PhysicsBody body = GetPhysicsBody(i);
95
-
96
- int vertexCount = GetPhysicsShapeVerticesCount(i);
97
- for (int j = 0; j < vertexCount; j++)
98
- {
99
- // Get physics bodies shape vertices to draw lines
100
- // Note: GetPhysicsShapeVertex() already calculates rotation transformations
101
- Vector2 vertexA = GetPhysicsShapeVertex(body, j);
102
-
103
- int jj = (((j + 1) < vertexCount) ? (j + 1) : 0); // Get next vertex or first to close the shape
104
- Vector2 vertexB = GetPhysicsShapeVertex(body, jj);
105
-
106
- DrawLineV(vertexA, vertexB, GREEN); // Draw a line between two vertex positions
107
- }
108
- }
109
-
110
- DrawText("Use 'ARROWS' to move player", 10, 10, 10, WHITE);
111
- DrawText("Press 'R' to reset example", 10, 30, 10, WHITE);
112
-
113
- DrawText("Physac", logoX, logoY, 30, WHITE);
114
- DrawText("Powered by", logoX + 50, logoY - 7, 10, WHITE);
115
-
116
- EndDrawing();
117
- //----------------------------------------------------------------------------------
118
- }
119
-
120
- // De-Initialization
121
- //--------------------------------------------------------------------------------------
122
- ClosePhysics(); // Unitialize physics
123
-
124
- CloseWindow(); // Close window and OpenGL context
125
- //--------------------------------------------------------------------------------------
126
-
127
- return 0;
128
- }
@@ -1,129 +0,0 @@
1
- /*******************************************************************************************
2
- *
3
- * raylib [physac] example - physics restitution
4
- *
5
- * This example has been created using raylib 1.5 (www.raylib.com)
6
- * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
7
- *
8
- * This example uses physac 1.1 (https://github.com/raysan5/raylib/blob/master/src/physac.h)
9
- *
10
- * Copyright (c) 2016-2021 Victor Fisac (@victorfisac) and Ramon Santamaria (@raysan5)
11
- *
12
- ********************************************************************************************/
13
-
14
- #include "raylib.h"
15
-
16
- #define PHYSAC_IMPLEMENTATION
17
- #include "extras/physac.h"
18
-
19
- int main(void)
20
- {
21
- // Initialization
22
- //--------------------------------------------------------------------------------------
23
- const int screenWidth = 800;
24
- const int screenHeight = 450;
25
-
26
- SetConfigFlags(FLAG_MSAA_4X_HINT);
27
- InitWindow(screenWidth, screenHeight, "raylib [physac] example - physics restitution");
28
-
29
- // Physac logo drawing position
30
- int logoX = screenWidth - MeasureText("Physac", 30) - 10;
31
- int logoY = 15;
32
-
33
- // Initialize physics and default physics bodies
34
- InitPhysics();
35
-
36
- // Create floor rectangle physics body
37
- PhysicsBody floor = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2.0f, (float)screenHeight }, (float)screenWidth, 100, 10);
38
- floor->enabled = false; // Disable body state to convert it to static (no dynamics, but collisions)
39
- floor->restitution = 1;
40
-
41
- // Create circles physics body
42
- PhysicsBody circleA = CreatePhysicsBodyCircle((Vector2){ screenWidth*0.25f, screenHeight/2.0f }, 30, 10);
43
- circleA->restitution = 0;
44
- PhysicsBody circleB = CreatePhysicsBodyCircle((Vector2){ screenWidth*0.5f, screenHeight/2.0f }, 30, 10);
45
- circleB->restitution = 0.5f;
46
- PhysicsBody circleC = CreatePhysicsBodyCircle((Vector2){ screenWidth*0.75f, screenHeight/2.0f }, 30, 10);
47
- circleC->restitution = 1;
48
-
49
- // Restitution demo needs a very tiny physics time step for a proper simulation
50
- SetPhysicsTimeStep(1.0/60.0/100*1000);
51
-
52
- SetTargetFPS(60); // Set our game to run at 60 frames-per-second
53
- //--------------------------------------------------------------------------------------
54
-
55
- // Main game loop
56
- while (!WindowShouldClose()) // Detect window close button or ESC key
57
- {
58
- // Update
59
- //----------------------------------------------------------------------------------
60
- UpdatePhysics(); // Update physics system
61
-
62
- if (IsKeyPressed(KEY_R)) // Reset physics input
63
- {
64
- // Reset circles physics bodies position and velocity
65
- circleA->position = (Vector2){ screenWidth*0.25f, screenHeight/2.0f };
66
- circleA->velocity = (Vector2){ 0, 0 };
67
- circleB->position = (Vector2){ screenWidth*0.5f, screenHeight/2.0f };
68
- circleB->velocity = (Vector2){ 0, 0 };
69
- circleC->position = (Vector2){ screenWidth*0.75f, screenHeight/2.0f };
70
- circleC->velocity = (Vector2){ 0, 0 };
71
- }
72
- //----------------------------------------------------------------------------------
73
-
74
- // Draw
75
- //----------------------------------------------------------------------------------
76
- BeginDrawing();
77
-
78
- ClearBackground(BLACK);
79
-
80
- DrawFPS(screenWidth - 90, screenHeight - 30);
81
-
82
- // Draw created physics bodies
83
- int bodiesCount = GetPhysicsBodiesCount();
84
- for (int i = 0; i < bodiesCount; i++)
85
- {
86
- PhysicsBody body = GetPhysicsBody(i);
87
-
88
- int vertexCount = GetPhysicsShapeVerticesCount(i);
89
- for (int j = 0; j < vertexCount; j++)
90
- {
91
- // Get physics bodies shape vertices to draw lines
92
- // Note: GetPhysicsShapeVertex() already calculates rotation transformations
93
- Vector2 vertexA = GetPhysicsShapeVertex(body, j);
94
-
95
- int jj = (((j + 1) < vertexCount) ? (j + 1) : 0); // Get next vertex or first to close the shape
96
- Vector2 vertexB = GetPhysicsShapeVertex(body, jj);
97
-
98
- DrawLineV(vertexA, vertexB, GREEN); // Draw a line between two vertex positions
99
- }
100
- }
101
-
102
- DrawText("Restitution amount", (screenWidth - MeasureText("Restitution amount", 30))/2, 75, 30, WHITE);
103
- DrawText("0", (int)circleA->position.x - MeasureText("0", 20)/2, circleA->position.y - 7, 20, WHITE);
104
- DrawText("0.5", (int)circleB->position.x - MeasureText("0.5", 20)/2, circleB->position.y - 7, 20, WHITE);
105
- DrawText("1", (int)circleC->position.x - MeasureText("1", 20)/2, circleC->position.y - 7, 20, WHITE);
106
-
107
- DrawText("Press 'R' to reset example", 10, 10, 10, WHITE);
108
-
109
- DrawText("Physac", logoX, logoY, 30, WHITE);
110
- DrawText("Powered by", logoX + 50, logoY - 7, 10, WHITE);
111
-
112
- EndDrawing();
113
- //----------------------------------------------------------------------------------
114
- }
115
-
116
- // De-Initialization
117
- //--------------------------------------------------------------------------------------
118
- DestroyPhysicsBody(circleA);
119
- DestroyPhysicsBody(circleB);
120
- DestroyPhysicsBody(circleC);
121
- DestroyPhysicsBody(floor);
122
-
123
- ClosePhysics(); // Unitialize physics
124
-
125
- CloseWindow(); // Close window and OpenGL context
126
- //--------------------------------------------------------------------------------------
127
-
128
- return 0;
129
- }
@@ -1,111 +0,0 @@
1
- /*******************************************************************************************
2
- *
3
- * raylib [physac] example - physics shatter
4
- *
5
- * This example has been created using raylib 1.5 (www.raylib.com)
6
- * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
7
- *
8
- * This example uses physac 1.1 (https://github.com/raysan5/raylib/blob/master/src/physac.h)
9
- *
10
- * Copyright (c) 2016-2021 Victor Fisac (@victorfisac) and Ramon Santamaria (@raysan5)
11
- *
12
- ********************************************************************************************/
13
-
14
- #include "raylib.h"
15
-
16
- #define PHYSAC_IMPLEMENTATION
17
- #include "extras/physac.h"
18
-
19
- int main(void)
20
- {
21
- // Initialization
22
- //--------------------------------------------------------------------------------------
23
- const int screenWidth = 800;
24
- const int screenHeight = 450;
25
-
26
- SetConfigFlags(FLAG_MSAA_4X_HINT);
27
- InitWindow(screenWidth, screenHeight, "raylib [physac] example - physics shatter");
28
-
29
- // Physac logo drawing position
30
- int logoX = screenWidth - MeasureText("Physac", 30) - 10;
31
- int logoY = 15;
32
-
33
- // Initialize physics and default physics bodies
34
- InitPhysics();
35
- SetPhysicsGravity(0, 0);
36
-
37
- // Create random polygon physics body to shatter
38
- CreatePhysicsBodyPolygon((Vector2){ screenWidth/2.0f, screenHeight/2.0f }, (float)GetRandomValue(80, 200), GetRandomValue(3, 8), 10);
39
-
40
- SetTargetFPS(60); // Set our game to run at 60 frames-per-second
41
- //--------------------------------------------------------------------------------------
42
-
43
- // Main game loop
44
- while (!WindowShouldClose()) // Detect window close button or ESC key
45
- {
46
- //----------------------------------------------------------------------------------
47
- UpdatePhysics(); // Update physics system
48
-
49
- if (IsKeyPressed(KEY_R)) // Reset physics input
50
- {
51
- ResetPhysics();
52
-
53
- CreatePhysicsBodyPolygon((Vector2){ screenWidth/2.0f, screenHeight/2.0f }, (float)GetRandomValue(80, 200), GetRandomValue(3, 8), 10);
54
- }
55
-
56
- if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) // Physics shatter input
57
- {
58
- int count = GetPhysicsBodiesCount();
59
- for (int i = count - 1; i >= 0; i--)
60
- {
61
- PhysicsBody currentBody = GetPhysicsBody(i);
62
-
63
- if (currentBody != NULL) PhysicsShatter(currentBody, GetMousePosition(), 10/currentBody->inverseMass);
64
- }
65
- }
66
- //----------------------------------------------------------------------------------
67
-
68
- // Draw
69
- //----------------------------------------------------------------------------------
70
- BeginDrawing();
71
-
72
- ClearBackground(BLACK);
73
-
74
- // Draw created physics bodies
75
- int bodiesCount = GetPhysicsBodiesCount();
76
- for (int i = 0; i < bodiesCount; i++)
77
- {
78
- PhysicsBody currentBody = GetPhysicsBody(i);
79
-
80
- int vertexCount = GetPhysicsShapeVerticesCount(i);
81
- for (int j = 0; j < vertexCount; j++)
82
- {
83
- // Get physics bodies shape vertices to draw lines
84
- // Note: GetPhysicsShapeVertex() already calculates rotation transformations
85
- Vector2 vertexA = GetPhysicsShapeVertex(currentBody, j);
86
-
87
- int jj = (((j + 1) < vertexCount) ? (j + 1) : 0); // Get next vertex or first to close the shape
88
- Vector2 vertexB = GetPhysicsShapeVertex(currentBody, jj);
89
-
90
- DrawLineV(vertexA, vertexB, GREEN); // Draw a line between two vertex positions
91
- }
92
- }
93
-
94
- DrawText("Left mouse button in polygon area to shatter body\nPress 'R' to reset example", 10, 10, 10, WHITE);
95
-
96
- DrawText("Physac", logoX, logoY, 30, WHITE);
97
- DrawText("Powered by", logoX + 50, logoY - 7, 10, WHITE);
98
-
99
- EndDrawing();
100
- //----------------------------------------------------------------------------------
101
- }
102
-
103
- // De-Initialization
104
- //--------------------------------------------------------------------------------------
105
- ClosePhysics(); // Unitialize physics
106
-
107
- CloseWindow(); // Close window and OpenGL context
108
- //--------------------------------------------------------------------------------------
109
-
110
- return 0;
111
- }