koffi 2.1.1 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChangeLog.md +12 -0
- package/build/qemu/2.1.3/koffi_darwin_arm64.tar.gz +0 -0
- package/build/qemu/2.1.3/koffi_darwin_x64.tar.gz +0 -0
- package/build/qemu/2.1.3/koffi_freebsd_arm64.tar.gz +0 -0
- package/build/qemu/2.1.3/koffi_freebsd_ia32.tar.gz +0 -0
- package/build/qemu/2.1.3/koffi_freebsd_x64.tar.gz +0 -0
- package/build/qemu/2.1.3/koffi_linux_arm32hf.tar.gz +0 -0
- package/build/qemu/2.1.3/koffi_linux_arm64.tar.gz +0 -0
- package/build/qemu/2.1.3/koffi_linux_ia32.tar.gz +0 -0
- package/build/qemu/2.1.3/koffi_linux_riscv64hf64.tar.gz +0 -0
- package/build/qemu/2.1.3/koffi_linux_x64.tar.gz +0 -0
- package/build/qemu/2.1.3/koffi_openbsd_ia32.tar.gz +0 -0
- package/build/qemu/2.1.3/koffi_openbsd_x64.tar.gz +0 -0
- package/build/qemu/2.1.3/koffi_win32_arm64.tar.gz +0 -0
- package/build/qemu/2.1.3/koffi_win32_ia32.tar.gz +0 -0
- package/build/qemu/2.1.3/koffi_win32_x64.tar.gz +0 -0
- package/doc/templates/badges.html +3 -0
- package/package.json +2 -2
- package/src/abi_arm64.cc +35 -1
- package/src/abi_x64_win.cc +2 -8
- package/src/abi_x86.cc +1 -7
- package/src/ffi.cc +2 -2
- package/src/ffi.hh +1 -1
- package/src/util.hh +6 -0
- package/test/raylib.js +37 -5
- package/vendor/libcc/libcc.cc +430 -196
- package/vendor/libcc/libcc.hh +1417 -1283
- package/vendor/raylib/BINDINGS.md +87 -70
- package/vendor/raylib/CHANGELOG +263 -50
- package/vendor/raylib/CMakeLists.txt +12 -0
- package/vendor/raylib/CMakeOptions.txt +8 -1
- package/vendor/raylib/CONVENTIONS.md +2 -3
- package/vendor/raylib/FAQ.md +137 -0
- package/vendor/raylib/HISTORY.md +62 -29
- package/vendor/raylib/LICENSE +1 -1
- package/vendor/raylib/README.md +22 -17
- package/vendor/raylib/ROADMAP.md +8 -7
- package/vendor/raylib/cmake/CompileDefinitions.cmake +19 -15
- package/vendor/raylib/cmake/GlfwImport.cmake +2 -0
- package/vendor/raylib/cmake/LibraryConfigurations.cmake +22 -16
- package/vendor/raylib/cmake/raylib-config.cmake +52 -49
- package/vendor/raylib/examples/CMakeLists.txt +14 -9
- package/vendor/raylib/examples/Makefile +112 -125
- package/vendor/raylib/examples/Makefile.Android +1 -1
- package/vendor/raylib/examples/Makefile.Web +145 -158
- package/vendor/raylib/examples/README.md +141 -141
- package/vendor/raylib/examples/audio/audio_module_playing.c +9 -4
- package/vendor/raylib/examples/audio/audio_multichannel_sound.c +8 -3
- package/vendor/raylib/examples/audio/audio_music_stream.c +16 -11
- package/vendor/raylib/examples/audio/audio_raw_stream.c +57 -9
- package/vendor/raylib/examples/audio/audio_sound_loading.c +8 -3
- package/vendor/raylib/examples/audio/audio_stream_effects.c +179 -0
- package/vendor/raylib/examples/audio/audio_stream_effects.png +0 -0
- package/vendor/raylib/examples/build.zig +17 -6
- package/vendor/raylib/examples/core/core_2d_camera.c +8 -4
- package/vendor/raylib/examples/core/core_2d_camera_mouse_zoom.c +105 -0
- package/vendor/raylib/examples/core/core_2d_camera_mouse_zoom.png +0 -0
- package/vendor/raylib/examples/core/core_2d_camera_platformer.c +11 -6
- package/vendor/raylib/examples/core/core_3d_camera_first_person.c +9 -4
- package/vendor/raylib/examples/core/core_3d_camera_free.c +9 -4
- package/vendor/raylib/examples/core/core_3d_camera_mode.c +8 -3
- package/vendor/raylib/examples/core/core_3d_picking.c +9 -4
- package/vendor/raylib/examples/core/core_basic_screen_manager.c +9 -7
- package/vendor/raylib/examples/core/core_basic_window.c +8 -3
- package/vendor/raylib/examples/core/core_basic_window_web.c +13 -11
- package/vendor/raylib/examples/core/core_custom_frame_control.c +9 -4
- package/vendor/raylib/examples/core/core_custom_logging.c +12 -8
- package/vendor/raylib/examples/core/core_drop_files.c +20 -12
- package/vendor/raylib/examples/core/core_input_gamepad.c +20 -15
- package/vendor/raylib/examples/core/core_input_gestures.c +19 -15
- package/vendor/raylib/examples/core/core_input_keys.c +8 -3
- package/vendor/raylib/examples/core/core_input_mouse.c +8 -3
- package/vendor/raylib/examples/core/core_input_mouse_wheel.c +8 -3
- package/vendor/raylib/examples/core/core_input_multitouch.c +8 -3
- package/vendor/raylib/examples/core/core_loading_thread.c +10 -6
- package/vendor/raylib/examples/core/core_random_values.c +8 -3
- package/vendor/raylib/examples/core/core_scissor_test.c +8 -3
- package/vendor/raylib/examples/core/core_smooth_pixelperfect.c +9 -4
- package/vendor/raylib/examples/core/core_split_screen.c +8 -3
- package/vendor/raylib/examples/core/core_storage_values.c +109 -3
- package/vendor/raylib/examples/core/core_vr_simulator.c +15 -7
- package/vendor/raylib/examples/core/core_window_flags.c +8 -3
- package/vendor/raylib/examples/core/core_window_letterbox.c +13 -18
- package/vendor/raylib/examples/core/core_window_should_close.c +77 -0
- package/vendor/raylib/examples/core/core_window_should_close.png +0 -0
- package/vendor/raylib/examples/core/core_world_screen.c +9 -4
- package/vendor/raylib/examples/examples_template.c +8 -3
- package/vendor/raylib/examples/models/models_animation.c +11 -7
- package/vendor/raylib/examples/models/models_billboard.c +9 -4
- package/vendor/raylib/examples/models/models_box_collisions.c +8 -3
- package/vendor/raylib/examples/models/models_cubicmap.c +9 -4
- package/vendor/raylib/examples/models/models_first_person_maze.c +9 -4
- package/vendor/raylib/examples/models/models_geometric_shapes.c +8 -3
- package/vendor/raylib/examples/models/models_heightmap.c +9 -4
- package/vendor/raylib/examples/models/models_loading.c +21 -17
- package/vendor/raylib/examples/models/models_loading_gltf.c +15 -41
- package/vendor/raylib/examples/models/models_loading_vox.c +9 -4
- package/vendor/raylib/examples/models/models_mesh_generation.c +71 -58
- package/vendor/raylib/examples/models/models_mesh_picking.c +25 -7
- package/vendor/raylib/examples/models/models_orthographic_projection.c +8 -5
- package/vendor/raylib/examples/models/models_rlgl_solar_system.c +6 -4
- package/vendor/raylib/examples/models/models_skybox.c +16 -12
- package/vendor/raylib/examples/models/models_waving_cubes.c +9 -4
- package/vendor/raylib/examples/models/models_yaw_pitch_roll.c +12 -7
- package/vendor/raylib/examples/models/resources/LICENSE.md +9 -10
- package/vendor/raylib/examples/models/resources/models/gltf/LICENSE +2 -23
- package/vendor/raylib/examples/models/resources/models/gltf/{raylib_32x32.glb → raylib_logo_3d.glb} +0 -0
- package/vendor/raylib/examples/models/resources/models/gltf/robot.blend +0 -0
- package/vendor/raylib/examples/models/resources/models/gltf/robot.glb +0 -0
- package/vendor/raylib/examples/others/easings_testbed.c +10 -8
- package/vendor/raylib/examples/others/easings_testbed.png +0 -0
- package/vendor/raylib/examples/others/embedded_files_loading.c +10 -5
- package/vendor/raylib/examples/others/embedded_files_loading.png +0 -0
- package/vendor/raylib/examples/others/raylib_opengl_interop.c +10 -6
- package/vendor/raylib/{src/extras/easings.h → examples/others/reasings.h} +38 -38
- package/vendor/raylib/examples/others/rlgl_compute_shader.c +21 -20
- package/vendor/raylib/examples/others/rlgl_compute_shader.png +0 -0
- package/vendor/raylib/examples/others/rlgl_standalone.c +4 -4
- package/vendor/raylib/examples/others/rlgl_standalone.png +0 -0
- package/vendor/raylib/examples/raylib_compile_execute.bat +2 -2
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/lighting.fs +1 -1
- package/vendor/raylib/examples/shaders/resources/shaders/glsl330/{base_lighting_instanced.vs → lighting_instancing.vs} +2 -2
- package/vendor/raylib/examples/shaders/rlights.h +14 -27
- package/vendor/raylib/examples/shaders/shaders_basic_lighting.c +24 -26
- package/vendor/raylib/examples/shaders/shaders_custom_uniform.c +10 -5
- package/vendor/raylib/examples/shaders/shaders_eratosthenes.c +13 -8
- package/vendor/raylib/examples/shaders/shaders_fog.c +8 -12
- package/vendor/raylib/examples/shaders/shaders_hot_reloading.c +10 -5
- package/vendor/raylib/examples/shaders/shaders_julia_set.c +9 -4
- package/vendor/raylib/examples/shaders/shaders_mesh_instancing.c +45 -119
- package/vendor/raylib/examples/shaders/shaders_model_shader.c +10 -5
- package/vendor/raylib/examples/shaders/shaders_multi_sample2d.c +8 -3
- package/vendor/raylib/examples/shaders/shaders_palette_switch.c +8 -3
- package/vendor/raylib/examples/shaders/shaders_postprocessing.c +9 -4
- package/vendor/raylib/examples/shaders/shaders_raymarching.c +14 -11
- package/vendor/raylib/examples/shaders/shaders_shapes_textures.c +8 -3
- package/vendor/raylib/examples/shaders/shaders_simple_mask.c +10 -5
- package/vendor/raylib/examples/shaders/shaders_spotlight.c +10 -6
- package/vendor/raylib/examples/shaders/shaders_texture_drawing.c +9 -4
- package/vendor/raylib/examples/shaders/shaders_texture_outline.c +8 -3
- package/vendor/raylib/examples/shaders/shaders_texture_waves.c +8 -3
- package/vendor/raylib/{src/extras → examples/shapes}/raygui.h +1290 -1141
- package/vendor/raylib/examples/{others/easings.h → shapes/reasings.h} +40 -40
- package/vendor/raylib/examples/shapes/shapes_basic_shapes.c +8 -3
- package/vendor/raylib/examples/shapes/shapes_bouncing_ball.c +8 -3
- package/vendor/raylib/examples/shapes/shapes_collision_area.c +10 -4
- package/vendor/raylib/examples/shapes/shapes_colors_palette.c +8 -3
- package/vendor/raylib/examples/shapes/shapes_draw_circle_sector.c +9 -4
- package/vendor/raylib/examples/shapes/shapes_draw_rectangle_rounded.c +9 -4
- package/vendor/raylib/examples/shapes/shapes_draw_ring.c +10 -6
- package/vendor/raylib/examples/shapes/shapes_easings_ball_anim.c +9 -4
- package/vendor/raylib/examples/shapes/shapes_easings_box_anim.c +9 -4
- package/vendor/raylib/examples/shapes/shapes_easings_rectangle_array.c +9 -4
- package/vendor/raylib/examples/shapes/shapes_following_eyes.c +8 -3
- package/vendor/raylib/examples/shapes/shapes_lines_bezier.c +8 -3
- package/vendor/raylib/examples/shapes/shapes_logo_raylib.c +8 -3
- package/vendor/raylib/examples/shapes/shapes_logo_raylib_anim.c +8 -3
- package/vendor/raylib/examples/shapes/shapes_rectangle_scaling.c +14 -5
- package/vendor/raylib/examples/shapes/shapes_top_down_lights.c +355 -0
- package/vendor/raylib/examples/shapes/shapes_top_down_lights.png +0 -0
- package/vendor/raylib/examples/text/resources/DotGothic16-Regular.ttf +0 -0
- package/vendor/raylib/examples/text/resources/DotGothic16-Regular_OFL.txt +93 -0
- package/vendor/raylib/examples/text/resources/LICENSE.md +1 -1
- package/vendor/raylib/examples/text/text_codepoints_loading.c +138 -0
- package/vendor/raylib/examples/text/text_codepoints_loading.png +0 -0
- package/vendor/raylib/examples/text/text_draw_3d.c +42 -33
- package/vendor/raylib/examples/text/text_font_filters.c +14 -11
- package/vendor/raylib/examples/text/text_font_loading.c +9 -4
- package/vendor/raylib/examples/text/text_font_sdf.c +9 -4
- package/vendor/raylib/examples/text/text_font_spritefont.c +12 -6
- package/vendor/raylib/examples/text/text_format_text.c +8 -3
- package/vendor/raylib/examples/text/text_input_box.c +8 -3
- package/vendor/raylib/examples/text/text_raylib_fonts.c +9 -4
- package/vendor/raylib/examples/text/text_rectangle_bounds.c +9 -5
- package/vendor/raylib/examples/text/text_unicode.c +9 -7
- package/vendor/raylib/examples/text/text_writing_anim.c +8 -3
- package/vendor/raylib/examples/textures/resources/scarfy_run.gif +0 -0
- package/vendor/raylib/examples/textures/textures_background_scrolling.c +8 -3
- package/vendor/raylib/examples/textures/textures_blend_modes.c +8 -3
- package/vendor/raylib/examples/textures/textures_bunnymark.c +8 -3
- package/vendor/raylib/examples/textures/textures_draw_tiled.c +14 -10
- package/vendor/raylib/examples/textures/textures_fog_of_war.c +154 -0
- package/vendor/raylib/examples/textures/textures_fog_of_war.png +0 -0
- package/vendor/raylib/examples/textures/textures_gif_player.c +121 -0
- package/vendor/raylib/examples/textures/textures_gif_player.png +0 -0
- package/vendor/raylib/examples/textures/textures_image_drawing.c +8 -3
- package/vendor/raylib/examples/textures/textures_image_generation.c +8 -3
- package/vendor/raylib/examples/textures/textures_image_loading.c +8 -3
- package/vendor/raylib/examples/textures/textures_image_processing.c +8 -3
- package/vendor/raylib/examples/textures/textures_image_text.c +8 -3
- package/vendor/raylib/examples/textures/textures_logo_raylib.c +8 -3
- package/vendor/raylib/examples/textures/textures_mouse_painting.c +9 -4
- package/vendor/raylib/examples/textures/textures_npatch_drawing.c +8 -3
- package/vendor/raylib/examples/textures/textures_particles_blending.c +8 -3
- package/vendor/raylib/examples/textures/textures_polygon.c +9 -5
- package/vendor/raylib/examples/textures/textures_raw_data.c +8 -3
- package/vendor/raylib/examples/textures/{textures_rectangle.c → textures_sprite_anim.c} +11 -5
- package/vendor/raylib/examples/textures/{textures_rectangle.png → textures_sprite_anim.png} +0 -0
- package/vendor/raylib/examples/textures/textures_sprite_button.c +8 -3
- package/vendor/raylib/examples/textures/textures_sprite_explosion.c +8 -3
- package/vendor/raylib/examples/textures/textures_srcrec_dstrec.c +8 -3
- package/vendor/raylib/examples/textures/textures_to_image.c +8 -3
- package/vendor/raylib/parser/LICENSE +1 -1
- package/vendor/raylib/parser/Makefile +28 -0
- package/vendor/raylib/parser/README.md +49 -5
- package/vendor/raylib/parser/output/raylib_api.json +10717 -0
- package/vendor/raylib/parser/output/raylib_api.lua +7435 -0
- package/vendor/raylib/parser/{raylib_api.txt → output/raylib_api.txt} +1371 -824
- package/vendor/raylib/parser/{raylib_api.xml → output/raylib_api.xml} +827 -595
- package/vendor/raylib/parser/raylib_parser.c +1174 -196
- package/vendor/raylib/projects/4coder/Makefile +2 -4
- package/vendor/raylib/projects/4coder/main.c +0 -1
- package/vendor/raylib/projects/CMake/CMakeLists.txt +13 -16
- package/vendor/raylib/projects/CMake/README.md +27 -0
- package/vendor/raylib/projects/CMake/core_basic_window.c +52 -31
- package/vendor/raylib/projects/CodeBlocks/README.md +4 -4
- package/vendor/raylib/projects/Geany/core_basic_window.c +1 -1
- package/vendor/raylib/projects/Notepad++/c_raylib.xml +168 -128
- 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 +168 -84
- package/vendor/raylib/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +67 -51
- package/vendor/raylib/projects/README.md +1 -1
- package/vendor/raylib/projects/VSCode/.vscode/c_cpp_properties.json +1 -1
- package/vendor/raylib/projects/VSCode/Makefile +8 -11
- package/vendor/raylib/projects/VSCode/main.c +53 -26
- package/vendor/raylib/projects/VSCode/resources/LICENSE +1 -0
- package/vendor/raylib/projects/scripts/build-linux.sh +6 -6
- package/vendor/raylib/projects/scripts/build-osx.sh +6 -6
- package/vendor/raylib/projects/scripts/build-rpi.sh +6 -6
- package/vendor/raylib/projects/scripts/build-windows.bat +2 -2
- package/vendor/raylib/src/CMakeLists.txt +6 -7
- package/vendor/raylib/src/Makefile +209 -103
- package/vendor/raylib/src/build.zig +56 -20
- package/vendor/raylib/src/config.h +32 -27
- package/vendor/raylib/src/external/cgltf.h +342 -104
- package/vendor/raylib/src/external/dr_wav.h +487 -225
- package/vendor/raylib/src/external/glfw/src/posix_time.c +1 -3
- package/vendor/raylib/src/external/glfw/src/wl_init.c +1 -3
- package/vendor/raylib/src/external/jar_xm.h +2 -1
- package/vendor/raylib/src/external/miniaudio.h +62251 -42061
- package/vendor/raylib/src/external/qoi.h +671 -0
- package/vendor/raylib/src/external/stb_vorbis.h +1 -1
- package/vendor/raylib/src/external/vox_loader.h +30 -25
- package/vendor/raylib/src/minshell.html +82 -0
- package/vendor/raylib/src/raudio.c +359 -201
- package/vendor/raylib/src/raylib.dll.rc +5 -5
- package/vendor/raylib/src/raylib.dll.rc.data +0 -0
- package/vendor/raylib/src/raylib.h +95 -63
- package/vendor/raylib/src/raylib.rc +5 -5
- package/vendor/raylib/src/raylib.rc.data +0 -0
- package/vendor/raylib/src/raymath.h +391 -133
- package/vendor/raylib/src/rcamera.h +32 -41
- package/vendor/raylib/src/rcore.c +775 -471
- package/vendor/raylib/src/rgestures.h +5 -5
- package/vendor/raylib/src/rglfw.c +3 -3
- package/vendor/raylib/src/rlgl.h +184 -144
- package/vendor/raylib/src/rmodels.c +207 -144
- package/vendor/raylib/src/rshapes.c +105 -47
- package/vendor/raylib/src/rtext.c +255 -38
- package/vendor/raylib/src/rtextures.c +167 -71
- package/vendor/raylib/src/shell.html +63 -63
- package/vendor/raylib/src/utils.c +49 -3
- package/vendor/raylib/src/utils.h +3 -3
- package/build/qemu/2.1.1/koffi_darwin_arm64.tar.gz +0 -0
- package/build/qemu/2.1.1/koffi_darwin_x64.tar.gz +0 -0
- package/build/qemu/2.1.1/koffi_freebsd_arm64.tar.gz +0 -0
- package/build/qemu/2.1.1/koffi_freebsd_ia32.tar.gz +0 -0
- package/build/qemu/2.1.1/koffi_freebsd_x64.tar.gz +0 -0
- package/build/qemu/2.1.1/koffi_linux_arm32hf.tar.gz +0 -0
- package/build/qemu/2.1.1/koffi_linux_arm64.tar.gz +0 -0
- package/build/qemu/2.1.1/koffi_linux_ia32.tar.gz +0 -0
- package/build/qemu/2.1.1/koffi_linux_riscv64hf64.tar.gz +0 -0
- package/build/qemu/2.1.1/koffi_linux_x64.tar.gz +0 -0
- package/build/qemu/2.1.1/koffi_openbsd_ia32.tar.gz +0 -0
- package/build/qemu/2.1.1/koffi_openbsd_x64.tar.gz +0 -0
- package/build/qemu/2.1.1/koffi_win32_arm64.tar.gz +0 -0
- package/build/qemu/2.1.1/koffi_win32_ia32.tar.gz +0 -0
- package/build/qemu/2.1.1/koffi_win32_x64.tar.gz +0 -0
- package/vendor/raylib/CONTRIBUTORS.md +0 -63
- package/vendor/raylib/SPONSORS.md +0 -68
- package/vendor/raylib/examples/core/core_quat_conversion.c +0 -132
- package/vendor/raylib/examples/core/core_quat_conversion.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 +0 -118
- package/vendor/raylib/examples/models/resources/models/gltf/BoxAnimated.glb +0 -0
- package/vendor/raylib/examples/models/resources/models/gltf/girl.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/vertex_colored_object.iqm +0 -0
- package/vendor/raylib/examples/models/rlights.h +0 -183
- package/vendor/raylib/examples/others/raudio_standalone.c +0 -152
- 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/physics/physics_demo.c +0 -128
- package/vendor/raylib/examples/physics/physics_demo.png +0 -0
- package/vendor/raylib/examples/physics/physics_friction.c +0 -142
- package/vendor/raylib/examples/physics/physics_friction.png +0 -0
- package/vendor/raylib/examples/physics/physics_movement.c +0 -128
- package/vendor/raylib/examples/physics/physics_movement.png +0 -0
- package/vendor/raylib/examples/physics/physics_restitution.c +0 -129
- package/vendor/raylib/examples/physics/physics_restitution.png +0 -0
- package/vendor/raylib/examples/physics/physics_shatter.c +0 -111
- package/vendor/raylib/examples/physics/physics_shatter.png +0 -0
- package/vendor/raylib/parser/raylib_api.json +0 -6668
- package/vendor/raylib/projects/VS2019/raylib/raylib.rc +0 -0
- package/vendor/raylib/projects/VS2019/raylib/resource.h +0 -14
- package/vendor/raylib/src/extras/physac.h +0 -1977
- package/vendor/raylib/src/extras/rmem.h +0 -751
- package/vendor/raylib/src/raudio.h +0 -198
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/*******************************************************************************************
|
|
2
2
|
*
|
|
3
|
-
* raylib [shaders] example -
|
|
3
|
+
* raylib [shaders] example - Mesh instancing
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
5
|
+
* Example originally created with raylib 3.7, last time updated with raylib 4.2
|
|
7
6
|
*
|
|
8
7
|
* Example contributed by @seanpringle and reviewed by Max (@moliad) and Ramon Santamaria (@raysan5)
|
|
9
8
|
*
|
|
10
|
-
*
|
|
9
|
+
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
|
10
|
+
* BSD-like license that allows static linking with closed source software
|
|
11
|
+
*
|
|
12
|
+
* Copyright (c) 2020-2022 @seanpringle, Max (@moliad) and Ramon Santamaria (@raysan5)
|
|
11
13
|
*
|
|
12
14
|
********************************************************************************************/
|
|
13
15
|
|
|
@@ -18,8 +20,7 @@
|
|
|
18
20
|
#define RLIGHTS_IMPLEMENTATION
|
|
19
21
|
#include "rlights.h"
|
|
20
22
|
|
|
21
|
-
#include <stdlib.h>
|
|
22
|
-
#include <math.h>
|
|
23
|
+
#include <stdlib.h> // Required for: calloc(), free()
|
|
23
24
|
|
|
24
25
|
#if defined(PLATFORM_DESKTOP)
|
|
25
26
|
#define GLSL_VERSION 330
|
|
@@ -38,18 +39,9 @@ int main(void)
|
|
|
38
39
|
//--------------------------------------------------------------------------------------
|
|
39
40
|
const int screenWidth = 800;
|
|
40
41
|
const int screenHeight = 450;
|
|
41
|
-
const int fps = 60;
|
|
42
42
|
|
|
43
|
-
SetConfigFlags(FLAG_MSAA_4X_HINT); // Enable Multi Sampling Anti Aliasing 4x (if available)
|
|
44
43
|
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - mesh instancing");
|
|
45
44
|
|
|
46
|
-
int speed = 30; // Speed of jump animation
|
|
47
|
-
int groups = 2; // Count of separate groups jumping around
|
|
48
|
-
float amp = 10; // Maximum amplitude of jump
|
|
49
|
-
float variance = 0.8f; // Global variance in jump height
|
|
50
|
-
float loop = 0.0f; // Individual cube's computed loop timer
|
|
51
|
-
float x = 0.0f, y = 0.0f, z = 0.0f; // Used for various 3D coordinate & vector ops
|
|
52
|
-
|
|
53
45
|
// Define the camera to look into our 3d world
|
|
54
46
|
Camera camera = { 0 };
|
|
55
47
|
camera.position = (Vector3){ -125.0f, 125.0f, -125.0f };
|
|
@@ -58,113 +50,66 @@ int main(void)
|
|
|
58
50
|
camera.fovy = 45.0f;
|
|
59
51
|
camera.projection = CAMERA_PERSPECTIVE;
|
|
60
52
|
|
|
53
|
+
// Define mesh to be instanced
|
|
61
54
|
Mesh cube = GenMeshCube(1.0f, 1.0f, 1.0f);
|
|
62
55
|
|
|
63
|
-
|
|
64
|
-
Matrix *
|
|
65
|
-
Matrix *translations = RL_MALLOC(MAX_INSTANCES*sizeof(Matrix)); // Locations of instances
|
|
56
|
+
// Define transforms to be uploaded to GPU for instances
|
|
57
|
+
Matrix *transforms = (Matrix *)RL_CALLOC(MAX_INSTANCES, sizeof(Matrix)); // Pre-multiplied transformations passed to rlgl
|
|
66
58
|
|
|
67
|
-
//
|
|
59
|
+
// Translate and rotate cubes randomly
|
|
68
60
|
for (int i = 0; i < MAX_INSTANCES; i++)
|
|
69
61
|
{
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
z = (float)GetRandomValue(-50, 50);
|
|
73
|
-
translations[i] = MatrixTranslate(x, y, z);
|
|
74
|
-
|
|
75
|
-
x = (float)GetRandomValue(0, 360);
|
|
76
|
-
y = (float)GetRandomValue(0, 360);
|
|
77
|
-
z = (float)GetRandomValue(0, 360);
|
|
78
|
-
Vector3 axis = Vector3Normalize((Vector3){ x, y, z });
|
|
62
|
+
Matrix translation = MatrixTranslate((float)GetRandomValue(-50, 50), (float)GetRandomValue(-50, 50), (float)GetRandomValue(-50, 50));
|
|
63
|
+
Vector3 axis = Vector3Normalize((Vector3){ (float)GetRandomValue(0, 360), (float)GetRandomValue(0, 360), (float)GetRandomValue(0, 360) });
|
|
79
64
|
float angle = (float)GetRandomValue(0, 10)*DEG2RAD;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
65
|
+
Matrix rotation = MatrixRotate(axis, angle);
|
|
66
|
+
|
|
67
|
+
transforms[i] = MatrixMultiply(rotation, translation);
|
|
83
68
|
}
|
|
84
69
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/base_lighting_instanced.vs", GLSL_VERSION),
|
|
70
|
+
// Load lighting shader
|
|
71
|
+
Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/lighting_instancing.vs", GLSL_VERSION),
|
|
88
72
|
TextFormat("resources/shaders/glsl%i/lighting.fs", GLSL_VERSION));
|
|
89
|
-
|
|
90
|
-
// Get some shader loactions
|
|
73
|
+
// Get shader locations
|
|
91
74
|
shader.locs[SHADER_LOC_MATRIX_MVP] = GetShaderLocation(shader, "mvp");
|
|
92
75
|
shader.locs[SHADER_LOC_VECTOR_VIEW] = GetShaderLocation(shader, "viewPos");
|
|
93
76
|
shader.locs[SHADER_LOC_MATRIX_MODEL] = GetShaderLocationAttrib(shader, "instanceTransform");
|
|
94
77
|
|
|
95
|
-
//
|
|
78
|
+
// Set shader value: ambient light level
|
|
96
79
|
int ambientLoc = GetShaderLocation(shader, "ambient");
|
|
97
80
|
SetShaderValue(shader, ambientLoc, (float[4]){ 0.2f, 0.2f, 0.2f, 1.0f }, SHADER_UNIFORM_VEC4);
|
|
98
81
|
|
|
82
|
+
// Create one light
|
|
99
83
|
CreateLight(LIGHT_DIRECTIONAL, (Vector3){ 50.0f, 50.0f, 0.0f }, Vector3Zero(), WHITE, shader);
|
|
100
84
|
|
|
101
85
|
// NOTE: We are assigning the intancing shader to material.shader
|
|
102
86
|
// to be used on mesh drawing with DrawMeshInstanced()
|
|
103
|
-
Material
|
|
104
|
-
|
|
105
|
-
|
|
87
|
+
Material matInstances = LoadMaterialDefault();
|
|
88
|
+
matInstances.shader = shader;
|
|
89
|
+
matInstances.maps[MATERIAL_MAP_DIFFUSE].color = RED;
|
|
106
90
|
|
|
107
|
-
|
|
91
|
+
// Load default material (using raylib intenral default shader) for non-instanced mesh drawing
|
|
92
|
+
// WARNING: Default shader enables vertex color attribute BUT GenMeshCube() does not generate vertex colors, so,
|
|
93
|
+
// when drawing the color attribute is disabled and a default color value is provided as input for thevertex attribute
|
|
94
|
+
Material matDefault = LoadMaterialDefault();
|
|
95
|
+
matDefault.maps[MATERIAL_MAP_DIFFUSE].color = BLUE;
|
|
108
96
|
|
|
109
|
-
|
|
110
|
-
|
|
97
|
+
// Set an orbital camera mode
|
|
98
|
+
SetCameraMode(camera, CAMERA_ORBITAL);
|
|
111
99
|
|
|
112
|
-
SetTargetFPS(
|
|
100
|
+
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
|
113
101
|
//--------------------------------------------------------------------------------------
|
|
114
102
|
|
|
115
103
|
// Main game loop
|
|
116
104
|
while (!WindowShouldClose()) // Detect window close button or ESC key
|
|
117
105
|
{
|
|
118
|
-
|
|
119
106
|
// Update
|
|
120
107
|
//----------------------------------------------------------------------------------
|
|
121
|
-
|
|
122
|
-
framesCounter++;
|
|
123
|
-
|
|
124
|
-
if (IsKeyDown(KEY_UP)) amp += 0.5f;
|
|
125
|
-
if (IsKeyDown(KEY_DOWN)) amp = (amp <= 1)? 1.0f : (amp - 1.0f);
|
|
126
|
-
if (IsKeyDown(KEY_LEFT)) variance = (variance <= 0.0f)? 0.0f : (variance - 0.01f);
|
|
127
|
-
if (IsKeyDown(KEY_RIGHT)) variance = (variance >= 1.0f)? 1.0f : (variance + 0.01f);
|
|
128
|
-
if (IsKeyDown(KEY_ONE)) groups = 1;
|
|
129
|
-
if (IsKeyDown(KEY_TWO)) groups = 2;
|
|
130
|
-
if (IsKeyDown(KEY_THREE)) groups = 3;
|
|
131
|
-
if (IsKeyDown(KEY_FOUR)) groups = 4;
|
|
132
|
-
if (IsKeyDown(KEY_FIVE)) groups = 5;
|
|
133
|
-
if (IsKeyDown(KEY_SIX)) groups = 6;
|
|
134
|
-
if (IsKeyDown(KEY_SEVEN)) groups = 7;
|
|
135
|
-
if (IsKeyDown(KEY_EIGHT)) groups = 8;
|
|
136
|
-
if (IsKeyDown(KEY_NINE)) groups = 9;
|
|
137
|
-
if (IsKeyDown(KEY_W)) { groups = 7; amp = 25; speed = 18; variance = 0.70f; }
|
|
138
|
-
|
|
139
|
-
if (IsKeyDown(KEY_EQUAL)) speed = (speed <= (fps*0.25f))? (int)(fps*0.25f) : (int)(speed*0.95f);
|
|
140
|
-
if (IsKeyDown(KEY_KP_ADD)) speed = (speed <= (fps*0.25f))? (int)(fps*0.25f) : (int)(speed*0.95f);
|
|
141
|
-
|
|
142
|
-
if (IsKeyDown(KEY_MINUS)) speed = (int)fmaxf(speed*1.02f, speed + 1);
|
|
143
|
-
if (IsKeyDown(KEY_KP_SUBTRACT)) speed = (int)fmaxf(speed*1.02f, speed + 1);
|
|
108
|
+
UpdateCamera(&camera);
|
|
144
109
|
|
|
145
110
|
// Update the light shader with the camera view position
|
|
146
111
|
float cameraPos[3] = { camera.position.x, camera.position.y, camera.position.z };
|
|
147
112
|
SetShaderValue(shader, shader.locs[SHADER_LOC_VECTOR_VIEW], cameraPos, SHADER_UNIFORM_VEC3);
|
|
148
|
-
|
|
149
|
-
// Apply per-instance transformations
|
|
150
|
-
for (int i = 0; i < MAX_INSTANCES; i++)
|
|
151
|
-
{
|
|
152
|
-
rotations[i] = MatrixMultiply(rotations[i], rotationsInc[i]);
|
|
153
|
-
transforms[i] = MatrixMultiply(rotations[i], translations[i]);
|
|
154
|
-
|
|
155
|
-
// Get the animation cycle's framesCounter for this instance
|
|
156
|
-
loop = (float)((framesCounter + (int)(((float)(i%groups)/groups)*speed))%speed)/speed;
|
|
157
|
-
|
|
158
|
-
// Calculate the y according to loop cycle
|
|
159
|
-
y = (sinf(loop*PI*2))*amp*((1 - variance) + (variance*(float)(i%(groups*10))/(groups*10)));
|
|
160
|
-
|
|
161
|
-
// Clamp to floor
|
|
162
|
-
y = (y < 0)? 0.0f : y;
|
|
163
|
-
|
|
164
|
-
transforms[i] = MatrixMultiply(transforms[i], MatrixTranslate(0.0f, y, 0.0f));
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
UpdateCamera(&camera);
|
|
168
113
|
//----------------------------------------------------------------------------------
|
|
169
114
|
|
|
170
115
|
// Draw
|
|
@@ -174,40 +119,19 @@ int main(void)
|
|
|
174
119
|
ClearBackground(RAYWHITE);
|
|
175
120
|
|
|
176
121
|
BeginMode3D(camera);
|
|
177
|
-
//DrawMesh(cube, material, MatrixIdentity());
|
|
178
|
-
DrawMeshInstanced(cube, material, transforms, MAX_INSTANCES);
|
|
179
|
-
EndMode3D();
|
|
180
|
-
|
|
181
|
-
DrawText("A CUBE OF DANCING CUBES!", 490, 10, 20, MAROON);
|
|
182
|
-
DrawText("PRESS KEYS:", 10, textPositionY, 20, BLACK);
|
|
183
|
-
|
|
184
|
-
DrawText("1 - 9", 10, textPositionY += 25, 10, BLACK);
|
|
185
|
-
DrawText(": Number of groups", 50, textPositionY , 10, BLACK);
|
|
186
|
-
DrawText(TextFormat(": %d", groups), 160, textPositionY , 10, BLACK);
|
|
187
122
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
DrawText(TextFormat(": %.2f", amp), 160, textPositionY , 10, BLACK);
|
|
123
|
+
// Draw cube mesh with default material (BLUE)
|
|
124
|
+
DrawMesh(cube, matDefault, MatrixTranslate(-10.0f, 0.0f, 0.0f));
|
|
191
125
|
|
|
192
|
-
|
|
193
|
-
|
|
126
|
+
// Draw meshes instanced using material containing instancing shader (RED + lighting),
|
|
127
|
+
// transforms[] for the instances should be provided, they are dynamically
|
|
128
|
+
// updated in GPU every frame, so we can animate the different mesh instances
|
|
129
|
+
DrawMeshInstanced(cube, matInstances, transforms, MAX_INSTANCES);
|
|
194
130
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
DrawText(TextFormat(": %.2f", variance), 160, textPositionY , 10, BLACK);
|
|
131
|
+
// Draw cube mesh with default material (BLUE)
|
|
132
|
+
DrawMesh(cube, matDefault, MatrixTranslate(10.0f, 0.0f, 0.0f));
|
|
198
133
|
|
|
199
|
-
|
|
200
|
-
DrawText(": increase variance", 50, textPositionY, 10, BLACK);
|
|
201
|
-
|
|
202
|
-
DrawText("+/=", 10, textPositionY += 15, 10, BLACK);
|
|
203
|
-
DrawText(": increase speed", 50, textPositionY, 10, BLACK);
|
|
204
|
-
DrawText(TextFormat(": %d = %f loops/sec", speed, ((float)fps / speed)), 160, textPositionY , 10, BLACK);
|
|
205
|
-
|
|
206
|
-
DrawText("-", 10, textPositionY += 15, 10, BLACK);
|
|
207
|
-
DrawText(": decrease speed", 50, textPositionY, 10, BLACK);
|
|
208
|
-
|
|
209
|
-
DrawText("W", 10, textPositionY += 15, 10, BLACK);
|
|
210
|
-
DrawText(": Wild setup!", 50, textPositionY, 10, BLACK);
|
|
134
|
+
EndMode3D();
|
|
211
135
|
|
|
212
136
|
DrawFPS(10, 10);
|
|
213
137
|
|
|
@@ -217,7 +141,9 @@ int main(void)
|
|
|
217
141
|
|
|
218
142
|
// De-Initialization
|
|
219
143
|
//--------------------------------------------------------------------------------------
|
|
220
|
-
|
|
144
|
+
RL_FREE(transforms); // Free transforms
|
|
145
|
+
|
|
146
|
+
CloseWindow(); // Close window and OpenGL context
|
|
221
147
|
//--------------------------------------------------------------------------------------
|
|
222
148
|
|
|
223
149
|
return 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*******************************************************************************************
|
|
2
2
|
*
|
|
3
|
-
* raylib [shaders] example -
|
|
3
|
+
* raylib [shaders] example - Model shader
|
|
4
4
|
*
|
|
5
5
|
* NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support,
|
|
6
6
|
* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version.
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
* on OpenGL ES 2.0 platforms (Android, Raspberry Pi, HTML5), use #version 100 shaders
|
|
10
10
|
* raylib comes with shaders ready for both versions, check raylib/shaders install folder
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
12
|
+
* Example originally created with raylib 1.3, last time updated with raylib 3.7
|
|
14
13
|
*
|
|
15
|
-
*
|
|
14
|
+
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
|
15
|
+
* BSD-like license that allows static linking with closed source software
|
|
16
|
+
*
|
|
17
|
+
* Copyright (c) 2014-2022 Ramon Santamaria (@raysan5)
|
|
16
18
|
*
|
|
17
19
|
********************************************************************************************/
|
|
18
20
|
|
|
@@ -24,6 +26,9 @@
|
|
|
24
26
|
#define GLSL_VERSION 100
|
|
25
27
|
#endif
|
|
26
28
|
|
|
29
|
+
//------------------------------------------------------------------------------------
|
|
30
|
+
// Program main entry point
|
|
31
|
+
//------------------------------------------------------------------------------------
|
|
27
32
|
int main(void)
|
|
28
33
|
{
|
|
29
34
|
// Initialization
|
|
@@ -65,7 +70,7 @@ int main(void)
|
|
|
65
70
|
{
|
|
66
71
|
// Update
|
|
67
72
|
//----------------------------------------------------------------------------------
|
|
68
|
-
UpdateCamera(&camera);
|
|
73
|
+
UpdateCamera(&camera);
|
|
69
74
|
//----------------------------------------------------------------------------------
|
|
70
75
|
|
|
71
76
|
// Draw
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
* on OpenGL ES 2.0 platforms (Android, Raspberry Pi, HTML5), use #version 100 shaders
|
|
10
10
|
* raylib comes with shaders ready for both versions, check raylib/shaders install folder
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
12
|
+
* Example originally created with raylib 3.5, last time updated with raylib 3.5
|
|
14
13
|
*
|
|
15
|
-
*
|
|
14
|
+
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
|
15
|
+
* BSD-like license that allows static linking with closed source software
|
|
16
|
+
*
|
|
17
|
+
* Copyright (c) 2020-2022 Ramon Santamaria (@raysan5)
|
|
16
18
|
*
|
|
17
19
|
********************************************************************************************/
|
|
18
20
|
|
|
@@ -24,6 +26,9 @@
|
|
|
24
26
|
#define GLSL_VERSION 100
|
|
25
27
|
#endif
|
|
26
28
|
|
|
29
|
+
//------------------------------------------------------------------------------------
|
|
30
|
+
// Program main entry point
|
|
31
|
+
//------------------------------------------------------------------------------------
|
|
27
32
|
int main(void)
|
|
28
33
|
{
|
|
29
34
|
// Initialization
|
|
@@ -9,12 +9,14 @@
|
|
|
9
9
|
* on OpenGL ES 2.0 platforms (Android, Raspberry Pi, HTML5), use #version 100 shaders
|
|
10
10
|
* raylib comes with shaders ready for both versions, check raylib/shaders install folder
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
12
|
+
* Example originally created with raylib 2.5, last time updated with raylib 3.7
|
|
14
13
|
*
|
|
15
14
|
* Example contributed by Marco Lizza (@MarcoLizza) and reviewed by Ramon Santamaria (@raysan5)
|
|
16
15
|
*
|
|
17
|
-
*
|
|
16
|
+
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
|
17
|
+
* BSD-like license that allows static linking with closed source software
|
|
18
|
+
*
|
|
19
|
+
* Copyright (c) 2019-2022 Marco Lizza (@MarcoLizza) and Ramon Santamaria (@raysan5)
|
|
18
20
|
*
|
|
19
21
|
********************************************************************************************/
|
|
20
22
|
|
|
@@ -69,6 +71,9 @@ static const char *paletteText[] = {
|
|
|
69
71
|
"RKBV (2-strip film)"
|
|
70
72
|
};
|
|
71
73
|
|
|
74
|
+
//------------------------------------------------------------------------------------
|
|
75
|
+
// Program main entry point
|
|
76
|
+
//------------------------------------------------------------------------------------
|
|
72
77
|
int main(void)
|
|
73
78
|
{
|
|
74
79
|
// Initialization
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
* on OpenGL ES 2.0 platforms (Android, Raspberry Pi, HTML5), use #version 100 shaders
|
|
10
10
|
* raylib comes with shaders ready for both versions, check raylib/shaders install folder
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
12
|
+
* Example originally created with raylib 1.3, last time updated with raylib 4.0
|
|
14
13
|
*
|
|
15
|
-
*
|
|
14
|
+
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
|
15
|
+
* BSD-like license that allows static linking with closed source software
|
|
16
|
+
*
|
|
17
|
+
* Copyright (c) 2015-2022 Ramon Santamaria (@raysan5)
|
|
16
18
|
*
|
|
17
19
|
********************************************************************************************/
|
|
18
20
|
|
|
@@ -58,6 +60,9 @@ static const char *postproShaderText[] = {
|
|
|
58
60
|
//"FXAA"
|
|
59
61
|
};
|
|
60
62
|
|
|
63
|
+
//------------------------------------------------------------------------------------
|
|
64
|
+
// Program main entry point
|
|
65
|
+
//------------------------------------------------------------------------------------
|
|
61
66
|
int main(void)
|
|
62
67
|
{
|
|
63
68
|
// Initialization
|
|
@@ -113,7 +118,7 @@ int main(void)
|
|
|
113
118
|
{
|
|
114
119
|
// Update
|
|
115
120
|
//----------------------------------------------------------------------------------
|
|
116
|
-
UpdateCamera(&camera);
|
|
121
|
+
UpdateCamera(&camera);
|
|
117
122
|
|
|
118
123
|
if (IsKeyPressed(KEY_RIGHT)) currentShader++;
|
|
119
124
|
else if (IsKeyPressed(KEY_LEFT)) currentShader--;
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
* NOTE: This example requires raylib OpenGL 3.3 for shaders support and only #version 330
|
|
6
6
|
* is currently supported. OpenGL ES 2.0 platforms are not supported at the moment.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
8
|
+
* Example originally created with raylib 2.0, last time updated with raylib 4.2
|
|
10
9
|
*
|
|
11
|
-
*
|
|
10
|
+
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
|
11
|
+
* BSD-like license that allows static linking with closed source software
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) 2018-2022 Ramon Santamaria (@raysan5)
|
|
12
14
|
*
|
|
13
15
|
********************************************************************************************/
|
|
14
16
|
|
|
@@ -20,12 +22,15 @@
|
|
|
20
22
|
#define GLSL_VERSION 100
|
|
21
23
|
#endif
|
|
22
24
|
|
|
25
|
+
//------------------------------------------------------------------------------------
|
|
26
|
+
// Program main entry point
|
|
27
|
+
//------------------------------------------------------------------------------------
|
|
23
28
|
int main(void)
|
|
24
29
|
{
|
|
25
30
|
// Initialization
|
|
26
31
|
//--------------------------------------------------------------------------------------
|
|
27
|
-
int screenWidth = 800;
|
|
28
|
-
int screenHeight = 450;
|
|
32
|
+
const int screenWidth = 800;
|
|
33
|
+
const int screenHeight = 450;
|
|
29
34
|
|
|
30
35
|
SetConfigFlags(FLAG_WINDOW_RESIZABLE);
|
|
31
36
|
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - raymarching shapes");
|
|
@@ -61,7 +66,7 @@ int main(void)
|
|
|
61
66
|
{
|
|
62
67
|
// Update
|
|
63
68
|
//----------------------------------------------------------------------------------
|
|
64
|
-
UpdateCamera(&camera);
|
|
69
|
+
UpdateCamera(&camera);
|
|
65
70
|
|
|
66
71
|
float cameraPos[3] = { camera.position.x, camera.position.y, camera.position.z };
|
|
67
72
|
float cameraTarget[3] = { camera.target.x, camera.target.y, camera.target.z };
|
|
@@ -77,9 +82,7 @@ int main(void)
|
|
|
77
82
|
// Check if screen is resized
|
|
78
83
|
if (IsWindowResized())
|
|
79
84
|
{
|
|
80
|
-
|
|
81
|
-
screenHeight = GetScreenHeight();
|
|
82
|
-
float resolution[2] = { (float)screenWidth, (float)screenHeight };
|
|
85
|
+
float resolution[2] = { (float)GetScreenWidth(), (float)GetScreenHeight() };
|
|
83
86
|
SetShaderValue(shader, resolutionLoc, resolution, SHADER_UNIFORM_VEC2);
|
|
84
87
|
}
|
|
85
88
|
//----------------------------------------------------------------------------------
|
|
@@ -93,10 +96,10 @@ int main(void)
|
|
|
93
96
|
// We only draw a white full-screen rectangle,
|
|
94
97
|
// frame is generated in shader using raymarching
|
|
95
98
|
BeginShaderMode(shader);
|
|
96
|
-
DrawRectangle(0, 0,
|
|
99
|
+
DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), WHITE);
|
|
97
100
|
EndShaderMode();
|
|
98
101
|
|
|
99
|
-
DrawText("(c) Raymarching shader by Iñigo Quilez. MIT License.",
|
|
102
|
+
DrawText("(c) Raymarching shader by Iñigo Quilez. MIT License.", GetScreenWidth() - 280, GetScreenHeight() - 20, 10, BLACK);
|
|
100
103
|
|
|
101
104
|
EndDrawing();
|
|
102
105
|
//----------------------------------------------------------------------------------
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
* on OpenGL ES 2.0 platforms (Android, Raspberry Pi, HTML5), use #version 100 shaders
|
|
10
10
|
* raylib comes with shaders ready for both versions, check raylib/shaders install folder
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
12
|
+
* Example originally created with raylib 1.7, last time updated with raylib 3.7
|
|
14
13
|
*
|
|
15
|
-
*
|
|
14
|
+
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
|
15
|
+
* BSD-like license that allows static linking with closed source software
|
|
16
|
+
*
|
|
17
|
+
* Copyright (c) 2015-2022 Ramon Santamaria (@raysan5)
|
|
16
18
|
*
|
|
17
19
|
********************************************************************************************/
|
|
18
20
|
|
|
@@ -24,6 +26,9 @@
|
|
|
24
26
|
#define GLSL_VERSION 100
|
|
25
27
|
#endif
|
|
26
28
|
|
|
29
|
+
//------------------------------------------------------------------------------------
|
|
30
|
+
// Program main entry point
|
|
31
|
+
//------------------------------------------------------------------------------------
|
|
27
32
|
int main(void)
|
|
28
33
|
{
|
|
29
34
|
// Initialization
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
*
|
|
3
3
|
* raylib [shaders] example - Simple shader mask
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
5
|
+
* Example originally created with raylib 2.5, last time updated with raylib 3.7
|
|
7
6
|
*
|
|
8
7
|
* Example contributed by Chris Camacho (@chriscamacho) and reviewed by Ramon Santamaria (@raysan5)
|
|
9
8
|
*
|
|
10
|
-
*
|
|
9
|
+
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
|
10
|
+
* BSD-like license that allows static linking with closed source software
|
|
11
|
+
*
|
|
12
|
+
* Copyright (c) 2019-2022 Chris Camacho (@chriscamacho) and Ramon Santamaria (@raysan5)
|
|
11
13
|
*
|
|
12
14
|
********************************************************************************************
|
|
13
15
|
*
|
|
@@ -27,6 +29,9 @@
|
|
|
27
29
|
#define GLSL_VERSION 100
|
|
28
30
|
#endif
|
|
29
31
|
|
|
32
|
+
//------------------------------------------------------------------------------------
|
|
33
|
+
// Program main entry point
|
|
34
|
+
//------------------------------------------------------------------------------------
|
|
30
35
|
int main(void)
|
|
31
36
|
{
|
|
32
37
|
// Initialization
|
|
@@ -88,6 +93,8 @@ int main(void)
|
|
|
88
93
|
{
|
|
89
94
|
// Update
|
|
90
95
|
//----------------------------------------------------------------------------------
|
|
96
|
+
UpdateCamera(&camera);
|
|
97
|
+
|
|
91
98
|
framesCounter++;
|
|
92
99
|
rotation.x += 0.01f;
|
|
93
100
|
rotation.y += 0.005f;
|
|
@@ -98,8 +105,6 @@ int main(void)
|
|
|
98
105
|
|
|
99
106
|
// Rotate one of the models
|
|
100
107
|
model1.transform = MatrixRotateXYZ(rotation);
|
|
101
|
-
|
|
102
|
-
UpdateCamera(&camera);
|
|
103
108
|
//----------------------------------------------------------------------------------
|
|
104
109
|
|
|
105
110
|
// Draw
|
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
*
|
|
3
3
|
* raylib [shaders] example - Simple shader mask
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
5
|
+
* Example originally created with raylib 2.5, last time updated with raylib 3.7
|
|
7
6
|
*
|
|
8
|
-
* Example contributed by Chris Camacho (@chriscamacho
|
|
9
|
-
* and reviewed by Ramon Santamaria (@raysan5)
|
|
7
|
+
* Example contributed by Chris Camacho (@chriscamacho) and reviewed by Ramon Santamaria (@raysan5)
|
|
10
8
|
*
|
|
11
|
-
*
|
|
9
|
+
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
|
10
|
+
* BSD-like license that allows static linking with closed source software
|
|
11
|
+
*
|
|
12
|
+
* Copyright (c) 2019-2022 Chris Camacho (@chriscamacho) and Ramon Santamaria (@raysan5)
|
|
12
13
|
*
|
|
13
14
|
********************************************************************************************
|
|
14
15
|
*
|
|
15
|
-
* The shader makes alpha holes in the forground to give the
|
|
16
|
+
* The shader makes alpha holes in the forground to give the appearance of a top
|
|
16
17
|
* down look at a spotlight casting a pool of light...
|
|
17
18
|
*
|
|
18
19
|
* The right hand side of the screen there is just enough light to see whats
|
|
@@ -64,6 +65,9 @@ typedef struct Star {
|
|
|
64
65
|
void UpdateStar(Star *s);
|
|
65
66
|
void ResetStar(Star *s);
|
|
66
67
|
|
|
68
|
+
//------------------------------------------------------------------------------------
|
|
69
|
+
// Program main entry point
|
|
70
|
+
//------------------------------------------------------------------------------------
|
|
67
71
|
int main(void)
|
|
68
72
|
{
|
|
69
73
|
// Initialization
|
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
*
|
|
3
3
|
* raylib [textures] example - Texture drawing
|
|
4
4
|
*
|
|
5
|
-
* This example illustrates how to draw
|
|
5
|
+
* NOTE: This example illustrates how to draw into a blank texture using a shader
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
7
|
+
* Example originally created with raylib 2.0, last time updated with raylib 3.7
|
|
9
8
|
*
|
|
10
9
|
* Example contributed by Michał Ciesielski and reviewed by Ramon Santamaria (@raysan5)
|
|
11
10
|
*
|
|
12
|
-
*
|
|
11
|
+
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
|
12
|
+
* BSD-like license that allows static linking with closed source software
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) 2019-2022 Michał Ciesielski and Ramon Santamaria (@raysan5)
|
|
13
15
|
*
|
|
14
16
|
********************************************************************************************/
|
|
15
17
|
|
|
@@ -21,6 +23,9 @@
|
|
|
21
23
|
#define GLSL_VERSION 100
|
|
22
24
|
#endif
|
|
23
25
|
|
|
26
|
+
//------------------------------------------------------------------------------------
|
|
27
|
+
// Program main entry point
|
|
28
|
+
//------------------------------------------------------------------------------------
|
|
24
29
|
int main(void)
|
|
25
30
|
{
|
|
26
31
|
// Initialization
|
|
@@ -5,12 +5,14 @@
|
|
|
5
5
|
* NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support,
|
|
6
6
|
* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
8
|
+
* Example originally created with raylib 4.0, last time updated with raylib 4.0
|
|
10
9
|
*
|
|
11
10
|
* Example contributed by Samuel Skiff (@GoldenThumbs) and reviewed by Ramon Santamaria (@raysan5)
|
|
12
11
|
*
|
|
13
|
-
*
|
|
12
|
+
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
|
13
|
+
* BSD-like license that allows static linking with closed source software
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) 2021-2022 Samuel SKiff (@GoldenThumbs) and Ramon Santamaria (@raysan5)
|
|
14
16
|
*
|
|
15
17
|
********************************************************************************************/
|
|
16
18
|
|
|
@@ -22,6 +24,9 @@
|
|
|
22
24
|
#define GLSL_VERSION 100
|
|
23
25
|
#endif
|
|
24
26
|
|
|
27
|
+
//------------------------------------------------------------------------------------
|
|
28
|
+
// Program main entry point
|
|
29
|
+
//------------------------------------------------------------------------------------
|
|
25
30
|
int main(void)
|
|
26
31
|
{
|
|
27
32
|
// Initialization
|
|
@@ -9,12 +9,14 @@
|
|
|
9
9
|
* on OpenGL ES 2.0 platforms (Android, Raspberry Pi, HTML5), use #version 100 shaders
|
|
10
10
|
* raylib comes with shaders ready for both versions, check raylib/shaders install folder
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
12
|
+
* Example originally created with raylib 2.5, last time updated with raylib 3.7
|
|
14
13
|
*
|
|
15
14
|
* Example contributed by Anata (@anatagawa) and reviewed by Ramon Santamaria (@raysan5)
|
|
16
15
|
*
|
|
17
|
-
*
|
|
16
|
+
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
|
17
|
+
* BSD-like license that allows static linking with closed source software
|
|
18
|
+
*
|
|
19
|
+
* Copyright (c) 2019-2022 Anata (@anatagawa) and Ramon Santamaria (@raysan5)
|
|
18
20
|
*
|
|
19
21
|
********************************************************************************************/
|
|
20
22
|
|
|
@@ -26,6 +28,9 @@
|
|
|
26
28
|
#define GLSL_VERSION 100
|
|
27
29
|
#endif
|
|
28
30
|
|
|
31
|
+
//------------------------------------------------------------------------------------
|
|
32
|
+
// Program main entry point
|
|
33
|
+
//------------------------------------------------------------------------------------
|
|
29
34
|
int main(void)
|
|
30
35
|
{
|
|
31
36
|
// Initialization
|