Skip to content

Commit

Permalink
Merge branch 'pure' of https://github.com/ColleagueRiley/raylib into …
Browse files Browse the repository at this point in the history
…pure
  • Loading branch information
ColleagueRiley committed Jan 14, 2025
2 parents 8f33d6d + 3a12de6 commit e966059
Show file tree
Hide file tree
Showing 34 changed files with 510 additions and 846 deletions.
36 changes: 19 additions & 17 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -330,25 +330,26 @@ endif
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# -Os # size optimization
# -O2 # optimization level 2, if used, also set --memory-init-file 0
# -sUSE_GLFW=3 # Use glfw3 library (context/input management)
# -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
# -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB)
# -sUSE_PTHREADS=1 # multithreading support
# -sWASM=0 # disable Web Assembly, emitted by default
# -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
# -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data
# -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
# -sGL_ENABLE_GET_PROC_ADDRESS # enable using the *glGetProcAddress() family of functions, required for extensions loading
# -sUSE_GLFW=3 # Use glfw3 library (context/input management)
# -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
# -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB)
# -sUSE_PTHREADS=1 # multithreading support
# -sWASM=0 # disable Web Assembly, emitted by default
# -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
# -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data
# -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
# -sMINIFY_HTML=0 # minify generated html from shell.html
# --profiling # include information for code profiling
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
# --preload-file resources # specify a resources folder for data compilation
# --source-map-base # allow debugging in browser with source map

# --shell-file shell.html # define a custom shell .html and output extension
LDFLAGS += -sTOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -sFORCE_FILESYSTEM=1 -sMINIFY_HTML=0

# Using GLFW3 library (instead of RGFW)
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
LDFLAGS += -sUSE_GLFW=3
endif

LDFLAGS += -sTOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -sFORCE_FILESYSTEM=1

# Build using asyncify
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
Expand Down Expand Up @@ -512,7 +513,6 @@ CORE = \
core/core_custom_logging \
core/core_drop_files \
core/core_input_gamepad \
core/core_input_gamepad_info \
core/core_input_gestures \
core/core_input_gestures_web \
core/core_input_keys \
Expand Down Expand Up @@ -547,10 +547,11 @@ SHAPES = \
shapes/shapes_lines_bezier \
shapes/shapes_logo_raylib \
shapes/shapes_logo_raylib_anim \
shapes/shapes_rectangle_advanced \
shapes/shapes_rectangle_scaling \
shapes/shapes_splines_drawing \
shapes/shapes_top_down_lights \
shapes/shapes_rectangle_advanced
shapes/shapes_top_down_lights


TEXTURES = \
textures/textures_background_scrolling \
Expand Down Expand Up @@ -603,6 +604,7 @@ MODELS = \
models/models_draw_cube_texture \
models/models_first_person_maze \
models/models_geometric_shapes \
models/models_gpu_skinning \
models/models_heightmap \
models/models_loading \
models/models_loading_gltf \
Expand All @@ -614,9 +616,9 @@ MODELS = \
models/models_point_rendering \
models/models_rlgl_solar_system \
models/models_skybox \
models/models_tesseract_view \
models/models_waving_cubes \
models/models_yaw_pitch_roll \
models/models_gpu_skinning
models/models_yaw_pitch_roll

SHADERS = \
shaders/shaders_basic_lighting \
Expand Down
45 changes: 23 additions & 22 deletions examples/Makefile.Web
Original file line number Diff line number Diff line change
Expand Up @@ -266,26 +266,27 @@ endif
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# -Os # size optimization
# -O2 # optimization level 2, if used, also set --memory-init-file 0
# -sUSE_GLFW=3 # Use glfw3 library (context/input management)
# -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
# -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB)
# -sUSE_PTHREADS=1 # multithreading support
# -sWASM=0 # disable Web Assembly, emitted by default
# -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
# -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data
# -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
# -sGL_ENABLE_GET_PROC_ADDRESS # enable using the *glGetProcAddress() family of functions, required for extensions loading
# -sUSE_GLFW=3 # Use glfw3 library (context/input management)
# -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
# -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB)
# -sUSE_PTHREADS=1 # multithreading support
# -sWASM=0 # disable Web Assembly, emitted by default
# -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
# -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data
# -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
# -sMINIFY_HTML=0 # minify generated html from shell.html
# --profiling # include information for code profiling
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
# --preload-file resources # specify a resources folder for data compilation
# --source-map-base # allow debugging in browser with source map

# --shell-file shell.html # define a custom shell .html and output extension
LDFLAGS += -sTOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -sFORCE_FILESYSTEM=1 -sEXPORTED_RUNTIME_METHODS=ccall -sMINIFY_HTML=0

# Using GLFW3 library (instead of RGFW)
ifeq ($(PLATFORM),PLATFORM_WEB)
LDFLAGS += -sUSE_GLFW=3
endif

LDFLAGS += -sEXPORTED_RUNTIME_METHODS=ccall

# Build using asyncify
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
LDFLAGS += -sASYNCIFY
Expand Down Expand Up @@ -393,7 +394,6 @@ CORE = \
core/core_custom_logging \
core/core_drop_files \
core/core_input_gamepad \
core/core_input_gamepad_info \
core/core_input_gestures \
core/core_input_gestures_web \
core/core_input_keys \
Expand Down Expand Up @@ -428,10 +428,10 @@ SHAPES = \
shapes/shapes_lines_bezier \
shapes/shapes_logo_raylib \
shapes/shapes_logo_raylib_anim \
shapes/shapes_rectangle_advanced \
shapes/shapes_rectangle_scaling \
shapes/shapes_splines_drawing \
shapes/shapes_top_down_lights \
shapes/shapes_rectangle_advanced
shapes/shapes_top_down_lights

TEXTURES = \
textures/textures_background_scrolling \
Expand Down Expand Up @@ -477,14 +477,14 @@ TEXT = \

MODELS = \
models/models_animation \
models/models_gpu_skinning \
models/models_billboard \
models/models_bone_socket \
models/models_box_collisions \
models/models_cubicmap \
models/models_draw_cube_texture \
models/models_first_person_maze \
models/models_geometric_shapes \
models/models_gpu_skinning \
models/models_heightmap \
models/models_loading \
models/models_loading_gltf \
Expand All @@ -496,6 +496,7 @@ MODELS = \
models/models_point_rendering \
models/models_rlgl_solar_system \
models/models_skybox \
models/models_tesseract_view \
models/models_waving_cubes \
models/models_yaw_pitch_roll

Expand Down Expand Up @@ -524,8 +525,8 @@ SHADERS = \
shaders/shaders_texture_outline \
shaders/shaders_texture_tiling \
shaders/shaders_texture_waves \
shaders/shaders_write_depth \
shaders/shaders_vertex_displacement
shaders/shaders_vertex_displacement \
shaders/shaders_write_depth

AUDIO = \
audio/audio_mixed_processor \
Expand Down Expand Up @@ -613,9 +614,6 @@ core/core_input_gamepad: core/core_input_gamepad.c
--preload-file core/resources/ps3.png@resources/ps3.png \
--preload-file core/resources/xbox.png@resources/xbox.png

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

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

Expand All @@ -637,7 +635,7 @@ core/core_input_multitouch: core/core_input_multitouch.c
core/core_input_virtual_controls: core/core_input_virtual_controls.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)
# NOTE: To use multi-threading raylib must be compiled with multi-theading support (-sUSE_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)
# in its source were transformed to non-atomic operations and non-thread-local data
Expand Down Expand Up @@ -998,6 +996,9 @@ models/models_skybox: models/models_skybox.c
--preload-file models/resources/shaders/glsl100/cubemap.vs@resources/shaders/glsl100/cubemap.vs \
--preload-file models/resources/shaders/glsl100/cubemap.fs@resources/shaders/glsl100/cubemap.fs

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

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

Expand Down
Binary file modified examples/core/core_2d_camera_mouse_zoom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion examples/core/core_basic_screen_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
switch(currentScreen)
switch (currentScreen)
{
case LOGO:
{
Expand Down
83 changes: 0 additions & 83 deletions examples/core/core_input_gamepad_info.c

This file was deleted.

2 changes: 1 addition & 1 deletion examples/core/core_input_multitouch.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int main(void)
// Get the touch point count ( how many fingers are touching the screen )
int tCount = GetTouchPointCount();
// Clamp touch points available ( set the maximum touch points allowed )
if(tCount > MAX_TOUCH_POINTS) tCount = MAX_TOUCH_POINTS;
if (tCount > MAX_TOUCH_POINTS) tCount = MAX_TOUCH_POINTS;
// Get touch points positions
for (int i = 0; i < tCount; ++i) touchPositions[i] = GetTouchPosition(i);
//----------------------------------------------------------------------------------
Expand Down
24 changes: 4 additions & 20 deletions examples/core/core_input_virtual_controls.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,26 +115,10 @@ int main(void)
// Move player according to pressed button
switch (pressedButton)
{
case BUTTON_UP:
{
playerPosition.y -= playerSpeed*GetFrameTime();
break;
}
case BUTTON_LEFT:
{
playerPosition.x -= playerSpeed*GetFrameTime();
break;
}
case BUTTON_RIGHT:
{
playerPosition.x += playerSpeed*GetFrameTime();
break;
}
case BUTTON_DOWN:
{
playerPosition.y += playerSpeed*GetFrameTime();
break;
}
case BUTTON_UP: playerPosition.y -= playerSpeed*GetFrameTime(); break;
case BUTTON_LEFT: playerPosition.x -= playerSpeed*GetFrameTime(); break;
case BUTTON_RIGHT: playerPosition.x += playerSpeed*GetFrameTime(); break;
case BUTTON_DOWN: playerPosition.y += playerSpeed*GetFrameTime(); break;
default: break;
};

Expand Down
Loading

0 comments on commit e966059

Please sign in to comment.