koffi 0.9.6 → 0.9.7
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.
- package/LICENSE.txt +661 -0
- package/README.md +195 -162
- package/package.json +36 -19
- package/src/call.hh +28 -27
- package/src/call_arm32.cc +498 -514
- package/src/call_arm32_fwd.S +108 -108
- package/src/call_arm64.cc +482 -497
- package/src/call_arm64_fwd.S +110 -110
- package/src/call_x64_sysv.cc +463 -477
- package/src/call_x64_sysv_fwd.S +131 -131
- package/src/call_x64_win.cc +240 -243
- package/src/call_x64_win_fwd.asm +105 -105
- package/src/call_x86.cc +246 -259
- package/src/call_x86_fwd.S +48 -48
- package/src/call_x86_fwd.asm +50 -50
- package/src/ffi.cc +506 -504
- package/src/ffi.hh +142 -136
- package/src/util.cc +330 -297
- package/src/util.hh +164 -80
- package/test/qemu/.gitkeep +0 -0
- package/test/registry/machines.json +112 -0
- package/test/registry/sha256sum.txt +21 -0
- package/test/test.js +493 -0
- package/vendor/dragonbox/include/dragonbox/dragonbox.h +2674 -2674
- package/vendor/dragonbox/subproject/test/results/binary32.csv +255 -255
- package/vendor/dragonbox/subproject/test/results/binary64.csv +2047 -2047
- package/vendor/libcc/libcc.cc +7669 -7651
- package/vendor/libcc/libcc.hh +4334 -4312
- package/vendor/node-addon-api/CHANGELOG.md +859 -859
- package/vendor/node-addon-api/CODE_OF_CONDUCT.md +4 -4
- package/vendor/node-addon-api/CONTRIBUTING.md +93 -93
- package/vendor/node-addon-api/LICENSE.md +12 -12
- package/vendor/node-addon-api/README.md +293 -293
- package/vendor/node-addon-api/appveyor.yml +37 -37
- package/vendor/node-addon-api/benchmark/README.md +47 -47
- package/vendor/node-addon-api/benchmark/binding.gyp +25 -25
- package/vendor/node-addon-api/benchmark/function_args.cc +217 -217
- package/vendor/node-addon-api/benchmark/function_args.js +60 -60
- package/vendor/node-addon-api/benchmark/index.js +34 -34
- package/vendor/node-addon-api/benchmark/property_descriptor.cc +91 -91
- package/vendor/node-addon-api/benchmark/property_descriptor.js +37 -37
- package/vendor/node-addon-api/common.gypi +21 -21
- package/vendor/node-addon-api/doc/addon.md +163 -163
- package/vendor/node-addon-api/doc/array.md +81 -81
- package/vendor/node-addon-api/doc/array_buffer.md +155 -155
- package/vendor/node-addon-api/doc/async_context.md +86 -86
- package/vendor/node-addon-api/doc/async_operations.md +31 -31
- package/vendor/node-addon-api/doc/async_worker.md +427 -427
- package/vendor/node-addon-api/doc/async_worker_variants.md +557 -557
- package/vendor/node-addon-api/doc/bigint.md +97 -97
- package/vendor/node-addon-api/doc/boolean.md +68 -68
- package/vendor/node-addon-api/doc/buffer.md +150 -150
- package/vendor/node-addon-api/doc/callback_scope.md +54 -54
- package/vendor/node-addon-api/doc/callbackinfo.md +97 -97
- package/vendor/node-addon-api/doc/checker-tool.md +32 -32
- package/vendor/node-addon-api/doc/class_property_descriptor.md +115 -115
- package/vendor/node-addon-api/doc/cmake-js.md +68 -68
- package/vendor/node-addon-api/doc/conversion-tool.md +27 -27
- package/vendor/node-addon-api/doc/creating_a_release.md +62 -62
- package/vendor/node-addon-api/doc/dataview.md +248 -248
- package/vendor/node-addon-api/doc/date.md +68 -68
- package/vendor/node-addon-api/doc/env.md +196 -196
- package/vendor/node-addon-api/doc/error.md +120 -120
- package/vendor/node-addon-api/doc/error_handling.md +254 -254
- package/vendor/node-addon-api/doc/escapable_handle_scope.md +80 -80
- package/vendor/node-addon-api/doc/external.md +63 -63
- package/vendor/node-addon-api/doc/function.md +402 -402
- package/vendor/node-addon-api/doc/function_reference.md +238 -238
- package/vendor/node-addon-api/doc/generator.md +13 -13
- package/vendor/node-addon-api/doc/handle_scope.md +63 -63
- package/vendor/node-addon-api/doc/hierarchy.md +91 -91
- package/vendor/node-addon-api/doc/instance_wrap.md +408 -408
- package/vendor/node-addon-api/doc/maybe.md +76 -76
- package/vendor/node-addon-api/doc/memory_management.md +27 -27
- package/vendor/node-addon-api/doc/name.md +29 -29
- package/vendor/node-addon-api/doc/node-gyp.md +82 -82
- package/vendor/node-addon-api/doc/number.md +163 -163
- package/vendor/node-addon-api/doc/object.md +432 -432
- package/vendor/node-addon-api/doc/object_lifetime_management.md +83 -83
- package/vendor/node-addon-api/doc/object_reference.md +117 -117
- package/vendor/node-addon-api/doc/object_wrap.md +561 -561
- package/vendor/node-addon-api/doc/prebuild_tools.md +16 -16
- package/vendor/node-addon-api/doc/promises.md +79 -79
- package/vendor/node-addon-api/doc/property_descriptor.md +286 -286
- package/vendor/node-addon-api/doc/propertylvalue.md +50 -50
- package/vendor/node-addon-api/doc/range_error.md +59 -59
- package/vendor/node-addon-api/doc/reference.md +113 -113
- package/vendor/node-addon-api/doc/setup.md +110 -110
- package/vendor/node-addon-api/doc/string.md +93 -93
- package/vendor/node-addon-api/doc/symbol.md +60 -60
- package/vendor/node-addon-api/doc/threadsafe.md +121 -121
- package/vendor/node-addon-api/doc/threadsafe_function.md +290 -290
- package/vendor/node-addon-api/doc/type_error.md +59 -59
- package/vendor/node-addon-api/doc/typed_array.md +78 -78
- package/vendor/node-addon-api/doc/typed_array_of.md +137 -137
- package/vendor/node-addon-api/doc/typed_threadsafe_function.md +306 -306
- package/vendor/node-addon-api/doc/value.md +340 -340
- package/vendor/node-addon-api/doc/version_management.md +43 -43
- package/vendor/node-addon-api/except.gypi +25 -25
- package/vendor/node-addon-api/index.js +11 -11
- package/vendor/node-addon-api/napi-inl.deprecated.h +192 -192
- package/vendor/node-addon-api/napi-inl.h +6209 -6209
- package/vendor/node-addon-api/napi.h +2983 -2983
- package/vendor/node-addon-api/node_api.gyp +9 -9
- package/vendor/node-addon-api/noexcept.gypi +26 -26
- package/vendor/node-addon-api/package-support.json +21 -21
- package/vendor/node-addon-api/package.json +399 -399
- package/vendor/node-addon-api/test/README.md +91 -91
- package/vendor/node-addon-api/test/addon.cc +36 -36
- package/vendor/node-addon-api/test/addon.js +11 -11
- package/vendor/node-addon-api/test/addon_build/index.js +49 -49
- package/vendor/node-addon-api/test/addon_build/tpl/addon.cc +17 -17
- package/vendor/node-addon-api/test/addon_build/tpl/binding.gyp +62 -62
- package/vendor/node-addon-api/test/addon_build/tpl/index.js +9 -9
- package/vendor/node-addon-api/test/addon_build/tpl/package.json +11 -11
- package/vendor/node-addon-api/test/addon_data.cc +99 -99
- package/vendor/node-addon-api/test/addon_data.js +46 -46
- package/vendor/node-addon-api/test/array_buffer.cc +243 -243
- package/vendor/node-addon-api/test/array_buffer.js +69 -69
- package/vendor/node-addon-api/test/async_context.cc +21 -21
- package/vendor/node-addon-api/test/async_context.js +86 -86
- package/vendor/node-addon-api/test/async_progress_queue_worker.cc +83 -83
- package/vendor/node-addon-api/test/async_progress_queue_worker.js +46 -46
- package/vendor/node-addon-api/test/async_progress_worker.cc +134 -134
- package/vendor/node-addon-api/test/async_progress_worker.js +61 -61
- package/vendor/node-addon-api/test/async_worker.cc +106 -106
- package/vendor/node-addon-api/test/async_worker.js +179 -179
- package/vendor/node-addon-api/test/async_worker_nocallback.js +13 -13
- package/vendor/node-addon-api/test/async_worker_persistent.cc +63 -63
- package/vendor/node-addon-api/test/async_worker_persistent.js +24 -24
- package/vendor/node-addon-api/test/basic_types/array.cc +40 -40
- package/vendor/node-addon-api/test/basic_types/array.js +35 -35
- package/vendor/node-addon-api/test/basic_types/boolean.cc +38 -38
- package/vendor/node-addon-api/test/basic_types/boolean.js +35 -35
- package/vendor/node-addon-api/test/basic_types/number.cc +99 -99
- package/vendor/node-addon-api/test/basic_types/number.js +114 -114
- package/vendor/node-addon-api/test/basic_types/value.cc +120 -120
- package/vendor/node-addon-api/test/basic_types/value.js +133 -133
- package/vendor/node-addon-api/test/bigint.cc +91 -91
- package/vendor/node-addon-api/test/bigint.js +53 -53
- package/vendor/node-addon-api/test/binding-swallowexcept.cc +12 -12
- package/vendor/node-addon-api/test/binding.cc +171 -171
- package/vendor/node-addon-api/test/binding.gyp +117 -117
- package/vendor/node-addon-api/test/buffer.cc +183 -183
- package/vendor/node-addon-api/test/buffer.js +69 -69
- package/vendor/node-addon-api/test/callbackscope.cc +22 -22
- package/vendor/node-addon-api/test/callbackscope.js +49 -49
- package/vendor/node-addon-api/test/common/index.js +113 -113
- package/vendor/node-addon-api/test/common/test_helper.h +61 -61
- package/vendor/node-addon-api/test/dataview/dataview.cc +48 -48
- package/vendor/node-addon-api/test/dataview/dataview.js +35 -35
- package/vendor/node-addon-api/test/dataview/dataview_read_write.cc +115 -115
- package/vendor/node-addon-api/test/dataview/dataview_read_write.js +90 -90
- package/vendor/node-addon-api/test/date.cc +44 -44
- package/vendor/node-addon-api/test/date.js +18 -18
- package/vendor/node-addon-api/test/env_cleanup.cc +88 -88
- package/vendor/node-addon-api/test/env_cleanup.js +56 -56
- package/vendor/node-addon-api/test/error.cc +287 -287
- package/vendor/node-addon-api/test/error.js +81 -81
- package/vendor/node-addon-api/test/error_handling_for_primitives.cc +13 -13
- package/vendor/node-addon-api/test/error_handling_for_primitives.js +29 -29
- package/vendor/node-addon-api/test/error_terminating_environment.js +94 -94
- package/vendor/node-addon-api/test/external.cc +81 -81
- package/vendor/node-addon-api/test/external.js +88 -88
- package/vendor/node-addon-api/test/function.cc +295 -295
- package/vendor/node-addon-api/test/function.js +121 -121
- package/vendor/node-addon-api/test/function_reference.cc +202 -202
- package/vendor/node-addon-api/test/function_reference.js +157 -157
- package/vendor/node-addon-api/test/globalObject/global_object.cc +61 -61
- package/vendor/node-addon-api/test/globalObject/global_object_delete_property.cc +31 -31
- package/vendor/node-addon-api/test/globalObject/global_object_delete_property.js +61 -61
- package/vendor/node-addon-api/test/globalObject/global_object_get_property.cc +40 -40
- package/vendor/node-addon-api/test/globalObject/global_object_get_property.js +57 -57
- package/vendor/node-addon-api/test/globalObject/global_object_has_own_property.cc +28 -28
- package/vendor/node-addon-api/test/globalObject/global_object_has_own_property.js +48 -48
- package/vendor/node-addon-api/test/globalObject/global_object_set_property.cc +30 -30
- package/vendor/node-addon-api/test/globalObject/global_object_set_property.js +58 -58
- package/vendor/node-addon-api/test/handlescope.cc +60 -60
- package/vendor/node-addon-api/test/handlescope.js +14 -14
- package/vendor/node-addon-api/test/index.js +136 -136
- package/vendor/node-addon-api/test/maybe/check.cc +23 -23
- package/vendor/node-addon-api/test/maybe/index.js +38 -38
- package/vendor/node-addon-api/test/memory_management.cc +17 -17
- package/vendor/node-addon-api/test/memory_management.js +9 -9
- package/vendor/node-addon-api/test/movable_callbacks.cc +23 -23
- package/vendor/node-addon-api/test/movable_callbacks.js +21 -21
- package/vendor/node-addon-api/test/name.cc +108 -108
- package/vendor/node-addon-api/test/name.js +59 -59
- package/vendor/node-addon-api/test/napi_child.js +14 -14
- package/vendor/node-addon-api/test/object/delete_property.cc +38 -38
- package/vendor/node-addon-api/test/object/delete_property.js +41 -41
- package/vendor/node-addon-api/test/object/finalizer.cc +29 -29
- package/vendor/node-addon-api/test/object/finalizer.js +28 -28
- package/vendor/node-addon-api/test/object/get_property.cc +34 -34
- package/vendor/node-addon-api/test/object/get_property.js +40 -40
- package/vendor/node-addon-api/test/object/has_own_property.cc +34 -34
- package/vendor/node-addon-api/test/object/has_own_property.js +34 -34
- package/vendor/node-addon-api/test/object/has_property.cc +38 -38
- package/vendor/node-addon-api/test/object/has_property.js +37 -37
- package/vendor/node-addon-api/test/object/object.cc +348 -348
- package/vendor/node-addon-api/test/object/object.js +217 -217
- package/vendor/node-addon-api/test/object/object_deprecated.cc +66 -66
- package/vendor/node-addon-api/test/object/object_deprecated.js +47 -47
- package/vendor/node-addon-api/test/object/object_freeze_seal.cc +25 -25
- package/vendor/node-addon-api/test/object/object_freeze_seal.js +61 -61
- package/vendor/node-addon-api/test/object/set_property.cc +37 -37
- package/vendor/node-addon-api/test/object/set_property.js +29 -29
- package/vendor/node-addon-api/test/object/subscript_operator.cc +42 -42
- package/vendor/node-addon-api/test/object/subscript_operator.js +17 -17
- package/vendor/node-addon-api/test/object_reference.cc +219 -219
- package/vendor/node-addon-api/test/object_reference.js +259 -259
- package/vendor/node-addon-api/test/objectwrap.cc +268 -268
- package/vendor/node-addon-api/test/objectwrap.js +284 -284
- package/vendor/node-addon-api/test/objectwrap_constructor_exception.cc +26 -26
- package/vendor/node-addon-api/test/objectwrap_constructor_exception.js +18 -18
- package/vendor/node-addon-api/test/objectwrap_multiple_inheritance.cc +30 -30
- package/vendor/node-addon-api/test/objectwrap_multiple_inheritance.js +13 -13
- package/vendor/node-addon-api/test/objectwrap_removewrap.cc +45 -45
- package/vendor/node-addon-api/test/objectwrap_removewrap.js +40 -40
- package/vendor/node-addon-api/test/objectwrap_worker_thread.js +19 -19
- package/vendor/node-addon-api/test/promise.cc +29 -29
- package/vendor/node-addon-api/test/promise.js +18 -18
- package/vendor/node-addon-api/test/reference.cc +24 -24
- package/vendor/node-addon-api/test/reference.js +14 -14
- package/vendor/node-addon-api/test/run_script.cc +56 -56
- package/vendor/node-addon-api/test/run_script.js +45 -45
- package/vendor/node-addon-api/test/symbol.cc +79 -79
- package/vendor/node-addon-api/test/symbol.js +73 -73
- package/vendor/node-addon-api/test/testUtil.js +54 -54
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function.cc +195 -195
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function.js +188 -188
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ctx.cc +63 -63
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ctx.js +12 -12
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_existing_tsfn.cc +115 -115
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_existing_tsfn.js +14 -14
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ptr.cc +26 -26
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ptr.js +7 -7
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_sum.cc +225 -225
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_sum.js +59 -59
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_unref.cc +42 -42
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_unref.js +53 -53
- package/vendor/node-addon-api/test/thunking_manual.cc +140 -140
- package/vendor/node-addon-api/test/thunking_manual.js +17 -17
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function.cc +215 -215
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function.js +188 -188
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ctx.cc +68 -68
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ctx.js +12 -12
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_existing_tsfn.cc +127 -127
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_existing_tsfn.js +14 -14
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ptr.cc +28 -28
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ptr.js +7 -7
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_sum.cc +237 -237
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_sum.js +59 -59
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_unref.cc +53 -53
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_unref.js +53 -53
- package/vendor/node-addon-api/test/typedarray-bigint.js +58 -58
- package/vendor/node-addon-api/test/typedarray.cc +216 -216
- package/vendor/node-addon-api/test/typedarray.js +69 -69
- package/vendor/node-addon-api/test/version_management.cc +27 -27
- package/vendor/node-addon-api/test/version_management.js +31 -31
- package/vendor/node-addon-api/tools/README.md +73 -73
- package/vendor/node-addon-api/tools/check-napi.js +100 -100
- package/vendor/node-addon-api/tools/clang-format.js +68 -68
- package/vendor/node-addon-api/tools/conversion.js +309 -309
- package/vendor/node-addon-api/tools/eslint-format.js +71 -71
- package/vendor/raylib/BINDINGS.md +123 -0
- package/vendor/raylib/CHANGELOG +1495 -0
- package/vendor/raylib/CMakeLists.txt +33 -0
- package/vendor/raylib/CMakeOptions.txt +87 -0
- package/vendor/raylib/CONTRIBUTING.md +76 -0
- package/vendor/raylib/CONTRIBUTORS.md +63 -0
- package/vendor/raylib/CONVENTIONS.md +95 -0
- package/vendor/raylib/HISTORY.md +364 -0
- package/vendor/raylib/LICENSE +16 -0
- package/vendor/raylib/README.md +141 -0
- package/vendor/raylib/ROADMAP.md +76 -0
- package/vendor/raylib/SPONSORS.md +68 -0
- package/vendor/raylib/cmake/AddIfFlagCompiles.cmake +12 -0
- package/vendor/raylib/cmake/BuildOptions.cmake +18 -0
- package/vendor/raylib/cmake/CompileDefinitions.cmake +110 -0
- package/vendor/raylib/cmake/CompilerFlags.cmake +79 -0
- package/vendor/raylib/cmake/EnumOption.cmake +9 -0
- package/vendor/raylib/cmake/GlfwImport.cmake +34 -0
- package/vendor/raylib/cmake/InstallConfigurations.cmake +29 -0
- package/vendor/raylib/cmake/JoinPaths.cmake +26 -0
- package/vendor/raylib/cmake/LibraryConfigurations.cmake +108 -0
- package/vendor/raylib/cmake/LibraryPathToLinkerFlags.cmake +24 -0
- package/vendor/raylib/cmake/PackConfigurations.cmake +13 -0
- package/vendor/raylib/cmake/PopulateConfigVariablesLocally.cmake +11 -0
- package/vendor/raylib/cmake/raylib-config-version.cmake +21 -0
- package/vendor/raylib/cmake/raylib-config.cmake +76 -0
- package/vendor/raylib/examples/CMakeLists.txt +139 -0
- package/vendor/raylib/examples/Makefile +565 -0
- package/vendor/raylib/examples/Makefile.Android +405 -0
- package/vendor/raylib/examples/Makefile.Web +1053 -0
- package/vendor/raylib/examples/README.md +203 -0
- package/vendor/raylib/examples/audio/audio_module_playing.c +146 -0
- package/vendor/raylib/examples/audio/audio_module_playing.png +0 -0
- package/vendor/raylib/examples/audio/audio_multichannel_sound.c +73 -0
- package/vendor/raylib/examples/audio/audio_multichannel_sound.png +0 -0
- package/vendor/raylib/examples/audio/audio_music_stream.c +93 -0
- package/vendor/raylib/examples/audio/audio_music_stream.png +0 -0
- package/vendor/raylib/examples/audio/audio_raw_stream.c +167 -0
- package/vendor/raylib/examples/audio/audio_raw_stream.png +0 -0
- package/vendor/raylib/examples/audio/audio_sound_loading.c +64 -0
- package/vendor/raylib/examples/audio/audio_sound_loading.png +0 -0
- package/vendor/raylib/examples/audio/resources/LICENSE.md +10 -0
- package/vendor/raylib/examples/audio/resources/coin.wav +0 -0
- package/vendor/raylib/examples/audio/resources/country.mp3 +0 -0
- package/vendor/raylib/examples/audio/resources/mini1111.xm +0 -0
- package/vendor/raylib/examples/audio/resources/sound.wav +0 -0
- package/vendor/raylib/examples/audio/resources/spring.wav +0 -0
- package/vendor/raylib/examples/audio/resources/target.flac +0 -0
- package/vendor/raylib/examples/audio/resources/target.ogg +0 -0
- package/vendor/raylib/examples/audio/resources/weird.wav +0 -0
- package/vendor/raylib/examples/build.zig +86 -0
- package/vendor/raylib/examples/core/core_2d_camera.c +132 -0
- package/vendor/raylib/examples/core/core_2d_camera.png +0 -0
- package/vendor/raylib/examples/core/core_2d_camera_platformer.c +293 -0
- package/vendor/raylib/examples/core/core_2d_camera_platformer.png +0 -0
- package/vendor/raylib/examples/core/core_2d_camera_smooth_pixelperfect.png +0 -0
- package/vendor/raylib/examples/core/core_3d_camera_first_person.c +97 -0
- package/vendor/raylib/examples/core/core_3d_camera_first_person.png +0 -0
- package/vendor/raylib/examples/core/core_3d_camera_free.c +83 -0
- package/vendor/raylib/examples/core/core_3d_camera_free.png +0 -0
- package/vendor/raylib/examples/core/core_3d_camera_mode.c +73 -0
- package/vendor/raylib/examples/core/core_3d_camera_mode.png +0 -0
- package/vendor/raylib/examples/core/core_3d_picking.c +107 -0
- package/vendor/raylib/examples/core/core_3d_picking.png +0 -0
- package/vendor/raylib/examples/core/core_basic_screen_manager.c +150 -0
- package/vendor/raylib/examples/core/core_basic_screen_manager.png +0 -0
- package/vendor/raylib/examples/core/core_basic_window.c +62 -0
- package/vendor/raylib/examples/core/core_basic_window.png +0 -0
- package/vendor/raylib/examples/core/core_basic_window_web.c +85 -0
- package/vendor/raylib/examples/core/core_custom_frame_control.c +125 -0
- package/vendor/raylib/examples/core/core_custom_frame_control.png +0 -0
- package/vendor/raylib/examples/core/core_custom_logging.c +84 -0
- package/vendor/raylib/examples/core/core_custom_logging.png +0 -0
- package/vendor/raylib/examples/core/core_drop_files.c +76 -0
- package/vendor/raylib/examples/core/core_drop_files.png +0 -0
- package/vendor/raylib/examples/core/core_input_gamepad.c +195 -0
- package/vendor/raylib/examples/core/core_input_gamepad.png +0 -0
- package/vendor/raylib/examples/core/core_input_gestures.c +115 -0
- package/vendor/raylib/examples/core/core_input_gestures.png +0 -0
- package/vendor/raylib/examples/core/core_input_keys.c +59 -0
- package/vendor/raylib/examples/core/core_input_keys.png +0 -0
- package/vendor/raylib/examples/core/core_input_mouse.c +65 -0
- package/vendor/raylib/examples/core/core_input_mouse.png +0 -0
- package/vendor/raylib/examples/core/core_input_mouse_wheel.c +58 -0
- package/vendor/raylib/examples/core/core_input_mouse_wheel.png +0 -0
- package/vendor/raylib/examples/core/core_input_multitouch.c +70 -0
- package/vendor/raylib/examples/core/core_input_multitouch.png +0 -0
- package/vendor/raylib/examples/core/core_loading_thread.c +147 -0
- package/vendor/raylib/examples/core/core_loading_thread.png +0 -0
- package/vendor/raylib/examples/core/core_quat_conversion.c +132 -0
- package/vendor/raylib/examples/core/core_quat_conversion.png +0 -0
- package/vendor/raylib/examples/core/core_random_values.c +67 -0
- package/vendor/raylib/examples/core/core_random_values.png +0 -0
- package/vendor/raylib/examples/core/core_scissor_test.c +71 -0
- package/vendor/raylib/examples/core/core_scissor_test.png +0 -0
- package/vendor/raylib/examples/core/core_smooth_pixelperfect.c +117 -0
- package/vendor/raylib/examples/core/core_smooth_pixelperfect.png +0 -0
- package/vendor/raylib/examples/core/core_split_screen.c +155 -0
- package/vendor/raylib/examples/core/core_split_screen.png +0 -0
- package/vendor/raylib/examples/core/core_storage_values.c +87 -0
- package/vendor/raylib/examples/core/core_storage_values.png +0 -0
- package/vendor/raylib/examples/core/core_vr_simulator.c +143 -0
- package/vendor/raylib/examples/core/core_vr_simulator.png +0 -0
- package/vendor/raylib/examples/core/core_window_flags.c +191 -0
- package/vendor/raylib/examples/core/core_window_flags.png +0 -0
- package/vendor/raylib/examples/core/core_window_letterbox.c +112 -0
- package/vendor/raylib/examples/core/core_window_letterbox.png +0 -0
- package/vendor/raylib/examples/core/core_world_screen.c +78 -0
- package/vendor/raylib/examples/core/core_world_screen.png +0 -0
- package/vendor/raylib/examples/core/resources/LICENSE.md +4 -0
- package/vendor/raylib/examples/core/resources/distortion100.fs +52 -0
- package/vendor/raylib/examples/core/resources/distortion330.fs +53 -0
- package/vendor/raylib/examples/core/resources/ps3.png +0 -0
- package/vendor/raylib/examples/core/resources/xbox.png +0 -0
- package/vendor/raylib/examples/examples_template.c +100 -0
- package/vendor/raylib/examples/models/models_animation.c +114 -0
- package/vendor/raylib/examples/models/models_animation.png +0 -0
- package/vendor/raylib/examples/models/models_billboard.c +75 -0
- package/vendor/raylib/examples/models/models_billboard.png +0 -0
- package/vendor/raylib/examples/models/models_box_collisions.c +121 -0
- package/vendor/raylib/examples/models/models_box_collisions.png +0 -0
- package/vendor/raylib/examples/models/models_cubicmap.c +87 -0
- package/vendor/raylib/examples/models/models_cubicmap.png +0 -0
- package/vendor/raylib/examples/models/models_first_person_maze.c +122 -0
- package/vendor/raylib/examples/models/models_first_person_maze.png +0 -0
- package/vendor/raylib/examples/models/models_geometric_shapes.c +80 -0
- package/vendor/raylib/examples/models/models_geometric_shapes.png +0 -0
- package/vendor/raylib/examples/models/models_heightmap.c +82 -0
- package/vendor/raylib/examples/models/models_heightmap.png +0 -0
- package/vendor/raylib/examples/models/models_loading.c +146 -0
- package/vendor/raylib/examples/models/models_loading.png +0 -0
- package/vendor/raylib/examples/models/models_loading_gltf.c +105 -0
- package/vendor/raylib/examples/models/models_loading_gltf.png +0 -0
- package/vendor/raylib/examples/models/models_loading_vox.c +130 -0
- package/vendor/raylib/examples/models/models_loading_vox.png +0 -0
- package/vendor/raylib/examples/models/models_mesh_generation.c +179 -0
- package/vendor/raylib/examples/models/models_mesh_generation.png +0 -0
- package/vendor/raylib/examples/models/models_mesh_picking.c +223 -0
- package/vendor/raylib/examples/models/models_mesh_picking.png +0 -0
- package/vendor/raylib/examples/models/models_orthographic_projection.c +99 -0
- package/vendor/raylib/examples/models/models_orthographic_projection.png +0 -0
- package/vendor/raylib/examples/models/models_rlgl_solar_system.c +172 -0
- package/vendor/raylib/examples/models/models_rlgl_solar_system.png +0 -0
- package/vendor/raylib/examples/models/models_skybox.c +262 -0
- package/vendor/raylib/examples/models/models_skybox.png +0 -0
- package/vendor/raylib/examples/models/models_waving_cubes.c +112 -0
- package/vendor/raylib/examples/models/models_waving_cubes.png +0 -0
- package/vendor/raylib/examples/models/models_yaw_pitch_roll.c +117 -0
- package/vendor/raylib/examples/models/models_yaw_pitch_roll.png +0 -0
- package/vendor/raylib/examples/models/resources/LICENSE.md +23 -0
- package/vendor/raylib/examples/models/resources/billboard.png +0 -0
- package/vendor/raylib/examples/models/resources/cubicmap.png +0 -0
- package/vendor/raylib/examples/models/resources/cubicmap_atlas.png +0 -0
- package/vendor/raylib/examples/models/resources/dresden_square_1k.hdr +0 -0
- package/vendor/raylib/examples/models/resources/dresden_square_2k.hdr +0 -0
- package/vendor/raylib/examples/models/resources/heightmap.png +0 -0
- package/vendor/raylib/examples/models/resources/models/gltf/AnimatedMorphCube.glb +0 -0
- package/vendor/raylib/examples/models/resources/models/gltf/AnimatedTriangle.gltf +118 -0
- package/vendor/raylib/examples/models/resources/models/gltf/BoxAnimated.glb +0 -0
- package/vendor/raylib/examples/models/resources/models/gltf/LICENSE +23 -0
- package/vendor/raylib/examples/models/resources/models/gltf/girl.glb +0 -0
- package/vendor/raylib/examples/models/resources/models/gltf/raylib_32x32.glb +0 -0
- package/vendor/raylib/examples/models/resources/models/gltf/rigged_figure.glb +0 -0
- package/vendor/raylib/examples/models/resources/models/gltf/vertex_colored_object.glb +0 -0
- package/vendor/raylib/examples/models/resources/models/iqm/guy.blend +0 -0
- package/vendor/raylib/examples/models/resources/models/iqm/guy.iqm +0 -0
- package/vendor/raylib/examples/models/resources/models/iqm/guyanim.iqm +0 -0
- package/vendor/raylib/examples/models/resources/models/iqm/guytex.png +0 -0
- package/vendor/raylib/examples/models/resources/models/iqm/vertex_colored_object.iqm +0 -0
- package/vendor/raylib/examples/models/resources/models/obj/bridge.obj +1725 -0
- package/vendor/raylib/examples/models/resources/models/obj/bridge_diffuse.png +0 -0
- package/vendor/raylib/examples/models/resources/models/obj/castle.obj +12919 -0
- package/vendor/raylib/examples/models/resources/models/obj/castle_diffuse.png +0 -0
- package/vendor/raylib/examples/models/resources/models/obj/cube.obj +68 -0
- package/vendor/raylib/examples/models/resources/models/obj/cube_diffuse.png +0 -0
- package/vendor/raylib/examples/models/resources/models/obj/house.obj +4564 -0
- package/vendor/raylib/examples/models/resources/models/obj/house_diffuse.png +0 -0
- package/vendor/raylib/examples/models/resources/models/obj/market.obj +7301 -0
- package/vendor/raylib/examples/models/resources/models/obj/market_diffuse.png +0 -0
- package/vendor/raylib/examples/models/resources/models/obj/plane.obj +10858 -0
- package/vendor/raylib/examples/models/resources/models/obj/plane_diffuse.png +0 -0
- package/vendor/raylib/examples/models/resources/models/obj/turret.obj +1888 -0
- package/vendor/raylib/examples/models/resources/models/obj/turret_diffuse.png +0 -0
- package/vendor/raylib/examples/models/resources/models/obj/well.obj +1030 -0
- package/vendor/raylib/examples/models/resources/models/obj/well_diffuse.png +0 -0
- package/vendor/raylib/examples/models/resources/models/vox/LICENSE +9 -0
- package/vendor/raylib/examples/models/resources/models/vox/chr_knight.vox +0 -0
- package/vendor/raylib/examples/models/resources/models/vox/chr_sword.vox +0 -0
- package/vendor/raylib/examples/models/resources/models/vox/monu9.vox +0 -0
- package/vendor/raylib/examples/models/resources/shaders/glsl100/cubemap.fs +29 -0
- package/vendor/raylib/examples/models/resources/shaders/glsl100/cubemap.vs +20 -0
- package/vendor/raylib/examples/models/resources/shaders/glsl100/skybox.fs +31 -0
- package/vendor/raylib/examples/models/resources/shaders/glsl100/skybox.vs +24 -0
- package/vendor/raylib/examples/models/resources/shaders/glsl330/cubemap.fs +30 -0
- package/vendor/raylib/examples/models/resources/shaders/glsl330/cubemap.vs +20 -0
- package/vendor/raylib/examples/models/resources/shaders/glsl330/skybox.fs +30 -0
- package/vendor/raylib/examples/models/resources/shaders/glsl330/skybox.vs +24 -0
- package/vendor/raylib/examples/models/resources/skybox.png +0 -0
- package/vendor/raylib/examples/models/rlights.h +183 -0
- package/vendor/raylib/examples/others/easings.h +263 -0
- package/vendor/raylib/examples/others/easings_testbed.c +227 -0
- package/vendor/raylib/examples/others/embedded_files_loading.c +103 -0
- package/vendor/raylib/examples/others/external/include/GLFW/glfw3.h +5538 -0
- package/vendor/raylib/examples/others/external/include/GLFW/glfw3native.h +572 -0
- package/vendor/raylib/examples/others/external/include/glad.h +5466 -0
- package/vendor/raylib/examples/others/external/lib/libglfw3.a +0 -0
- package/vendor/raylib/examples/others/raudio_standalone.c +152 -0
- package/vendor/raylib/examples/others/raylib_opengl_interop.c +152 -0
- package/vendor/raylib/examples/others/raylib_opengl_interop.png +0 -0
- package/vendor/raylib/examples/others/resources/audio/country.mp3 +0 -0
- package/vendor/raylib/examples/others/resources/audio/target.ogg +0 -0
- package/vendor/raylib/examples/others/resources/audio/weird.wav +0 -0
- package/vendor/raylib/examples/others/resources/audio_data.h +4893 -0
- package/vendor/raylib/examples/others/resources/image_data.h +9848 -0
- package/vendor/raylib/examples/others/resources/shaders/glsl100/point_particle.fs +16 -0
- package/vendor/raylib/examples/others/resources/shaders/glsl100/point_particle.vs +24 -0
- package/vendor/raylib/examples/others/resources/shaders/glsl330/point_particle.fs +17 -0
- package/vendor/raylib/examples/others/resources/shaders/glsl330/point_particle.vs +24 -0
- package/vendor/raylib/examples/others/resources/shaders/glsl430/gol.glsl +41 -0
- package/vendor/raylib/examples/others/resources/shaders/glsl430/gol_render.glsl +29 -0
- package/vendor/raylib/examples/others/resources/shaders/glsl430/gol_transfert.glsl +51 -0
- package/vendor/raylib/examples/others/rlgl_compute_shader.c +173 -0
- package/vendor/raylib/examples/others/rlgl_standalone.c +469 -0
- package/vendor/raylib/examples/physics/physics_demo.c +128 -0
- package/vendor/raylib/examples/physics/physics_demo.png +0 -0
- package/vendor/raylib/examples/physics/physics_friction.c +142 -0
- package/vendor/raylib/examples/physics/physics_friction.png +0 -0
- package/vendor/raylib/examples/physics/physics_movement.c +128 -0
- package/vendor/raylib/examples/physics/physics_movement.png +0 -0
- package/vendor/raylib/examples/physics/physics_restitution.c +129 -0
- package/vendor/raylib/examples/physics/physics_restitution.png +0 -0
- package/vendor/raylib/examples/physics/physics_shatter.c +111 -0
- package/vendor/raylib/examples/physics/physics_shatter.png +0 -0
- package/vendor/raylib/examples/raylib_compile_execute.bat +32 -0
- package/vendor/raylib/examples/raylib_makefile_example.bat +27 -0
- package/vendor/raylib/examples/shaders/resources/LICENSE.md +11 -0
- package/vendor/raylib/examples/shaders/resources/fudesumi.png +0 -0
- package/vendor/raylib/examples/shaders/resources/mask.png +0 -0
- package/vendor/raylib/examples/shaders/resources/models/barracks.obj +22251 -0
- package/vendor/raylib/examples/shaders/resources/models/barracks_diffuse.png +0 -0
- package/vendor/raylib/examples/shaders/resources/models/church.obj +5116 -0
- package/vendor/raylib/examples/shaders/resources/models/church_diffuse.png +0 -0
- package/vendor/raylib/examples/shaders/resources/models/watermill.obj +5316 -0
- package/vendor/raylib/examples/shaders/resources/models/watermill_diffuse.png +0 -0
- package/vendor/raylib/examples/shaders/resources/plasma.png +0 -0
- package/vendor/raylib/examples/shaders/resources/raysan.png +0 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/base.fs +23 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/base.vs +26 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/base_lighting.vs +59 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/base_lighting_instanced.vs +36 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/bloom.fs +39 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/blur.fs +34 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/color_mix.fs +26 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/cross_hatching.fs +47 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/cross_stitching.fs +57 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/cubes_panning.fs +60 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/depth.fs +26 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/distortion.fs +54 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/dream_vision.fs +37 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/eratosthenes.fs +60 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/fisheye.fs +43 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/fog.fs +94 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/grayscale.fs +25 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/julia_set.fs +83 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/lighting.fs +81 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/mask.fs +24 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/outline.fs +34 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/palette_switch.fs +41 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/pixelizer.fs +32 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/posterization.fs +29 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/predator.fs +31 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/raymarching.fs +431 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/reload.fs +39 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/scanlines.fs +44 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/sobel.fs +40 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/spotlight.fs +77 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/swirl.fs +46 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl100/wave.fs +36 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/base.fs +22 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/base.vs +26 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/base_lighting.vs +59 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/bloom.fs +37 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/blur.fs +32 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/cross_hatching.fs +45 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/cross_stitching.fs +55 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/distortion.fs +52 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/dream_vision.fs +35 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/fisheye.fs +41 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/fog.fs +92 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/grayscale.fs +23 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/palette_switch.fs +27 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/pixelizer.fs +30 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/posterization.fs +27 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/predator.fs +29 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/scanlines.fs +42 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/sobel.fs +38 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl120/swirl.fs +44 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/base.fs +25 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/base.vs +26 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/base_lighting.vs +32 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/base_lighting_instanced.vs +36 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/bloom.fs +40 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/blur.fs +35 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/color_mix.fs +27 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/cross_hatching.fs +48 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/cross_stitching.fs +59 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/cubes_panning.fs +61 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/depth.fs +27 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/distortion.fs +56 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/dream_vision.fs +34 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/eratosthenes.fs +59 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/fisheye.fs +40 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/fog.fs +95 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/grayscale.fs +26 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/julia_set.fs +81 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/lighting.fs +82 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/mask.fs +22 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/outline.fs +35 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/overdraw.fs +26 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/palette_switch.fs +30 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/pixelizer.fs +33 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/posterization.fs +31 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/predator.fs +32 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/raymarching.fs +430 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/reload.fs +40 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/scanlines.fs +49 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/sobel.fs +41 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/spotlight.fs +65 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/swirl.fs +47 -0
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/wave.fs +37 -0
- package/vendor/raylib/examples/shaders/resources/space.png +0 -0
- package/vendor/raylib/examples/shaders/resources/texel_checker.png +0 -0
- package/vendor/raylib/examples/shaders/rlights.h +183 -0
- package/vendor/raylib/examples/shaders/shaders_basic_lighting.c +152 -0
- package/vendor/raylib/examples/shaders/shaders_basic_lighting.png +0 -0
- package/vendor/raylib/examples/shaders/shaders_custom_uniform.c +127 -0
- package/vendor/raylib/examples/shaders/shaders_custom_uniform.png +0 -0
- package/vendor/raylib/examples/shaders/shaders_eratosthenes.c +92 -0
- package/vendor/raylib/examples/shaders/shaders_eratosthenes.png +0 -0
- package/vendor/raylib/examples/shaders/shaders_fog.c +160 -0
- package/vendor/raylib/examples/shaders/shaders_fog.png +0 -0
- package/vendor/raylib/examples/shaders/shaders_hot_reloading.c +130 -0
- package/vendor/raylib/examples/shaders/shaders_hot_reloading.png +0 -0
- package/vendor/raylib/examples/shaders/shaders_julia_set.c +191 -0
- package/vendor/raylib/examples/shaders/shaders_julia_set.png +0 -0
- package/vendor/raylib/examples/shaders/shaders_mesh_instancing.c +224 -0
- package/vendor/raylib/examples/shaders/shaders_mesh_instancing.png +0 -0
- package/vendor/raylib/examples/shaders/shaders_model_shader.c +103 -0
- package/vendor/raylib/examples/shaders/shaders_model_shader.png +0 -0
- package/vendor/raylib/examples/shaders/shaders_multi_sample2d.c +105 -0
- package/vendor/raylib/examples/shaders/shaders_multi_sample2d.png +0 -0
- package/vendor/raylib/examples/shaders/shaders_palette_switch.c +147 -0
- package/vendor/raylib/examples/shaders/shaders_palette_switch.png +0 -0
- package/vendor/raylib/examples/shaders/shaders_postprocessing.c +170 -0
- package/vendor/raylib/examples/shaders/shaders_postprocessing.png +0 -0
- package/vendor/raylib/examples/shaders/shaders_raymarching.c +113 -0
- package/vendor/raylib/examples/shaders/shaders_raymarching.png +0 -0
- package/vendor/raylib/examples/shaders/shaders_shapes_textures.c +116 -0
- package/vendor/raylib/examples/shaders/shaders_shapes_textures.png +0 -0
- package/vendor/raylib/examples/shaders/shaders_simple_mask.c +144 -0
- package/vendor/raylib/examples/shaders/shaders_simple_mask.png +0 -0
- package/vendor/raylib/examples/shaders/shaders_spotlight.c +254 -0
- package/vendor/raylib/examples/shaders/shaders_spotlight.png +0 -0
- package/vendor/raylib/examples/shaders/shaders_texture_drawing.c +80 -0
- package/vendor/raylib/examples/shaders/shaders_texture_drawing.png +0 -0
- package/vendor/raylib/examples/shaders/shaders_texture_outline.c +97 -0
- package/vendor/raylib/examples/shaders/shaders_texture_outline.png +0 -0
- package/vendor/raylib/examples/shaders/shaders_texture_waves.c +110 -0
- package/vendor/raylib/examples/shaders/shaders_texture_waves.png +0 -0
- package/vendor/raylib/examples/shapes/shapes_basic_shapes.c +78 -0
- package/vendor/raylib/examples/shapes/shapes_basic_shapes.png +0 -0
- package/vendor/raylib/examples/shapes/shapes_bouncing_ball.c +76 -0
- package/vendor/raylib/examples/shapes/shapes_bouncing_ball.png +0 -0
- package/vendor/raylib/examples/shapes/shapes_collision_area.c +108 -0
- package/vendor/raylib/examples/shapes/shapes_collision_area.png +0 -0
- package/vendor/raylib/examples/shapes/shapes_colors_palette.c +99 -0
- package/vendor/raylib/examples/shapes/shapes_colors_palette.png +0 -0
- package/vendor/raylib/examples/shapes/shapes_draw_circle_sector.c +83 -0
- package/vendor/raylib/examples/shapes/shapes_draw_circle_sector.png +0 -0
- package/vendor/raylib/examples/shapes/shapes_draw_rectangle_rounded.c +89 -0
- package/vendor/raylib/examples/shapes/shapes_draw_rectangle_rounded.png +0 -0
- package/vendor/raylib/examples/shapes/shapes_draw_ring.c +96 -0
- package/vendor/raylib/examples/shapes/shapes_draw_ring.png +0 -0
- package/vendor/raylib/examples/shapes/shapes_easings_ball_anim.c +110 -0
- package/vendor/raylib/examples/shapes/shapes_easings_ball_anim.png +0 -0
- package/vendor/raylib/examples/shapes/shapes_easings_box_anim.c +136 -0
- package/vendor/raylib/examples/shapes/shapes_easings_box_anim.png +0 -0
- package/vendor/raylib/examples/shapes/shapes_easings_rectangle_array.c +118 -0
- package/vendor/raylib/examples/shapes/shapes_easings_rectangle_array.png +0 -0
- package/vendor/raylib/examples/shapes/shapes_following_eyes.c +104 -0
- package/vendor/raylib/examples/shapes/shapes_following_eyes.png +0 -0
- package/vendor/raylib/examples/shapes/shapes_lines_bezier.c +59 -0
- package/vendor/raylib/examples/shapes/shapes_lines_bezier.png +0 -0
- package/vendor/raylib/examples/shapes/shapes_logo_raylib.c +56 -0
- package/vendor/raylib/examples/shapes/shapes_logo_raylib.png +0 -0
- package/vendor/raylib/examples/shapes/shapes_logo_raylib_anim.c +160 -0
- package/vendor/raylib/examples/shapes/shapes_logo_raylib_anim.png +0 -0
- package/vendor/raylib/examples/shapes/shapes_rectangle_scaling.c +94 -0
- package/vendor/raylib/examples/shapes/shapes_rectangle_scaling.png +0 -0
- package/vendor/raylib/examples/text/resources/KAISG.ttf +0 -0
- package/vendor/raylib/examples/text/resources/LICENSE.md +20 -0
- package/vendor/raylib/examples/text/resources/anonymous_pro_bold.ttf +0 -0
- package/vendor/raylib/examples/text/resources/custom_alagard.png +0 -0
- package/vendor/raylib/examples/text/resources/custom_jupiter_crash.png +0 -0
- package/vendor/raylib/examples/text/resources/custom_mecha.png +0 -0
- package/vendor/raylib/examples/text/resources/dejavu.fnt +1115 -0
- package/vendor/raylib/examples/text/resources/dejavu.png +0 -0
- package/vendor/raylib/examples/text/resources/fonts/alagard.png +0 -0
- package/vendor/raylib/examples/text/resources/fonts/alpha_beta.png +0 -0
- package/vendor/raylib/examples/text/resources/fonts/jupiter_crash.png +0 -0
- package/vendor/raylib/examples/text/resources/fonts/mecha.png +0 -0
- package/vendor/raylib/examples/text/resources/fonts/pixantiqua.png +0 -0
- package/vendor/raylib/examples/text/resources/fonts/pixelplay.png +0 -0
- package/vendor/raylib/examples/text/resources/fonts/romulus.png +0 -0
- package/vendor/raylib/examples/text/resources/fonts/setback.png +0 -0
- package/vendor/raylib/examples/text/resources/noto_cjk.fnt +580 -0
- package/vendor/raylib/examples/text/resources/noto_cjk.png +0 -0
- package/vendor/raylib/examples/text/resources/pixantiqua.fnt +188 -0
- package/vendor/raylib/examples/text/resources/pixantiqua.png +0 -0
- package/vendor/raylib/examples/text/resources/pixantiqua.ttf +0 -0
- package/vendor/raylib/examples/text/resources/shaders/glsl100/alpha_discard.fs +20 -0
- package/vendor/raylib/examples/text/resources/shaders/glsl100/sdf.fs +25 -0
- package/vendor/raylib/examples/text/resources/shaders/glsl330/alpha_discard.fs +19 -0
- package/vendor/raylib/examples/text/resources/shaders/glsl330/sdf.fs +26 -0
- package/vendor/raylib/examples/text/resources/symbola.fnt +191 -0
- package/vendor/raylib/examples/text/resources/symbola.png +0 -0
- package/vendor/raylib/examples/text/text_draw_3d.c +739 -0
- package/vendor/raylib/examples/text/text_draw_3d.png +0 -0
- package/vendor/raylib/examples/text/text_font_filters.c +134 -0
- package/vendor/raylib/examples/text/text_font_filters.png +0 -0
- package/vendor/raylib/examples/text/text_font_loading.c +91 -0
- package/vendor/raylib/examples/text/text_font_loading.png +0 -0
- package/vendor/raylib/examples/text/text_font_sdf.c +141 -0
- package/vendor/raylib/examples/text/text_font_sdf.png +0 -0
- package/vendor/raylib/examples/text/text_font_spritefont.c +85 -0
- package/vendor/raylib/examples/text/text_font_spritefont.png +0 -0
- package/vendor/raylib/examples/text/text_format_text.c +62 -0
- package/vendor/raylib/examples/text/text_format_text.png +0 -0
- package/vendor/raylib/examples/text/text_input_box.c +127 -0
- package/vendor/raylib/examples/text/text_input_box.png +0 -0
- package/vendor/raylib/examples/text/text_raylib_fonts.c +105 -0
- package/vendor/raylib/examples/text/text_raylib_fonts.png +0 -0
- package/vendor/raylib/examples/text/text_rectangle_bounds.c +264 -0
- package/vendor/raylib/examples/text/text_rectangle_bounds.png +0 -0
- package/vendor/raylib/examples/text/text_unicode.c +465 -0
- package/vendor/raylib/examples/text/text_unicode.png +0 -0
- package/vendor/raylib/examples/text/text_writing_anim.c +62 -0
- package/vendor/raylib/examples/text/text_writing_anim.png +0 -0
- package/vendor/raylib/examples/textures/resources/KAISG.ttf +0 -0
- package/vendor/raylib/examples/textures/resources/LICENSE.md +18 -0
- package/vendor/raylib/examples/textures/resources/boom.wav +0 -0
- package/vendor/raylib/examples/textures/resources/button.png +0 -0
- package/vendor/raylib/examples/textures/resources/buttonfx.wav +0 -0
- package/vendor/raylib/examples/textures/resources/cat.png +0 -0
- package/vendor/raylib/examples/textures/resources/custom_jupiter_crash.png +0 -0
- package/vendor/raylib/examples/textures/resources/cyberpunk_street_background.png +0 -0
- package/vendor/raylib/examples/textures/resources/cyberpunk_street_foreground.png +0 -0
- package/vendor/raylib/examples/textures/resources/cyberpunk_street_midground.png +0 -0
- package/vendor/raylib/examples/textures/resources/explosion.png +0 -0
- package/vendor/raylib/examples/textures/resources/fudesumi.png +0 -0
- package/vendor/raylib/examples/textures/resources/fudesumi.raw +0 -0
- package/vendor/raylib/examples/textures/resources/ninepatch_button.png +0 -0
- package/vendor/raylib/examples/textures/resources/parrots.png +0 -0
- package/vendor/raylib/examples/textures/resources/patterns.png +0 -0
- package/vendor/raylib/examples/textures/resources/raylib_logo.png +0 -0
- package/vendor/raylib/examples/textures/resources/scarfy.png +0 -0
- package/vendor/raylib/examples/textures/resources/spark_flame.png +0 -0
- package/vendor/raylib/examples/textures/resources/wabbit_alpha.png +0 -0
- package/vendor/raylib/examples/textures/textures_background_scrolling.c +87 -0
- package/vendor/raylib/examples/textures/textures_background_scrolling.png +0 -0
- package/vendor/raylib/examples/textures/textures_blend_modes.c +93 -0
- package/vendor/raylib/examples/textures/textures_blend_modes.png +0 -0
- package/vendor/raylib/examples/textures/textures_bunnymark.c +120 -0
- package/vendor/raylib/examples/textures/textures_bunnymark.png +0 -0
- package/vendor/raylib/examples/textures/textures_draw_tiled.c +165 -0
- package/vendor/raylib/examples/textures/textures_draw_tiled.png +0 -0
- package/vendor/raylib/examples/textures/textures_image_drawing.c +91 -0
- package/vendor/raylib/examples/textures/textures_image_drawing.png +0 -0
- package/vendor/raylib/examples/textures/textures_image_generation.c +102 -0
- package/vendor/raylib/examples/textures/textures_image_generation.png +0 -0
- package/vendor/raylib/examples/textures/textures_image_loading.c +64 -0
- package/vendor/raylib/examples/textures/textures_image_loading.png +0 -0
- package/vendor/raylib/examples/textures/textures_image_processing.c +169 -0
- package/vendor/raylib/examples/textures/textures_image_processing.png +0 -0
- package/vendor/raylib/examples/textures/textures_image_text.c +83 -0
- package/vendor/raylib/examples/textures/textures_image_text.png +0 -0
- package/vendor/raylib/examples/textures/textures_logo_raylib.c +57 -0
- package/vendor/raylib/examples/textures/textures_logo_raylib.png +0 -0
- package/vendor/raylib/examples/textures/textures_mouse_painting.c +221 -0
- package/vendor/raylib/examples/textures/textures_mouse_painting.png +0 -0
- package/vendor/raylib/examples/textures/textures_npatch_drawing.c +109 -0
- package/vendor/raylib/examples/textures/textures_npatch_drawing.png +0 -0
- package/vendor/raylib/examples/textures/textures_particles_blending.c +135 -0
- package/vendor/raylib/examples/textures/textures_particles_blending.png +0 -0
- package/vendor/raylib/examples/textures/textures_polygon.c +100 -0
- package/vendor/raylib/examples/textures/textures_polygon.png +0 -0
- package/vendor/raylib/examples/textures/textures_raw_data.c +99 -0
- package/vendor/raylib/examples/textures/textures_raw_data.png +0 -0
- package/vendor/raylib/examples/textures/textures_rectangle.c +99 -0
- package/vendor/raylib/examples/textures/textures_rectangle.png +0 -0
- package/vendor/raylib/examples/textures/textures_sprite_button.c +97 -0
- package/vendor/raylib/examples/textures/textures_sprite_button.png +0 -0
- package/vendor/raylib/examples/textures/textures_sprite_explosion.c +120 -0
- package/vendor/raylib/examples/textures/textures_sprite_explosion.png +0 -0
- package/vendor/raylib/examples/textures/textures_srcrec_dstrec.c +82 -0
- package/vendor/raylib/examples/textures/textures_srcrec_dstrec.png +0 -0
- package/vendor/raylib/examples/textures/textures_to_image.c +68 -0
- package/vendor/raylib/examples/textures/textures_to_image.png +0 -0
- package/vendor/raylib/logo/raylib.ico +0 -0
- package/vendor/raylib/logo/raylib_128x128.png +0 -0
- package/vendor/raylib/logo/raylib_144x144.png +0 -0
- package/vendor/raylib/logo/raylib_16x16.png +0 -0
- package/vendor/raylib/logo/raylib_180x180.png +0 -0
- package/vendor/raylib/logo/raylib_24x24.png +0 -0
- package/vendor/raylib/logo/raylib_256x256.png +0 -0
- package/vendor/raylib/logo/raylib_32x32.png +0 -0
- package/vendor/raylib/logo/raylib_36x36.png +0 -0
- package/vendor/raylib/logo/raylib_48x48.png +0 -0
- package/vendor/raylib/logo/raylib_512x512.png +0 -0
- package/vendor/raylib/logo/raylib_64x64.png +0 -0
- package/vendor/raylib/logo/raylib_72x72.png +0 -0
- package/vendor/raylib/logo/raylib_96x96.png +0 -0
- package/vendor/raylib/logo/raylib_logo_animation.gif +0 -0
- package/vendor/raylib/parser/LICENSE +16 -0
- package/vendor/raylib/parser/README.md +63 -0
- package/vendor/raylib/parser/raylib_api.json +6668 -0
- package/vendor/raylib/parser/raylib_api.txt +3568 -0
- package/vendor/raylib/parser/raylib_api.xml +2509 -0
- package/vendor/raylib/parser/raylib_parser.c +1003 -0
- package/vendor/raylib/projects/4coder/Makefile +401 -0
- package/vendor/raylib/projects/4coder/Makefile.Android +300 -0
- package/vendor/raylib/projects/4coder/main.c +39 -0
- package/vendor/raylib/projects/4coder/project.4coder +54 -0
- package/vendor/raylib/projects/Builder/README.md +24 -0
- package/vendor/raylib/projects/Builder/examples/README.md +1 -0
- package/vendor/raylib/projects/Builder/examples/meson.build +25 -0
- package/vendor/raylib/projects/Builder/meson.build +25 -0
- package/vendor/raylib/projects/CMake/CMakeLists.txt +44 -0
- package/vendor/raylib/projects/CMake/core_basic_window.c +62 -0
- package/vendor/raylib/projects/CodeBlocks/README.md +22 -0
- package/vendor/raylib/projects/CodeBlocks/compiler_settings.png +0 -0
- package/vendor/raylib/projects/CodeBlocks/core_basic_window.c +58 -0
- package/vendor/raylib/projects/CodeBlocks/core_basic_window.cbp +137 -0
- package/vendor/raylib/projects/Geany/core_basic_window.c +52 -0
- package/vendor/raylib/projects/Geany/raylib.c.tags +452 -0
- package/vendor/raylib/projects/Geany/raylib_compile_execute.bat +21 -0
- package/vendor/raylib/projects/Geany/raylib_compile_sources.bat +42 -0
- package/vendor/raylib/projects/Geany/raylib_project.geany +41 -0
- package/vendor/raylib/projects/Notepad++/README.md +19 -0
- package/vendor/raylib/projects/Notepad++/c_raylib.xml +3104 -0
- package/vendor/raylib/projects/Notepad++/npes_saved_mingw.txt +0 -0
- package/vendor/raylib/projects/Notepad++/npes_saved_tcc.txt +0 -0
- package/vendor/raylib/projects/Notepad++/npes_saved_w64devkit.txt +0 -0
- package/vendor/raylib/projects/Notepad++/npes_saved_zig.txt +0 -0
- package/vendor/raylib/projects/Notepad++/raylib_npp_parser/raylib_npp.xml +3060 -0
- package/vendor/raylib/projects/Notepad++/raylib_npp_parser/raylib_npp_parser.c +150 -0
- package/vendor/raylib/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +631 -0
- package/vendor/raylib/projects/README.md +18 -0
- package/vendor/raylib/projects/SublimeText/README.md +13 -0
- package/vendor/raylib/projects/SublimeText/raylib.sublime-build +13 -0
- package/vendor/raylib/projects/SublimeText/raylib.sublime-project +8 -0
- package/vendor/raylib/projects/VS2019/raylib/raylib.rc +0 -0
- package/vendor/raylib/projects/VS2019/raylib/resource.h +14 -0
- package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/android_native_app_glue.c +437 -0
- package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/android_native_app_glue.h +344 -0
- package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/main.c +64 -0
- package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.Packaging/AndroidManifest.xml +22 -0
- package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.Packaging/build.xml +90 -0
- package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.Packaging/project.properties +3 -0
- package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.Packaging/raylib_android.Packaging.androidproj +134 -0
- package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.Packaging/res/values/strings.xml +4 -0
- package/vendor/raylib/projects/VSCode/.vscode/c_cpp_properties.json +63 -0
- package/vendor/raylib/projects/VSCode/.vscode/launch.json +60 -0
- package/vendor/raylib/projects/VSCode/.vscode/settings.json +11 -0
- package/vendor/raylib/projects/VSCode/.vscode/tasks.json +71 -0
- package/vendor/raylib/projects/VSCode/Makefile +408 -0
- package/vendor/raylib/projects/VSCode/Makefile.Android +300 -0
- package/vendor/raylib/projects/VSCode/main.c +83 -0
- package/vendor/raylib/projects/VSCode/main.code-workspace +16 -0
- package/vendor/raylib/projects/scripts/README.md +68 -0
- package/vendor/raylib/projects/scripts/build-linux.sh +169 -0
- package/vendor/raylib/projects/scripts/build-osx.sh +171 -0
- package/vendor/raylib/projects/scripts/build-rpi.sh +169 -0
- package/vendor/raylib/projects/scripts/build-windows.bat +219 -0
- package/vendor/raylib/projects/scripts/core_basic_window.c +61 -0
- package/vendor/raylib/raylib.pc.in +13 -0
- package/vendor/raylib/src/CMakeLists.txt +121 -0
- package/vendor/raylib/src/Makefile +696 -0
- package/vendor/raylib/src/build.zig +60 -0
- package/vendor/raylib/src/config.h +230 -0
- package/vendor/raylib/src/external/cgltf.h +6501 -0
- package/vendor/raylib/src/external/dirent.h +183 -0
- package/vendor/raylib/src/external/dr_flac.h +12269 -0
- package/vendor/raylib/src/external/dr_mp3.h +4787 -0
- package/vendor/raylib/src/external/dr_wav.h +8019 -0
- package/vendor/raylib/src/external/glad.h +8640 -0
- package/vendor/raylib/src/external/glfw/.mailmap +10 -0
- package/vendor/raylib/src/external/glfw/CMake/GenerateMappings.cmake +33 -0
- package/vendor/raylib/src/external/glfw/CMake/Info.plist.in +38 -0
- package/vendor/raylib/src/external/glfw/CMake/MacOSXBundleInfo.plist.in +38 -0
- package/vendor/raylib/src/external/glfw/CMake/cmake_uninstall.cmake.in +29 -0
- package/vendor/raylib/src/external/glfw/CMake/glfw3.pc.in +13 -0
- package/vendor/raylib/src/external/glfw/CMake/glfw3Config.cmake.in +3 -0
- package/vendor/raylib/src/external/glfw/CMake/i686-w64-mingw32-clang.cmake +13 -0
- package/vendor/raylib/src/external/glfw/CMake/i686-w64-mingw32.cmake +13 -0
- package/vendor/raylib/src/external/glfw/CMake/modules/FindEpollShim.cmake +17 -0
- package/vendor/raylib/src/external/glfw/CMake/modules/FindOSMesa.cmake +18 -0
- package/vendor/raylib/src/external/glfw/CMake/modules/FindWaylandProtocols.cmake +26 -0
- package/vendor/raylib/src/external/glfw/CMake/modules/FindXKBCommon.cmake +34 -0
- package/vendor/raylib/src/external/glfw/CMake/x86_64-w64-mingw32-clang.cmake +13 -0
- package/vendor/raylib/src/external/glfw/CMake/x86_64-w64-mingw32.cmake +13 -0
- package/vendor/raylib/src/external/glfw/CMakeLists.txt +323 -0
- package/vendor/raylib/src/external/glfw/LICENSE.md +23 -0
- package/vendor/raylib/src/external/glfw/README.md +477 -0
- package/vendor/raylib/src/external/glfw/deps/getopt.c +230 -0
- package/vendor/raylib/src/external/glfw/deps/getopt.h +57 -0
- package/vendor/raylib/src/external/glfw/deps/glad/gl.h +3840 -0
- package/vendor/raylib/src/external/glfw/deps/glad/khrplatform.h +282 -0
- package/vendor/raylib/src/external/glfw/deps/glad/vk_platform.h +92 -0
- package/vendor/raylib/src/external/glfw/deps/glad/vulkan.h +3480 -0
- package/vendor/raylib/src/external/glfw/deps/glad_gl.c +1791 -0
- package/vendor/raylib/src/external/glfw/deps/glad_vulkan.c +593 -0
- package/vendor/raylib/src/external/glfw/deps/mingw/_mingw_dxhelper.h +117 -0
- package/vendor/raylib/src/external/glfw/deps/mingw/dinput.h +2467 -0
- package/vendor/raylib/src/external/glfw/deps/mingw/xinput.h +239 -0
- package/vendor/raylib/src/external/glfw/deps/vs2008/stdint.h +247 -0
- package/vendor/raylib/src/external/glfw/include/GLFW/glfw3.h +6075 -0
- package/vendor/raylib/src/external/glfw/include/GLFW/glfw3native.h +530 -0
- package/vendor/raylib/src/external/glfw/src/CMakeLists.txt +246 -0
- package/vendor/raylib/src/external/glfw/src/cocoa_init.m +620 -0
- package/vendor/raylib/src/external/glfw/src/cocoa_joystick.h +46 -0
- package/vendor/raylib/src/external/glfw/src/cocoa_joystick.m +483 -0
- package/vendor/raylib/src/external/glfw/src/cocoa_monitor.m +631 -0
- package/vendor/raylib/src/external/glfw/src/cocoa_platform.h +206 -0
- package/vendor/raylib/src/external/glfw/src/cocoa_time.c +62 -0
- package/vendor/raylib/src/external/glfw/src/cocoa_window.m +1923 -0
- package/vendor/raylib/src/external/glfw/src/context.c +756 -0
- package/vendor/raylib/src/external/glfw/src/egl_context.c +846 -0
- package/vendor/raylib/src/external/glfw/src/egl_context.h +229 -0
- package/vendor/raylib/src/external/glfw/src/glfw.rc.in +30 -0
- package/vendor/raylib/src/external/glfw/src/glfw_config.h.in +58 -0
- package/vendor/raylib/src/external/glfw/src/glx_context.c +699 -0
- package/vendor/raylib/src/external/glfw/src/glx_context.h +181 -0
- package/vendor/raylib/src/external/glfw/src/init.c +357 -0
- package/vendor/raylib/src/external/glfw/src/input.c +1406 -0
- package/vendor/raylib/src/external/glfw/src/internal.h +799 -0
- package/vendor/raylib/src/external/glfw/src/linux_joystick.c +428 -0
- package/vendor/raylib/src/external/glfw/src/linux_joystick.h +59 -0
- package/vendor/raylib/src/external/glfw/src/mappings.h +1550 -0
- package/vendor/raylib/src/external/glfw/src/mappings.h.in +73 -0
- package/vendor/raylib/src/external/glfw/src/monitor.c +542 -0
- package/vendor/raylib/src/external/glfw/src/nsgl_context.h +66 -0
- package/vendor/raylib/src/external/glfw/src/nsgl_context.m +369 -0
- package/vendor/raylib/src/external/glfw/src/null_init.c +57 -0
- package/vendor/raylib/src/external/glfw/src/null_joystick.c +53 -0
- package/vendor/raylib/src/external/glfw/src/null_joystick.h +31 -0
- package/vendor/raylib/src/external/glfw/src/null_monitor.c +159 -0
- package/vendor/raylib/src/external/glfw/src/null_platform.h +89 -0
- package/vendor/raylib/src/external/glfw/src/null_window.c +670 -0
- package/vendor/raylib/src/external/glfw/src/osmesa_context.c +372 -0
- package/vendor/raylib/src/external/glfw/src/osmesa_context.h +90 -0
- package/vendor/raylib/src/external/glfw/src/posix_thread.c +105 -0
- package/vendor/raylib/src/external/glfw/src/posix_thread.h +51 -0
- package/vendor/raylib/src/external/glfw/src/posix_time.c +90 -0
- package/vendor/raylib/src/external/glfw/src/posix_time.h +44 -0
- package/vendor/raylib/src/external/glfw/src/vulkan.c +332 -0
- package/vendor/raylib/src/external/glfw/src/wgl_context.c +798 -0
- package/vendor/raylib/src/external/glfw/src/wgl_context.h +160 -0
- package/vendor/raylib/src/external/glfw/src/win32_init.c +636 -0
- package/vendor/raylib/src/external/glfw/src/win32_joystick.c +753 -0
- package/vendor/raylib/src/external/glfw/src/win32_joystick.h +53 -0
- package/vendor/raylib/src/external/glfw/src/win32_monitor.c +537 -0
- package/vendor/raylib/src/external/glfw/src/win32_platform.h +462 -0
- package/vendor/raylib/src/external/glfw/src/win32_thread.c +99 -0
- package/vendor/raylib/src/external/glfw/src/win32_time.c +76 -0
- package/vendor/raylib/src/external/glfw/src/win32_window.c +2405 -0
- package/vendor/raylib/src/external/glfw/src/window.c +1114 -0
- package/vendor/raylib/src/external/glfw/src/wl_init.c +1310 -0
- package/vendor/raylib/src/external/glfw/src/wl_monitor.c +231 -0
- package/vendor/raylib/src/external/glfw/src/wl_platform.h +352 -0
- package/vendor/raylib/src/external/glfw/src/wl_window.c +1814 -0
- package/vendor/raylib/src/external/glfw/src/x11_init.c +1500 -0
- package/vendor/raylib/src/external/glfw/src/x11_monitor.c +614 -0
- package/vendor/raylib/src/external/glfw/src/x11_platform.h +798 -0
- package/vendor/raylib/src/external/glfw/src/x11_window.c +3310 -0
- package/vendor/raylib/src/external/glfw/src/xkb_unicode.c +942 -0
- package/vendor/raylib/src/external/glfw/src/xkb_unicode.h +28 -0
- package/vendor/raylib/src/external/jar_mod.h +1596 -0
- package/vendor/raylib/src/external/jar_xm.h +2470 -0
- package/vendor/raylib/src/external/miniaudio.h +70273 -0
- package/vendor/raylib/src/external/msf_gif.h +717 -0
- package/vendor/raylib/src/external/par_shapes.h +2155 -0
- package/vendor/raylib/src/external/sdefl.h +696 -0
- package/vendor/raylib/src/external/sinfl.h +584 -0
- package/vendor/raylib/src/external/stb_image.h +7897 -0
- package/vendor/raylib/src/external/stb_image_resize.h +2634 -0
- package/vendor/raylib/src/external/stb_image_write.h +1724 -0
- package/vendor/raylib/src/external/stb_rect_pack.h +623 -0
- package/vendor/raylib/src/external/stb_truetype.h +5077 -0
- package/vendor/raylib/src/external/stb_vorbis.h +5475 -0
- package/vendor/raylib/src/external/tinyobj_loader_c.h +1589 -0
- package/vendor/raylib/src/external/vox_loader.h +710 -0
- package/vendor/raylib/src/extras/easings.h +263 -0
- package/vendor/raylib/src/extras/physac.h +1977 -0
- package/vendor/raylib/src/extras/raygui.h +4342 -0
- package/vendor/raylib/src/extras/rmem.h +751 -0
- package/vendor/raylib/src/raudio.c +2380 -0
- package/vendor/raylib/src/raudio.h +198 -0
- package/vendor/raylib/src/raylib.dll.rc +27 -0
- package/vendor/raylib/src/raylib.dll.rc.data +0 -0
- package/vendor/raylib/src/raylib.h +1536 -0
- package/vendor/raylib/src/raylib.ico +0 -0
- package/vendor/raylib/src/raylib.rc +27 -0
- package/vendor/raylib/src/raylib.rc.data +0 -0
- package/vendor/raylib/src/raymath.h +1853 -0
- package/vendor/raylib/src/rcamera.h +567 -0
- package/vendor/raylib/src/rcore.c +6772 -0
- package/vendor/raylib/src/rgestures.h +566 -0
- package/vendor/raylib/src/rglfw.c +126 -0
- package/vendor/raylib/src/rlgl.h +4677 -0
- package/vendor/raylib/src/rmodels.c +5041 -0
- package/vendor/raylib/src/rshapes.c +1759 -0
- package/vendor/raylib/src/rtext.c +1790 -0
- package/vendor/raylib/src/rtextures.c +4761 -0
- package/vendor/raylib/src/shell.html +328 -0
- package/vendor/raylib/src/utils.c +433 -0
- package/vendor/raylib/src/utils.h +81 -0
- package/vendor/sqlite3/shell.c +23487 -0
- package/vendor/sqlite3/sqlite3.c +239246 -0
- package/vendor/sqlite3/sqlite3.h +12802 -0
- package/vendor/sqlite3/sqlite3ext.h +689 -0
- package/CMakeLists.txt +0 -63
|
@@ -0,0 +1,1759 @@
|
|
|
1
|
+
/**********************************************************************************************
|
|
2
|
+
*
|
|
3
|
+
* rshapes - Basic functions to draw 2d shapes and check collisions
|
|
4
|
+
*
|
|
5
|
+
* CONFIGURATION:
|
|
6
|
+
*
|
|
7
|
+
* #define SUPPORT_QUADS_DRAW_MODE
|
|
8
|
+
* Use QUADS instead of TRIANGLES for drawing when possible.
|
|
9
|
+
* Some lines-based shapes could still use lines
|
|
10
|
+
*
|
|
11
|
+
* LICENSE: zlib/libpng
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) 2013-2021 Ramon Santamaria (@raysan5)
|
|
14
|
+
*
|
|
15
|
+
* This software is provided "as-is", without any express or implied warranty. In no event
|
|
16
|
+
* will the authors be held liable for any damages arising from the use of this software.
|
|
17
|
+
*
|
|
18
|
+
* Permission is granted to anyone to use this software for any purpose, including commercial
|
|
19
|
+
* applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
|
20
|
+
*
|
|
21
|
+
* 1. The origin of this software must not be misrepresented; you must not claim that you
|
|
22
|
+
* wrote the original software. If you use this software in a product, an acknowledgment
|
|
23
|
+
* in the product documentation would be appreciated but is not required.
|
|
24
|
+
*
|
|
25
|
+
* 2. Altered source versions must be plainly marked as such, and must not be misrepresented
|
|
26
|
+
* as being the original software.
|
|
27
|
+
*
|
|
28
|
+
* 3. This notice may not be removed or altered from any source distribution.
|
|
29
|
+
*
|
|
30
|
+
**********************************************************************************************/
|
|
31
|
+
|
|
32
|
+
#include "raylib.h" // Declares module functions
|
|
33
|
+
|
|
34
|
+
// Check if config flags have been externally provided on compilation line
|
|
35
|
+
#if !defined(EXTERNAL_CONFIG_FLAGS)
|
|
36
|
+
#include "config.h" // Defines module configuration flags
|
|
37
|
+
#endif
|
|
38
|
+
|
|
39
|
+
#include "rlgl.h" // OpenGL abstraction layer to OpenGL 1.1, 2.1, 3.3+ or ES2
|
|
40
|
+
|
|
41
|
+
#include <math.h> // Required for: sinf(), asinf(), cosf(), acosf(), sqrtf(), fabsf()
|
|
42
|
+
#include <float.h> // Required for: FLT_EPSILON
|
|
43
|
+
|
|
44
|
+
//----------------------------------------------------------------------------------
|
|
45
|
+
// Defines and Macros
|
|
46
|
+
//----------------------------------------------------------------------------------
|
|
47
|
+
|
|
48
|
+
// Error rate to calculate how many segments we need to draw a smooth circle,
|
|
49
|
+
// taken from https://stackoverflow.com/a/2244088
|
|
50
|
+
#ifndef SMOOTH_CIRCLE_ERROR_RATE
|
|
51
|
+
#define SMOOTH_CIRCLE_ERROR_RATE 0.5f
|
|
52
|
+
#endif
|
|
53
|
+
|
|
54
|
+
//----------------------------------------------------------------------------------
|
|
55
|
+
// Types and Structures Definition
|
|
56
|
+
//----------------------------------------------------------------------------------
|
|
57
|
+
// Not here...
|
|
58
|
+
|
|
59
|
+
//----------------------------------------------------------------------------------
|
|
60
|
+
// Global Variables Definition
|
|
61
|
+
//----------------------------------------------------------------------------------
|
|
62
|
+
Texture2D texShapes = { 1, 1, 1, 1, 7 }; // Texture used on shapes drawing (usually a white pixel)
|
|
63
|
+
Rectangle texShapesRec = { 0, 0, 1, 1 }; // Texture source rectangle used on shapes drawing
|
|
64
|
+
|
|
65
|
+
//----------------------------------------------------------------------------------
|
|
66
|
+
// Module specific Functions Declaration
|
|
67
|
+
//----------------------------------------------------------------------------------
|
|
68
|
+
static float EaseCubicInOut(float t, float b, float c, float d); // Cubic easing
|
|
69
|
+
|
|
70
|
+
//----------------------------------------------------------------------------------
|
|
71
|
+
// Module Functions Definition
|
|
72
|
+
//----------------------------------------------------------------------------------
|
|
73
|
+
|
|
74
|
+
// Set texture and rectangle to be used on shapes drawing
|
|
75
|
+
// NOTE: It can be useful when using basic shapes and one single font,
|
|
76
|
+
// defining a font char white rectangle would allow drawing everything in a single draw call
|
|
77
|
+
void SetShapesTexture(Texture2D texture, Rectangle source)
|
|
78
|
+
{
|
|
79
|
+
texShapes = texture;
|
|
80
|
+
texShapesRec = source;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Draw a pixel
|
|
84
|
+
void DrawPixel(int posX, int posY, Color color)
|
|
85
|
+
{
|
|
86
|
+
rlBegin(RL_LINES);
|
|
87
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
88
|
+
rlVertex2i(posX, posY);
|
|
89
|
+
rlVertex2i(posX + 1, posY + 1);
|
|
90
|
+
rlEnd();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Draw a pixel (Vector version)
|
|
94
|
+
void DrawPixelV(Vector2 position, Color color)
|
|
95
|
+
{
|
|
96
|
+
rlBegin(RL_LINES);
|
|
97
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
98
|
+
rlVertex2f(position.x, position.y);
|
|
99
|
+
rlVertex2f(position.x + 1.0f, position.y + 1.0f);
|
|
100
|
+
rlEnd();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Draw a line
|
|
104
|
+
void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color)
|
|
105
|
+
{
|
|
106
|
+
rlBegin(RL_LINES);
|
|
107
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
108
|
+
rlVertex2i(startPosX, startPosY);
|
|
109
|
+
rlVertex2i(endPosX, endPosY);
|
|
110
|
+
rlEnd();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Draw a line (Vector version)
|
|
114
|
+
void DrawLineV(Vector2 startPos, Vector2 endPos, Color color)
|
|
115
|
+
{
|
|
116
|
+
rlBegin(RL_LINES);
|
|
117
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
118
|
+
rlVertex2f(startPos.x, startPos.y);
|
|
119
|
+
rlVertex2f(endPos.x, endPos.y);
|
|
120
|
+
rlEnd();
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Draw a line defining thickness
|
|
124
|
+
void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color)
|
|
125
|
+
{
|
|
126
|
+
Vector2 delta = { endPos.x - startPos.x, endPos.y - startPos.y };
|
|
127
|
+
float length = sqrtf(delta.x*delta.x + delta.y*delta.y);
|
|
128
|
+
|
|
129
|
+
if ((length > 0) && (thick > 0))
|
|
130
|
+
{
|
|
131
|
+
float scale = thick/(2*length);
|
|
132
|
+
Vector2 radius = { -scale*delta.y, scale*delta.x };
|
|
133
|
+
Vector2 strip[4] = {
|
|
134
|
+
{ startPos.x - radius.x, startPos.y - radius.y },
|
|
135
|
+
{ startPos.x + radius.x, startPos.y + radius.y },
|
|
136
|
+
{ endPos.x - radius.x, endPos.y - radius.y },
|
|
137
|
+
{ endPos.x + radius.x, endPos.y + radius.y }
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
DrawTriangleStrip(strip, 4, color);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Draw line using cubic-bezier curves in-out
|
|
145
|
+
void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color)
|
|
146
|
+
{
|
|
147
|
+
#ifndef BEZIER_LINE_DIVISIONS
|
|
148
|
+
#define BEZIER_LINE_DIVISIONS 24 // Bezier line divisions
|
|
149
|
+
#endif
|
|
150
|
+
|
|
151
|
+
Vector2 previous = startPos;
|
|
152
|
+
Vector2 current = { 0 };
|
|
153
|
+
|
|
154
|
+
for (int i = 1; i <= BEZIER_LINE_DIVISIONS; i++)
|
|
155
|
+
{
|
|
156
|
+
// Cubic easing in-out
|
|
157
|
+
// NOTE: Easing is calculated only for y position value
|
|
158
|
+
current.y = EaseCubicInOut((float)i, startPos.y, endPos.y - startPos.y, (float)BEZIER_LINE_DIVISIONS);
|
|
159
|
+
current.x = previous.x + (endPos.x - startPos.x)/ (float)BEZIER_LINE_DIVISIONS;
|
|
160
|
+
|
|
161
|
+
DrawLineEx(previous, current, thick, color);
|
|
162
|
+
|
|
163
|
+
previous = current;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Draw line using quadratic bezier curves with a control point
|
|
168
|
+
void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color)
|
|
169
|
+
{
|
|
170
|
+
const float step = 1.0f/BEZIER_LINE_DIVISIONS;
|
|
171
|
+
|
|
172
|
+
Vector2 previous = startPos;
|
|
173
|
+
Vector2 current = { 0 };
|
|
174
|
+
float t = 0.0f;
|
|
175
|
+
|
|
176
|
+
for (int i = 0; i <= BEZIER_LINE_DIVISIONS; i++)
|
|
177
|
+
{
|
|
178
|
+
t = step*i;
|
|
179
|
+
float a = powf(1 - t, 2);
|
|
180
|
+
float b = 2*(1 - t)*t;
|
|
181
|
+
float c = powf(t, 2);
|
|
182
|
+
|
|
183
|
+
// NOTE: The easing functions aren't suitable here because they don't take a control point
|
|
184
|
+
current.y = a*startPos.y + b*controlPos.y + c*endPos.y;
|
|
185
|
+
current.x = a*startPos.x + b*controlPos.x + c*endPos.x;
|
|
186
|
+
|
|
187
|
+
DrawLineEx(previous, current, thick, color);
|
|
188
|
+
|
|
189
|
+
previous = current;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// Draw line using cubic bezier curves with 2 control points
|
|
194
|
+
void DrawLineBezierCubic(Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thick, Color color)
|
|
195
|
+
{
|
|
196
|
+
const float step = 1.0f/BEZIER_LINE_DIVISIONS;
|
|
197
|
+
|
|
198
|
+
Vector2 previous = startPos;
|
|
199
|
+
Vector2 current = { 0 };
|
|
200
|
+
float t = 0.0f;
|
|
201
|
+
|
|
202
|
+
for (int i = 0; i <= BEZIER_LINE_DIVISIONS; i++)
|
|
203
|
+
{
|
|
204
|
+
t = step*i;
|
|
205
|
+
float a = powf(1 - t, 3);
|
|
206
|
+
float b = 3*powf(1 - t, 2)*t;
|
|
207
|
+
float c = 3*(1-t)*powf(t, 2);
|
|
208
|
+
float d = powf(t, 3);
|
|
209
|
+
|
|
210
|
+
current.y = a*startPos.y + b*startControlPos.y + c*endControlPos.y + d*endPos.y;
|
|
211
|
+
current.x = a*startPos.x + b*startControlPos.x + c*endControlPos.x + d*endPos.x;
|
|
212
|
+
|
|
213
|
+
DrawLineEx(previous, current, thick, color);
|
|
214
|
+
|
|
215
|
+
previous = current;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Draw lines sequence
|
|
220
|
+
void DrawLineStrip(Vector2 *points, int pointCount, Color color)
|
|
221
|
+
{
|
|
222
|
+
if (pointCount >= 2)
|
|
223
|
+
{
|
|
224
|
+
rlCheckRenderBatchLimit(pointCount);
|
|
225
|
+
|
|
226
|
+
rlBegin(RL_LINES);
|
|
227
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
228
|
+
|
|
229
|
+
for (int i = 0; i < pointCount - 1; i++)
|
|
230
|
+
{
|
|
231
|
+
rlVertex2f(points[i].x, points[i].y);
|
|
232
|
+
rlVertex2f(points[i + 1].x, points[i + 1].y);
|
|
233
|
+
}
|
|
234
|
+
rlEnd();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Draw a color-filled circle
|
|
239
|
+
void DrawCircle(int centerX, int centerY, float radius, Color color)
|
|
240
|
+
{
|
|
241
|
+
DrawCircleV((Vector2){ (float)centerX, (float)centerY }, radius, color);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Draw a piece of a circle
|
|
245
|
+
void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color)
|
|
246
|
+
{
|
|
247
|
+
if (radius <= 0.0f) radius = 0.1f; // Avoid div by zero
|
|
248
|
+
|
|
249
|
+
// Function expects (endAngle > startAngle)
|
|
250
|
+
if (endAngle < startAngle)
|
|
251
|
+
{
|
|
252
|
+
// Swap values
|
|
253
|
+
float tmp = startAngle;
|
|
254
|
+
startAngle = endAngle;
|
|
255
|
+
endAngle = tmp;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
int minSegments = (int)ceilf((endAngle - startAngle)/90);
|
|
259
|
+
|
|
260
|
+
if (segments < minSegments)
|
|
261
|
+
{
|
|
262
|
+
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
|
263
|
+
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1);
|
|
264
|
+
segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360);
|
|
265
|
+
|
|
266
|
+
if (segments <= 0) segments = minSegments;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
float stepLength = (endAngle - startAngle)/(float)segments;
|
|
270
|
+
float angle = startAngle;
|
|
271
|
+
|
|
272
|
+
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
|
273
|
+
rlCheckRenderBatchLimit(4*segments/2);
|
|
274
|
+
|
|
275
|
+
rlSetTexture(texShapes.id);
|
|
276
|
+
|
|
277
|
+
rlBegin(RL_QUADS);
|
|
278
|
+
// NOTE: Every QUAD actually represents two segments
|
|
279
|
+
for (int i = 0; i < segments/2; i++)
|
|
280
|
+
{
|
|
281
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
282
|
+
|
|
283
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
284
|
+
rlVertex2f(center.x, center.y);
|
|
285
|
+
|
|
286
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
287
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
|
|
288
|
+
|
|
289
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
290
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius);
|
|
291
|
+
|
|
292
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
293
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength*2))*radius, center.y + cosf(DEG2RAD*(angle + stepLength*2))*radius);
|
|
294
|
+
|
|
295
|
+
angle += (stepLength*2);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// NOTE: In case number of segments is odd, we add one last piece to the cake
|
|
299
|
+
if (segments%2)
|
|
300
|
+
{
|
|
301
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
302
|
+
|
|
303
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
304
|
+
rlVertex2f(center.x, center.y);
|
|
305
|
+
|
|
306
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
307
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
|
|
308
|
+
|
|
309
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
310
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius);
|
|
311
|
+
|
|
312
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
313
|
+
rlVertex2f(center.x, center.y);
|
|
314
|
+
}
|
|
315
|
+
rlEnd();
|
|
316
|
+
|
|
317
|
+
rlSetTexture(0);
|
|
318
|
+
#else
|
|
319
|
+
rlCheckRenderBatchLimit(3*segments);
|
|
320
|
+
|
|
321
|
+
rlBegin(RL_TRIANGLES);
|
|
322
|
+
for (int i = 0; i < segments; i++)
|
|
323
|
+
{
|
|
324
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
325
|
+
|
|
326
|
+
rlVertex2f(center.x, center.y);
|
|
327
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
|
|
328
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius);
|
|
329
|
+
|
|
330
|
+
angle += stepLength;
|
|
331
|
+
}
|
|
332
|
+
rlEnd();
|
|
333
|
+
#endif
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color)
|
|
337
|
+
{
|
|
338
|
+
if (radius <= 0.0f) radius = 0.1f; // Avoid div by zero issue
|
|
339
|
+
|
|
340
|
+
// Function expects (endAngle > startAngle)
|
|
341
|
+
if (endAngle < startAngle)
|
|
342
|
+
{
|
|
343
|
+
// Swap values
|
|
344
|
+
float tmp = startAngle;
|
|
345
|
+
startAngle = endAngle;
|
|
346
|
+
endAngle = tmp;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
int minSegments = (int)ceilf((endAngle - startAngle)/90);
|
|
350
|
+
|
|
351
|
+
if (segments < minSegments)
|
|
352
|
+
{
|
|
353
|
+
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
|
354
|
+
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1);
|
|
355
|
+
segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360);
|
|
356
|
+
|
|
357
|
+
if (segments <= 0) segments = minSegments;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
float stepLength = (endAngle - startAngle)/(float)segments;
|
|
361
|
+
float angle = startAngle;
|
|
362
|
+
|
|
363
|
+
// Hide the cap lines when the circle is full
|
|
364
|
+
bool showCapLines = true;
|
|
365
|
+
int limit = 2*(segments + 2);
|
|
366
|
+
if ((int)(endAngle - startAngle)%360 == 0) { limit = 2*segments; showCapLines = false; }
|
|
367
|
+
|
|
368
|
+
rlCheckRenderBatchLimit(limit);
|
|
369
|
+
|
|
370
|
+
rlBegin(RL_LINES);
|
|
371
|
+
if (showCapLines)
|
|
372
|
+
{
|
|
373
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
374
|
+
rlVertex2f(center.x, center.y);
|
|
375
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
for (int i = 0; i < segments; i++)
|
|
379
|
+
{
|
|
380
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
381
|
+
|
|
382
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
|
|
383
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius);
|
|
384
|
+
|
|
385
|
+
angle += stepLength;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
if (showCapLines)
|
|
389
|
+
{
|
|
390
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
391
|
+
rlVertex2f(center.x, center.y);
|
|
392
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
|
|
393
|
+
}
|
|
394
|
+
rlEnd();
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// Draw a gradient-filled circle
|
|
398
|
+
// NOTE: Gradient goes from center (color1) to border (color2)
|
|
399
|
+
void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2)
|
|
400
|
+
{
|
|
401
|
+
rlCheckRenderBatchLimit(3*36);
|
|
402
|
+
|
|
403
|
+
rlBegin(RL_TRIANGLES);
|
|
404
|
+
for (int i = 0; i < 360; i += 10)
|
|
405
|
+
{
|
|
406
|
+
rlColor4ub(color1.r, color1.g, color1.b, color1.a);
|
|
407
|
+
rlVertex2f((float)centerX, (float)centerY);
|
|
408
|
+
rlColor4ub(color2.r, color2.g, color2.b, color2.a);
|
|
409
|
+
rlVertex2f((float)centerX + sinf(DEG2RAD*i)*radius, (float)centerY + cosf(DEG2RAD*i)*radius);
|
|
410
|
+
rlColor4ub(color2.r, color2.g, color2.b, color2.a);
|
|
411
|
+
rlVertex2f((float)centerX + sinf(DEG2RAD*(i + 10))*radius, (float)centerY + cosf(DEG2RAD*(i + 10))*radius);
|
|
412
|
+
}
|
|
413
|
+
rlEnd();
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// Draw a color-filled circle (Vector version)
|
|
417
|
+
// NOTE: On OpenGL 3.3 and ES2 we use QUADS to avoid drawing order issues
|
|
418
|
+
void DrawCircleV(Vector2 center, float radius, Color color)
|
|
419
|
+
{
|
|
420
|
+
DrawCircleSector(center, radius, 0, 360, 36, color);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// Draw circle outline
|
|
424
|
+
void DrawCircleLines(int centerX, int centerY, float radius, Color color)
|
|
425
|
+
{
|
|
426
|
+
rlCheckRenderBatchLimit(2*36);
|
|
427
|
+
|
|
428
|
+
rlBegin(RL_LINES);
|
|
429
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
430
|
+
|
|
431
|
+
// NOTE: Circle outline is drawn pixel by pixel every degree (0 to 360)
|
|
432
|
+
for (int i = 0; i < 360; i += 10)
|
|
433
|
+
{
|
|
434
|
+
rlVertex2f(centerX + sinf(DEG2RAD*i)*radius, centerY + cosf(DEG2RAD*i)*radius);
|
|
435
|
+
rlVertex2f(centerX + sinf(DEG2RAD*(i + 10))*radius, centerY + cosf(DEG2RAD*(i + 10))*radius);
|
|
436
|
+
}
|
|
437
|
+
rlEnd();
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// Draw ellipse
|
|
441
|
+
void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color)
|
|
442
|
+
{
|
|
443
|
+
rlCheckRenderBatchLimit(3*36);
|
|
444
|
+
|
|
445
|
+
rlBegin(RL_TRIANGLES);
|
|
446
|
+
for (int i = 0; i < 360; i += 10)
|
|
447
|
+
{
|
|
448
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
449
|
+
rlVertex2f((float)centerX, (float)centerY);
|
|
450
|
+
rlVertex2f((float)centerX + sinf(DEG2RAD*i)*radiusH, (float)centerY + cosf(DEG2RAD*i)*radiusV);
|
|
451
|
+
rlVertex2f((float)centerX + sinf(DEG2RAD*(i + 10))*radiusH, (float)centerY + cosf(DEG2RAD*(i + 10))*radiusV);
|
|
452
|
+
}
|
|
453
|
+
rlEnd();
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// Draw ellipse outline
|
|
457
|
+
void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color)
|
|
458
|
+
{
|
|
459
|
+
rlCheckRenderBatchLimit(2*36);
|
|
460
|
+
|
|
461
|
+
rlBegin(RL_LINES);
|
|
462
|
+
for (int i = 0; i < 360; i += 10)
|
|
463
|
+
{
|
|
464
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
465
|
+
rlVertex2f(centerX + sinf(DEG2RAD*i)*radiusH, centerY + cosf(DEG2RAD*i)*radiusV);
|
|
466
|
+
rlVertex2f(centerX + sinf(DEG2RAD*(i + 10))*radiusH, centerY + cosf(DEG2RAD*(i + 10))*radiusV);
|
|
467
|
+
}
|
|
468
|
+
rlEnd();
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color)
|
|
472
|
+
{
|
|
473
|
+
if (startAngle == endAngle) return;
|
|
474
|
+
|
|
475
|
+
// Function expects (outerRadius > innerRadius)
|
|
476
|
+
if (outerRadius < innerRadius)
|
|
477
|
+
{
|
|
478
|
+
float tmp = outerRadius;
|
|
479
|
+
outerRadius = innerRadius;
|
|
480
|
+
innerRadius = tmp;
|
|
481
|
+
|
|
482
|
+
if (outerRadius <= 0.0f) outerRadius = 0.1f;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// Function expects (endAngle > startAngle)
|
|
486
|
+
if (endAngle < startAngle)
|
|
487
|
+
{
|
|
488
|
+
// Swap values
|
|
489
|
+
float tmp = startAngle;
|
|
490
|
+
startAngle = endAngle;
|
|
491
|
+
endAngle = tmp;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
int minSegments = (int)ceilf((endAngle - startAngle)/90);
|
|
495
|
+
|
|
496
|
+
if (segments < minSegments)
|
|
497
|
+
{
|
|
498
|
+
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
|
499
|
+
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1);
|
|
500
|
+
segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360);
|
|
501
|
+
|
|
502
|
+
if (segments <= 0) segments = minSegments;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
// Not a ring
|
|
506
|
+
if (innerRadius <= 0.0f)
|
|
507
|
+
{
|
|
508
|
+
DrawCircleSector(center, outerRadius, startAngle, endAngle, segments, color);
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
float stepLength = (endAngle - startAngle)/(float)segments;
|
|
513
|
+
float angle = startAngle;
|
|
514
|
+
|
|
515
|
+
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
|
516
|
+
rlCheckRenderBatchLimit(4*segments);
|
|
517
|
+
|
|
518
|
+
rlSetTexture(texShapes.id);
|
|
519
|
+
|
|
520
|
+
rlBegin(RL_QUADS);
|
|
521
|
+
for (int i = 0; i < segments; i++)
|
|
522
|
+
{
|
|
523
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
524
|
+
|
|
525
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
526
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*innerRadius, center.y + cosf(DEG2RAD*angle)*innerRadius);
|
|
527
|
+
|
|
528
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
529
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
|
|
530
|
+
|
|
531
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
532
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*outerRadius);
|
|
533
|
+
|
|
534
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
535
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*innerRadius);
|
|
536
|
+
|
|
537
|
+
angle += stepLength;
|
|
538
|
+
}
|
|
539
|
+
rlEnd();
|
|
540
|
+
|
|
541
|
+
rlSetTexture(0);
|
|
542
|
+
#else
|
|
543
|
+
rlCheckRenderBatchLimit(6*segments);
|
|
544
|
+
|
|
545
|
+
rlBegin(RL_TRIANGLES);
|
|
546
|
+
for (int i = 0; i < segments; i++)
|
|
547
|
+
{
|
|
548
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
549
|
+
|
|
550
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*innerRadius, center.y + cosf(DEG2RAD*angle)*innerRadius);
|
|
551
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
|
|
552
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*innerRadius);
|
|
553
|
+
|
|
554
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*innerRadius);
|
|
555
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
|
|
556
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*outerRadius);
|
|
557
|
+
|
|
558
|
+
angle += stepLength;
|
|
559
|
+
}
|
|
560
|
+
rlEnd();
|
|
561
|
+
#endif
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color)
|
|
565
|
+
{
|
|
566
|
+
if (startAngle == endAngle) return;
|
|
567
|
+
|
|
568
|
+
// Function expects (outerRadius > innerRadius)
|
|
569
|
+
if (outerRadius < innerRadius)
|
|
570
|
+
{
|
|
571
|
+
float tmp = outerRadius;
|
|
572
|
+
outerRadius = innerRadius;
|
|
573
|
+
innerRadius = tmp;
|
|
574
|
+
|
|
575
|
+
if (outerRadius <= 0.0f) outerRadius = 0.1f;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
// Function expects (endAngle > startAngle)
|
|
579
|
+
if (endAngle < startAngle)
|
|
580
|
+
{
|
|
581
|
+
// Swap values
|
|
582
|
+
float tmp = startAngle;
|
|
583
|
+
startAngle = endAngle;
|
|
584
|
+
endAngle = tmp;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
int minSegments = (int)ceilf((endAngle - startAngle)/90);
|
|
588
|
+
|
|
589
|
+
if (segments < minSegments)
|
|
590
|
+
{
|
|
591
|
+
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
|
592
|
+
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1);
|
|
593
|
+
segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360);
|
|
594
|
+
|
|
595
|
+
if (segments <= 0) segments = minSegments;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
if (innerRadius <= 0.0f)
|
|
599
|
+
{
|
|
600
|
+
DrawCircleSectorLines(center, outerRadius, startAngle, endAngle, segments, color);
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
float stepLength = (endAngle - startAngle)/(float)segments;
|
|
605
|
+
float angle = startAngle;
|
|
606
|
+
|
|
607
|
+
bool showCapLines = true;
|
|
608
|
+
int limit = 4*(segments + 1);
|
|
609
|
+
if ((int)(endAngle - startAngle)%360 == 0) { limit = 4*segments; showCapLines = false; }
|
|
610
|
+
|
|
611
|
+
rlCheckRenderBatchLimit(limit);
|
|
612
|
+
|
|
613
|
+
rlBegin(RL_LINES);
|
|
614
|
+
if (showCapLines)
|
|
615
|
+
{
|
|
616
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
617
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
|
|
618
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*innerRadius, center.y + cosf(DEG2RAD*angle)*innerRadius);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
for (int i = 0; i < segments; i++)
|
|
622
|
+
{
|
|
623
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
624
|
+
|
|
625
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
|
|
626
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*outerRadius);
|
|
627
|
+
|
|
628
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*innerRadius, center.y + cosf(DEG2RAD*angle)*innerRadius);
|
|
629
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*innerRadius);
|
|
630
|
+
|
|
631
|
+
angle += stepLength;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
if (showCapLines)
|
|
635
|
+
{
|
|
636
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
637
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
|
|
638
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*innerRadius, center.y + cosf(DEG2RAD*angle)*innerRadius);
|
|
639
|
+
}
|
|
640
|
+
rlEnd();
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
// Draw a color-filled rectangle
|
|
644
|
+
void DrawRectangle(int posX, int posY, int width, int height, Color color)
|
|
645
|
+
{
|
|
646
|
+
DrawRectangleV((Vector2){ (float)posX, (float)posY }, (Vector2){ (float)width, (float)height }, color);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
// Draw a color-filled rectangle (Vector version)
|
|
650
|
+
// NOTE: On OpenGL 3.3 and ES2 we use QUADS to avoid drawing order issues
|
|
651
|
+
void DrawRectangleV(Vector2 position, Vector2 size, Color color)
|
|
652
|
+
{
|
|
653
|
+
DrawRectanglePro((Rectangle){ position.x, position.y, size.x, size.y }, (Vector2){ 0.0f, 0.0f }, 0.0f, color);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
// Draw a color-filled rectangle
|
|
657
|
+
void DrawRectangleRec(Rectangle rec, Color color)
|
|
658
|
+
{
|
|
659
|
+
DrawRectanglePro(rec, (Vector2){ 0.0f, 0.0f }, 0.0f, color);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
// Draw a color-filled rectangle with pro parameters
|
|
663
|
+
void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color)
|
|
664
|
+
{
|
|
665
|
+
rlCheckRenderBatchLimit(4);
|
|
666
|
+
|
|
667
|
+
Vector2 topLeft = { 0 };
|
|
668
|
+
Vector2 topRight = { 0 };
|
|
669
|
+
Vector2 bottomLeft = { 0 };
|
|
670
|
+
Vector2 bottomRight = { 0 };
|
|
671
|
+
|
|
672
|
+
// Only calculate rotation if needed
|
|
673
|
+
if (rotation == 0.0f)
|
|
674
|
+
{
|
|
675
|
+
float x = rec.x - origin.x;
|
|
676
|
+
float y = rec.y - origin.y;
|
|
677
|
+
topLeft = (Vector2){ x, y };
|
|
678
|
+
topRight = (Vector2){ x + rec.width, y };
|
|
679
|
+
bottomLeft = (Vector2){ x, y + rec.height };
|
|
680
|
+
bottomRight = (Vector2){ x + rec.width, y + rec.height };
|
|
681
|
+
}
|
|
682
|
+
else
|
|
683
|
+
{
|
|
684
|
+
float sinRotation = sinf(rotation*DEG2RAD);
|
|
685
|
+
float cosRotation = cosf(rotation*DEG2RAD);
|
|
686
|
+
float x = rec.x;
|
|
687
|
+
float y = rec.y;
|
|
688
|
+
float dx = -origin.x;
|
|
689
|
+
float dy = -origin.y;
|
|
690
|
+
|
|
691
|
+
topLeft.x = x + dx*cosRotation - dy*sinRotation;
|
|
692
|
+
topLeft.y = y + dx*sinRotation + dy*cosRotation;
|
|
693
|
+
|
|
694
|
+
topRight.x = x + (dx + rec.width)*cosRotation - dy*sinRotation;
|
|
695
|
+
topRight.y = y + (dx + rec.width)*sinRotation + dy*cosRotation;
|
|
696
|
+
|
|
697
|
+
bottomLeft.x = x + dx*cosRotation - (dy + rec.height)*sinRotation;
|
|
698
|
+
bottomLeft.y = y + dx*sinRotation + (dy + rec.height)*cosRotation;
|
|
699
|
+
|
|
700
|
+
bottomRight.x = x + (dx + rec.width)*cosRotation - (dy + rec.height)*sinRotation;
|
|
701
|
+
bottomRight.y = y + (dx + rec.width)*sinRotation + (dy + rec.height)*cosRotation;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
rlSetTexture(texShapes.id);
|
|
705
|
+
rlBegin(RL_QUADS);
|
|
706
|
+
|
|
707
|
+
rlNormal3f(0.0f, 0.0f, 1.0f);
|
|
708
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
709
|
+
|
|
710
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
711
|
+
rlVertex2f(topLeft.x, topLeft.y);
|
|
712
|
+
|
|
713
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
714
|
+
rlVertex2f(bottomLeft.x, bottomLeft.y);
|
|
715
|
+
|
|
716
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
717
|
+
rlVertex2f(bottomRight.x, bottomRight.y);
|
|
718
|
+
|
|
719
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
720
|
+
rlVertex2f(topRight.x, topRight.y);
|
|
721
|
+
|
|
722
|
+
rlEnd();
|
|
723
|
+
rlSetTexture(0);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
// Draw a vertical-gradient-filled rectangle
|
|
727
|
+
// NOTE: Gradient goes from bottom (color1) to top (color2)
|
|
728
|
+
void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2)
|
|
729
|
+
{
|
|
730
|
+
DrawRectangleGradientEx((Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, color1, color2, color2, color1);
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
// Draw a horizontal-gradient-filled rectangle
|
|
734
|
+
// NOTE: Gradient goes from bottom (color1) to top (color2)
|
|
735
|
+
void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2)
|
|
736
|
+
{
|
|
737
|
+
DrawRectangleGradientEx((Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, color1, color1, color2, color2);
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
// Draw a gradient-filled rectangle
|
|
741
|
+
// NOTE: Colors refer to corners, starting at top-lef corner and counter-clockwise
|
|
742
|
+
void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4)
|
|
743
|
+
{
|
|
744
|
+
rlSetTexture(texShapes.id);
|
|
745
|
+
|
|
746
|
+
rlPushMatrix();
|
|
747
|
+
rlBegin(RL_QUADS);
|
|
748
|
+
rlNormal3f(0.0f, 0.0f, 1.0f);
|
|
749
|
+
|
|
750
|
+
// NOTE: Default raylib font character 95 is a white square
|
|
751
|
+
rlColor4ub(col1.r, col1.g, col1.b, col1.a);
|
|
752
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
753
|
+
rlVertex2f(rec.x, rec.y);
|
|
754
|
+
|
|
755
|
+
rlColor4ub(col2.r, col2.g, col2.b, col2.a);
|
|
756
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
757
|
+
rlVertex2f(rec.x, rec.y + rec.height);
|
|
758
|
+
|
|
759
|
+
rlColor4ub(col3.r, col3.g, col3.b, col3.a);
|
|
760
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
761
|
+
rlVertex2f(rec.x + rec.width, rec.y + rec.height);
|
|
762
|
+
|
|
763
|
+
rlColor4ub(col4.r, col4.g, col4.b, col4.a);
|
|
764
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
765
|
+
rlVertex2f(rec.x + rec.width, rec.y);
|
|
766
|
+
rlEnd();
|
|
767
|
+
rlPopMatrix();
|
|
768
|
+
|
|
769
|
+
rlSetTexture(0);
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
// Draw rectangle outline
|
|
773
|
+
// NOTE: On OpenGL 3.3 and ES2 we use QUADS to avoid drawing order issues
|
|
774
|
+
void DrawRectangleLines(int posX, int posY, int width, int height, Color color)
|
|
775
|
+
{
|
|
776
|
+
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
|
777
|
+
DrawRectangle(posX, posY, width, 1, color);
|
|
778
|
+
DrawRectangle(posX + width - 1, posY + 1, 1, height - 2, color);
|
|
779
|
+
DrawRectangle(posX, posY + height - 1, width, 1, color);
|
|
780
|
+
DrawRectangle(posX, posY + 1, 1, height - 2, color);
|
|
781
|
+
#else
|
|
782
|
+
rlBegin(RL_LINES);
|
|
783
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
784
|
+
rlVertex2i(posX + 1, posY + 1);
|
|
785
|
+
rlVertex2i(posX + width, posY + 1);
|
|
786
|
+
|
|
787
|
+
rlVertex2i(posX + width, posY + 1);
|
|
788
|
+
rlVertex2i(posX + width, posY + height);
|
|
789
|
+
|
|
790
|
+
rlVertex2i(posX + width, posY + height);
|
|
791
|
+
rlVertex2i(posX + 1, posY + height);
|
|
792
|
+
|
|
793
|
+
rlVertex2i(posX + 1, posY + height);
|
|
794
|
+
rlVertex2i(posX + 1, posY + 1);
|
|
795
|
+
rlEnd();
|
|
796
|
+
#endif
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
// Draw rectangle outline with extended parameters
|
|
800
|
+
void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color)
|
|
801
|
+
{
|
|
802
|
+
if ((lineThick > rec.width) || (lineThick > rec.height))
|
|
803
|
+
{
|
|
804
|
+
if (rec.width > rec.height) lineThick = rec.height/2;
|
|
805
|
+
else if (rec.width < rec.height) lineThick = rec.width/2;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
// When rec = { x, y, 8.0f, 6.0f } and lineThick = 2, the following
|
|
809
|
+
// four rectangles are drawn ([T]op, [B]ottom, [L]eft, [R]ight):
|
|
810
|
+
//
|
|
811
|
+
// TTTTTTTT
|
|
812
|
+
// TTTTTTTT
|
|
813
|
+
// LL RR
|
|
814
|
+
// LL RR
|
|
815
|
+
// BBBBBBBB
|
|
816
|
+
// BBBBBBBB
|
|
817
|
+
//
|
|
818
|
+
|
|
819
|
+
Rectangle top = { rec.x, rec.y, rec.width, lineThick };
|
|
820
|
+
Rectangle bottom = { rec.x, rec.y - lineThick + rec.height, rec.width, lineThick };
|
|
821
|
+
Rectangle left = { rec.x, rec.y + lineThick, lineThick, rec.height - lineThick*2.0f };
|
|
822
|
+
Rectangle right = { rec.x - lineThick + rec.width, rec.y + lineThick, lineThick, rec.height - lineThick*2.0f };
|
|
823
|
+
|
|
824
|
+
DrawRectangleRec(top, color);
|
|
825
|
+
DrawRectangleRec(bottom, color);
|
|
826
|
+
DrawRectangleRec(left, color);
|
|
827
|
+
DrawRectangleRec(right, color);
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
// Draw rectangle with rounded edges
|
|
831
|
+
void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color)
|
|
832
|
+
{
|
|
833
|
+
// Not a rounded rectangle
|
|
834
|
+
if ((roundness <= 0.0f) || (rec.width < 1) || (rec.height < 1 ))
|
|
835
|
+
{
|
|
836
|
+
DrawRectangleRec(rec, color);
|
|
837
|
+
return;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
if (roundness >= 1.0f) roundness = 1.0f;
|
|
841
|
+
|
|
842
|
+
// Calculate corner radius
|
|
843
|
+
float radius = (rec.width > rec.height)? (rec.height*roundness)/2 : (rec.width*roundness)/2;
|
|
844
|
+
if (radius <= 0.0f) return;
|
|
845
|
+
|
|
846
|
+
// Calculate number of segments to use for the corners
|
|
847
|
+
if (segments < 4)
|
|
848
|
+
{
|
|
849
|
+
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
|
850
|
+
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1);
|
|
851
|
+
segments = (int)(ceilf(2*PI/th)/4.0f);
|
|
852
|
+
if (segments <= 0) segments = 4;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
float stepLength = 90.0f/(float)segments;
|
|
856
|
+
|
|
857
|
+
/*
|
|
858
|
+
Quick sketch to make sense of all of this,
|
|
859
|
+
there are 9 parts to draw, also mark the 12 points we'll use
|
|
860
|
+
|
|
861
|
+
P0____________________P1
|
|
862
|
+
/| |\
|
|
863
|
+
/1| 2 |3\
|
|
864
|
+
P7 /__|____________________|__\ P2
|
|
865
|
+
| |P8 P9| |
|
|
866
|
+
| 8 | 9 | 4 |
|
|
867
|
+
| __|____________________|__ |
|
|
868
|
+
P6 \ |P11 P10| / P3
|
|
869
|
+
\7| 6 |5/
|
|
870
|
+
\|____________________|/
|
|
871
|
+
P5 P4
|
|
872
|
+
*/
|
|
873
|
+
// Coordinates of the 12 points that define the rounded rect
|
|
874
|
+
const Vector2 point[12] = {
|
|
875
|
+
{(float)rec.x + radius, rec.y}, {(float)(rec.x + rec.width) - radius, rec.y}, { rec.x + rec.width, (float)rec.y + radius }, // PO, P1, P2
|
|
876
|
+
{rec.x + rec.width, (float)(rec.y + rec.height) - radius}, {(float)(rec.x + rec.width) - radius, rec.y + rec.height}, // P3, P4
|
|
877
|
+
{(float)rec.x + radius, rec.y + rec.height}, { rec.x, (float)(rec.y + rec.height) - radius}, {rec.x, (float)rec.y + radius}, // P5, P6, P7
|
|
878
|
+
{(float)rec.x + radius, (float)rec.y + radius}, {(float)(rec.x + rec.width) - radius, (float)rec.y + radius}, // P8, P9
|
|
879
|
+
{(float)(rec.x + rec.width) - radius, (float)(rec.y + rec.height) - radius}, {(float)rec.x + radius, (float)(rec.y + rec.height) - radius} // P10, P11
|
|
880
|
+
};
|
|
881
|
+
|
|
882
|
+
const Vector2 centers[4] = { point[8], point[9], point[10], point[11] };
|
|
883
|
+
const float angles[4] = { 180.0f, 90.0f, 0.0f, 270.0f };
|
|
884
|
+
|
|
885
|
+
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
|
886
|
+
rlCheckRenderBatchLimit(16*segments/2 + 5*4);
|
|
887
|
+
|
|
888
|
+
rlSetTexture(texShapes.id);
|
|
889
|
+
|
|
890
|
+
rlBegin(RL_QUADS);
|
|
891
|
+
// Draw all of the 4 corners: [1] Upper Left Corner, [3] Upper Right Corner, [5] Lower Right Corner, [7] Lower Left Corner
|
|
892
|
+
for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop
|
|
893
|
+
{
|
|
894
|
+
float angle = angles[k];
|
|
895
|
+
const Vector2 center = centers[k];
|
|
896
|
+
|
|
897
|
+
// NOTE: Every QUAD actually represents two segments
|
|
898
|
+
for (int i = 0; i < segments/2; i++)
|
|
899
|
+
{
|
|
900
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
901
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
902
|
+
rlVertex2f(center.x, center.y);
|
|
903
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
904
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
|
|
905
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
906
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius);
|
|
907
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
908
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength*2))*radius, center.y + cosf(DEG2RAD*(angle + stepLength*2))*radius);
|
|
909
|
+
angle += (stepLength*2);
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
// NOTE: In case number of segments is odd, we add one last piece to the cake
|
|
913
|
+
if (segments%2)
|
|
914
|
+
{
|
|
915
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
916
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
917
|
+
rlVertex2f(center.x, center.y);
|
|
918
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
919
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
|
|
920
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
921
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius);
|
|
922
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
923
|
+
rlVertex2f(center.x, center.y);
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
// [2] Upper Rectangle
|
|
928
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
929
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
930
|
+
rlVertex2f(point[0].x, point[0].y);
|
|
931
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
932
|
+
rlVertex2f(point[8].x, point[8].y);
|
|
933
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
934
|
+
rlVertex2f(point[9].x, point[9].y);
|
|
935
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
936
|
+
rlVertex2f(point[1].x, point[1].y);
|
|
937
|
+
|
|
938
|
+
// [4] Right Rectangle
|
|
939
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
940
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
941
|
+
rlVertex2f(point[2].x, point[2].y);
|
|
942
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
943
|
+
rlVertex2f(point[9].x, point[9].y);
|
|
944
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
945
|
+
rlVertex2f(point[10].x, point[10].y);
|
|
946
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
947
|
+
rlVertex2f(point[3].x, point[3].y);
|
|
948
|
+
|
|
949
|
+
// [6] Bottom Rectangle
|
|
950
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
951
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
952
|
+
rlVertex2f(point[11].x, point[11].y);
|
|
953
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
954
|
+
rlVertex2f(point[5].x, point[5].y);
|
|
955
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
956
|
+
rlVertex2f(point[4].x, point[4].y);
|
|
957
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
958
|
+
rlVertex2f(point[10].x, point[10].y);
|
|
959
|
+
|
|
960
|
+
// [8] Left Rectangle
|
|
961
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
962
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
963
|
+
rlVertex2f(point[7].x, point[7].y);
|
|
964
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
965
|
+
rlVertex2f(point[6].x, point[6].y);
|
|
966
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
967
|
+
rlVertex2f(point[11].x, point[11].y);
|
|
968
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
969
|
+
rlVertex2f(point[8].x, point[8].y);
|
|
970
|
+
|
|
971
|
+
// [9] Middle Rectangle
|
|
972
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
973
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
974
|
+
rlVertex2f(point[8].x, point[8].y);
|
|
975
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
976
|
+
rlVertex2f(point[11].x, point[11].y);
|
|
977
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
978
|
+
rlVertex2f(point[10].x, point[10].y);
|
|
979
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
980
|
+
rlVertex2f(point[9].x, point[9].y);
|
|
981
|
+
|
|
982
|
+
rlEnd();
|
|
983
|
+
rlSetTexture(0);
|
|
984
|
+
#else
|
|
985
|
+
rlCheckRenderBatchLimit(12*segments + 5*6); // 4 corners with 3 vertices per segment + 5 rectangles with 6 vertices each
|
|
986
|
+
|
|
987
|
+
rlBegin(RL_TRIANGLES);
|
|
988
|
+
|
|
989
|
+
// Draw all of the 4 corners: [1] Upper Left Corner, [3] Upper Right Corner, [5] Lower Right Corner, [7] Lower Left Corner
|
|
990
|
+
for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop
|
|
991
|
+
{
|
|
992
|
+
float angle = angles[k];
|
|
993
|
+
const Vector2 center = centers[k];
|
|
994
|
+
for (int i = 0; i < segments; i++)
|
|
995
|
+
{
|
|
996
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
997
|
+
rlVertex2f(center.x, center.y);
|
|
998
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
|
|
999
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius);
|
|
1000
|
+
angle += stepLength;
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
// [2] Upper Rectangle
|
|
1005
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1006
|
+
rlVertex2f(point[0].x, point[0].y);
|
|
1007
|
+
rlVertex2f(point[8].x, point[8].y);
|
|
1008
|
+
rlVertex2f(point[9].x, point[9].y);
|
|
1009
|
+
rlVertex2f(point[1].x, point[1].y);
|
|
1010
|
+
rlVertex2f(point[0].x, point[0].y);
|
|
1011
|
+
rlVertex2f(point[9].x, point[9].y);
|
|
1012
|
+
|
|
1013
|
+
// [4] Right Rectangle
|
|
1014
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1015
|
+
rlVertex2f(point[9].x, point[9].y);
|
|
1016
|
+
rlVertex2f(point[10].x, point[10].y);
|
|
1017
|
+
rlVertex2f(point[3].x, point[3].y);
|
|
1018
|
+
rlVertex2f(point[2].x, point[2].y);
|
|
1019
|
+
rlVertex2f(point[9].x, point[9].y);
|
|
1020
|
+
rlVertex2f(point[3].x, point[3].y);
|
|
1021
|
+
|
|
1022
|
+
// [6] Bottom Rectangle
|
|
1023
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1024
|
+
rlVertex2f(point[11].x, point[11].y);
|
|
1025
|
+
rlVertex2f(point[5].x, point[5].y);
|
|
1026
|
+
rlVertex2f(point[4].x, point[4].y);
|
|
1027
|
+
rlVertex2f(point[10].x, point[10].y);
|
|
1028
|
+
rlVertex2f(point[11].x, point[11].y);
|
|
1029
|
+
rlVertex2f(point[4].x, point[4].y);
|
|
1030
|
+
|
|
1031
|
+
// [8] Left Rectangle
|
|
1032
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1033
|
+
rlVertex2f(point[7].x, point[7].y);
|
|
1034
|
+
rlVertex2f(point[6].x, point[6].y);
|
|
1035
|
+
rlVertex2f(point[11].x, point[11].y);
|
|
1036
|
+
rlVertex2f(point[8].x, point[8].y);
|
|
1037
|
+
rlVertex2f(point[7].x, point[7].y);
|
|
1038
|
+
rlVertex2f(point[11].x, point[11].y);
|
|
1039
|
+
|
|
1040
|
+
// [9] Middle Rectangle
|
|
1041
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1042
|
+
rlVertex2f(point[8].x, point[8].y);
|
|
1043
|
+
rlVertex2f(point[11].x, point[11].y);
|
|
1044
|
+
rlVertex2f(point[10].x, point[10].y);
|
|
1045
|
+
rlVertex2f(point[9].x, point[9].y);
|
|
1046
|
+
rlVertex2f(point[8].x, point[8].y);
|
|
1047
|
+
rlVertex2f(point[10].x, point[10].y);
|
|
1048
|
+
rlEnd();
|
|
1049
|
+
#endif
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
// Draw rectangle with rounded edges outline
|
|
1053
|
+
void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color)
|
|
1054
|
+
{
|
|
1055
|
+
if (lineThick < 0) lineThick = 0;
|
|
1056
|
+
|
|
1057
|
+
// Not a rounded rectangle
|
|
1058
|
+
if (roundness <= 0.0f)
|
|
1059
|
+
{
|
|
1060
|
+
DrawRectangleLinesEx((Rectangle){rec.x-lineThick, rec.y-lineThick, rec.width+2*lineThick, rec.height+2*lineThick}, lineThick, color);
|
|
1061
|
+
return;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
if (roundness >= 1.0f) roundness = 1.0f;
|
|
1065
|
+
|
|
1066
|
+
// Calculate corner radius
|
|
1067
|
+
float radius = (rec.width > rec.height)? (rec.height*roundness)/2 : (rec.width*roundness)/2;
|
|
1068
|
+
if (radius <= 0.0f) return;
|
|
1069
|
+
|
|
1070
|
+
// Calculate number of segments to use for the corners
|
|
1071
|
+
if (segments < 4)
|
|
1072
|
+
{
|
|
1073
|
+
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
|
1074
|
+
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1);
|
|
1075
|
+
segments = (int)(ceilf(2*PI/th)/2.0f);
|
|
1076
|
+
if (segments <= 0) segments = 4;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
float stepLength = 90.0f/(float)segments;
|
|
1080
|
+
const float outerRadius = radius + lineThick, innerRadius = radius;
|
|
1081
|
+
|
|
1082
|
+
/*
|
|
1083
|
+
Quick sketch to make sense of all of this,
|
|
1084
|
+
marks the 16 + 4(corner centers P16-19) points we'll use
|
|
1085
|
+
|
|
1086
|
+
P0 ================== P1
|
|
1087
|
+
// P8 P9 \\
|
|
1088
|
+
// \\
|
|
1089
|
+
P7 // P15 P10 \\ P2
|
|
1090
|
+
|| *P16 P17* ||
|
|
1091
|
+
|| ||
|
|
1092
|
+
|| P14 P11 ||
|
|
1093
|
+
P6 \\ *P19 P18* // P3
|
|
1094
|
+
\\ //
|
|
1095
|
+
\\ P13 P12 //
|
|
1096
|
+
P5 ================== P4
|
|
1097
|
+
*/
|
|
1098
|
+
const Vector2 point[16] = {
|
|
1099
|
+
{(float)rec.x + innerRadius, rec.y - lineThick}, {(float)(rec.x + rec.width) - innerRadius, rec.y - lineThick}, { rec.x + rec.width + lineThick, (float)rec.y + innerRadius }, // PO, P1, P2
|
|
1100
|
+
{rec.x + rec.width + lineThick, (float)(rec.y + rec.height) - innerRadius}, {(float)(rec.x + rec.width) - innerRadius, rec.y + rec.height + lineThick}, // P3, P4
|
|
1101
|
+
{(float)rec.x + innerRadius, rec.y + rec.height + lineThick}, { rec.x - lineThick, (float)(rec.y + rec.height) - innerRadius}, {rec.x - lineThick, (float)rec.y + innerRadius}, // P5, P6, P7
|
|
1102
|
+
{(float)rec.x + innerRadius, rec.y}, {(float)(rec.x + rec.width) - innerRadius, rec.y}, // P8, P9
|
|
1103
|
+
{ rec.x + rec.width, (float)rec.y + innerRadius }, {rec.x + rec.width, (float)(rec.y + rec.height) - innerRadius}, // P10, P11
|
|
1104
|
+
{(float)(rec.x + rec.width) - innerRadius, rec.y + rec.height}, {(float)rec.x + innerRadius, rec.y + rec.height}, // P12, P13
|
|
1105
|
+
{ rec.x, (float)(rec.y + rec.height) - innerRadius}, {rec.x, (float)rec.y + innerRadius} // P14, P15
|
|
1106
|
+
};
|
|
1107
|
+
|
|
1108
|
+
const Vector2 centers[4] = {
|
|
1109
|
+
{(float)rec.x + innerRadius, (float)rec.y + innerRadius}, {(float)(rec.x + rec.width) - innerRadius, (float)rec.y + innerRadius}, // P16, P17
|
|
1110
|
+
{(float)(rec.x + rec.width) - innerRadius, (float)(rec.y + rec.height) - innerRadius}, {(float)rec.x + innerRadius, (float)(rec.y + rec.height) - innerRadius} // P18, P19
|
|
1111
|
+
};
|
|
1112
|
+
|
|
1113
|
+
const float angles[4] = { 180.0f, 90.0f, 0.0f, 270.0f };
|
|
1114
|
+
|
|
1115
|
+
if (lineThick > 1)
|
|
1116
|
+
{
|
|
1117
|
+
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
|
1118
|
+
rlCheckRenderBatchLimit(4*4*segments + 4*4); // 4 corners with 4 vertices for each segment + 4 rectangles with 4 vertices each
|
|
1119
|
+
|
|
1120
|
+
rlSetTexture(texShapes.id);
|
|
1121
|
+
|
|
1122
|
+
rlBegin(RL_QUADS);
|
|
1123
|
+
|
|
1124
|
+
// Draw all of the 4 corners first: Upper Left Corner, Upper Right Corner, Lower Right Corner, Lower Left Corner
|
|
1125
|
+
for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop
|
|
1126
|
+
{
|
|
1127
|
+
float angle = angles[k];
|
|
1128
|
+
const Vector2 center = centers[k];
|
|
1129
|
+
for (int i = 0; i < segments; i++)
|
|
1130
|
+
{
|
|
1131
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1132
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1133
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*innerRadius, center.y + cosf(DEG2RAD*angle)*innerRadius);
|
|
1134
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1135
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
|
|
1136
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1137
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*outerRadius);
|
|
1138
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1139
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*innerRadius);
|
|
1140
|
+
|
|
1141
|
+
angle += stepLength;
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
// Upper rectangle
|
|
1146
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1147
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1148
|
+
rlVertex2f(point[0].x, point[0].y);
|
|
1149
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1150
|
+
rlVertex2f(point[8].x, point[8].y);
|
|
1151
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1152
|
+
rlVertex2f(point[9].x, point[9].y);
|
|
1153
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1154
|
+
rlVertex2f(point[1].x, point[1].y);
|
|
1155
|
+
|
|
1156
|
+
// Right rectangle
|
|
1157
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1158
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1159
|
+
rlVertex2f(point[2].x, point[2].y);
|
|
1160
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1161
|
+
rlVertex2f(point[10].x, point[10].y);
|
|
1162
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1163
|
+
rlVertex2f(point[11].x, point[11].y);
|
|
1164
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1165
|
+
rlVertex2f(point[3].x, point[3].y);
|
|
1166
|
+
|
|
1167
|
+
// Lower rectangle
|
|
1168
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1169
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1170
|
+
rlVertex2f(point[13].x, point[13].y);
|
|
1171
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1172
|
+
rlVertex2f(point[5].x, point[5].y);
|
|
1173
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1174
|
+
rlVertex2f(point[4].x, point[4].y);
|
|
1175
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1176
|
+
rlVertex2f(point[12].x, point[12].y);
|
|
1177
|
+
|
|
1178
|
+
// Left rectangle
|
|
1179
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1180
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1181
|
+
rlVertex2f(point[15].x, point[15].y);
|
|
1182
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1183
|
+
rlVertex2f(point[7].x, point[7].y);
|
|
1184
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1185
|
+
rlVertex2f(point[6].x, point[6].y);
|
|
1186
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1187
|
+
rlVertex2f(point[14].x, point[14].y);
|
|
1188
|
+
|
|
1189
|
+
rlEnd();
|
|
1190
|
+
rlSetTexture(0);
|
|
1191
|
+
#else
|
|
1192
|
+
rlCheckRenderBatchLimit(4*6*segments + 4*6); // 4 corners with 6(2*3) vertices for each segment + 4 rectangles with 6 vertices each
|
|
1193
|
+
|
|
1194
|
+
rlBegin(RL_TRIANGLES);
|
|
1195
|
+
|
|
1196
|
+
// Draw all of the 4 corners first: Upper Left Corner, Upper Right Corner, Lower Right Corner, Lower Left Corner
|
|
1197
|
+
for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop
|
|
1198
|
+
{
|
|
1199
|
+
float angle = angles[k];
|
|
1200
|
+
const Vector2 center = centers[k];
|
|
1201
|
+
|
|
1202
|
+
for (int i = 0; i < segments; i++)
|
|
1203
|
+
{
|
|
1204
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1205
|
+
|
|
1206
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*innerRadius, center.y + cosf(DEG2RAD*angle)*innerRadius);
|
|
1207
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
|
|
1208
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*innerRadius);
|
|
1209
|
+
|
|
1210
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*innerRadius);
|
|
1211
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
|
|
1212
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*outerRadius);
|
|
1213
|
+
|
|
1214
|
+
angle += stepLength;
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
// Upper rectangle
|
|
1219
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1220
|
+
rlVertex2f(point[0].x, point[0].y);
|
|
1221
|
+
rlVertex2f(point[8].x, point[8].y);
|
|
1222
|
+
rlVertex2f(point[9].x, point[9].y);
|
|
1223
|
+
rlVertex2f(point[1].x, point[1].y);
|
|
1224
|
+
rlVertex2f(point[0].x, point[0].y);
|
|
1225
|
+
rlVertex2f(point[9].x, point[9].y);
|
|
1226
|
+
|
|
1227
|
+
// Right rectangle
|
|
1228
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1229
|
+
rlVertex2f(point[10].x, point[10].y);
|
|
1230
|
+
rlVertex2f(point[11].x, point[11].y);
|
|
1231
|
+
rlVertex2f(point[3].x, point[3].y);
|
|
1232
|
+
rlVertex2f(point[2].x, point[2].y);
|
|
1233
|
+
rlVertex2f(point[10].x, point[10].y);
|
|
1234
|
+
rlVertex2f(point[3].x, point[3].y);
|
|
1235
|
+
|
|
1236
|
+
// Lower rectangle
|
|
1237
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1238
|
+
rlVertex2f(point[13].x, point[13].y);
|
|
1239
|
+
rlVertex2f(point[5].x, point[5].y);
|
|
1240
|
+
rlVertex2f(point[4].x, point[4].y);
|
|
1241
|
+
rlVertex2f(point[12].x, point[12].y);
|
|
1242
|
+
rlVertex2f(point[13].x, point[13].y);
|
|
1243
|
+
rlVertex2f(point[4].x, point[4].y);
|
|
1244
|
+
|
|
1245
|
+
// Left rectangle
|
|
1246
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1247
|
+
rlVertex2f(point[7].x, point[7].y);
|
|
1248
|
+
rlVertex2f(point[6].x, point[6].y);
|
|
1249
|
+
rlVertex2f(point[14].x, point[14].y);
|
|
1250
|
+
rlVertex2f(point[15].x, point[15].y);
|
|
1251
|
+
rlVertex2f(point[7].x, point[7].y);
|
|
1252
|
+
rlVertex2f(point[14].x, point[14].y);
|
|
1253
|
+
rlEnd();
|
|
1254
|
+
#endif
|
|
1255
|
+
}
|
|
1256
|
+
else
|
|
1257
|
+
{
|
|
1258
|
+
// Use LINES to draw the outline
|
|
1259
|
+
rlCheckRenderBatchLimit(8*segments + 4*2); // 4 corners with 2 vertices for each segment + 4 rectangles with 2 vertices each
|
|
1260
|
+
|
|
1261
|
+
rlBegin(RL_LINES);
|
|
1262
|
+
|
|
1263
|
+
// Draw all of the 4 corners first: Upper Left Corner, Upper Right Corner, Lower Right Corner, Lower Left Corner
|
|
1264
|
+
for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop
|
|
1265
|
+
{
|
|
1266
|
+
float angle = angles[k];
|
|
1267
|
+
const Vector2 center = centers[k];
|
|
1268
|
+
|
|
1269
|
+
for (int i = 0; i < segments; i++)
|
|
1270
|
+
{
|
|
1271
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1272
|
+
rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
|
|
1273
|
+
rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*outerRadius);
|
|
1274
|
+
angle += stepLength;
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
// And now the remaining 4 lines
|
|
1279
|
+
for (int i = 0; i < 8; i += 2)
|
|
1280
|
+
{
|
|
1281
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1282
|
+
rlVertex2f(point[i].x, point[i].y);
|
|
1283
|
+
rlVertex2f(point[i + 1].x, point[i + 1].y);
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
rlEnd();
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
// Draw a triangle
|
|
1291
|
+
// NOTE: Vertex must be provided in counter-clockwise order
|
|
1292
|
+
void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color)
|
|
1293
|
+
{
|
|
1294
|
+
rlCheckRenderBatchLimit(4);
|
|
1295
|
+
|
|
1296
|
+
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
|
1297
|
+
rlSetTexture(texShapes.id);
|
|
1298
|
+
|
|
1299
|
+
rlBegin(RL_QUADS);
|
|
1300
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1301
|
+
|
|
1302
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1303
|
+
rlVertex2f(v1.x, v1.y);
|
|
1304
|
+
|
|
1305
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1306
|
+
rlVertex2f(v2.x, v2.y);
|
|
1307
|
+
|
|
1308
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1309
|
+
rlVertex2f(v2.x, v2.y);
|
|
1310
|
+
|
|
1311
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1312
|
+
rlVertex2f(v3.x, v3.y);
|
|
1313
|
+
rlEnd();
|
|
1314
|
+
|
|
1315
|
+
rlSetTexture(0);
|
|
1316
|
+
#else
|
|
1317
|
+
rlBegin(RL_TRIANGLES);
|
|
1318
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1319
|
+
rlVertex2f(v1.x, v1.y);
|
|
1320
|
+
rlVertex2f(v2.x, v2.y);
|
|
1321
|
+
rlVertex2f(v3.x, v3.y);
|
|
1322
|
+
rlEnd();
|
|
1323
|
+
#endif
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
// Draw a triangle using lines
|
|
1327
|
+
// NOTE: Vertex must be provided in counter-clockwise order
|
|
1328
|
+
void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color)
|
|
1329
|
+
{
|
|
1330
|
+
rlCheckRenderBatchLimit(6);
|
|
1331
|
+
|
|
1332
|
+
rlBegin(RL_LINES);
|
|
1333
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1334
|
+
rlVertex2f(v1.x, v1.y);
|
|
1335
|
+
rlVertex2f(v2.x, v2.y);
|
|
1336
|
+
|
|
1337
|
+
rlVertex2f(v2.x, v2.y);
|
|
1338
|
+
rlVertex2f(v3.x, v3.y);
|
|
1339
|
+
|
|
1340
|
+
rlVertex2f(v3.x, v3.y);
|
|
1341
|
+
rlVertex2f(v1.x, v1.y);
|
|
1342
|
+
rlEnd();
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
// Draw a triangle fan defined by points
|
|
1346
|
+
// NOTE: First vertex provided is the center, shared by all triangles
|
|
1347
|
+
// By default, following vertex should be provided in counter-clockwise order
|
|
1348
|
+
void DrawTriangleFan(Vector2 *points, int pointCount, Color color)
|
|
1349
|
+
{
|
|
1350
|
+
if (pointCount >= 3)
|
|
1351
|
+
{
|
|
1352
|
+
rlCheckRenderBatchLimit((pointCount - 2)*4);
|
|
1353
|
+
|
|
1354
|
+
rlSetTexture(texShapes.id);
|
|
1355
|
+
rlBegin(RL_QUADS);
|
|
1356
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1357
|
+
|
|
1358
|
+
for (int i = 1; i < pointCount - 1; i++)
|
|
1359
|
+
{
|
|
1360
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1361
|
+
rlVertex2f(points[0].x, points[0].y);
|
|
1362
|
+
|
|
1363
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1364
|
+
rlVertex2f(points[i].x, points[i].y);
|
|
1365
|
+
|
|
1366
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1367
|
+
rlVertex2f(points[i + 1].x, points[i + 1].y);
|
|
1368
|
+
|
|
1369
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1370
|
+
rlVertex2f(points[i + 1].x, points[i + 1].y);
|
|
1371
|
+
}
|
|
1372
|
+
rlEnd();
|
|
1373
|
+
rlSetTexture(0);
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
// Draw a triangle strip defined by points
|
|
1378
|
+
// NOTE: Every new vertex connects with previous two
|
|
1379
|
+
void DrawTriangleStrip(Vector2 *points, int pointCount, Color color)
|
|
1380
|
+
{
|
|
1381
|
+
if (pointCount >= 3)
|
|
1382
|
+
{
|
|
1383
|
+
rlCheckRenderBatchLimit(3*(pointCount - 2));
|
|
1384
|
+
|
|
1385
|
+
rlBegin(RL_TRIANGLES);
|
|
1386
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1387
|
+
|
|
1388
|
+
for (int i = 2; i < pointCount; i++)
|
|
1389
|
+
{
|
|
1390
|
+
if ((i%2) == 0)
|
|
1391
|
+
{
|
|
1392
|
+
rlVertex2f(points[i].x, points[i].y);
|
|
1393
|
+
rlVertex2f(points[i - 2].x, points[i - 2].y);
|
|
1394
|
+
rlVertex2f(points[i - 1].x, points[i - 1].y);
|
|
1395
|
+
}
|
|
1396
|
+
else
|
|
1397
|
+
{
|
|
1398
|
+
rlVertex2f(points[i].x, points[i].y);
|
|
1399
|
+
rlVertex2f(points[i - 1].x, points[i - 1].y);
|
|
1400
|
+
rlVertex2f(points[i - 2].x, points[i - 2].y);
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
rlEnd();
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
// Draw a regular polygon of n sides (Vector version)
|
|
1408
|
+
void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color)
|
|
1409
|
+
{
|
|
1410
|
+
if (sides < 3) sides = 3;
|
|
1411
|
+
float centralAngle = 0.0f;
|
|
1412
|
+
|
|
1413
|
+
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
|
1414
|
+
rlCheckRenderBatchLimit(4*sides); // Each side is a quad
|
|
1415
|
+
#else
|
|
1416
|
+
rlCheckRenderBatchLimit(3*sides);
|
|
1417
|
+
#endif
|
|
1418
|
+
|
|
1419
|
+
rlPushMatrix();
|
|
1420
|
+
rlTranslatef(center.x, center.y, 0.0f);
|
|
1421
|
+
rlRotatef(rotation, 0.0f, 0.0f, 1.0f);
|
|
1422
|
+
|
|
1423
|
+
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
|
1424
|
+
rlSetTexture(texShapes.id);
|
|
1425
|
+
|
|
1426
|
+
rlBegin(RL_QUADS);
|
|
1427
|
+
for (int i = 0; i < sides; i++)
|
|
1428
|
+
{
|
|
1429
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1430
|
+
|
|
1431
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1432
|
+
rlVertex2f(0, 0);
|
|
1433
|
+
|
|
1434
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1435
|
+
rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
|
|
1436
|
+
|
|
1437
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1438
|
+
rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
|
|
1439
|
+
|
|
1440
|
+
centralAngle += 360.0f/(float)sides;
|
|
1441
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1442
|
+
rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
|
|
1443
|
+
}
|
|
1444
|
+
rlEnd();
|
|
1445
|
+
rlSetTexture(0);
|
|
1446
|
+
#else
|
|
1447
|
+
rlBegin(RL_TRIANGLES);
|
|
1448
|
+
for (int i = 0; i < sides; i++)
|
|
1449
|
+
{
|
|
1450
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1451
|
+
|
|
1452
|
+
rlVertex2f(0, 0);
|
|
1453
|
+
rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
|
|
1454
|
+
|
|
1455
|
+
centralAngle += 360.0f/(float)sides;
|
|
1456
|
+
rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
|
|
1457
|
+
}
|
|
1458
|
+
rlEnd();
|
|
1459
|
+
#endif
|
|
1460
|
+
rlPopMatrix();
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
// Draw a polygon outline of n sides
|
|
1464
|
+
void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color)
|
|
1465
|
+
{
|
|
1466
|
+
if (sides < 3) sides = 3;
|
|
1467
|
+
float centralAngle = 0.0f;
|
|
1468
|
+
|
|
1469
|
+
rlCheckRenderBatchLimit(2*sides);
|
|
1470
|
+
|
|
1471
|
+
rlPushMatrix();
|
|
1472
|
+
rlTranslatef(center.x, center.y, 0.0f);
|
|
1473
|
+
rlRotatef(rotation, 0.0f, 0.0f, 1.0f);
|
|
1474
|
+
|
|
1475
|
+
rlBegin(RL_LINES);
|
|
1476
|
+
for (int i = 0; i < sides; i++)
|
|
1477
|
+
{
|
|
1478
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1479
|
+
|
|
1480
|
+
rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
|
|
1481
|
+
centralAngle += 360.0f/(float)sides;
|
|
1482
|
+
rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
|
|
1483
|
+
}
|
|
1484
|
+
rlEnd();
|
|
1485
|
+
rlPopMatrix();
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color)
|
|
1489
|
+
{
|
|
1490
|
+
if (sides < 3) sides = 3;
|
|
1491
|
+
float centralAngle = 0.0f;
|
|
1492
|
+
float exteriorAngle = 360.0f/(float)sides;
|
|
1493
|
+
float innerRadius = radius - (lineThick*cosf(DEG2RAD*exteriorAngle/2.0f));
|
|
1494
|
+
|
|
1495
|
+
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
|
1496
|
+
rlCheckRenderBatchLimit(4*sides);
|
|
1497
|
+
#else
|
|
1498
|
+
rlCheckRenderBatchLimit(6*sides);
|
|
1499
|
+
#endif
|
|
1500
|
+
|
|
1501
|
+
rlPushMatrix();
|
|
1502
|
+
rlTranslatef(center.x, center.y, 0.0f);
|
|
1503
|
+
rlRotatef(rotation, 0.0f, 0.0f, 1.0f);
|
|
1504
|
+
|
|
1505
|
+
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
|
1506
|
+
rlSetTexture(texShapes.id);
|
|
1507
|
+
|
|
1508
|
+
rlBegin(RL_QUADS);
|
|
1509
|
+
for (int i = 0; i < sides; i++)
|
|
1510
|
+
{
|
|
1511
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1512
|
+
|
|
1513
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1514
|
+
rlVertex2f(sinf(DEG2RAD*centralAngle)*innerRadius, cosf(DEG2RAD*centralAngle)*innerRadius);
|
|
1515
|
+
|
|
1516
|
+
rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1517
|
+
rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
|
|
1518
|
+
|
|
1519
|
+
centralAngle += exteriorAngle;
|
|
1520
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
|
|
1521
|
+
rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
|
|
1522
|
+
|
|
1523
|
+
rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
|
|
1524
|
+
rlVertex2f(sinf(DEG2RAD*centralAngle)*innerRadius, cosf(DEG2RAD*centralAngle)*innerRadius);
|
|
1525
|
+
}
|
|
1526
|
+
rlEnd();
|
|
1527
|
+
rlSetTexture(0);
|
|
1528
|
+
#else
|
|
1529
|
+
rlBegin(RL_TRIANGLES);
|
|
1530
|
+
for (int i = 0; i < sides; i++)
|
|
1531
|
+
{
|
|
1532
|
+
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
1533
|
+
float nextAngle = centralAngle + exteriorAngle;
|
|
1534
|
+
|
|
1535
|
+
rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
|
|
1536
|
+
rlVertex2f(sinf(DEG2RAD*centralAngle)*innerRadius, cosf(DEG2RAD*centralAngle)*innerRadius);
|
|
1537
|
+
rlVertex2f(sinf(DEG2RAD*nextAngle)*radius, cosf(DEG2RAD*nextAngle)*radius);
|
|
1538
|
+
|
|
1539
|
+
rlVertex2f(sinf(DEG2RAD*centralAngle)*innerRadius, cosf(DEG2RAD*centralAngle)*innerRadius);
|
|
1540
|
+
rlVertex2f(sinf(DEG2RAD*nextAngle)*radius, cosf(DEG2RAD*nextAngle)*radius);
|
|
1541
|
+
rlVertex2f(sinf(DEG2RAD*nextAngle)*innerRadius, cosf(DEG2RAD*nextAngle)*innerRadius);
|
|
1542
|
+
|
|
1543
|
+
centralAngle = nextAngle;
|
|
1544
|
+
}
|
|
1545
|
+
rlEnd();
|
|
1546
|
+
#endif
|
|
1547
|
+
rlPopMatrix();
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
//----------------------------------------------------------------------------------
|
|
1551
|
+
// Module Functions Definition - Collision Detection functions
|
|
1552
|
+
//----------------------------------------------------------------------------------
|
|
1553
|
+
|
|
1554
|
+
// Check if point is inside rectangle
|
|
1555
|
+
bool CheckCollisionPointRec(Vector2 point, Rectangle rec)
|
|
1556
|
+
{
|
|
1557
|
+
bool collision = false;
|
|
1558
|
+
|
|
1559
|
+
if ((point.x >= rec.x) && (point.x <= (rec.x + rec.width)) && (point.y >= rec.y) && (point.y <= (rec.y + rec.height))) collision = true;
|
|
1560
|
+
|
|
1561
|
+
return collision;
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
// Check if point is inside circle
|
|
1565
|
+
bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius)
|
|
1566
|
+
{
|
|
1567
|
+
return CheckCollisionCircles(point, 0, center, radius);
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
// Check if point is inside a triangle defined by three points (p1, p2, p3)
|
|
1571
|
+
bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3)
|
|
1572
|
+
{
|
|
1573
|
+
bool collision = false;
|
|
1574
|
+
|
|
1575
|
+
float alpha = ((p2.y - p3.y)*(point.x - p3.x) + (p3.x - p2.x)*(point.y - p3.y)) /
|
|
1576
|
+
((p2.y - p3.y)*(p1.x - p3.x) + (p3.x - p2.x)*(p1.y - p3.y));
|
|
1577
|
+
|
|
1578
|
+
float beta = ((p3.y - p1.y)*(point.x - p3.x) + (p1.x - p3.x)*(point.y - p3.y)) /
|
|
1579
|
+
((p2.y - p3.y)*(p1.x - p3.x) + (p3.x - p2.x)*(p1.y - p3.y));
|
|
1580
|
+
|
|
1581
|
+
float gamma = 1.0f - alpha - beta;
|
|
1582
|
+
|
|
1583
|
+
if ((alpha > 0) && (beta > 0) && (gamma > 0)) collision = true;
|
|
1584
|
+
|
|
1585
|
+
return collision;
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
// Check collision between two rectangles
|
|
1589
|
+
bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2)
|
|
1590
|
+
{
|
|
1591
|
+
bool collision = false;
|
|
1592
|
+
|
|
1593
|
+
if ((rec1.x < (rec2.x + rec2.width) && (rec1.x + rec1.width) > rec2.x) &&
|
|
1594
|
+
(rec1.y < (rec2.y + rec2.height) && (rec1.y + rec1.height) > rec2.y)) collision = true;
|
|
1595
|
+
|
|
1596
|
+
return collision;
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
// Check collision between two circles
|
|
1600
|
+
bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2)
|
|
1601
|
+
{
|
|
1602
|
+
bool collision = false;
|
|
1603
|
+
|
|
1604
|
+
float dx = center2.x - center1.x; // X distance between centers
|
|
1605
|
+
float dy = center2.y - center1.y; // Y distance between centers
|
|
1606
|
+
|
|
1607
|
+
float distance = sqrtf(dx*dx + dy*dy); // Distance between centers
|
|
1608
|
+
|
|
1609
|
+
if (distance <= (radius1 + radius2)) collision = true;
|
|
1610
|
+
|
|
1611
|
+
return collision;
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
// Check collision between circle and rectangle
|
|
1615
|
+
// NOTE: Reviewed version to take into account corner limit case
|
|
1616
|
+
bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec)
|
|
1617
|
+
{
|
|
1618
|
+
int recCenterX = (int)(rec.x + rec.width/2.0f);
|
|
1619
|
+
int recCenterY = (int)(rec.y + rec.height/2.0f);
|
|
1620
|
+
|
|
1621
|
+
float dx = fabsf(center.x - (float)recCenterX);
|
|
1622
|
+
float dy = fabsf(center.y - (float)recCenterY);
|
|
1623
|
+
|
|
1624
|
+
if (dx > (rec.width/2.0f + radius)) { return false; }
|
|
1625
|
+
if (dy > (rec.height/2.0f + radius)) { return false; }
|
|
1626
|
+
|
|
1627
|
+
if (dx <= (rec.width/2.0f)) { return true; }
|
|
1628
|
+
if (dy <= (rec.height/2.0f)) { return true; }
|
|
1629
|
+
|
|
1630
|
+
float cornerDistanceSq = (dx - rec.width/2.0f)*(dx - rec.width/2.0f) +
|
|
1631
|
+
(dy - rec.height/2.0f)*(dy - rec.height/2.0f);
|
|
1632
|
+
|
|
1633
|
+
return (cornerDistanceSq <= (radius*radius));
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
// Check the collision between two lines defined by two points each, returns collision point by reference
|
|
1637
|
+
bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint)
|
|
1638
|
+
{
|
|
1639
|
+
const float div = (endPos2.y - startPos2.y)*(endPos1.x - startPos1.x) - (endPos2.x - startPos2.x)*(endPos1.y - startPos1.y);
|
|
1640
|
+
|
|
1641
|
+
if (fabsf(div) < FLT_EPSILON) return false;
|
|
1642
|
+
|
|
1643
|
+
const float xi = ((startPos2.x - endPos2.x)*(startPos1.x*endPos1.y - startPos1.y*endPos1.x) - (startPos1.x - endPos1.x)*(startPos2.x*endPos2.y - startPos2.y*endPos2.x))/div;
|
|
1644
|
+
const float yi = ((startPos2.y - endPos2.y)*(startPos1.x*endPos1.y - startPos1.y*endPos1.x) - (startPos1.y - endPos1.y)*(startPos2.x*endPos2.y - startPos2.y*endPos2.x))/div;
|
|
1645
|
+
|
|
1646
|
+
if (fabsf(startPos1.x - endPos1.x) > FLT_EPSILON && (xi < fminf(startPos1.x, endPos1.x) || xi > fmaxf(startPos1.x, endPos1.x))) return false;
|
|
1647
|
+
if (fabsf(startPos2.x - endPos2.x) > FLT_EPSILON && (xi < fminf(startPos2.x, endPos2.x) || xi > fmaxf(startPos2.x, endPos2.x))) return false;
|
|
1648
|
+
if (fabsf(startPos1.y - endPos1.y) > FLT_EPSILON && (yi < fminf(startPos1.y, endPos1.y) || yi > fmaxf(startPos1.y, endPos1.y))) return false;
|
|
1649
|
+
if (fabsf(startPos2.y - endPos2.y) > FLT_EPSILON && (yi < fminf(startPos2.y, endPos2.y) || yi > fmaxf(startPos2.y, endPos2.y))) return false;
|
|
1650
|
+
|
|
1651
|
+
if (collisionPoint != 0)
|
|
1652
|
+
{
|
|
1653
|
+
collisionPoint->x = xi;
|
|
1654
|
+
collisionPoint->y = yi;
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
return true;
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
// Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]
|
|
1661
|
+
bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold)
|
|
1662
|
+
{
|
|
1663
|
+
bool collision = false;
|
|
1664
|
+
float dxc = point.x - p1.x;
|
|
1665
|
+
float dyc = point.y - p1.y;
|
|
1666
|
+
float dxl = p2.x - p1.x;
|
|
1667
|
+
float dyl = p2.y - p1.y;
|
|
1668
|
+
float cross = dxc*dyl - dyc*dxl;
|
|
1669
|
+
|
|
1670
|
+
if (fabsf(cross) < (threshold*fmaxf(fabsf(dxl), fabsf(dyl))))
|
|
1671
|
+
{
|
|
1672
|
+
if (fabsf(dxl) >= fabsf(dyl)) collision = (dxl > 0)? ((p1.x <= point.x) && (point.x <= p2.x)) : ((p2.x <= point.x) && (point.x <= p1.x));
|
|
1673
|
+
else collision = (dyl > 0)? ((p1.y <= point.y) && (point.y <= p2.y)) : ((p2.y <= point.y) && (point.y <= p1.y));
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
return collision;
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
// Get collision rectangle for two rectangles collision
|
|
1680
|
+
Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2)
|
|
1681
|
+
{
|
|
1682
|
+
Rectangle rec = { 0, 0, 0, 0 };
|
|
1683
|
+
|
|
1684
|
+
if (CheckCollisionRecs(rec1, rec2))
|
|
1685
|
+
{
|
|
1686
|
+
float dxx = fabsf(rec1.x - rec2.x);
|
|
1687
|
+
float dyy = fabsf(rec1.y - rec2.y);
|
|
1688
|
+
|
|
1689
|
+
if (rec1.x <= rec2.x)
|
|
1690
|
+
{
|
|
1691
|
+
if (rec1.y <= rec2.y)
|
|
1692
|
+
{
|
|
1693
|
+
rec.x = rec2.x;
|
|
1694
|
+
rec.y = rec2.y;
|
|
1695
|
+
rec.width = rec1.width - dxx;
|
|
1696
|
+
rec.height = rec1.height - dyy;
|
|
1697
|
+
}
|
|
1698
|
+
else
|
|
1699
|
+
{
|
|
1700
|
+
rec.x = rec2.x;
|
|
1701
|
+
rec.y = rec1.y;
|
|
1702
|
+
rec.width = rec1.width - dxx;
|
|
1703
|
+
rec.height = rec2.height - dyy;
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
else
|
|
1707
|
+
{
|
|
1708
|
+
if (rec1.y <= rec2.y)
|
|
1709
|
+
{
|
|
1710
|
+
rec.x = rec1.x;
|
|
1711
|
+
rec.y = rec2.y;
|
|
1712
|
+
rec.width = rec2.width - dxx;
|
|
1713
|
+
rec.height = rec1.height - dyy;
|
|
1714
|
+
}
|
|
1715
|
+
else
|
|
1716
|
+
{
|
|
1717
|
+
rec.x = rec1.x;
|
|
1718
|
+
rec.y = rec1.y;
|
|
1719
|
+
rec.width = rec2.width - dxx;
|
|
1720
|
+
rec.height = rec2.height - dyy;
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
if (rec1.width > rec2.width)
|
|
1725
|
+
{
|
|
1726
|
+
if (rec.width >= rec2.width) rec.width = rec2.width;
|
|
1727
|
+
}
|
|
1728
|
+
else
|
|
1729
|
+
{
|
|
1730
|
+
if (rec.width >= rec1.width) rec.width = rec1.width;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
if (rec1.height > rec2.height)
|
|
1734
|
+
{
|
|
1735
|
+
if (rec.height >= rec2.height) rec.height = rec2.height;
|
|
1736
|
+
}
|
|
1737
|
+
else
|
|
1738
|
+
{
|
|
1739
|
+
if (rec.height >= rec1.height) rec.height = rec1.height;
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
return rec;
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
//----------------------------------------------------------------------------------
|
|
1747
|
+
// Module specific Functions Definition
|
|
1748
|
+
//----------------------------------------------------------------------------------
|
|
1749
|
+
|
|
1750
|
+
// Cubic easing in-out
|
|
1751
|
+
// NOTE: Used by DrawLineBezier() only
|
|
1752
|
+
static float EaseCubicInOut(float t, float b, float c, float d)
|
|
1753
|
+
{
|
|
1754
|
+
if ((t /= 0.5f*d) < 1) return 0.5f*c*t*t*t + b;
|
|
1755
|
+
|
|
1756
|
+
t -= 2;
|
|
1757
|
+
|
|
1758
|
+
return 0.5f*c*(t*t*t + 2.0f) + b;
|
|
1759
|
+
}
|