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
@@ -85,7 +85,7 @@
85
85
  *
86
86
  * LICENSE: zlib/libpng
87
87
  *
88
- * Copyright (c) 2014-2021 Ramon Santamaria (@raysan5)
88
+ * Copyright (c) 2014-2022 Ramon Santamaria (@raysan5)
89
89
  *
90
90
  * This software is provided "as-is", without any express or implied warranty. In no event
91
91
  * will the authors be held liable for any damages arising from the use of this software.
@@ -358,11 +358,11 @@ typedef struct rlRenderBatch {
358
358
  float currentDepth; // Current depth value for next draw
359
359
  } rlRenderBatch;
360
360
 
361
- #if defined(__STDC__) && __STDC_VERSION__ >= 199901L
361
+ #if (defined(__STDC__) && __STDC_VERSION__ >= 199901L) || (defined(_MSC_VER) && _MSC_VER >= 1800)
362
362
  #include <stdbool.h>
363
363
  #elif !defined(__cplusplus) && !defined(bool) && !defined(RL_BOOL_TYPE)
364
364
  // Boolean type
365
- typedef enum bool { false, true } bool;
365
+ typedef enum bool { false = 0, true = !false } bool;
366
366
  #endif
367
367
 
368
368
  #if !defined(RL_MATRIX_TYPE)
@@ -418,7 +418,7 @@ typedef enum {
418
418
  // NOTE 1: Filtering considers mipmaps if available in the texture
419
419
  // NOTE 2: Filter is accordingly set for minification and magnification
420
420
  typedef enum {
421
- RL_TEXTURE_FILTER_POINT = 0, // No filter, just pixel aproximation
421
+ RL_TEXTURE_FILTER_POINT = 0, // No filter, just pixel approximation
422
422
  RL_TEXTURE_FILTER_BILINEAR, // Linear filtering
423
423
  RL_TEXTURE_FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps)
424
424
  RL_TEXTURE_FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x
@@ -433,7 +433,8 @@ typedef enum {
433
433
  RL_BLEND_MULTIPLIED, // Blend textures multiplying colors
434
434
  RL_BLEND_ADD_COLORS, // Blend textures adding colors (alternative)
435
435
  RL_BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative)
436
- RL_BLEND_CUSTOM // Belnd textures using custom src/dst factors (use SetBlendModeCustom())
436
+ RL_BLEND_ALPHA_PREMULTIPLY, // Blend premultiplied textures considering alpha
437
+ RL_BLEND_CUSTOM // Blend textures using custom src/dst factors (use rlSetBlendFactors())
437
438
  } rlBlendMode;
438
439
 
439
440
  // Shader location point type
@@ -597,7 +598,9 @@ RLAPI void rlglInit(int width, int height); // Initialize rlgl (buffer
597
598
  RLAPI void rlglClose(void); // De-inititialize rlgl (buffers, shaders, textures)
598
599
  RLAPI void rlLoadExtensions(void *loader); // Load OpenGL extensions (loader function required)
599
600
  RLAPI int rlGetVersion(void); // Get current OpenGL version
601
+ RLAPI void rlSetFramebufferWidth(int width); // Set current framebuffer width
600
602
  RLAPI int rlGetFramebufferWidth(void); // Get default framebuffer width
603
+ RLAPI void rlSetFramebufferHeight(int height); // Set current framebuffer height
601
604
  RLAPI int rlGetFramebufferHeight(void); // Get default framebuffer height
602
605
 
603
606
  RLAPI unsigned int rlGetTextureIdDefault(void); // Get default texture id
@@ -619,25 +622,26 @@ RLAPI void rlSetTexture(unsigned int id); // Set current texture for r
619
622
 
620
623
  // Vertex buffers management
621
624
  RLAPI unsigned int rlLoadVertexArray(void); // Load vertex array (vao) if supported
622
- RLAPI unsigned int rlLoadVertexBuffer(void *buffer, int size, bool dynamic); // Load a vertex buffer attribute
623
- RLAPI unsigned int rlLoadVertexBufferElement(void *buffer, int size, bool dynamic); // Load a new attributes element buffer
624
- RLAPI void rlUpdateVertexBuffer(unsigned int bufferId, void *data, int dataSize, int offset); // Update GPU buffer with new data
625
+ RLAPI unsigned int rlLoadVertexBuffer(const void *buffer, int size, bool dynamic); // Load a vertex buffer attribute
626
+ RLAPI unsigned int rlLoadVertexBufferElement(const void *buffer, int size, bool dynamic); // Load a new attributes element buffer
627
+ RLAPI void rlUpdateVertexBuffer(unsigned int bufferId, const void *data, int dataSize, int offset); // Update GPU buffer with new data
628
+ RLAPI void rlUpdateVertexBufferElements(unsigned int id, const void *data, int dataSize, int offset); // Update vertex buffer elements with new data
625
629
  RLAPI void rlUnloadVertexArray(unsigned int vaoId);
626
630
  RLAPI void rlUnloadVertexBuffer(unsigned int vboId);
627
- RLAPI void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, void *pointer);
631
+ RLAPI void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, const void *pointer);
628
632
  RLAPI void rlSetVertexAttributeDivisor(unsigned int index, int divisor);
629
633
  RLAPI void rlSetVertexAttributeDefault(int locIndex, const void *value, int attribType, int count); // Set vertex attribute default value
630
634
  RLAPI void rlDrawVertexArray(int offset, int count);
631
- RLAPI void rlDrawVertexArrayElements(int offset, int count, void *buffer);
635
+ RLAPI void rlDrawVertexArrayElements(int offset, int count, const void *buffer);
632
636
  RLAPI void rlDrawVertexArrayInstanced(int offset, int count, int instances);
633
- RLAPI void rlDrawVertexArrayElementsInstanced(int offset, int count, void *buffer, int instances);
637
+ RLAPI void rlDrawVertexArrayElementsInstanced(int offset, int count, const void *buffer, int instances);
634
638
 
635
639
  // Textures management
636
- RLAPI unsigned int rlLoadTexture(void *data, int width, int height, int format, int mipmapCount); // Load texture in GPU
640
+ RLAPI unsigned int rlLoadTexture(const void *data, int width, int height, int format, int mipmapCount); // Load texture in GPU
637
641
  RLAPI unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer); // Load depth texture/renderbuffer (to be attached to fbo)
638
- RLAPI unsigned int rlLoadTextureCubemap(void *data, int size, int format); // Load texture cubemap
642
+ RLAPI unsigned int rlLoadTextureCubemap(const void *data, int size, int format); // Load texture cubemap
639
643
  RLAPI void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int height, int format, const void *data); // Update GPU texture with new data
640
- RLAPI void rlGetGlTextureFormats(int format, int *glInternalFormat, int *glFormat, int *glType); // Get OpenGL internal formats
644
+ RLAPI void rlGetGlTextureFormats(int format, unsigned int *glInternalFormat, unsigned int *glFormat, unsigned int *glType); // Get OpenGL internal formats
641
645
  RLAPI const char *rlGetPixelFormatName(unsigned int format); // Get name string for pixel format
642
646
  RLAPI void rlUnloadTexture(unsigned int id); // Unload texture from GPU memory
643
647
  RLAPI void rlGenTextureMipmaps(unsigned int id, int width, int height, int format, int *mipmaps); // Generate mipmap data for selected texture
@@ -713,7 +717,7 @@ RLAPI void rlLoadDrawQuad(void); // Load and draw a quad
713
717
  #include <OpenGL/glext.h> // OpenGL extensions library
714
718
  #else
715
719
  // APIENTRY for OpenGL function pointer declarations is required
716
- #ifndef APIENTRY
720
+ #if !defined(APIENTRY)
717
721
  #if defined(_WIN32)
718
722
  #define APIENTRY __stdcall
719
723
  #else
@@ -925,8 +929,8 @@ typedef struct rlglData {
925
929
  int glBlendDstFactor; // Blending destination factor
926
930
  int glBlendEquation; // Blending equation
927
931
 
928
- int framebufferWidth; // Default framebuffer width
929
- int framebufferHeight; // Default framebuffer height
932
+ int framebufferWidth; // Current framebuffer width
933
+ int framebufferHeight; // Current framebuffer height
930
934
 
931
935
  } State; // Renderer state
932
936
  struct {
@@ -1228,6 +1232,7 @@ void rlOrtho(double left, double right, double bottom, double top, double znear,
1228
1232
  #endif
1229
1233
 
1230
1234
  // Set the viewport area (transformation from normalized device coordinates to window coordinates)
1235
+ // NOTE: We store current viewport dimensions
1231
1236
  void rlViewport(int x, int y, int width, int height)
1232
1237
  {
1233
1238
  glViewport(x, y, width, height);
@@ -1512,6 +1517,11 @@ void rlTextureParameters(unsigned int id, int param, int value)
1512
1517
  {
1513
1518
  glBindTexture(GL_TEXTURE_2D, id);
1514
1519
 
1520
+ #if !defined(GRAPHICS_API_OPENGL_11)
1521
+ // Reset anisotropy filter, in case it was set
1522
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0f);
1523
+ #endif
1524
+
1515
1525
  switch (param)
1516
1526
  {
1517
1527
  case RL_TEXTURE_WRAP_S:
@@ -1535,7 +1545,7 @@ void rlTextureParameters(unsigned int id, int param, int value)
1535
1545
  if (value <= RLGL.ExtSupported.maxAnisotropyLevel) glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)value);
1536
1546
  else if (RLGL.ExtSupported.maxAnisotropyLevel > 0.0f)
1537
1547
  {
1538
- TRACELOG(RL_LOG_WARNING, "GL: Maximum anisotropic filter level supported is %iX", id, RLGL.ExtSupported.maxAnisotropyLevel);
1548
+ TRACELOG(RL_LOG_WARNING, "GL: Maximum anisotropic filter level supported is %iX", id, (int)RLGL.ExtSupported.maxAnisotropyLevel);
1539
1549
  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)value);
1540
1550
  }
1541
1551
  else TRACELOG(RL_LOG_WARNING, "GL: Anisotropic filtering not supported");
@@ -1778,7 +1788,12 @@ void rlSetBlendMode(int mode)
1778
1788
  case RL_BLEND_MULTIPLIED: glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA); glBlendEquation(GL_FUNC_ADD); break;
1779
1789
  case RL_BLEND_ADD_COLORS: glBlendFunc(GL_ONE, GL_ONE); glBlendEquation(GL_FUNC_ADD); break;
1780
1790
  case RL_BLEND_SUBTRACT_COLORS: glBlendFunc(GL_ONE, GL_ONE); glBlendEquation(GL_FUNC_SUBTRACT); break;
1781
- case RL_BLEND_CUSTOM: glBlendFunc(RLGL.State.glBlendSrcFactor, RLGL.State.glBlendDstFactor); glBlendEquation(RLGL.State.glBlendEquation); break;
1791
+ case RL_BLEND_ALPHA_PREMULTIPLY: glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); glBlendEquation(GL_FUNC_ADD); break;
1792
+ case RL_BLEND_CUSTOM:
1793
+ {
1794
+ // NOTE: Using GL blend src/dst factors and GL equation configured with rlSetBlendFactors()
1795
+ glBlendFunc(RLGL.State.glBlendSrcFactor, RLGL.State.glBlendDstFactor); glBlendEquation(RLGL.State.glBlendEquation);
1796
+ } break;
1782
1797
  default: break;
1783
1798
  }
1784
1799
 
@@ -2160,13 +2175,12 @@ void rlLoadExtensions(void *loader)
2160
2175
  for (int i = 0; i < capability; i++) TRACELOG(RL_LOG_INFO, " %s", rlGetCompressedFormatName(compFormats[i]));
2161
2176
  RL_FREE(compFormats);
2162
2177
 
2163
- /*
2164
- // Following capabilities are only supported by OpenGL 4.3 or greater
2178
+ #if defined(GRAPHICS_API_OPENGL_43)
2165
2179
  glGetIntegerv(GL_MAX_VERTEX_ATTRIB_BINDINGS, &capability);
2166
2180
  TRACELOG(RL_LOG_INFO, " GL_MAX_VERTEX_ATTRIB_BINDINGS: %i", capability);
2167
2181
  glGetIntegerv(GL_MAX_UNIFORM_LOCATIONS, &capability);
2168
2182
  TRACELOG(RL_LOG_INFO, " GL_MAX_UNIFORM_LOCATIONS: %i", capability);
2169
- */
2183
+ #endif // GRAPHICS_API_OPENGL_43
2170
2184
  #else // RLGL_SHOW_GL_DETAILS_INFO
2171
2185
 
2172
2186
  // Show some basic info about GL supported features
@@ -2213,6 +2227,22 @@ int rlGetVersion(void)
2213
2227
  return glVersion;
2214
2228
  }
2215
2229
 
2230
+ // Set current framebuffer width
2231
+ void rlSetFramebufferWidth(int width)
2232
+ {
2233
+ #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
2234
+ RLGL.State.framebufferWidth = width;
2235
+ #endif
2236
+ }
2237
+
2238
+ // Set current framebuffer height
2239
+ void rlSetFramebufferHeight(int height)
2240
+ {
2241
+ #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
2242
+ RLGL.State.framebufferHeight = height;
2243
+ #endif
2244
+ }
2245
+
2216
2246
  // Get default framebuffer width
2217
2247
  int rlGetFramebufferWidth(void)
2218
2248
  {
@@ -2595,6 +2625,9 @@ void rlDrawRenderBatch(rlRenderBatch *batch)
2595
2625
 
2596
2626
  glUseProgram(0); // Unbind shader program
2597
2627
  }
2628
+
2629
+ // Restore viewport to default measures
2630
+ if (eyeCount == 2) rlViewport(0, 0, RLGL.State.framebufferWidth, RLGL.State.framebufferHeight);
2598
2631
  //------------------------------------------------------------------------------------------------------------
2599
2632
 
2600
2633
  // Reset batch buffers
@@ -2677,7 +2710,7 @@ bool rlCheckRenderBatchLimit(int vCount)
2677
2710
  // Textures data management
2678
2711
  //-----------------------------------------------------------------------------------------
2679
2712
  // Convert image data to OpenGL texture (returns OpenGL valid Id)
2680
- unsigned int rlLoadTexture(void *data, int width, int height, int format, int mipmapCount)
2713
+ unsigned int rlLoadTexture(const void *data, int width, int height, int format, int mipmapCount)
2681
2714
  {
2682
2715
  glBindTexture(GL_TEXTURE_2D, 0); // Free any old binding
2683
2716
 
@@ -2739,7 +2772,7 @@ unsigned int rlLoadTexture(void *data, int width, int height, int format, int mi
2739
2772
  {
2740
2773
  unsigned int mipSize = rlGetPixelDataSize(mipWidth, mipHeight, format);
2741
2774
 
2742
- int glInternalFormat, glFormat, glType;
2775
+ unsigned int glInternalFormat, glFormat, glType;
2743
2776
  rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType);
2744
2777
 
2745
2778
  TRACELOGD("TEXTURE: Load mipmap level %i (%i x %i), size: %i, offset: %i", i, mipWidth, mipHeight, mipSize, mipOffset);
@@ -2879,7 +2912,7 @@ unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer)
2879
2912
  // Load texture cubemap
2880
2913
  // NOTE: Cubemap data is expected to be 6 images in a single data array (one after the other),
2881
2914
  // expected the following convention: +X, -X, +Y, -Y, +Z, -Z
2882
- unsigned int rlLoadTextureCubemap(void *data, int size, int format)
2915
+ unsigned int rlLoadTextureCubemap(const void *data, int size, int format)
2883
2916
  {
2884
2917
  unsigned int id = 0;
2885
2918
 
@@ -2889,7 +2922,7 @@ unsigned int rlLoadTextureCubemap(void *data, int size, int format)
2889
2922
  glGenTextures(1, &id);
2890
2923
  glBindTexture(GL_TEXTURE_CUBE_MAP, id);
2891
2924
 
2892
- int glInternalFormat, glFormat, glType;
2925
+ unsigned int glInternalFormat, glFormat, glType;
2893
2926
  rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType);
2894
2927
 
2895
2928
  if (glInternalFormat != -1)
@@ -2961,22 +2994,22 @@ void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int h
2961
2994
  {
2962
2995
  glBindTexture(GL_TEXTURE_2D, id);
2963
2996
 
2964
- int glInternalFormat, glFormat, glType;
2997
+ unsigned int glInternalFormat, glFormat, glType;
2965
2998
  rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType);
2966
2999
 
2967
3000
  if ((glInternalFormat != -1) && (format < RL_PIXELFORMAT_COMPRESSED_DXT1_RGB))
2968
3001
  {
2969
- glTexSubImage2D(GL_TEXTURE_2D, 0, offsetX, offsetY, width, height, glFormat, glType, (unsigned char *)data);
3002
+ glTexSubImage2D(GL_TEXTURE_2D, 0, offsetX, offsetY, width, height, glFormat, glType, data);
2970
3003
  }
2971
3004
  else TRACELOG(RL_LOG_WARNING, "TEXTURE: [ID %i] Failed to update for current texture format (%i)", id, format);
2972
3005
  }
2973
3006
 
2974
3007
  // Get OpenGL internal formats and data type from raylib PixelFormat
2975
- void rlGetGlTextureFormats(int format, int *glInternalFormat, int *glFormat, int *glType)
3008
+ void rlGetGlTextureFormats(int format, unsigned int *glInternalFormat, unsigned int *glFormat, unsigned int *glType)
2976
3009
  {
2977
- *glInternalFormat = -1;
2978
- *glFormat = -1;
2979
- *glType = -1;
3010
+ *glInternalFormat = 0;
3011
+ *glFormat = 0;
3012
+ *glType = 0;
2980
3013
 
2981
3014
  switch (format)
2982
3015
  {
@@ -3082,14 +3115,11 @@ void rlGenTextureMipmaps(unsigned int id, int width, int height, int format, int
3082
3115
  #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
3083
3116
  if ((texIsPOT) || (RLGL.ExtSupported.texNPOT))
3084
3117
  {
3085
- //glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE); // Hint for mipmaps generation algorythm: GL_FASTEST, GL_NICEST, GL_DONT_CARE
3118
+ //glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE); // Hint for mipmaps generation algorithm: GL_FASTEST, GL_NICEST, GL_DONT_CARE
3086
3119
  glGenerateMipmap(GL_TEXTURE_2D); // Generate mipmaps automatically
3087
3120
 
3088
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
3089
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); // Activate Trilinear filtering for mipmaps
3090
-
3091
- #define MIN(a,b) (((a)<(b))?(a):(b))
3092
- #define MAX(a,b) (((a)>(b))?(a):(b))
3121
+ #define MIN(a,b) (((a)<(b))? (a):(b))
3122
+ #define MAX(a,b) (((a)>(b))? (a):(b))
3093
3123
 
3094
3124
  *mipmaps = 1 + (int)floor(log(MAX(width, height))/log(2));
3095
3125
  TRACELOG(RL_LOG_INFO, "TEXTURE: [ID %i] Mipmaps generated automatically, total: %i", id, *mipmaps);
@@ -3122,7 +3152,7 @@ void *rlReadTexturePixels(unsigned int id, int width, int height, int format)
3122
3152
  // GL_UNPACK_ALIGNMENT affects operations that write to OpenGL memory (glTexImage, etc.)
3123
3153
  glPixelStorei(GL_PACK_ALIGNMENT, 1);
3124
3154
 
3125
- int glInternalFormat, glFormat, glType;
3155
+ unsigned int glInternalFormat, glFormat, glType;
3126
3156
  rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType);
3127
3157
  unsigned int size = rlGetPixelDataSize(width, height, format);
3128
3158
 
@@ -3165,7 +3195,6 @@ void *rlReadTexturePixels(unsigned int id, int width, int height, int format)
3165
3195
  return pixels;
3166
3196
  }
3167
3197
 
3168
-
3169
3198
  // Read screen pixel data (color buffer)
3170
3199
  unsigned char *rlReadScreenPixels(int width, int height)
3171
3200
  {
@@ -3314,7 +3343,7 @@ void rlUnloadFramebuffer(unsigned int id)
3314
3343
  // Vertex data management
3315
3344
  //-----------------------------------------------------------------------------------------
3316
3345
  // Load a new attributes buffer
3317
- unsigned int rlLoadVertexBuffer(void *buffer, int size, bool dynamic)
3346
+ unsigned int rlLoadVertexBuffer(const void *buffer, int size, bool dynamic)
3318
3347
  {
3319
3348
  unsigned int id = 0;
3320
3349
 
@@ -3328,7 +3357,7 @@ unsigned int rlLoadVertexBuffer(void *buffer, int size, bool dynamic)
3328
3357
  }
3329
3358
 
3330
3359
  // Load a new attributes element buffer
3331
- unsigned int rlLoadVertexBufferElement(void *buffer, int size, bool dynamic)
3360
+ unsigned int rlLoadVertexBufferElement(const void *buffer, int size, bool dynamic)
3332
3361
  {
3333
3362
  unsigned int id = 0;
3334
3363
 
@@ -3375,7 +3404,7 @@ void rlDisableVertexBufferElement(void)
3375
3404
 
3376
3405
  // Update vertex buffer with new data
3377
3406
  // NOTE: dataSize and offset must be provided in bytes
3378
- void rlUpdateVertexBuffer(unsigned int id, void *data, int dataSize, int offset)
3407
+ void rlUpdateVertexBuffer(unsigned int id, const void *data, int dataSize, int offset)
3379
3408
  {
3380
3409
  #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
3381
3410
  glBindBuffer(GL_ARRAY_BUFFER, id);
@@ -3385,7 +3414,7 @@ void rlUpdateVertexBuffer(unsigned int id, void *data, int dataSize, int offset)
3385
3414
 
3386
3415
  // Update vertex buffer elements with new data
3387
3416
  // NOTE: dataSize and offset must be provided in bytes
3388
- void rlUpdateVertexBufferElements(unsigned int id, void *data, int dataSize, int offset)
3417
+ void rlUpdateVertexBufferElements(unsigned int id, const void *data, int dataSize, int offset)
3389
3418
  {
3390
3419
  #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
3391
3420
  glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, id);
@@ -3438,9 +3467,9 @@ void rlDrawVertexArray(int offset, int count)
3438
3467
  }
3439
3468
 
3440
3469
  // Draw vertex array elements
3441
- void rlDrawVertexArrayElements(int offset, int count, void *buffer)
3470
+ void rlDrawVertexArrayElements(int offset, int count, const void *buffer)
3442
3471
  {
3443
- glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (unsigned short *)buffer + offset);
3472
+ glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (const unsigned short *)buffer + offset);
3444
3473
  }
3445
3474
 
3446
3475
  // Draw vertex array instanced
@@ -3452,10 +3481,10 @@ void rlDrawVertexArrayInstanced(int offset, int count, int instances)
3452
3481
  }
3453
3482
 
3454
3483
  // Draw vertex array elements instanced
3455
- void rlDrawVertexArrayElementsInstanced(int offset, int count, void *buffer, int instances)
3484
+ void rlDrawVertexArrayElementsInstanced(int offset, int count, const void *buffer, int instances)
3456
3485
  {
3457
3486
  #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
3458
- glDrawElementsInstanced(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (unsigned short *)buffer + offset, instances);
3487
+ glDrawElementsInstanced(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (const unsigned short *)buffer + offset, instances);
3459
3488
  #endif
3460
3489
  }
3461
3490
 
@@ -3496,7 +3525,7 @@ unsigned int rlLoadVertexArray(void)
3496
3525
  }
3497
3526
 
3498
3527
  // Set vertex attribute
3499
- void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, void *pointer)
3528
+ void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, const void *pointer)
3500
3529
  {
3501
3530
  #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
3502
3531
  glVertexAttribPointer(index, compSize, type, normalized, stride, pointer);
@@ -3542,56 +3571,69 @@ unsigned int rlLoadShaderCode(const char *vsCode, const char *fsCode)
3542
3571
  unsigned int id = 0;
3543
3572
 
3544
3573
  #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
3545
- unsigned int vertexShaderId = RLGL.State.defaultVShaderId;
3546
- unsigned int fragmentShaderId = RLGL.State.defaultFShaderId;
3574
+ unsigned int vertexShaderId = 0;
3575
+ unsigned int fragmentShaderId = 0;
3547
3576
 
3577
+ // Compile vertex shader (if provided)
3548
3578
  if (vsCode != NULL) vertexShaderId = rlCompileShader(vsCode, GL_VERTEX_SHADER);
3579
+ // In case no vertex shader was provided or compilation failed, we use default vertex shader
3580
+ if (vertexShaderId == 0) vertexShaderId = RLGL.State.defaultVShaderId;
3581
+
3582
+ // Compile fragment shader (if provided)
3549
3583
  if (fsCode != NULL) fragmentShaderId = rlCompileShader(fsCode, GL_FRAGMENT_SHADER);
3584
+ // In case no fragment shader was provided or compilation failed, we use default fragment shader
3585
+ if (fragmentShaderId == 0) fragmentShaderId = RLGL.State.defaultFShaderId;
3550
3586
 
3587
+ // In case vertex and fragment shader are the default ones, no need to recompile, we can just assign the default shader program id
3551
3588
  if ((vertexShaderId == RLGL.State.defaultVShaderId) && (fragmentShaderId == RLGL.State.defaultFShaderId)) id = RLGL.State.defaultShaderId;
3552
3589
  else
3553
3590
  {
3591
+ // One of or both shader are new, we need to compile a new shader program
3554
3592
  id = rlLoadShaderProgram(vertexShaderId, fragmentShaderId);
3555
3593
 
3594
+ // We can detach and delete vertex/fragment shaders (if not default ones)
3595
+ // NOTE: We detach shader before deletion to make sure memory is freed
3556
3596
  if (vertexShaderId != RLGL.State.defaultVShaderId)
3557
3597
  {
3558
- // Detach shader before deletion to make sure memory is freed
3559
3598
  glDetachShader(id, vertexShaderId);
3560
3599
  glDeleteShader(vertexShaderId);
3561
3600
  }
3562
3601
  if (fragmentShaderId != RLGL.State.defaultFShaderId)
3563
3602
  {
3564
- // Detach shader before deletion to make sure memory is freed
3565
3603
  glDetachShader(id, fragmentShaderId);
3566
3604
  glDeleteShader(fragmentShaderId);
3567
3605
  }
3568
3606
 
3607
+ // In case shader program loading failed, we assign default shader
3569
3608
  if (id == 0)
3570
3609
  {
3571
- TRACELOG(RL_LOG_WARNING, "SHADER: Failed to load custom shader code");
3610
+ // In case shader loading fails, we return the default shader
3611
+ TRACELOG(RL_LOG_WARNING, "SHADER: Failed to load custom shader code, using default shader");
3572
3612
  id = RLGL.State.defaultShaderId;
3573
3613
  }
3574
- }
3575
-
3576
- // Get available shader uniforms
3577
- // NOTE: This information is useful for debug...
3578
- int uniformCount = -1;
3579
-
3580
- glGetProgramiv(id, GL_ACTIVE_UNIFORMS, &uniformCount);
3581
-
3582
- for (int i = 0; i < uniformCount; i++)
3583
- {
3584
- int namelen = -1;
3585
- int num = -1;
3586
- char name[256] = { 0 }; // Assume no variable names longer than 256
3587
- GLenum type = GL_ZERO;
3614
+ /*
3615
+ else
3616
+ {
3617
+ // Get available shader uniforms
3618
+ // NOTE: This information is useful for debug...
3619
+ int uniformCount = -1;
3620
+ glGetProgramiv(id, GL_ACTIVE_UNIFORMS, &uniformCount);
3588
3621
 
3589
- // Get the name of the uniforms
3590
- glGetActiveUniform(id, i, sizeof(name) - 1, &namelen, &num, &type, name);
3622
+ for (int i = 0; i < uniformCount; i++)
3623
+ {
3624
+ int namelen = -1;
3625
+ int num = -1;
3626
+ char name[256] = { 0 }; // Assume no variable names longer than 256
3627
+ GLenum type = GL_ZERO;
3591
3628
 
3592
- name[namelen] = 0;
3629
+ // Get the name of the uniforms
3630
+ glGetActiveUniform(id, i, sizeof(name) - 1, &namelen, &num, &type, name);
3593
3631
 
3594
- TRACELOGD("SHADER: [ID %i] Active uniform (%s) set at location: %i", id, name, glGetUniformLocation(id, name));
3632
+ name[namelen] = 0;
3633
+ TRACELOGD("SHADER: [ID %i] Active uniform (%s) set at location: %i", id, name, glGetUniformLocation(id, name));
3634
+ }
3635
+ }
3636
+ */
3595
3637
  }
3596
3638
  #endif
3597
3639
 
@@ -3630,7 +3672,7 @@ unsigned int rlCompileShader(const char *shaderCode, int type)
3630
3672
  if (maxLength > 0)
3631
3673
  {
3632
3674
  int length = 0;
3633
- char *log = RL_CALLOC(maxLength, sizeof(char));
3675
+ char *log = (char *)RL_CALLOC(maxLength, sizeof(char));
3634
3676
  glGetShaderInfoLog(shader, maxLength, &length, log);
3635
3677
  TRACELOG(RL_LOG_WARNING, "SHADER: [ID %i] Compile error: %s", shader, log);
3636
3678
  RL_FREE(log);
@@ -3692,7 +3734,7 @@ unsigned int rlLoadShaderProgram(unsigned int vShaderId, unsigned int fShaderId)
3692
3734
  if (maxLength > 0)
3693
3735
  {
3694
3736
  int length = 0;
3695
- char *log = RL_CALLOC(maxLength, sizeof(char));
3737
+ char *log = (char *)RL_CALLOC(maxLength, sizeof(char));
3696
3738
  glGetProgramInfoLog(program, maxLength, &length, log);
3697
3739
  TRACELOG(RL_LOG_WARNING, "SHADER: [ID %i] Link error: %s", program, log);
3698
3740
  RL_FREE(log);
@@ -3859,7 +3901,7 @@ unsigned int rlLoadComputeShaderProgram(unsigned int shaderId)
3859
3901
  if (maxLength > 0)
3860
3902
  {
3861
3903
  int length = 0;
3862
- char *log = RL_CALLOC(maxLength, sizeof(char));
3904
+ char *log = (char *)RL_CALLOC(maxLength, sizeof(char));
3863
3905
  glGetProgramInfoLog(program, maxLength, &length, log);
3864
3906
  TRACELOG(RL_LOG_WARNING, "SHADER: [ID %i] Link error: %s", program, log);
3865
3907
  RL_FREE(log);
@@ -3895,11 +3937,13 @@ void rlComputeShaderDispatch(unsigned int groupX, unsigned int groupY, unsigned
3895
3937
  unsigned int rlLoadShaderBuffer(unsigned long long size, const void *data, int usageHint)
3896
3938
  {
3897
3939
  unsigned int ssbo = 0;
3898
-
3940
+
3899
3941
  #if defined(GRAPHICS_API_OPENGL_43)
3900
3942
  glGenBuffers(1, &ssbo);
3901
3943
  glBindBuffer(GL_SHADER_STORAGE_BUFFER, ssbo);
3902
3944
  glBufferData(GL_SHADER_STORAGE_BUFFER, size, data, usageHint? usageHint : RL_STREAM_COPY);
3945
+ glClearBufferData(GL_SHADER_STORAGE_BUFFER, GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE, 0);
3946
+ glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
3903
3947
  #endif
3904
3948
 
3905
3949
  return ssbo;
@@ -3926,7 +3970,7 @@ void rlUpdateShaderBufferElements(unsigned int id, const void *data, unsigned lo
3926
3970
  unsigned long long rlGetShaderBufferSize(unsigned int id)
3927
3971
  {
3928
3972
  long long size = 0;
3929
-
3973
+
3930
3974
  #if defined(GRAPHICS_API_OPENGL_43)
3931
3975
  glBindBuffer(GL_SHADER_STORAGE_BUFFER, id);
3932
3976
  glGetInteger64v(GL_SHADER_STORAGE_BUFFER_SIZE, &size);
@@ -3966,7 +4010,7 @@ void rlCopyBuffersElements(unsigned int destId, unsigned int srcId, unsigned lon
3966
4010
  void rlBindImageTexture(unsigned int id, unsigned int index, unsigned int format, int readonly)
3967
4011
  {
3968
4012
  #if defined(GRAPHICS_API_OPENGL_43)
3969
- int glInternalFormat = 0, glFormat = 0, glType = 0;
4013
+ unsigned int glInternalFormat = 0, glFormat = 0, glType = 0;
3970
4014
 
3971
4015
  rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType);
3972
4016
  glBindImageTexture(index, id, 0, 0, 0, readonly ? GL_READ_ONLY : GL_READ_WRITE, glInternalFormat);
@@ -4337,7 +4381,8 @@ static void rlLoadShaderDefault(void)
4337
4381
  "} \n";
4338
4382
  #endif
4339
4383
 
4340
- // NOTE: Compiled vertex/fragment shaders are kept for re-use
4384
+ // NOTE: Compiled vertex/fragment shaders are not deleted,
4385
+ // they are kept for re-use as default shaders in case some shader loading fails
4341
4386
  RLGL.State.defaultVShaderId = rlCompileShader(defaultVShaderCode, GL_VERTEX_SHADER); // Compile default vertex shader
4342
4387
  RLGL.State.defaultFShaderId = rlCompileShader(defaultFShaderCode, GL_FRAGMENT_SHADER); // Compile default fragment shader
4343
4388
 
@@ -4382,80 +4427,75 @@ static void rlUnloadShaderDefault(void)
4382
4427
  // Get compressed format official GL identifier name
4383
4428
  static char *rlGetCompressedFormatName(int format)
4384
4429
  {
4385
- static char compName[64] = { 0 };
4386
- memset(compName, 0, 64);
4387
-
4388
4430
  switch (format)
4389
4431
  {
4390
4432
  // GL_EXT_texture_compression_s3tc
4391
- case 0x83F0: strcpy(compName, "GL_COMPRESSED_RGB_S3TC_DXT1_EXT"); break;
4392
- case 0x83F1: strcpy(compName, "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT"); break;
4393
- case 0x83F2: strcpy(compName, "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT"); break;
4394
- case 0x83F3: strcpy(compName, "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT"); break;
4433
+ case 0x83F0: return "GL_COMPRESSED_RGB_S3TC_DXT1_EXT"; break;
4434
+ case 0x83F1: return "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT"; break;
4435
+ case 0x83F2: return "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT"; break;
4436
+ case 0x83F3: return "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT"; break;
4395
4437
  // GL_3DFX_texture_compression_FXT1
4396
- case 0x86B0: strcpy(compName, "GL_COMPRESSED_RGB_FXT1_3DFX"); break;
4397
- case 0x86B1: strcpy(compName, "GL_COMPRESSED_RGBA_FXT1_3DFX"); break;
4438
+ case 0x86B0: return "GL_COMPRESSED_RGB_FXT1_3DFX"; break;
4439
+ case 0x86B1: return "GL_COMPRESSED_RGBA_FXT1_3DFX"; break;
4398
4440
  // GL_IMG_texture_compression_pvrtc
4399
- case 0x8C00: strcpy(compName, "GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG"); break;
4400
- case 0x8C01: strcpy(compName, "GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG"); break;
4401
- case 0x8C02: strcpy(compName, "GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"); break;
4402
- case 0x8C03: strcpy(compName, "GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG"); break;
4441
+ case 0x8C00: return "GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG"; break;
4442
+ case 0x8C01: return "GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG"; break;
4443
+ case 0x8C02: return "GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"; break;
4444
+ case 0x8C03: return "GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG"; break;
4403
4445
  // GL_OES_compressed_ETC1_RGB8_texture
4404
- case 0x8D64: strcpy(compName, "GL_ETC1_RGB8_OES"); break;
4446
+ case 0x8D64: return "GL_ETC1_RGB8_OES"; break;
4405
4447
  // GL_ARB_texture_compression_rgtc
4406
- case 0x8DBB: strcpy(compName, "GL_COMPRESSED_RED_RGTC1"); break;
4407
- case 0x8DBC: strcpy(compName, "GL_COMPRESSED_SIGNED_RED_RGTC1"); break;
4408
- case 0x8DBD: strcpy(compName, "GL_COMPRESSED_RG_RGTC2"); break;
4409
- case 0x8DBE: strcpy(compName, "GL_COMPRESSED_SIGNED_RG_RGTC2"); break;
4448
+ case 0x8DBB: return "GL_COMPRESSED_RED_RGTC1"; break;
4449
+ case 0x8DBC: return "GL_COMPRESSED_SIGNED_RED_RGTC1"; break;
4450
+ case 0x8DBD: return "GL_COMPRESSED_RG_RGTC2"; break;
4451
+ case 0x8DBE: return "GL_COMPRESSED_SIGNED_RG_RGTC2"; break;
4410
4452
  // GL_ARB_texture_compression_bptc
4411
- case 0x8E8C: strcpy(compName, "GL_COMPRESSED_RGBA_BPTC_UNORM_ARB"); break;
4412
- case 0x8E8D: strcpy(compName, "GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB"); break;
4413
- case 0x8E8E: strcpy(compName, "GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB"); break;
4414
- case 0x8E8F: strcpy(compName, "GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB"); break;
4453
+ case 0x8E8C: return "GL_COMPRESSED_RGBA_BPTC_UNORM_ARB"; break;
4454
+ case 0x8E8D: return "GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB"; break;
4455
+ case 0x8E8E: return "GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB"; break;
4456
+ case 0x8E8F: return "GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB"; break;
4415
4457
  // GL_ARB_ES3_compatibility
4416
- case 0x9274: strcpy(compName, "GL_COMPRESSED_RGB8_ETC2"); break;
4417
- case 0x9275: strcpy(compName, "GL_COMPRESSED_SRGB8_ETC2"); break;
4418
- case 0x9276: strcpy(compName, "GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2"); break;
4419
- case 0x9277: strcpy(compName, "GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2"); break;
4420
- case 0x9278: strcpy(compName, "GL_COMPRESSED_RGBA8_ETC2_EAC"); break;
4421
- case 0x9279: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"); break;
4422
- case 0x9270: strcpy(compName, "GL_COMPRESSED_R11_EAC"); break;
4423
- case 0x9271: strcpy(compName, "GL_COMPRESSED_SIGNED_R11_EAC"); break;
4424
- case 0x9272: strcpy(compName, "GL_COMPRESSED_RG11_EAC"); break;
4425
- case 0x9273: strcpy(compName, "GL_COMPRESSED_SIGNED_RG11_EAC"); break;
4458
+ case 0x9274: return "GL_COMPRESSED_RGB8_ETC2"; break;
4459
+ case 0x9275: return "GL_COMPRESSED_SRGB8_ETC2"; break;
4460
+ case 0x9276: return "GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2"; break;
4461
+ case 0x9277: return "GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2"; break;
4462
+ case 0x9278: return "GL_COMPRESSED_RGBA8_ETC2_EAC"; break;
4463
+ case 0x9279: return "GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"; break;
4464
+ case 0x9270: return "GL_COMPRESSED_R11_EAC"; break;
4465
+ case 0x9271: return "GL_COMPRESSED_SIGNED_R11_EAC"; break;
4466
+ case 0x9272: return "GL_COMPRESSED_RG11_EAC"; break;
4467
+ case 0x9273: return "GL_COMPRESSED_SIGNED_RG11_EAC"; break;
4426
4468
  // GL_KHR_texture_compression_astc_hdr
4427
- case 0x93B0: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_4x4_KHR"); break;
4428
- case 0x93B1: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_5x4_KHR"); break;
4429
- case 0x93B2: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_5x5_KHR"); break;
4430
- case 0x93B3: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_6x5_KHR"); break;
4431
- case 0x93B4: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_6x6_KHR"); break;
4432
- case 0x93B5: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_8x5_KHR"); break;
4433
- case 0x93B6: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_8x6_KHR"); break;
4434
- case 0x93B7: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_8x8_KHR"); break;
4435
- case 0x93B8: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_10x5_KHR"); break;
4436
- case 0x93B9: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_10x6_KHR"); break;
4437
- case 0x93BA: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_10x8_KHR"); break;
4438
- case 0x93BB: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_10x10_KHR"); break;
4439
- case 0x93BC: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_12x10_KHR"); break;
4440
- case 0x93BD: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_12x12_KHR"); break;
4441
- case 0x93D0: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR"); break;
4442
- case 0x93D1: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR"); break;
4443
- case 0x93D2: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR"); break;
4444
- case 0x93D3: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR"); break;
4445
- case 0x93D4: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR"); break;
4446
- case 0x93D5: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR"); break;
4447
- case 0x93D6: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR"); break;
4448
- case 0x93D7: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR"); break;
4449
- case 0x93D8: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR"); break;
4450
- case 0x93D9: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR"); break;
4451
- case 0x93DA: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR"); break;
4452
- case 0x93DB: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR"); break;
4453
- case 0x93DC: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR"); break;
4454
- case 0x93DD: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR"); break;
4455
- default: strcpy(compName, "GL_COMPRESSED_UNKNOWN"); break;
4469
+ case 0x93B0: return "GL_COMPRESSED_RGBA_ASTC_4x4_KHR"; break;
4470
+ case 0x93B1: return "GL_COMPRESSED_RGBA_ASTC_5x4_KHR"; break;
4471
+ case 0x93B2: return "GL_COMPRESSED_RGBA_ASTC_5x5_KHR"; break;
4472
+ case 0x93B3: return "GL_COMPRESSED_RGBA_ASTC_6x5_KHR"; break;
4473
+ case 0x93B4: return "GL_COMPRESSED_RGBA_ASTC_6x6_KHR"; break;
4474
+ case 0x93B5: return "GL_COMPRESSED_RGBA_ASTC_8x5_KHR"; break;
4475
+ case 0x93B6: return "GL_COMPRESSED_RGBA_ASTC_8x6_KHR"; break;
4476
+ case 0x93B7: return "GL_COMPRESSED_RGBA_ASTC_8x8_KHR"; break;
4477
+ case 0x93B8: return "GL_COMPRESSED_RGBA_ASTC_10x5_KHR"; break;
4478
+ case 0x93B9: return "GL_COMPRESSED_RGBA_ASTC_10x6_KHR"; break;
4479
+ case 0x93BA: return "GL_COMPRESSED_RGBA_ASTC_10x8_KHR"; break;
4480
+ case 0x93BB: return "GL_COMPRESSED_RGBA_ASTC_10x10_KHR"; break;
4481
+ case 0x93BC: return "GL_COMPRESSED_RGBA_ASTC_12x10_KHR"; break;
4482
+ case 0x93BD: return "GL_COMPRESSED_RGBA_ASTC_12x12_KHR"; break;
4483
+ case 0x93D0: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR"; break;
4484
+ case 0x93D1: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR"; break;
4485
+ case 0x93D2: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR"; break;
4486
+ case 0x93D3: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR"; break;
4487
+ case 0x93D4: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR"; break;
4488
+ case 0x93D5: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR"; break;
4489
+ case 0x93D6: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR"; break;
4490
+ case 0x93D7: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR"; break;
4491
+ case 0x93D8: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR"; break;
4492
+ case 0x93D9: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR"; break;
4493
+ case 0x93DA: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR"; break;
4494
+ case 0x93DB: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR"; break;
4495
+ case 0x93DC: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR"; break;
4496
+ case 0x93DD: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR"; break;
4497
+ default: return "GL_COMPRESSED_UNKNOWN"; break;
4456
4498
  }
4457
-
4458
- return compName;
4459
4499
  }
4460
4500
  #endif // RLGL_SHOW_GL_DETAILS_INFO
4461
4501
 
@@ -4547,8 +4587,8 @@ static unsigned char *rlGenNextMipmapData(unsigned char *srcData, int srcWidth,
4547
4587
  {
4548
4588
  int x2 = 0;
4549
4589
  int y2 = 0;
4550
- unsigned char prow[4];
4551
- unsigned char pcol[4];
4590
+ unsigned char prow[4] = { 0 };
4591
+ unsigned char pcol[4] = { 0 };
4552
4592
 
4553
4593
  int width = srcWidth/2;
4554
4594
  int height = srcHeight/2;