Skip to content

Commit

Permalink
[example] Core Input Gestures for Web (#3172)
Browse files Browse the repository at this point in the history
* [example] Core Input Gestures for Web

* Fix Doubletap for web

* Changes TAP_TIMEOUT and rgGetCurrentTime to seconds
  • Loading branch information
ubkp authored Jul 16, 2023
1 parent 22895ba commit b980268
Show file tree
Hide file tree
Showing 6 changed files with 360 additions and 19 deletions.
1 change: 1 addition & 0 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ CORE = \
core/core_input_gamepad \
core/core_input_multitouch \
core/core_input_gestures \
core/core_input_gestures_web \
core/core_2d_camera \
core/core_2d_camera_platformer \
core/core_2d_camera_mouse_zoom \
Expand Down
26 changes: 15 additions & 11 deletions examples/Makefile.Web
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ CORE = \
core/core_input_gamepad \
core/core_input_multitouch \
core/core_input_gestures \
core/core_input_gestures_web \
core/core_2d_camera \
core/core_2d_camera_platformer \
core/core_2d_camera_mouse_zoom \
Expand Down Expand Up @@ -558,12 +559,15 @@ core/core_input_multitouch: core/core_input_multitouch.c
core/core_input_gestures: core/core_input_gestures.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)

core/core_input_gestures_web: core/core_input_gestures_web.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)

core/core_2d_camera: core/core_2d_camera.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)

core/core_2d_camera_platformer: core/core_2d_camera_platformer.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)

core/core_2d_camera_mouse_zoom: core/core_2d_camera_mouse_zoom.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)

Expand Down Expand Up @@ -618,10 +622,10 @@ core/core_custom_frame_control: core/core_custom_frame_control.c

core/core_window_should_close: core/core_window_should_close.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)

# NOTE: To use multi-threading raylib must be compiled with multi-theading support (-s USE_PTHREADS=1)
# WARNING: For security reasons multi-threading is not supported on browsers, it requires cross-origin isolation (Oct.2021)
# WARNING: It requires raylib to be compiled using -pthread, so atomic operations and thread-local data (if any)
# WARNING: It requires raylib to be compiled using -pthread, so atomic operations and thread-local data (if any)
# in its source were transformed to non-atomic operations and non-thread-local data
core/core_loading_thread: core/core_loading_thread.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s USE_PTHREADS=1
Expand Down Expand Up @@ -745,7 +749,7 @@ textures/textures_sprite_explosion: textures/textures_sprite_explosion.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
--preload-file textures/resources/explosion.png@resources/explosion.png \
--preload-file textures/resources/boom.wav@resources/boom.wav

textures/textures_textured_curve: textures/textures_textured_curve.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
--preload-file textures/resources/road.png@resources/road.png
Expand Down Expand Up @@ -857,8 +861,8 @@ models/models_cubicmap: models/models_cubicmap.c

models/models_draw_cube_texture: models/models_draw_cube_texture.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
--preload-file models/resources/cubicmap_atlas.png@resources/cubicmap_atlas.png
--preload-file models/resources/cubicmap_atlas.png@resources/cubicmap_atlas.png

models/models_first_person_maze: models/models_first_person_maze.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
--preload-file models/resources/cubicmap.png@resources/cubicmap.png \
Expand Down Expand Up @@ -889,7 +893,7 @@ models/models_loading_vox: models/models_loading_vox.c
models/models_loading_gltf: models/models_loading_gltf.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
--preload-file models/resources/models/gltf/robot.glb@resources/models/gltf/robot.glb

models/models_loading_m3d: models/models_loading_m3d.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
--preload-file models/resources/models/m3d/cesium_man.m3d@resources/models/m3d/cesium_man.m3d
Expand Down Expand Up @@ -1010,16 +1014,16 @@ shaders/shaders_texture_outline: shaders/shaders_texture_outline.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
--preload-file shaders/resources/shaders/glsl100/outline.fs@resources/shaders/glsl100/outline.fs \
--preload-file shaders/resources/fudesumi.png@resources/fudesumi.png

shaders/shaders_write_depth: shaders/shaders_write_depth.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
--preload-file shaders/resources/shaders/glsl100/write_depth.fs@resources/shaders/glsl100/write_depth.fs

shaders/shaders_hybrid_render: shaders/shaders_hybrid_render.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
--preload-file shaders/resources/shaders/glsl100/hybrid_raymarch.fs@resources/shaders/glsl100/hybrid_raymarch.fs \
--preload-file shaders/resources/shaders/glsl100/hybrid_raster.fs@resources/shaders/glsl100/hybrid_raster.fs

# Compile AUDIO examples
audio/audio_module_playing: audio/audio_module_playing.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
Expand All @@ -1040,7 +1044,7 @@ audio/audio_sound_loading: audio/audio_sound_loading.c
audio/audio_stream_effects: audio/audio_stream_effects.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
--preload-file audio/resources/country.mp3@resources/country.mp3

audio/audio_mixed_processor: audio/audio_mixed_processor.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s TOTAL_MEMORY=67108864 \
--preload-file audio/resources/country.mp3@resources/country.mp3 \
Expand Down
Loading

0 comments on commit b980268

Please sign in to comment.