mirror of
https://github.com/raysan5/raylib.git
synced 2026-02-02 04:09:18 -05:00
Compare commits
13 Commits
43bc00379c
...
a36905607c
| Author | SHA1 | Date | |
|---|---|---|---|
| a36905607c | |||
| 3e65b23f89 | |||
| 8adccfd521 | |||
| fde3166e6a | |||
| 9477838193 | |||
| cb91c02bea | |||
| a872de82ed | |||
| 9d07be6bde | |||
| 234f4b2b10 | |||
| 10079e4e65 | |||
| 6b0174d034 | |||
| 9fa53aac6f | |||
| 11ccf11814 |
30
.github/workflows/linux.yml
vendored
30
.github/workflows/linux.yml
vendored
@ -22,22 +22,28 @@ jobs:
|
||||
build:
|
||||
permissions:
|
||||
contents: write # for actions/upload-release-asset to upload release asset
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
bits: [32, 64]
|
||||
include:
|
||||
- bits: 32
|
||||
ARCH: "i386"
|
||||
ARCH_NAME: "i386"
|
||||
COMPILER_PATH: "/user/bin"
|
||||
runner: "ubuntu-latest"
|
||||
- bits: 64
|
||||
ARCH: "x86_64"
|
||||
ARCH_NAME: "amd64"
|
||||
COMPILER_PATH: "/user/bin"
|
||||
runner: "ubuntu-latest"
|
||||
- bits: 64
|
||||
ARCH: "aarch64"
|
||||
ARCH_NAME: "arm64"
|
||||
COMPILER_PATH: "/user/bin"
|
||||
runner: "ubuntu-24.04-arm"
|
||||
|
||||
runs-on: ${{ matrix.runner }}
|
||||
env:
|
||||
RELEASE_NAME: raylib-dev_linux_${{ matrix.ARCH_NAME }}
|
||||
|
||||
@ -54,7 +60,6 @@ jobs:
|
||||
- name: Setup Environment
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install gcc-multilib
|
||||
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev libwayland-dev libxkbcommon-dev
|
||||
mkdir build
|
||||
cd build
|
||||
@ -64,9 +69,14 @@ jobs:
|
||||
mkdir lib
|
||||
cd ../../../raylib
|
||||
# ${{ matrix.ARCH }}-linux-gnu-gcc -v
|
||||
|
||||
- name: Setup Environment (x86)
|
||||
run : |
|
||||
sudo apt-get install gcc-multilib
|
||||
if: matrix.bits == 32 && matrix.ARCH == 'i386'
|
||||
|
||||
# TODO: Support 32bit (i386) static/shared library building
|
||||
- name: Build Library
|
||||
- name: Build Library (32-bit)
|
||||
run: |
|
||||
cd src
|
||||
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CUSTOM_CFLAGS="-m32" -B
|
||||
@ -74,13 +84,21 @@ jobs:
|
||||
cd ..
|
||||
if: matrix.bits == 32
|
||||
|
||||
- name: Build Library
|
||||
- name: Build Library (64-bit x86)
|
||||
run: |
|
||||
cd src
|
||||
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||
cd ..
|
||||
if: matrix.bits == 64
|
||||
if: matrix.bits == 64 && matrix.ARCH == 'x86_64'
|
||||
|
||||
- name: Build Library (64-bit ARM)
|
||||
run: |
|
||||
cd src
|
||||
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||
cd ..
|
||||
if: matrix.bits == 64 && matrix.ARCH == 'aarch64'
|
||||
|
||||
- name: Generate Artifacts
|
||||
run: |
|
||||
|
||||
1
.github/workflows/windows.yml
vendored
1
.github/workflows/windows.yml
vendored
@ -54,7 +54,6 @@ jobs:
|
||||
- compiler: mingw-w64
|
||||
ziptarget: winarm64 # We don't build arm64 with mingw-w64 yet
|
||||
|
||||
|
||||
env:
|
||||
RELEASE_NAME: raylib-dev_${{ matrix.ziptarget }}_${{ matrix.compiler }}
|
||||
GNUTARGET: default
|
||||
|
||||
@ -106,6 +106,9 @@ BUILD_WEB_SHELL ?= $(RAYLIB_PATH)/src/minshell.html
|
||||
BUILD_WEB_HEAP_SIZE ?= 134217728
|
||||
BUILD_WEB_RESOURCES ?= TRUE
|
||||
BUILD_WEB_RESOURCES_PATH ?= $(dir $<)resources@resources
|
||||
# Use WebGL2 backend (OpenGL 3.0)
|
||||
# WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3
|
||||
BUILD_WEB_WEBGL2 ?= FALSE
|
||||
|
||||
# Determine PLATFORM_OS when required
|
||||
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
@ -186,7 +189,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
|
||||
endif
|
||||
endif
|
||||
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
# HTML5 emscripten compiler
|
||||
# HTML5 emscripten compiler
|
||||
# WARNING: To compile to HTML5, code must be redesigned
|
||||
# to use emscripten.h and emscripten_set_main_loop()
|
||||
CC = emcc
|
||||
@ -269,8 +272,8 @@ endif
|
||||
# NOTE: Some external/extras libraries could be required (stb, easings...)
|
||||
#------------------------------------------------------------------------------------------------
|
||||
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external $(EXTRA_INCLUDE_PATHS)
|
||||
# Define additional directories containing required header files
|
||||
|
||||
# Define additional directories containing required header files
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
|
||||
ifeq ($(PLATFORM_OS),BSD)
|
||||
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH) -I/usr/pkg/include -I/usr/X11R7/include
|
||||
@ -287,11 +290,6 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
|
||||
INCLUDE_PATHS += -I/usr/include/libdrm
|
||||
endif
|
||||
|
||||
# Include GLFW required for examples/others/rlgl_standalone.c
|
||||
ifeq ($(USE_EXTERNAL_GLFW),FALSE)
|
||||
all others: INCLUDE_PATHS += -I$(RAYLIB_PATH)/src/external/glfw/include
|
||||
endif
|
||||
|
||||
# Define library paths containing required libs: LDFLAGS
|
||||
#------------------------------------------------------------------------------------------------
|
||||
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
|
||||
@ -340,18 +338,24 @@ ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_R
|
||||
# --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
|
||||
LDFLAGS += -sTOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -sFORCE_FILESYSTEM=1 -sEXPORTED_RUNTIME_METHODS=ccall -sMINIFY_HTML=0
|
||||
|
||||
# Using GLFW3 library (instead of RGFW)
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
|
||||
LDFLAGS += -sUSE_GLFW=3
|
||||
endif
|
||||
|
||||
# Build using asyncify
|
||||
# Build using asyncify
|
||||
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
|
||||
LDFLAGS += -sASYNCIFY
|
||||
endif
|
||||
|
||||
# NOTE: Flags required for WebGL 2.0 (OpenGL ES 3.0)
|
||||
# WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3
|
||||
ifeq ($(BUILD_WEB_WEBGL2),TRUE)
|
||||
LDFLAGS += -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2
|
||||
endif
|
||||
|
||||
# Add resources building if required
|
||||
ifeq ($(BUILD_WEB_RESOURCES),TRUE)
|
||||
LDFLAGS += --preload-file $(BUILD_WEB_RESOURCES_PATH)
|
||||
@ -491,6 +495,7 @@ endif
|
||||
|
||||
# Define source code object files required
|
||||
#------------------------------------------------------------------------------------------------
|
||||
#EXAMPLES_LIST_START
|
||||
CORE = \
|
||||
core/core_2d_camera \
|
||||
core/core_2d_camera_mouse_zoom \
|
||||
@ -534,6 +539,8 @@ SHAPES = \
|
||||
shapes/shapes_bouncing_ball \
|
||||
shapes/shapes_collision_area \
|
||||
shapes/shapes_colors_palette \
|
||||
shapes/shapes_digital_clock \
|
||||
shapes/shapes_double_pendulum \
|
||||
shapes/shapes_draw_circle_sector \
|
||||
shapes/shapes_draw_rectangle_rounded \
|
||||
shapes/shapes_draw_ring \
|
||||
@ -547,9 +554,7 @@ SHAPES = \
|
||||
shapes/shapes_rectangle_advanced \
|
||||
shapes/shapes_rectangle_scaling \
|
||||
shapes/shapes_splines_drawing \
|
||||
shapes/shapes_top_down_lights \
|
||||
shapes/shapes_digital_clock \
|
||||
shapes/shapes_double_pendulum
|
||||
shapes/shapes_top_down_lights
|
||||
|
||||
TEXTURES = \
|
||||
textures/textures_background_scrolling \
|
||||
@ -644,9 +649,9 @@ SHADERS = \
|
||||
shaders/shaders_texture_outline \
|
||||
shaders/shaders_texture_tiling \
|
||||
shaders/shaders_texture_waves \
|
||||
shaders/shaders_vertex_displacement \
|
||||
shaders/shaders_view_depth \
|
||||
shaders/shaders_write_depth \
|
||||
shaders/shaders_vertex_displacement
|
||||
shaders/shaders_write_depth
|
||||
|
||||
AUDIO = \
|
||||
audio/audio_mixed_processor \
|
||||
@ -663,18 +668,16 @@ OTHERS = \
|
||||
others/embedded_files_loading \
|
||||
others/raylib_opengl_interop \
|
||||
others/raymath_vector_angle \
|
||||
others/rlgl_compute_shader
|
||||
|
||||
ifeq ($(TARGET_PLATFORM), PLATFORM_DESKTOP_GFLW)
|
||||
OTHERS += others/rlgl_standalone
|
||||
endif
|
||||
others/rlgl_compute_shader \
|
||||
others/rlgl_standalone
|
||||
#EXAMPLES_LIST_END
|
||||
|
||||
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
|
||||
|
||||
# Define processes to execute
|
||||
#------------------------------------------------------------------------------------------------
|
||||
# Default target entry
|
||||
all: $(CORE) $(SHAPES) $(TEXT) $(TEXTURES) $(MODELS) $(SHADERS) $(AUDIO) $(OTHERS)
|
||||
all: $(CORE) $(SHAPES) $(TEXT) $(TEXTURES) $(MODELS) $(SHADERS) $(AUDIO)
|
||||
|
||||
core: $(CORE)
|
||||
shapes: $(SHAPES)
|
||||
@ -683,7 +686,7 @@ text: $(TEXT)
|
||||
models: $(MODELS)
|
||||
shaders: $(SHADERS)
|
||||
audio: $(AUDIO)
|
||||
others: $(OTHERS)
|
||||
|
||||
|
||||
# Generic compilation pattern
|
||||
# NOTE: Examples must be ready for Android compilation!
|
||||
|
||||
@ -1,6 +1,34 @@
|
||||
#**************************************************************************************************
|
||||
#
|
||||
# raylib makefile for Web platform
|
||||
# raylib makefile for multiple platforms
|
||||
#
|
||||
# This file supports building raylib examples for the following platforms:
|
||||
#
|
||||
# > PLATFORM_DESKTOP
|
||||
# - Defaults to PLATFORM_DESKTOP_GLFW
|
||||
# > PLATFORM_DESKTOP_GFLW (GLFW backend):
|
||||
# - Windows (Win32, Win64)
|
||||
# - Linux (X11/Wayland desktop mode)
|
||||
# - macOS/OSX (x64, arm64)
|
||||
# - FreeBSD, OpenBSD, NetBSD, DragonFly (X11 desktop)
|
||||
# > PLATFORM_DESKTOP_SDL (SDL backend):
|
||||
# - Windows (Win32, Win64)
|
||||
# - Linux (X11/Wayland desktop mode)
|
||||
# - Others (not tested)
|
||||
# > PLATFORM_DESKTOP_RGFW (RGFW backend):
|
||||
# - Windows (Win32, Win64)
|
||||
# - Linux (X11 desktop mode)
|
||||
# - macOS/OSX (x64, arm64 (not tested))
|
||||
# - Others (not tested)
|
||||
# > PLATFORM_WEB_RGFW:
|
||||
# - HTML5 (WebAssembly)
|
||||
# > PLATFORM_WEB:
|
||||
# - HTML5 (WebAssembly)
|
||||
# > PLATFORM_DRM:
|
||||
# - Raspberry Pi 0-5 (DRM/KMS)
|
||||
# - Linux DRM subsystem (KMS mode)
|
||||
# > PLATFORM_ANDROID:
|
||||
# - Android (ARM, ARM64)
|
||||
#
|
||||
# Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)
|
||||
#
|
||||
@ -25,9 +53,20 @@
|
||||
|
||||
# Define required environment variables
|
||||
#------------------------------------------------------------------------------------------------
|
||||
# Define target platform: PLATFORM_DESKTOP, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB
|
||||
# Define target platform: PLATFORM_DESKTOP, PLATFORM_DESKTOP_SDL, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB, PLATFORM_WEB_RGFW
|
||||
PLATFORM ?= PLATFORM_WEB
|
||||
|
||||
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW))
|
||||
TARGET_PLATFORM := $(PLATFORM)
|
||||
override PLATFORM = PLATFORM_DESKTOP
|
||||
else
|
||||
ifeq ($(PLATFORM), PLATFORM_DESKTOP)
|
||||
TARGET_PLATFORM = PLATFORM_DESKTOP_GLFW
|
||||
else
|
||||
TARGET_PLATFORM = $(PLATFORM)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Define required raylib variables
|
||||
PROJECT_NAME ?= raylib_examples
|
||||
RAYLIB_VERSION ?= 5.5.0
|
||||
@ -51,6 +90,12 @@ BUILD_MODE ?= RELEASE
|
||||
# Use external GLFW library instead of rglfw module
|
||||
USE_EXTERNAL_GLFW ?= FALSE
|
||||
|
||||
# PLATFORM_DESKTOP_SDL: It requires SDL library to be provided externally
|
||||
# WARNING: Library is not included in raylib, it MUST be configured by users
|
||||
SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/include
|
||||
SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/lib
|
||||
SDL_LIBRARIES ?= -lSDL2 -lSDL2main
|
||||
|
||||
# Use Wayland display server protocol on Linux desktop (by default it uses X11 windowing system)
|
||||
# NOTE: This variable is only used for PLATFORM_OS: LINUX
|
||||
USE_WAYLAND_DISPLAY ?= FALSE
|
||||
@ -59,13 +104,14 @@ USE_WAYLAND_DISPLAY ?= FALSE
|
||||
BUILD_WEB_ASYNCIFY ?= TRUE
|
||||
BUILD_WEB_SHELL ?= $(RAYLIB_PATH)/src/shell.html
|
||||
BUILD_WEB_HEAP_SIZE ?= 134217728
|
||||
|
||||
BUILD_WEB_RESOURCES ?= TRUE
|
||||
BUILD_WEB_RESOURCES_PATH ?= $(dir $<)resources@resources
|
||||
# Use WebGL2 backend (OpenGL 3.0)
|
||||
# WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3
|
||||
USE_WEBGL2 ?= FALSE
|
||||
BUILD_WEB_WEBGL2 ?= FALSE
|
||||
|
||||
# Determine PLATFORM_OS in case PLATFORM_DESKTOP or PLATFORM_WEB selected
|
||||
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
# Determine PLATFORM_OS when required
|
||||
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
|
||||
# ifeq ($(UNAME),Msys) -> Windows
|
||||
ifeq ($(OS),Windows_NT)
|
||||
@ -92,7 +138,7 @@ ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_WEB PLATFORM_WE
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
ifeq ($(PLATFORM),PLATFORM_DRM)
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
|
||||
UNAMEOS = $(shell uname)
|
||||
ifeq ($(UNAMEOS),Linux)
|
||||
PLATFORM_OS = LINUX
|
||||
@ -101,7 +147,7 @@ endif
|
||||
|
||||
# RAYLIB_PATH adjustment for LINUX platform
|
||||
# TODO: Do we really need this?
|
||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
|
||||
ifeq ($(PLATFORM_OS),LINUX)
|
||||
RAYLIB_PREFIX ?= ..
|
||||
RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX))
|
||||
@ -109,14 +155,14 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||
endif
|
||||
|
||||
# Default path for raylib on Raspberry Pi
|
||||
ifeq ($(PLATFORM),PLATFORM_DRM)
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
|
||||
RAYLIB_PATH ?= /home/pi/raylib
|
||||
endif
|
||||
|
||||
# Define raylib release directory for compiled library
|
||||
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src
|
||||
|
||||
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||
# Emscripten required variables
|
||||
EMSDK_PATH ?= C:/raylib/emsdk
|
||||
@ -132,7 +178,7 @@ endif
|
||||
#------------------------------------------------------------------------------------------------
|
||||
CC = gcc
|
||||
|
||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
|
||||
ifeq ($(PLATFORM_OS),OSX)
|
||||
# OSX default compiler
|
||||
CC = clang
|
||||
@ -142,7 +188,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||
CC = clang
|
||||
endif
|
||||
endif
|
||||
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
# HTML5 emscripten compiler
|
||||
# WARNING: To compile to HTML5, code must be redesigned
|
||||
# to use emscripten.h and emscripten_set_main_loop()
|
||||
@ -153,15 +199,15 @@ endif
|
||||
#------------------------------------------------------------------------------------------------
|
||||
MAKE ?= make
|
||||
|
||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
|
||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||
MAKE = mingw32-make
|
||||
endif
|
||||
endif
|
||||
ifeq ($(PLATFORM),PLATFORM_ANDROID)
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
|
||||
MAKE = mingw32-make
|
||||
endif
|
||||
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
ifeq ($(OS),Windows_NT)
|
||||
MAKE = mingw32-make
|
||||
else
|
||||
@ -190,14 +236,14 @@ CFLAGS = -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result
|
||||
ifeq ($(BUILD_MODE),DEBUG)
|
||||
CFLAGS += -g -D_DEBUG
|
||||
else
|
||||
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
|
||||
CFLAGS += -O3
|
||||
else
|
||||
CFLAGS += -Os
|
||||
endif
|
||||
else
|
||||
CFLAGS += -s -O2
|
||||
CFLAGS += -O2
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -207,7 +253,7 @@ endif
|
||||
# -Wstrict-prototypes warn if a function is declared or defined without specifying the argument types
|
||||
# -Werror=implicit-function-declaration catch function calls without prior declaration
|
||||
#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes
|
||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
|
||||
ifeq ($(PLATFORM_OS),LINUX)
|
||||
ifeq ($(RAYLIB_LIBTYPE),STATIC)
|
||||
CFLAGS += -D_DEFAULT_SOURCE
|
||||
@ -218,25 +264,29 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
ifeq ($(PLATFORM),PLATFORM_DRM)
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
|
||||
CFLAGS += -std=gnu99 -DEGL_NO_X11
|
||||
endif
|
||||
|
||||
# Define include paths for required headers: INCLUDE_PATHS
|
||||
# NOTE: Some external/extras libraries could be required (stb, easings...)
|
||||
#------------------------------------------------------------------------------------------------
|
||||
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external
|
||||
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external $(EXTRA_INCLUDE_PATHS)
|
||||
|
||||
# Define additional directories containing required header files
|
||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
|
||||
ifeq ($(PLATFORM_OS),BSD)
|
||||
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
|
||||
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH) -I/usr/pkg/include -I/usr/X11R7/include
|
||||
endif
|
||||
ifeq ($(PLATFORM_OS),LINUX)
|
||||
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
|
||||
endif
|
||||
endif
|
||||
ifeq ($(PLATFORM),PLATFORM_DRM)
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL)
|
||||
INCLUDE_PATHS += -I$(SDL_INCLUDE_PATH)
|
||||
endif
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
|
||||
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
|
||||
INCLUDE_PATHS += -I/usr/include/libdrm
|
||||
endif
|
||||
|
||||
@ -244,7 +294,7 @@ endif
|
||||
#------------------------------------------------------------------------------------------------
|
||||
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
|
||||
|
||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
|
||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||
# NOTE: The resource .rc file contains windows executable icon and properties
|
||||
LDFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data
|
||||
@ -260,7 +310,18 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||
LDFLAGS += -Lsrc -L$(RAYLIB_LIB_PATH)
|
||||
endif
|
||||
endif
|
||||
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL)
|
||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||
# NOTE: The resource .rc file contains windows executable icon and properties
|
||||
LDFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data
|
||||
# -Wl,--subsystem,windows hides the console window
|
||||
ifeq ($(BUILD_MODE), RELEASE)
|
||||
LDFLAGS += -Wl,--subsystem,windows
|
||||
endif
|
||||
endif
|
||||
LDFLAGS += -L$(SDL_LIBRARY_PATH)
|
||||
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)
|
||||
@ -277,10 +338,10 @@ ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
# --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
|
||||
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)
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
|
||||
LDFLAGS += -sUSE_GLFW=3
|
||||
endif
|
||||
|
||||
@ -291,9 +352,14 @@ ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
|
||||
# NOTE: Flags required for WebGL 2.0 (OpenGL ES 3.0)
|
||||
# WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3
|
||||
ifeq ($(USE_WEBGL2),TRUE)
|
||||
ifeq ($(BUILD_WEB_WEBGL2),TRUE)
|
||||
LDFLAGS += -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2
|
||||
endif
|
||||
|
||||
# Add resources building if required
|
||||
ifeq ($(BUILD_WEB_RESOURCES),TRUE)
|
||||
LDFLAGS += --preload-file $(BUILD_WEB_RESOURCES_PATH)
|
||||
endif
|
||||
|
||||
# Add debug mode flags if required
|
||||
ifeq ($(BUILD_MODE),DEBUG)
|
||||
@ -314,7 +380,7 @@ endif
|
||||
# Define libraries required on linking: LDLIBS
|
||||
# NOTE: To link libraries (lib<name>.so or lib<name>.a), use -l<name>
|
||||
#------------------------------------------------------------------------------------------------
|
||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
|
||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||
# Libraries for Windows desktop compilation
|
||||
# NOTE: WinMM library required to set high-res timer resolution
|
||||
@ -361,18 +427,75 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||
LDLIBS += -lglfw
|
||||
endif
|
||||
endif
|
||||
ifeq ($(PLATFORM),PLATFORM_DRM)
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL)
|
||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||
# Libraries for Windows desktop compilation
|
||||
LDLIBS = -lraylib $(SDL_LIBRARIES) -lopengl32 -lgdi32
|
||||
endif
|
||||
ifeq ($(PLATFORM_OS),LINUX)
|
||||
# Libraries for Debian GNU/Linux desktop compiling
|
||||
# NOTE: Required packages: libegl1-mesa-dev
|
||||
LDLIBS = -lraylib $(SDL_LIBRARIES) -lGL -lm -lpthread -ldl -lrt
|
||||
|
||||
# On X11 requires also below libraries
|
||||
LDLIBS += -lX11
|
||||
# NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them
|
||||
#LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
|
||||
|
||||
# On Wayland windowing system, additional libraries requires
|
||||
ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
|
||||
LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
|
||||
endif
|
||||
# Explicit link to libc
|
||||
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
||||
LDLIBS += -lc
|
||||
endif
|
||||
|
||||
# NOTE: On ARM 32bit arch, miniaudio requires atomics library
|
||||
LDLIBS += -latomic
|
||||
endif
|
||||
endif
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_RGFW)
|
||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||
# Libraries for Windows desktop compilation
|
||||
LDFLAGS += -L..\src
|
||||
LDLIBS = -lraylib -lgdi32 -lwinmm -lopengl32
|
||||
endif
|
||||
ifeq ($(PLATFORM_OS),LINUX)
|
||||
# Libraries for Debian GNU/Linux desktop compipling
|
||||
# NOTE: Required packages: libegl1-mesa-dev
|
||||
LDFLAGS += -L../src
|
||||
LDLIBS = -lraylib -lGL -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor -lm -lpthread -ldl -lrt
|
||||
|
||||
# Explicit link to libc
|
||||
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
||||
LDLIBS += -lc
|
||||
endif
|
||||
|
||||
# NOTE: On ARM 32bit arch, miniaudio requires atomics library
|
||||
LDLIBS += -latomic
|
||||
endif
|
||||
ifeq ($(PLATFORM_OS),OSX)
|
||||
# Libraries for Debian GNU/Linux desktop compiling
|
||||
# NOTE: Required packages: libegl1-mesa-dev
|
||||
LDFLAGS += -L../src
|
||||
LDLIBS = -lraylib -lm
|
||||
LDLIBS += -framework Foundation -framework AppKit -framework IOKit -framework OpenGL -framework CoreVideo
|
||||
endif
|
||||
endif
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
|
||||
# Libraries for DRM compiling
|
||||
# NOTE: Required packages: libasound2-dev (ALSA)
|
||||
LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl -latomic
|
||||
endif
|
||||
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
# Libraries for web (HTML5) compiling
|
||||
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.web.a
|
||||
endif
|
||||
|
||||
# Define source code object files required
|
||||
#------------------------------------------------------------------------------------------------
|
||||
#EXAMPLES_LIST_START
|
||||
CORE = \
|
||||
core/core_2d_camera \
|
||||
core/core_2d_camera_mouse_zoom \
|
||||
@ -416,6 +539,8 @@ SHAPES = \
|
||||
shapes/shapes_bouncing_ball \
|
||||
shapes/shapes_collision_area \
|
||||
shapes/shapes_colors_palette \
|
||||
shapes/shapes_digital_clock \
|
||||
shapes/shapes_double_pendulum \
|
||||
shapes/shapes_draw_circle_sector \
|
||||
shapes/shapes_draw_rectangle_rounded \
|
||||
shapes/shapes_draw_ring \
|
||||
@ -429,9 +554,7 @@ SHAPES = \
|
||||
shapes/shapes_rectangle_advanced \
|
||||
shapes/shapes_rectangle_scaling \
|
||||
shapes/shapes_splines_drawing \
|
||||
shapes/shapes_top_down_lights \
|
||||
shapes/shapes_digital_clock \
|
||||
shapes/shapes_double_pendulum
|
||||
shapes/shapes_top_down_lights
|
||||
|
||||
TEXTURES = \
|
||||
textures/textures_background_scrolling \
|
||||
@ -547,6 +670,7 @@ OTHERS = \
|
||||
others/raymath_vector_angle \
|
||||
others/rlgl_compute_shader \
|
||||
others/rlgl_standalone
|
||||
#EXAMPLES_LIST_END
|
||||
|
||||
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
|
||||
|
||||
@ -676,7 +800,6 @@ core/core_window_should_close: core/core_window_should_close.c
|
||||
core/core_world_screen: core/core_world_screen.c
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||
|
||||
|
||||
# Compile SHAPES examples
|
||||
shapes/shapes_basic_shapes: shapes/shapes_basic_shapes.c
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||
@ -735,7 +858,6 @@ shapes/shapes_rectangle_advanced: shapes/shapes_rectangle_advanced.c
|
||||
shapes/shapes_double_pendulum: shapes/shapes_double_pendulum.c
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||
|
||||
|
||||
# Compile TEXTURES examples
|
||||
textures/textures_background_scrolling: textures/textures_background_scrolling.c
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||
@ -846,7 +968,6 @@ textures/textures_to_image: textures/textures_to_image.c
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||
--preload-file textures/resources/raylib_logo.png@resources/raylib_logo.png
|
||||
|
||||
|
||||
# Compile TEXT examples
|
||||
text/text_codepoints_loading: text/text_codepoints_loading.c
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||
@ -1014,7 +1135,6 @@ models/models_yaw_pitch_roll: models/models_yaw_pitch_roll.c
|
||||
--preload-file models/resources/models/obj/plane.obj@resources/models/obj/plane.obj \
|
||||
--preload-file models/resources/models/obj/plane_diffuse.png@resources/models/obj/plane_diffuse.png
|
||||
|
||||
|
||||
# Compile SHADER examples
|
||||
shaders/shaders_basic_lighting: shaders/shaders_basic_lighting.c
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||
@ -1172,7 +1292,6 @@ shaders/shaders_vertex_displacement: shaders/shaders_vertex_displacement.c
|
||||
--preload-file shaders/resources/shaders/glsl100/vertex_displacement.fs@resources/shaders/glsl100/vertex_displacement.fs \
|
||||
--preload-file shaders/resources/shaders/glsl330/vertex_displacement.fs@resources/shaders/glsl330/vertex_displacement.fs
|
||||
|
||||
|
||||
# Compile AUDIO examples
|
||||
audio/audio_mixed_processor: audio/audio_mixed_processor.c
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \
|
||||
@ -1203,7 +1322,6 @@ audio/audio_stream_effects: audio/audio_stream_effects.c
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \
|
||||
--preload-file audio/resources/country.mp3@resources/country.mp3
|
||||
|
||||
|
||||
# Compile OTHERS examples
|
||||
others/easings_testbed: others/easings_testbed.c
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||
|
||||
@ -216,12 +216,12 @@ Examples using raylib audio functionality, including sound/music loading and pla
|
||||
| 148 | [audio_sound_loading](audio/audio_sound_loading.c) | <img src="audio/audio_sound_loading.png" alt="audio_sound_loading" width="80"> | ⭐️☆☆☆ | 1.1 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||
| 149 | [audio_mixed_processor](audio/audio_mixed_processor.c) | <img src="audio/audio_mixed_processor.png" alt="audio_mixed_processor" width="80"> | ⭐️⭐️⭐️⭐️ | 4.2 | 4.2 | [hkc](https://github.com/hatkidchan) |
|
||||
| 150 | [audio_stream_effects](audio/audio_stream_effects.c) | <img src="audio/audio_stream_effects.png" alt="audio_stream_effects" width="80"> | ⭐️⭐️⭐️⭐️ | 4.2 | 5.0 | [Ray](https://github.com/raysan5) |
|
||||
| 151 [audio_sound_multi](audio/audio_sound_multi.c) | <img src="audio/audio_sound_multi.png" alt="audio_sound_multi" width="80"> | ⭐️⭐️☆☆ | 4.6 | 4.6 | [Jeffery Myers](https://github.com/JeffM2501) |
|
||||
| 151 | [audio_sound_multi](audio/audio_sound_multi.c) | <img src="audio/audio_sound_multi.png" alt="audio_sound_multi" width="80"> | ⭐️⭐️☆☆ | 4.6 | 4.6 | [Jeffery Myers](https://github.com/JeffM2501) |
|
||||
| 152 | [audio_sound_positioning](audio/audio_sound_positioning.c) | <img src="audio/audio_sound_positioning.png" alt="audio_sound_positioning" width="80"> | ⭐️⭐️☆☆ | 5.5 | 5.5 | [Le Juez Victor](https://github.com/Bigfoot71) |
|
||||
|
||||
### category: others
|
||||
|
||||
Ex151amples showing raylib misc functionality that does not fit in other categories, like standalone modules usage or examples integrating external libraries.
|
||||
Examples showing raylib misc functionality that does not fit in other categories, like standalone modules usage or examples integrating external libraries.
|
||||
|
||||
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||
|----|----------|--------|:-------------------:|:------------------:|:-----------------------:|:----------------------|
|
||||
|
||||
168
examples/examples_list.txt
Normal file
168
examples/examples_list.txt
Normal file
@ -0,0 +1,168 @@
|
||||
#
|
||||
# raylib examples list used to generate/update collection
|
||||
# examples must be provided as: <example_category>;<example_name>;<example_stars>;<raylib_created_version>;<raylib_last_update_version>;"<example_author_name>";<author_github_user>
|
||||
#
|
||||
# This list is used as the main reference by [rexm] tool for examples collection validation and management
|
||||
# New examples must be added to this list and any possible rename must be made on this list first
|
||||
#
|
||||
# WARNING: List is not ordered by example name but by the display order on web
|
||||
#
|
||||
core;core_basic_window;⭐️☆☆☆;1.0;1.0;"Ray";@raysan5
|
||||
core;core_input_keys;⭐️☆☆☆;1.0;1.0;"Ray";@raysan5
|
||||
core;core_input_mouse;⭐️☆☆☆;1.0;5.5;"Ray";@raysan5
|
||||
core;core_input_mouse_wheel;⭐️☆☆☆;1.1;1.3;"Ray";@raysan5
|
||||
core;core_input_gamepad;⭐️☆☆☆;1.1;4.2;"Ray";@raysan5
|
||||
core;core_input_multitouch;⭐️☆☆☆;2.1;2.5;"Berni";@Berni8k
|
||||
core;core_input_gestures;⭐️⭐️☆☆;1.4;4.2;"Ray";@raysan5
|
||||
core;core_input_virtual_controls;⭐️⭐️☆☆;5.0;5.0;"oblerion";@oblerion
|
||||
core;core_2d_camera;⭐️⭐️☆☆;1.5;3.0;"Ray";@raysan5
|
||||
core;core_2d_camera_mouse_zoom;⭐️⭐️☆☆;4.2;4.2;"Jeffery Myers";@JeffM2501
|
||||
core;core_2d_camera_platformer;⭐️⭐️⭐️☆;2.5;3.0;"arvyy";@arvyy
|
||||
core;core_2d_camera_split_screen;⭐️⭐️⭐️⭐️;4.5;4.5;"Gabriel dos Santos Sanches";@gabrielssanches
|
||||
core;core_3d_camera_mode;⭐️☆☆☆;1.0;1.0;"Ray";@raysan5
|
||||
core;core_3d_camera_free;⭐️☆☆☆;1.3;1.3;"Ray";@raysan5
|
||||
core;core_3d_camera_first_person;⭐️⭐️☆☆;1.3;1.3;"Ray";@raysan5
|
||||
core;core_3d_camera_split_screen;⭐️⭐️⭐️☆;3.7;4.0;"Jeffery Myers";@JeffM2501
|
||||
core;core_3d_picking;⭐️⭐️☆☆;1.3;4.0;"Ray";@raysan5
|
||||
core;core_world_screen;⭐️⭐️☆☆;1.3;1.4;"Ray";@raysan5
|
||||
core;core_custom_logging;⭐️⭐️⭐️☆;2.5;2.5;"Pablo Marcos Oltra";@pamarcos
|
||||
core;core_window_flags;⭐️⭐️⭐️☆;3.5;3.5;"Ray";@raysan5
|
||||
core;core_window_letterbox;⭐️⭐️☆☆;2.5;4.0;"Anata";@anatagawa
|
||||
core;core_window_should_close;⭐️☆☆☆;4.2;4.2;"Ray";@raysan5
|
||||
core;core_drop_files;⭐️⭐️☆☆;1.3;4.2;"Ray";@raysan5
|
||||
core;core_random_values;⭐️☆☆☆;1.1;1.1;"Ray";@raysan5
|
||||
core;core_storage_values;⭐️⭐️☆☆;1.4;4.2;"Ray";@raysan5
|
||||
core;core_vr_simulator;⭐️⭐️⭐️☆;2.5;4.0;"Ray";@raysan5
|
||||
core;core_loading_thread;⭐️⭐️⭐️☆;2.5;3.0;"Ray";@raysan5
|
||||
core;core_scissor_test;⭐️☆☆☆;2.5;3.0;"Chris Dill";@MysteriousSpace
|
||||
core;core_basic_screen_manager;⭐️☆☆☆;4.0;4.0;"Ray";@raysan5
|
||||
core;core_custom_frame_control;⭐️⭐️⭐️⭐️;4.0;4.0;"Ray";@raysan5
|
||||
core;core_smooth_pixelperfect;⭐️⭐️⭐️☆;3.7;4.0;"Giancamillo Alessandroni";@NotManyIdeasDev
|
||||
core;core_random_sequence;⭐️☆☆☆;5.0;5.0;"Dalton Overmyer";@REDl3east
|
||||
core;core_basic_window_web;⭐️☆☆☆;1.3;1.3;"Ray";@raysan5
|
||||
core;core_input_gestures_web;⭐️⭐️☆☆;4.6-dev;4.6-dev;"ubkp";@ubkp
|
||||
core;core_automation_events;⭐️⭐️⭐️☆;5.0;5.0;"Ray";@raysan5
|
||||
core;core_high_dpi;⭐️☆☆☆;5.0;5.0;"Jonathan Marler";@marler8997
|
||||
shapes;shapes_basic_shapes;⭐️☆☆☆;1.0;4.2;"Ray";@raysan5
|
||||
shapes;shapes_bouncing_ball;⭐️☆☆☆;2.5;2.5;"Ray";@raysan5
|
||||
shapes;shapes_colors_palette;⭐️⭐️☆☆;1.0;2.5;"Ray";@raysan5
|
||||
shapes;shapes_logo_raylib;⭐️☆☆☆;1.0;1.0;"Ray";@raysan5
|
||||
shapes;shapes_logo_raylib_anim;⭐️⭐️☆☆;2.5;4.0;"Ray";@raysan5
|
||||
shapes;shapes_rectangle_scaling;⭐️⭐️☆☆;2.5;2.5;"Vlad Adrian";@demizdor
|
||||
shapes;shapes_lines_bezier;⭐️☆☆☆;1.7;1.7;"Ray";@raysan5
|
||||
shapes;shapes_collision_area;⭐️⭐️☆☆;2.5;2.5;"Ray";@raysan5
|
||||
shapes;shapes_following_eyes;⭐️⭐️☆☆;2.5;2.5;"Ray";@raysan5
|
||||
shapes;shapes_easings_ball_anim;⭐️⭐️☆☆;2.5;2.5;"Ray";@raysan5
|
||||
shapes;shapes_easings_box_anim;⭐️⭐️☆☆;2.5;2.5;"Ray";@raysan5
|
||||
shapes;shapes_easings_rectangle_array;⭐️⭐️⭐️☆;2.0;2.5;"Ray";@raysan5
|
||||
shapes;shapes_draw_ring;⭐️⭐️⭐️☆;2.5;2.5;"Vlad Adrian";@demizdor
|
||||
shapes;shapes_draw_circle_sector;⭐️⭐️⭐️☆;2.5;2.5;"Vlad Adrian";@demizdor
|
||||
shapes;shapes_draw_rectangle_rounded;⭐️⭐️⭐️☆;2.5;2.5;"Vlad Adrian";@demizdor
|
||||
shapes;shapes_top_down_lights;⭐️⭐️⭐️⭐️;4.2;4.2;"Jeffery Myers";@JeffM2501
|
||||
shapes;shapes_rectangle_advanced;⭐️⭐️⭐️⭐️;5.5;5.5;"Everton Jr.";@evertonse
|
||||
shapes;shapes_splines_drawing;⭐️⭐️⭐️☆;5.0;5.0;"Ray";@raysan5
|
||||
shapes;shapes_digital_clock;⭐️⭐️☆☆;5.5;5.5;"Hamza RAHAL";@rhmz-rhl
|
||||
shapes;shapes_double_pendulum;⭐️⭐️☆☆;5.5;5.5;"JoeCheong";@Joecheong2006
|
||||
textures;textures_logo_raylib;⭐️☆☆☆;1.0;1.0;"Ray";@raysan5
|
||||
textures;textures_srcrec_dstrec;⭐️⭐️⭐️☆;1.3;1.3;"Ray";@raysan5
|
||||
textures;textures_image_drawing;⭐️⭐️☆☆;1.4;1.4;"Ray";@raysan5
|
||||
textures;textures_image_generation;⭐️⭐️☆☆;1.8;1.8;"Wilhem Barbier";@nounoursheureux
|
||||
textures;textures_image_loading;⭐️☆☆☆;1.3;1.3;"Ray";@raysan5
|
||||
textures;textures_image_processing;⭐️⭐️⭐️☆;1.4;3.5;"Ray";@raysan5
|
||||
textures;textures_image_text;⭐️⭐️☆☆;1.8;4.0;"Ray";@raysan5
|
||||
textures;textures_to_image;⭐️☆☆☆;1.3;4.0;"Ray";@raysan5
|
||||
textures;textures_raw_data;⭐️⭐️⭐️☆;1.3;3.5;"Ray";@raysan5
|
||||
textures;textures_particles_blending;⭐️☆☆☆;1.7;3.5;"Ray";@raysan5
|
||||
textures;textures_npatch_drawing;⭐️⭐️⭐️☆;2.0;2.5;"Jorge A. Gomes";@overdev
|
||||
textures;textures_background_scrolling;⭐️☆☆☆;2.0;2.5;"Ray";@raysan5
|
||||
textures;textures_sprite_anim;⭐️⭐️☆☆;1.3;1.3;"Ray";@raysan5
|
||||
textures;textures_sprite_button;⭐️⭐️☆☆;2.5;2.5;"Ray";@raysan5
|
||||
textures;textures_sprite_explosion;⭐️⭐️☆☆;2.5;3.5;"Ray";@raysan5
|
||||
textures;textures_bunnymark;⭐️⭐️⭐️☆;1.6;2.5;"Ray";@raysan5
|
||||
textures;textures_mouse_painting;⭐️⭐️⭐️☆;3.0;3.0;"Chris Dill";@MysteriousSpace
|
||||
textures;textures_blend_modes;⭐️☆☆☆;3.5;3.5;"Karlo Licudine";@accidentalrebel
|
||||
textures;textures_draw_tiled;⭐️⭐️⭐️☆;3.0;4.2;"Vlad Adrian";@demizdor
|
||||
textures;textures_polygon;⭐️☆☆☆;3.7;3.7;"Chris Camacho";@chriscamacho
|
||||
textures;textures_fog_of_war;⭐️⭐️⭐️☆;4.2;4.2;"Ray";@raysan5
|
||||
textures;textures_gif_player;⭐️⭐️⭐️☆;4.2;4.2;"Ray";@raysan5
|
||||
textures;textures_image_kernel;⭐️⭐️⭐️⭐️;1.3;1.3;"Karim Salem";@kimo-s
|
||||
textures;textures_image_channel;⭐️⭐️☆☆;5.1-dev;5.1-dev;"Bruno Cabral";@brccabral
|
||||
textures;textures_image_rotate;⭐️⭐️☆☆;1.0;1.0;"Ray";@raysan5
|
||||
textures;textures_textured_curve;⭐️⭐️⭐️☆;4.5;4.5;"Jeffery Myers";@JeffM2501
|
||||
text;text_raylib_fonts;⭐️☆☆☆;1.7;3.7;"Ray";@raysan5
|
||||
text;text_font_spritefont;⭐️☆☆☆;1.0;1.0;"Ray";@raysan5
|
||||
text;text_font_filters;⭐️⭐️☆☆;1.3;4.2;"Ray";@raysan5
|
||||
text;text_font_loading;⭐️☆☆☆;1.4;3.0;"Ray";@raysan5
|
||||
text;text_font_sdf;⭐️⭐️⭐️☆;1.3;4.0;"Ray";@raysan5
|
||||
text;text_format_text;⭐️☆☆☆;1.1;3.0;"Ray";@raysan5
|
||||
text;text_input_box;⭐️⭐️☆☆;1.7;3.5;"Ray";@raysan5
|
||||
text;text_writing_anim;⭐️⭐️☆☆;1.4;1.4;"Ray";@raysan5
|
||||
text;text_rectangle_bounds;⭐️⭐️⭐️⭐️;2.5;4.0;"Vlad Adrian";@demizdor
|
||||
text;text_unicode;⭐️⭐️⭐️⭐️;2.5;4.0;"Vlad Adrian";@demizdor
|
||||
text;text_draw_3d;⭐️⭐️⭐️⭐️;3.5;4.0;"Vlad Adrian";@demizdor
|
||||
text;text_codepoints_loading;⭐️⭐️⭐️☆;4.2;4.2;"Ray";@raysan5
|
||||
models;models_animation;⭐️⭐️☆☆;2.5;3.5;"Culacant";@culacant
|
||||
models;models_billboard;⭐️⭐️⭐️☆;1.3;3.5;"Ray";@raysan5
|
||||
models;models_box_collisions;⭐️☆☆☆;1.3;3.5;"Ray";@raysan5
|
||||
models;models_cubicmap;⭐️⭐️☆☆;1.8;3.5;"Ray";@raysan5
|
||||
models;models_first_person_maze;⭐️⭐️☆☆;2.5;3.5;"Ray";@raysan5
|
||||
models;models_geometric_shapes;⭐️☆☆☆;1.0;3.5;"Ray";@raysan5
|
||||
models;models_mesh_generation;⭐️⭐️☆☆;1.8;4.0;"Ray";@raysan5
|
||||
models;models_mesh_picking;⭐️⭐️⭐️☆;1.7;4.0;"Joel Davis";@joeld42
|
||||
models;models_loading;⭐️☆☆☆;2.0;4.2;"Ray";@raysan5
|
||||
models;models_loading_gltf;⭐️☆☆☆;3.7;4.2;"Ray";@raysan5
|
||||
models;models_loading_vox;⭐️☆☆☆;4.0;4.0;"Johann Nadalutti";@procfxgen
|
||||
models;models_loading_m3d;⭐️⭐️☆☆;4.5;4.5;"bzt";@model3d
|
||||
models;models_orthographic_projection;⭐️☆☆☆;2.0;3.7;"Max Danielsson";@autious
|
||||
models;models_point_rendering;⭐️⭐️⭐️☆;5.0;5.0;"Reese Gallagher";@satchelfrost
|
||||
models;models_rlgl_solar_system;⭐️⭐️⭐️⭐️;2.5;4.0;"Ray";@raysan5
|
||||
models;models_yaw_pitch_roll;⭐️⭐️☆☆;1.8;4.0;"Berni";@Berni8k
|
||||
models;models_waving_cubes;⭐️⭐️⭐️☆;2.5;3.7;"Codecat";@codecat
|
||||
models;models_heightmap;⭐️☆☆☆;1.8;3.5;"Ray";@raysan5
|
||||
models;models_skybox;⭐️⭐️☆☆;1.8;4.0;"Ray";@raysan5
|
||||
models;models_draw_cube_texture;⭐️⭐️☆☆;4.5;4.5;"Ray";@raysan5
|
||||
models;models_gpu_skinning;⭐️⭐️⭐️☆;4.5;4.5;"Daniel Holden";@orangeduck
|
||||
models;models_bone_socket;⭐️⭐️⭐️⭐️;4.5;4.5;"iP";@ipzaur
|
||||
models;models_tesseract_view;⭐️⭐️☆☆;5.6-dev;5.6-dev;"Timothy van der Valk";@arceryz
|
||||
shaders;shaders_basic_lighting;⭐️⭐️⭐️⭐️;3.0;4.2;"Chris Camacho";@chriscamacho
|
||||
shaders;shaders_model_shader;⭐️⭐️☆☆;1.3;3.7;"Ray";@raysan5
|
||||
shaders;shaders_shapes_textures;⭐️⭐️☆☆;1.7;3.7;"Ray";@raysan5
|
||||
shaders;shaders_custom_uniform;⭐️⭐️☆☆;1.3;4.0;"Ray";@raysan5
|
||||
shaders;shaders_postprocessing;⭐️⭐️⭐️☆;1.3;4.0;"Ray";@raysan5
|
||||
shaders;shaders_palette_switch;⭐️⭐️⭐️☆;2.5;3.7;"Marco Lizza";@MarcoLizza
|
||||
shaders;shaders_raymarching;⭐️⭐️⭐️⭐️;2.0;4.2;"Ray";@raysan5
|
||||
shaders;shaders_texture_drawing;⭐️⭐️☆☆;2.0;3.7;"Michał Ciesielski";@ciessielski
|
||||
shaders;shaders_texture_outline;⭐️⭐️⭐️☆;4.0;4.0;"Samuel Skiff";@GoldenThumbs
|
||||
shaders;shaders_texture_waves;⭐️⭐️☆☆;2.5;3.7;"Anata";@anatagawa
|
||||
shaders;shaders_julia_set;⭐️⭐️⭐️☆;2.5;4.0;"Josh Colclough";@joshcol9232
|
||||
shaders;shaders_eratosthenes;⭐️⭐️⭐️☆;2.5;4.0;"ProfJski";@ProfJski
|
||||
shaders;shaders_fog;⭐️⭐️⭐️☆;2.5;3.7;"Chris Camacho";@chriscamacho
|
||||
shaders;shaders_simple_mask;⭐️⭐️☆☆;2.5;3.7;"Chris Camacho";@chriscamacho
|
||||
shaders;shaders_hot_reloading;⭐️⭐️⭐️☆;3.0;3.5;"Ray";@raysan5
|
||||
shaders;shaders_mesh_instancing;⭐️⭐️⭐️⭐️;3.7;4.2;"seanpringle";@seanpringle
|
||||
shaders;shaders_multi_sample2d;⭐️⭐️☆☆;3.5;3.5;"Ray";@raysan5
|
||||
shaders;shaders_spotlight;⭐️⭐️☆☆;2.5;3.7;"Chris Camacho";@chriscamacho
|
||||
shaders;shaders_deferred_render;⭐️⭐️⭐️⭐️;4.5;4.5;"Justin Andreas Lacoste";@27justin
|
||||
shaders;shaders_hybrid_render;⭐️⭐️⭐️⭐️;4.2;4.2;"Buğra Alptekin Sarı";@BugraAlptekinSari
|
||||
shaders;shaders_texture_tiling;⭐️⭐️☆☆;4.5;4.5;"Luis Almeida";@luis605
|
||||
shaders;shaders_shadowmap;⭐️⭐️⭐️⭐️;5.0;5.0;"TheManTheMythTheGameDev";@TheManTheMythTheGameDev
|
||||
shaders;shaders_vertex_displacement;⭐️⭐️⭐️☆;5.0;4.5;"Alex ZH";@ZzzhHe
|
||||
shaders;shaders_write_depth;⭐️⭐️☆☆;4.2;4.2;"Buğra Alptekin Sarı";@BugraAlptekinSari
|
||||
shaders;shaders_basic_pbr;⭐️⭐️⭐️⭐️;5.0;5.1-dev;"Afan OLOVCIC";@_DevDad
|
||||
shaders;shaders_lightmap;⭐️⭐️⭐️☆;4.5;4.5;"Jussi Viitala";@nullstare
|
||||
shaders;shaders_rounded_rectangle;⭐️⭐️⭐️☆;5.5;5.5;"Anstro Pleuton";@anstropleuton
|
||||
shaders;shaders_view_depth;⭐️⭐️⭐️☆;5.6-dev;5.6-dev;"Luís Almeida";@luis605
|
||||
audio;audio_module_playing;⭐️☆☆☆;1.5;3.5;"Ray";@raysan5
|
||||
audio;audio_music_stream;⭐️☆☆☆;1.3;4.2;"Ray";@raysan5
|
||||
audio;audio_raw_stream;⭐️⭐️⭐️☆;1.6;4.2;"Ray";@raysan5
|
||||
audio;audio_sound_loading;⭐️☆☆☆;1.1;3.5;"Ray";@raysan5
|
||||
audio;audio_mixed_processor;⭐️⭐️⭐️⭐️;4.2;4.2;"hkc";@hatkidchan
|
||||
audio;audio_stream_effects;⭐️⭐️⭐️⭐️;4.2;5.0;"Ray";@raysan5
|
||||
audio;audio_sound_multi;⭐️⭐️☆☆;4.6;4.6;"Jeffery Myers";@JeffM2501
|
||||
audio;audio_sound_positioning;⭐️⭐️☆☆;5.5;5.5;"Le Juez Victor";@Bigfoot71
|
||||
others;rlgl_standalone;⭐️⭐️⭐️⭐️;1.6;4.0;"Ray";@raysan5
|
||||
others;rlgl_compute_shader;⭐️⭐️⭐️⭐️;4.0;4.0;"Teddy Astie";@tsnake41
|
||||
others;easings_testbed;⭐️⭐️⭐️☆;2.5;3.0;"Juan Miguel López";@flashback-fx
|
||||
others;raylib_opengl_interop;⭐️⭐️⭐️⭐️;3.8;4.0;"Stephan Soller";@arkanis
|
||||
others;embedded_files_loading;⭐️⭐️☆☆;3.0;3.5;"Kristian Holmgren";@defutura
|
||||
others;raymath_vector_angle;⭐️⭐️☆☆;1.0;4.6;"Ray";@raysan5
|
||||
@ -60,7 +60,7 @@
|
||||
*
|
||||
* Example complexity rating: [★☆??] ?/4
|
||||
*
|
||||
* Example originally created with raylib 5.5, last time updated with raylib 5.5
|
||||
* Example originally created with raylib 5.5, last time updated with raylib 5.6-dev
|
||||
*
|
||||
* Example contributed by <user_name> (@<user_github>) and reviewed by Ramon Santamaria (@raysan5)
|
||||
*
|
||||
|
||||
294
examples/rexm.c
294
examples/rexm.c
@ -7,6 +7,7 @@
|
||||
* - add <example_name>
|
||||
* - rename <old_examples_name> <new_example_name>
|
||||
* - remove <example_name>
|
||||
* - validate
|
||||
*
|
||||
* Files involved in the processes:
|
||||
* - raylib/examples/<category>/<category>_example_name.c
|
||||
@ -60,22 +61,50 @@
|
||||
//----------------------------------------------------------------------------------
|
||||
// Types and Structures Definition
|
||||
//----------------------------------------------------------------------------------
|
||||
// raylib example info struct
|
||||
typedef struct {
|
||||
char category[16];
|
||||
char name[64];
|
||||
char stars;
|
||||
float verCreated;
|
||||
float verUpdated;
|
||||
char author[64];
|
||||
char authorGitHub[32];
|
||||
} rlExampleInfo;
|
||||
|
||||
// Example management operations
|
||||
typedef enum {
|
||||
OP_NONE = 0,
|
||||
OP_CREATE = 1,
|
||||
OP_ADD = 2,
|
||||
OP_RENAME = 3,
|
||||
OP_REMOVE = 4
|
||||
} ExampleOperation;
|
||||
OP_NONE = 0, // No process to do
|
||||
OP_CREATE = 1, // Create new example, using default template
|
||||
OP_ADD = 2, // Add existing examples (hopefully following template)
|
||||
OP_RENAME = 3, // Rename existing example
|
||||
OP_REMOVE = 4, // Remove existing example
|
||||
OP_VALIDATE = 5, // Validate examples, using [examples_list.txt] as main source by default
|
||||
} rlExampleOperation;
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Module specific functions declaration
|
||||
//----------------------------------------------------------------------------------
|
||||
static int FileTextReplace(const char *fileName, const char *textLookUp, const char *textReplace);
|
||||
static int FileCopy(const char *srcPath, const char *dstPath);
|
||||
static int FileRename(const char *fileName, const char *fileRename); // TODO: Implement, make sure to deal with paths moving
|
||||
static int FileRemove(const char *fileName); // TODO: Implement
|
||||
static int FileRename(const char *fileName, const char *fileRename);
|
||||
static int FileRemove(const char *fileName);
|
||||
|
||||
// Load examples collection information
|
||||
static rlExampleInfo *LoadExamplesData(const char *fileName, int *exCount);
|
||||
static void UnloadExamplesData(rlExampleInfo *exInfo);
|
||||
|
||||
// Get text lines (by line-breaks '\n')
|
||||
// WARNING: It does not copy text data, just returns line pointers
|
||||
static const char **GetTextLines(const char *text, int *count);
|
||||
|
||||
// raylib example line info parser
|
||||
// Parses following line format: core/core_basic_window;⭐️☆☆☆;1.0;1.0;"Ray"/@raysan5
|
||||
static int ParseExampleInfoLine(const char *line, rlExampleInfo *entry);
|
||||
|
||||
// Sort array of strings by name
|
||||
// WARNING: items[] pointers are reorganized
|
||||
static void SortStringsByName(char **items, int count);
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
@ -87,15 +116,14 @@ int main(int argc, char *argv[])
|
||||
char *exBasePath = "C:/GitHub/raylib/examples";
|
||||
char *exWebPath = "C:/GitHub/raylib.com/examples";
|
||||
char *exTemplateFilePath = "C:/GitHub/raylib/examples/examples_template.c";
|
||||
|
||||
char *exCollectionList = "C:/GitHub/raylib/examples/examples_list.txt";
|
||||
|
||||
char inFileName[1024] = { 0 }; // Example input filename
|
||||
|
||||
char exName[1024] = { 0 }; // Example name, without extension: core_basic_window
|
||||
char exName[64] = { 0 }; // Example name, without extension: core_basic_window
|
||||
char exCategory[32] = { 0 }; // Example category: core
|
||||
char exRename[1024] = { 0 }; // Example re-name, without extension
|
||||
char exPath[1024] = { 0 }; // Example path -NOT USED-
|
||||
char exFullPath[1024] = { 0 }; // Example full path -NOT USED-
|
||||
|
||||
char exRename[64] = { 0 }; // Example re-name, without extension
|
||||
|
||||
int opCode = OP_NONE; // Operation code: 0-None(Help), 1-Create, 2-Add, 3-Rename, 4-Remove
|
||||
|
||||
// Command-line usage mode
|
||||
@ -108,6 +136,7 @@ int main(int argc, char *argv[])
|
||||
// add <example_name> : Add existing example, category extracted from name
|
||||
// rename <old_examples_name> <new_example_name> : Rename an existing example
|
||||
// remove <example_name> : Remove an existing example
|
||||
// validate : Validate examples collection
|
||||
if (strcmp(argv[1], "create") == 0)
|
||||
{
|
||||
// Check for valid upcoming argument
|
||||
@ -116,7 +145,7 @@ int main(int argc, char *argv[])
|
||||
else
|
||||
{
|
||||
// TODO: Additional security checks for file name?
|
||||
|
||||
|
||||
strcpy(inFileName, argv[2]); // Register filename for creation
|
||||
opCode = 1;
|
||||
}
|
||||
@ -131,7 +160,7 @@ int main(int argc, char *argv[])
|
||||
if (IsFileExtension(argv[2], ".c")) // Check for valid file extension: input
|
||||
{
|
||||
// TODO: Parse category name from filename provided!
|
||||
|
||||
|
||||
strcpy(inFileName, argv[2]); // Register filename for creation
|
||||
opCode = 2;
|
||||
}
|
||||
@ -141,17 +170,11 @@ int main(int argc, char *argv[])
|
||||
else if (strcmp(argv[1], "rename") == 0)
|
||||
{
|
||||
if (argc == 2) LOG("WARNING: No filename provided to create\n");
|
||||
//else if (argc == 3) LOG("WARNING: No enough arguments provided\n"); All the documentation says 3 args but I don't mind being wrong
|
||||
else if (argc > 3) LOG("WARNING: Too many arguments provided\n");
|
||||
else if (argc == 3) LOG("WARNING: No enough arguments provided\n");
|
||||
else if (argc > 4) LOG("WARNING: Too many arguments provided\n");
|
||||
else
|
||||
{
|
||||
strcpy(exName, argv[2]);
|
||||
for (int index = 0; index < 32; index++)
|
||||
{
|
||||
if (exName[index] == '_') break;
|
||||
exCategory[index] = exName[index];
|
||||
}
|
||||
strcpy(exRename, argv[3]);
|
||||
// TODO: Register exName, exCategory and exRename
|
||||
|
||||
opCode = 3;
|
||||
}
|
||||
@ -167,8 +190,12 @@ int main(int argc, char *argv[])
|
||||
opCode = 4;
|
||||
}
|
||||
}
|
||||
else if (strcmp(argv[1], "validate") == 0)
|
||||
{
|
||||
opCode = 5;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
switch (opCode)
|
||||
{
|
||||
case 1: // Create: New example from template
|
||||
@ -181,33 +208,33 @@ int main(int argc, char *argv[])
|
||||
if ((opCode != 1) && FileExists(inFileName))
|
||||
{
|
||||
FileCopy(inFileName, TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Generate all required files
|
||||
//--------------------------------------------------------------------------------
|
||||
// Create: raylib/examples/<category>/<category>_example_name.c
|
||||
// Create: raylib/examples/<category>/<category>_example_name.png
|
||||
FileCopy("C:/GitHub/raylib/examples/examples_template.png",
|
||||
FileCopy("C:/GitHub/raylib/examples/examples_template.png",
|
||||
TextFormat("%s/%s/%s.png", exBasePath, exCategory, exName)); // To be updated manually!
|
||||
|
||||
|
||||
// Copy: raylib/examples/<category>/resources/*.* ---> To be updated manually!
|
||||
|
||||
|
||||
// TODO: Update the required files to add new example in the required position (ordered by category and name),
|
||||
// it could require some logic to make it possible...
|
||||
|
||||
|
||||
// Edit: raylib/examples/Makefile --> Add new example
|
||||
// Edit: raylib/examples/Makefile.Web --> Add new example
|
||||
// Edit: raylib/examples/README.md --> Add new example
|
||||
|
||||
|
||||
// Create: raylib/projects/VS2022/examples/<category>_example_name.vcxproj
|
||||
// Edit: raylib/projects/VS2022/raylib.sln --> Add new example
|
||||
// Edit: raylib.com/common/examples.js --> Add new example
|
||||
|
||||
|
||||
// Compile to: raylib.com/examples/<category>/<category>_example_name.html
|
||||
// Compile to: raylib.com/examples/<category>/<category>_example_name.data
|
||||
// Compile to: raylib.com/examples/<category>/<category>_example_name.wasm
|
||||
// Compile to: raylib.com/examples/<category>/<category>_example_name.js
|
||||
|
||||
|
||||
// Recompile example (on raylib side)
|
||||
// NOTE: Tools requirements: emscripten, w64devkit
|
||||
system(TextFormat("%s/../build_example_web.bat %s\%s", exBasePath, exCategory, exName));
|
||||
@ -225,19 +252,19 @@ int main(int argc, char *argv[])
|
||||
case 3: // Rename
|
||||
{
|
||||
// Rename all required files
|
||||
rename(TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName),
|
||||
rename(TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName),
|
||||
TextFormat("%s/%s/%s.c", exBasePath, exCategory, exRename));
|
||||
rename(TextFormat("%s/%s/%s.png", exBasePath, exCategory, exName),
|
||||
rename(TextFormat("%s/%s/%s.png", exBasePath, exCategory, exName),
|
||||
TextFormat("%s/%s/%s.png", exBasePath, exCategory, exRename));
|
||||
|
||||
|
||||
FileTextReplace(TextFormat("%s/Makefile", exBasePath), exName, exRename);
|
||||
FileTextReplace(TextFormat("%s/Makefile.Web", exBasePath), exName, exRename);
|
||||
FileTextReplace(TextFormat("%s/README.md", exBasePath), exName, exRename);
|
||||
|
||||
rename(TextFormat("%s/../projects/VS2022/examples/%s.vcxproj", exBasePath, exName),
|
||||
|
||||
rename(TextFormat("%s/../projects/VS2022/examples/%s.vcxproj", exBasePath, exName),
|
||||
TextFormat("%s/../projects/VS2022/examples/%s.vcxproj", exBasePath, exRename));
|
||||
FileTextReplace(TextFormat("%s/../projects/VS2022/raylib.sln", exBasePath), exName, exRename);
|
||||
|
||||
|
||||
// Remove old web compilation
|
||||
FileTextReplace(TextFormat("%s/../common/examples.js", exWebPath), exName, exRename);
|
||||
remove(TextFormat("%s/%s/%s.html", exWebPath, exCategory, exName));
|
||||
@ -263,6 +290,25 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
// TODO: Remove and update all required files...
|
||||
|
||||
} break;
|
||||
case 5: // Validate
|
||||
{
|
||||
// TODO: Validate examples collection against [examples_list.txt]
|
||||
|
||||
// Validate: raylib/examples/<category>/<category>_example_name.c
|
||||
// Validate: raylib/examples/<category>/<category>_example_name.png
|
||||
// Validate: raylib/examples/<category>/resources/.. -> Not possible for now...
|
||||
// Validate: raylib/examples/Makefile
|
||||
// Validate: raylib/examples/Makefile.Web
|
||||
// Validate: raylib/examples/README.md
|
||||
// Validate: raylib/projects/VS2022/examples/<category>_example_name.vcxproj
|
||||
// Validate: raylib/projects/VS2022/raylib.sln
|
||||
// Validate: raylib.com/common/examples.js
|
||||
// Validate: raylib.com/examples/<category>/<category>_example_name.html
|
||||
// Validate: raylib.com/examples/<category>/<category>_example_name.data
|
||||
// Validate: raylib.com/examples/<category>/<category>_example_name.wasm
|
||||
// Validate: raylib.com/examples/<category>/<category>_example_name.js
|
||||
|
||||
} break;
|
||||
default: // Help
|
||||
{
|
||||
@ -272,7 +318,7 @@ int main(int argc, char *argv[])
|
||||
// add <example_name> : Add existing example, category extracted from name
|
||||
// rename <old_examples_name> <new_example_name> : Rename an existing example
|
||||
// remove <example_name> : Remove an existing example
|
||||
|
||||
|
||||
printf("\n////////////////////////////////////////////////////////////////////////////////////////////\n");
|
||||
printf("// //\n");
|
||||
printf("// rexm [raylib examples manager] - A simple command-line tool to manage raylib examples //\n");
|
||||
@ -299,57 +345,197 @@ int main(int argc, char *argv[])
|
||||
printf(" Renames and updates example <core_basic_window> to <core_cool_window>\n\n");
|
||||
} break;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Module specific functions definition
|
||||
//----------------------------------------------------------------------------------
|
||||
// Load examples collection information
|
||||
static rlExampleInfo *LoadExamplesData(const char *fileName, int *exCount)
|
||||
{
|
||||
#define MAX_EXAMPLES_INFO 256
|
||||
|
||||
*exCount = 0;
|
||||
rlExampleInfo *exInfo = (rlExampleInfo *)RL_CALLOC(MAX_EXAMPLES_INFO, sizeof(rlExampleInfo));
|
||||
|
||||
const char *text = LoadFileText(fileName);
|
||||
|
||||
if (text != NULL)
|
||||
{
|
||||
int lineCount = 0;
|
||||
const char **linePtrs = GetTextLines(text, &lineCount);
|
||||
|
||||
for (int i = 0; i < lineCount; i++)
|
||||
{
|
||||
// Basic validation for lines start categories
|
||||
if ((linePtrs[i][0] != '#') &&
|
||||
((linePtrs[i][0] == 'c') || // core
|
||||
(linePtrs[i][0] == 's') || // shapes, shaders
|
||||
(linePtrs[i][0] == 't') || // textures, text
|
||||
(linePtrs[i][0] == 'm') || // models
|
||||
(linePtrs[i][0] == 'a') || // audio
|
||||
(linePtrs[i][0] == 'o'))) // others
|
||||
{
|
||||
if (ParseExampleInfoLine(linePtrs[i], &exInfo[*exCount]) == 0) *exCount += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return exInfo;
|
||||
}
|
||||
|
||||
// Unload examples collection data
|
||||
static void UnloadExamplesData(rlExampleInfo *exInfo)
|
||||
{
|
||||
RL_FREE(exInfo);
|
||||
}
|
||||
|
||||
// Replace text in an existing file
|
||||
static int FileTextReplace(const char *fileName, const char *textLookUp, const char *textReplace)
|
||||
{
|
||||
int result = 0;
|
||||
char *fileText = NULL;
|
||||
char *fileTextUpdated = { 0 };
|
||||
|
||||
fileText = LoadFileText(fileName);
|
||||
fileTextUpdated = TextReplace(fileText, textLookUp, textReplace);
|
||||
result = SaveFileText(fileName, fileTextUpdated);
|
||||
MemFree(fileTextUpdated);
|
||||
UnloadFileText(fileText);
|
||||
|
||||
if (FileExists(fileName))
|
||||
{
|
||||
fileText = LoadFileText(fileName);
|
||||
fileTextUpdated = TextReplace(fileText, textLookUp, textReplace);
|
||||
result = SaveFileText(fileName, fileTextUpdated);
|
||||
MemFree(fileTextUpdated);
|
||||
UnloadFileText(fileText);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Copy file from one path to another
|
||||
// WARNING: Destination path must exist
|
||||
static int FileCopy(const char *srcPath, const char *dstPath)
|
||||
{
|
||||
int result = 0;
|
||||
int srcDataSize = 0;
|
||||
unsigned char *srcFileData = LoadFileData(srcPath, &srcDataSize);
|
||||
|
||||
// TODO: Create required paths if they do not exist
|
||||
|
||||
if ((srcFileData != NULL) && (srcDataSize > 0)) result = SaveFileData(dstPath, srcFileData, srcDataSize);
|
||||
|
||||
UnloadFileData(srcFileData);
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Rename file (if exists)
|
||||
// NOTE: Only rename file name required, not full path
|
||||
static int FileRename(const char *fileName, const char *fileRename)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
// TODO: Make sure to deal with paths properly for file moving if required
|
||||
|
||||
|
||||
if (FileExists(fileName)) rename(fileName, TextFormat("%s/%s", GetDirectoryPath(fileName), fileRename));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Remove file (if exists)
|
||||
static int FileRemove(const char *fileName)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
|
||||
if (FileExists(fileName)) remove(fileName);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Get text lines (by line-breaks '\n')
|
||||
// WARNING: It does not copy text data, just returns line pointers
|
||||
static const char **GetTextLines(const char *text, int *count)
|
||||
{
|
||||
#define MAX_TEXT_LINE_PTRS 128
|
||||
|
||||
static const char *linePtrs[MAX_TEXT_LINE_PTRS] = { 0 };
|
||||
for (int i = 0; i < MAX_TEXT_LINE_PTRS; i++) linePtrs[i] = NULL; // Init NULL pointers to substrings
|
||||
|
||||
int textSize = (int)strlen(text);
|
||||
|
||||
linePtrs[0] = text;
|
||||
int len = 0;
|
||||
*count = 1;
|
||||
|
||||
for (int i = 0, k = 0; (i < textSize) && (*count < MAX_TEXT_LINE_PTRS); i++)
|
||||
{
|
||||
if (text[i] == '\n')
|
||||
{
|
||||
k++;
|
||||
linePtrs[k] = &text[i + 1]; // WARNING: next value is valid?
|
||||
len = 0;
|
||||
*count += 1;
|
||||
}
|
||||
else len++;
|
||||
}
|
||||
|
||||
return linePtrs;
|
||||
}
|
||||
|
||||
// raylib example line info parser
|
||||
// Parses following line format: core/core_basic_window;⭐️☆☆☆;1.0;1.0;"Ray"/@raysan5
|
||||
static int ParseExampleInfoLine(const char *line, rlExampleInfo *entry)
|
||||
{
|
||||
#define MAX_EXAMPLE_INFO_LINE_LEN 512
|
||||
|
||||
char temp[MAX_EXAMPLE_INFO_LINE_LEN] = { 0 };
|
||||
strncpy(temp, line, MAX_EXAMPLE_INFO_LINE_LEN); // WARNING: Copy is needed because strtok() modifies string, adds '\0'
|
||||
temp[MAX_EXAMPLE_INFO_LINE_LEN - 1] = '\0'; // Ensure null termination
|
||||
|
||||
int tokenCount = 0;
|
||||
char **tokens = TextSplit(line, ';', &tokenCount);
|
||||
|
||||
// Get category and name
|
||||
strncpy(entry->category, tokens[0], sizeof(entry->category));
|
||||
strncpy(entry->name, tokens[1], sizeof(entry->name));
|
||||
|
||||
// Parsing stars
|
||||
// NOTE: Counting the unicode char occurrences: ⭐️
|
||||
const char *ptr = tokens[2];
|
||||
while (*ptr)
|
||||
{
|
||||
if (((unsigned char)ptr[0] == 0xE2) &&
|
||||
((unsigned char)ptr[1] == 0xAD) &&
|
||||
((unsigned char)ptr[2] == 0x90))
|
||||
{
|
||||
entry->stars++;
|
||||
ptr += 3; // Advance past multibyte character
|
||||
}
|
||||
else ptr++;
|
||||
}
|
||||
|
||||
// Get raylib creation/update versions
|
||||
entry->verCreated = strtof(tokens[3], NULL);
|
||||
entry->verUpdated = strtof(tokens[4], NULL);
|
||||
|
||||
// Get author and github
|
||||
char *quote1 = strchr(tokens[5], '"');
|
||||
char *quote2 = quote1? strchr(quote1 + 1, '"') : NULL;
|
||||
if (quote1 && quote2) strncpy(entry->author, quote1 + 1, sizeof(entry->author));
|
||||
strncpy(entry->authorGitHub, tokens[6], sizeof(entry->authorGitHub));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Text compare, required for qsort() function
|
||||
static int SortTextCompare(const void *a, const void *b)
|
||||
{
|
||||
const char *str1 = *(const char **)a;
|
||||
const char *str2 = *(const char **)b;
|
||||
|
||||
return strcmp(str1, str2);
|
||||
}
|
||||
|
||||
// Sort array of strings by name
|
||||
// WARNING: items[] pointers are reorganized
|
||||
static void SortStringsByName(char **items, int count)
|
||||
{
|
||||
qsort(items, count, sizeof(char *), SortTextCompare);
|
||||
}
|
||||
|
||||
@ -9739,7 +9739,7 @@
|
||||
},
|
||||
{
|
||||
"name": "TextSplit",
|
||||
"description": "Split text into multiple strings",
|
||||
"description": "Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings",
|
||||
"returnType": "char **",
|
||||
"params": [
|
||||
{
|
||||
|
||||
@ -6922,7 +6922,7 @@ return {
|
||||
},
|
||||
{
|
||||
name = "TextSplit",
|
||||
description = "Split text into multiple strings",
|
||||
description = "Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings",
|
||||
returnType = "char **",
|
||||
params = {
|
||||
{type = "const char *", name = "text"},
|
||||
|
||||
@ -3728,7 +3728,7 @@ Function 432: TextJoin() (3 input parameters)
|
||||
Function 433: TextSplit() (3 input parameters)
|
||||
Name: TextSplit
|
||||
Return type: char **
|
||||
Description: Split text into multiple strings
|
||||
Description: Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings
|
||||
Param[1]: text (type: const char *)
|
||||
Param[2]: delimiter (type: char)
|
||||
Param[3]: count (type: int *)
|
||||
|
||||
@ -2470,7 +2470,7 @@
|
||||
<Param type="int" name="count" desc="" />
|
||||
<Param type="const char *" name="delimiter" desc="" />
|
||||
</Function>
|
||||
<Function name="TextSplit" retType="char **" paramCount="3" desc="Split text into multiple strings">
|
||||
<Function name="TextSplit" retType="char **" paramCount="3" desc="Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings">
|
||||
<Param type="const char *" name="text" desc="" />
|
||||
<Param type="char" name="delimiter" desc="" />
|
||||
<Param type="int *" name="count" desc="" />
|
||||
|
||||
@ -1514,7 +1514,7 @@ RLAPI const char *TextSubtext(const char *text, int position, int length);
|
||||
RLAPI char *TextReplace(const char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!)
|
||||
RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!)
|
||||
RLAPI char *TextJoin(char **textList, int count, const char *delimiter); // Join text strings with delimiter
|
||||
RLAPI char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings
|
||||
RLAPI char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings
|
||||
RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor!
|
||||
RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string
|
||||
RLAPI char *TextToUpper(const char *text); // Get upper case version of provided string
|
||||
|
||||
Reference in New Issue
Block a user