Skip to content

Commit 8380c48

Browse files
authored
Merge pull request raysan5#371 from raysan5/develop
Integrate Develop branch
2 parents 18601f7 + 2ba43b5 commit 8380c48

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2760
-1428
lines changed

examples/Makefile

Lines changed: 7 additions & 251 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,9 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
198198
else
199199
LDLIBS += -lopenal32dll
200200
endif
201-
PHYSAC_LIBS = -static -lpthread
201+
202+
# Required for physac examples
203+
LDLIBS += -static -lpthread
202204
endif
203205
ifeq ($(PLATFORM_OS),LINUX)
204206
# Libraries for Debian GNU/Linux desktop compiling
@@ -301,263 +303,17 @@ EXAMPLES = \
301303
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
302304

303305
# Default target entry
304-
all: examples
306+
all: $(EXAMPLES)
305307

306308
# Generic compilation pattern
309+
# NOTE: Examples must be ready for Android compilation!
307310
%: %.c
308-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
309-
310-
# Compile all examples
311-
examples: $(EXAMPLES)
312-
313-
# compile [core] example - basic window
314-
core/core_basic_window: core/core_basic_window.c
315-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
316-
317-
# compile [core] example - keyboard input
318-
core/core_input_keys: core/core_input_keys.c
319-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
320-
321-
# compile [core] example - mouse input
322-
core/core_input_mouse: core/core_input_mouse.c
323-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
324-
325-
# compile [core] example - mouse wheel
326-
core/core_mouse_wheel: core/core_mouse_wheel.c
327-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
328-
329-
# compile [core] example - gamepad input
330-
core/core_input_gamepad: core/core_input_gamepad.c
331-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
332-
333-
# compile [core] example - generate random values
334-
core/core_random_values: core/core_random_values.c
335-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
336-
337-
# compile [core] example - color selection (collision detection)
338-
core/core_color_select: core/core_color_select.c
339-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
340-
341-
# compile [core] example - drop files
342-
core/core_drop_files: core/core_drop_files.c
343-
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
344-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
311+
ifeq ($(PLATFORM),PLATFORM_ANDROID)
312+
$(MAKE) -f Makefile.Android PROJECT_NAME=$@ PROJECT_SOURCE_FILES=$<
345313
else
346-
@echo core_drop_files: Example not supported on PLATFORM_ANDROID or PLATFORM_WEB or PLATFORM_RPI
347-
endif
348-
349-
# compile [core] example - storage values
350-
core/core_storage_values: core/core_storage_values.c
351-
ifeq ($(PLATFORM), $(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_RPI))
352314
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
353-
else
354-
@echo core_storage_values: Example not supported on PLATFORM_ANDROID or PLATFORM_WEB
355315
endif
356316

357-
# compile [core] example - gestures detection
358-
core/core_gestures_detection: core/core_gestures_detection.c
359-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
360-
361-
# compile [core] example - 3d mode
362-
core/core_3d_mode: core/core_3d_mode.c
363-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
364-
365-
# compile [core] example - 3d picking
366-
core/core_3d_picking: core/core_3d_picking.c
367-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
368-
369-
# compile [core] example - 3d camera free
370-
core/core_3d_camera_free: core/core_3d_camera_free.c
371-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
372-
373-
# compile [core] example - 3d camera first person
374-
core/core_3d_camera_first_person: core/core_3d_camera_first_person.c
375-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
376-
377-
# compile [core] example - 2d camera
378-
core/core_2d_camera: core/core_2d_camera.c
379-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
380-
381-
# compile [core] example - world screen
382-
core/core_world_screen: core/core_world_screen.c
383-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
384-
385-
# compile [core] example - vr simulator
386-
core/core_vr_simulator: core/core_vr_simulator.c
387-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
388-
389-
# compile [shapes] example - raylib logo (with basic shapes)
390-
shapes/shapes_logo_raylib: shapes/shapes_logo_raylib.c
391-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
392-
393-
# compile [shapes] example - basic shapes usage (rectangle, circle, ...)
394-
shapes/shapes_basic_shapes: shapes/shapes_basic_shapes.c
395-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
396-
397-
# compile [shapes] example - raylib color palette
398-
shapes/shapes_colors_palette: shapes/shapes_colors_palette.c
399-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
400-
401-
# compile [shapes] example - raylib logo animation
402-
shapes/shapes_logo_raylib_anim: shapes/shapes_logo_raylib_anim.c
403-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
404-
405-
# compile [shapes] example - lines bezier
406-
shapes/shapes_lines_bezier: shapes/shapes_lines_bezier.c
407-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
408-
409-
# compile [textures] example - raylib logo texture loading
410-
textures/textures_logo_raylib: textures/textures_logo_raylib.c
411-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
412-
413-
# compile [textures] example - image loading and conversion to texture
414-
textures/textures_image_loading: textures/textures_image_loading.c
415-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
416-
417-
# compile [textures] example - texture rectangle drawing
418-
textures/textures_rectangle: textures/textures_rectangle.c
419-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
420-
421-
# compile [textures] example - texture source and destination rectangles
422-
textures/textures_srcrec_dstrec: textures/textures_srcrec_dstrec.c
423-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
424-
425-
# compile [textures] example - texture to image
426-
textures/textures_to_image: textures/textures_to_image.c
427-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
428-
429-
# compile [textures] example - texture raw data
430-
textures/textures_raw_data: textures/textures_raw_data.c
431-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
432-
433-
# compile [textures] example - texture particles blending
434-
textures/textures_particles_blending: textures/textures_particles_blending.c
435-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
436-
437-
# compile [textures] example - texture image processing
438-
textures/textures_image_processing: textures/textures_image_processing.c
439-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
440-
441-
# compile [textures] example - texture image drawing
442-
textures/textures_image_drawing: textures/textures_image_drawing.c
443-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
444-
445-
# compile [text] example - sprite fonts loading
446-
text/text_sprite_fonts: text/text_sprite_fonts.c
447-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
448-
449-
# compile [text] example - bmfonts and ttf loading
450-
text/text_bmfont_ttf: text/text_bmfont_ttf.c
451-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
452-
453-
# compile [text] example - raylib fonts
454-
text/text_raylib_fonts: text/text_raylib_fonts.c
455-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
456-
457-
# compile [text] example - text formatting
458-
text/text_format_text: text/text_format_text.c
459-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
460-
461-
# compile [text] example - text writing animation
462-
text/text_writing_anim: text/text_writing_anim.c
463-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
464-
465-
# compile [text] example - text ttf loading
466-
text/text_ttf_loading: text/text_ttf_loading.c
467-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
468-
469-
# compile [text] example - text bmfont unordered
470-
text/text_bmfont_unordered: text/text_bmfont_unordered.c
471-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
472-
473-
# compile [text] example - text input box
474-
text/text_input_box: text/text_input_box.c
475-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
476-
477-
# compile [models] example - basic geometric 3d shapes
478-
models/models_geometric_shapes: models/models_geometric_shapes.c
479-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
480-
481-
# compile [models] example - box collisions
482-
models/models_box_collisions: models/models_box_collisions.c
483-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
484-
485-
# compile [models] example - basic window
486-
models/models_planes: models/models_planes.c
487-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
488-
489-
# compile [models] example - billboard usage
490-
models/models_billboard: models/models_billboard.c
491-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
492-
493-
# compile [models] example - OBJ model loading
494-
models/models_obj_loading: models/models_obj_loading.c
495-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
496-
497-
# compile [models] example - heightmap loading
498-
models/models_heightmap: models/models_heightmap.c
499-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
500-
501-
# compile [models] example - cubesmap loading
502-
models/models_cubicmap: models/models_cubicmap.c
503-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
504-
505-
# compile [models] example - model mesh picking
506-
models/models_mesh_picking: models/models_mesh_picking.c
507-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
508-
509-
# compile [shaders] example - model shader
510-
shaders/shaders_model_shader: shaders/shaders_model_shader.c
511-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
512-
513-
# compile [shaders] example - shapes texture shader
514-
shaders/shaders_shapes_textures: shaders/shaders_shapes_textures.c
515-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
516-
517-
# compile [shaders] example - custom uniform in shader
518-
shaders/shaders_custom_uniform: shaders/shaders_custom_uniform.c
519-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
520-
521-
# compile [shaders] example - postprocessing shader
522-
shaders/shaders_postprocessing: shaders/shaders_postprocessing.c
523-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
524-
525-
# compile [audio] example - sound loading and playing (WAV and OGG)
526-
audio/audio_sound_loading: audio/audio_sound_loading.c
527-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
528-
529-
# compile [audio] example - music stream playing (OGG)
530-
audio/audio_music_stream: audio/audio_music_stream.c
531-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
532-
533-
# compile [audio] example - module playing (XM)
534-
audio/audio_module_playing: audio/audio_module_playing.c
535-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
536-
537-
# compile [audio] example - raw audio streaming
538-
audio/audio_raw_stream: audio/audio_raw_stream.c
539-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
540-
541-
# compile [physac] example - physics demo
542-
physac/physics_demo: physac/physics_demo.c
543-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) $(PHYSAC_LIBS) -D$(PLATFORM)
544-
545-
# compile [physac] example - physics friction
546-
physac/physics_friction: physac/physics_friction.c
547-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) $(PHYSAC_LIBS) -D$(PLATFORM)
548-
549-
# compile [physac] example - physics movement
550-
physac/physics_movement: physac/physics_movement.c
551-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) $(PHYSAC_LIBS) -D$(PLATFORM)
552-
553-
# compile [physac] example - physics restitution
554-
physac/physics_restitution: physac/physics_restitution.c
555-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) $(PHYSAC_LIBS) -D$(PLATFORM)
556-
557-
# compile [physac] example - physics shatter
558-
physac/physics_shatter: physac/physics_shatter.c
559-
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) $(PHYSAC_LIBS) -D$(PLATFORM)
560-
561317
# fix dylib install path name for each executable (MAC)
562318
fix_dylib:
563319
ifeq ($(PLATFORM_OS),OSX)

examples/others/audio_standalone.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66
*
77
* [audio] module requires some external libs:
88
* OpenAL Soft - Audio device management lib (http://kcat.strangesoft.net/openal.html)
9-
* stb_vorbis - Ogg audio files loading (http://www.nothings.org/stb_vorbis/)
10-
* jar_xm - XM module file loading
11-
* jar_mod - MOD audio file loading
9+
* stb_vorbis - Ogg audio files loading (http://www.nothings.org/stb_vorbis/)
10+
* jar_xm - XM module file loading
11+
* jar_mod - MOD audio file loading
12+
* dr_flac - FLAC audio file loading
1213
*
1314
* Compile audio module using:
1415
* gcc -c audio.c stb_vorbis.c -Wall -std=c99 -DAUDIO_STANDALONE -DAL_LIBTYPE_STATIC
1516
*
1617
* Compile example using:
1718
* gcc -o audio_standalone.exe audio_standalone.c audio.o stb_vorbis.o -lopenal32 -lwinmm /
18-
* -Wall -std=c99 -Wl,-allow-multiple-definition
19+
* -s -Wall -std=c99 -Wl,-allow-multiple-definition
1920
*
2021
* This example has been created using raylib 1.7 (www.raylib.com)
2122
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)

0 commit comments

Comments
 (0)