├── .github └── workflows │ ├── linux.yml │ ├── macos.yml │ ├── webassembly.yml │ └── windows.yml ├── .gitignore ├── CMakeLists.txt ├── CONVENTIONS.md ├── LICENSE ├── README.md ├── projects └── VS2022 │ ├── raylib │ └── raylib.vcxproj │ ├── raylib_game.sln │ └── raylib_game │ └── raylib_game.vcxproj ├── screenshots └── screenshot000.png └── src ├── CMakeLists.txt ├── Info.plist ├── Makefile ├── Makefile.Android ├── minshell.html ├── raylib.icns ├── raylib.ico ├── raylib_game.c ├── raylib_game.rc └── resources └── README.txt /.github/workflows/linux.yml: -------------------------------------------------------------------------------- 1 | name: Linux 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | paths: 7 | - 'src/**' 8 | - '.github/workflows/linux.yml' 9 | release: 10 | types: [published] 11 | 12 | permissions: 13 | contents: read 14 | 15 | jobs: 16 | build: 17 | permissions: 18 | contents: write # for actions/upload-release-asset to upload release asset 19 | runs-on: ubuntu-latest 20 | 21 | env: 22 | PROJECT_NAME: ${{ github.event.repository.name }} 23 | PROJECT_BUILD_PATH: ${{ github.event.repository.name }}/src 24 | PROJECT_RELEASE_PATH: ${{ github.event.repository.name }}_dev_linux_x64 25 | PROJECT_CUSTOM_FLAGS: "" 26 | PROJECT_RESOURCES_PATH: src/resources 27 | 28 | steps: 29 | - name: Checkout this repo 30 | uses: actions/checkout@master 31 | with: 32 | path: ${{ env.PROJECT_NAME }} 33 | 34 | - name: Checkout raylib repo 35 | uses: actions/checkout@v4 36 | with: 37 | repository: raysan5/raylib 38 | path: raylib 39 | 40 | - name: Setup Release Paths 41 | run: | 42 | echo "PROJECT_RELEASE_PATH=${{ env.PROJECT_NAME }}_v${{ github.event.release.tag_name }}_linux_x64" >> $GITHUB_ENV 43 | shell: bash 44 | if: github.event_name == 'release' && github.event.action == 'published' 45 | 46 | - name: Setup Environment 47 | run: | 48 | sudo apt-get update -qq 49 | 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 50 | mkdir ${{ env.PROJECT_RELEASE_PATH }} 51 | ls 52 | shell: bash 53 | 54 | - name: Build raylib Library 55 | run: | 56 | cd raylib/src 57 | gcc --version 58 | make PLATFORM=PLATFORM_DESKTOP BUILD_MODE=RELEASE RAYLIB_LIBTYPE=STATIC RAYLIB_PROJECT_RELEASE_PATH=. -B 59 | 60 | - name: Build Product 61 | run: | 62 | cd ${{ env.PROJECT_NAME }}/src 63 | make PLATFORM=PLATFORM_DESKTOP BUILD_MODE=RELEASE PROJECT_CUSTOM_FLAGS=${{ env.PROJECT_CUSTOM_FLAGS }} PROJECT_BUILD_PATH=. RAYLIB_SRC_PATH=../../raylib/src 64 | 65 | - name: Generate Artifacts 66 | run: | 67 | ls ${{ env.PROJECT_BUILD_PATH }} 68 | cp ${{ env.PROJECT_BUILD_PATH }}/${{ env.PROJECT_NAME }} ${{ env.PROJECT_RELEASE_PATH }} 69 | cp -r ${{ env.PROJECT_NAME }}/${{ env.PROJECT_RESOURCES_PATH }} ${{ env.PROJECT_RELEASE_PATH }} 70 | cp ${{ env.PROJECT_NAME }}/README.md ${{ env.PROJECT_RELEASE_PATH }} 71 | cp ${{ env.PROJECT_NAME }}/LICENSE ${{ env.PROJECT_RELEASE_PATH }} 72 | ls ${{ env.PROJECT_RELEASE_PATH }} 73 | 7z a ./${{ env.PROJECT_RELEASE_PATH }}.zip ./${{ env.PROJECT_RELEASE_PATH }} 74 | 75 | - name: Upload Artifacts 76 | uses: actions/upload-artifact@v4 77 | with: 78 | name: ${{ env.PROJECT_RELEASE_PATH }}.zip 79 | path: ./${{ env.PROJECT_RELEASE_PATH }}.zip 80 | 81 | - name: Upload Artifact to Release 82 | uses: softprops/action-gh-release@v1 83 | with: 84 | files: ${{ env.PROJECT_RELEASE_PATH }}.zip 85 | env: 86 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 87 | if: github.event_name == 'release' && github.event.action == 'published' 88 | -------------------------------------------------------------------------------- /.github/workflows/macos.yml: -------------------------------------------------------------------------------- 1 | name: macOS 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | paths: 7 | - 'src/**' 8 | - '.github/workflows/macos.yml' 9 | release: 10 | types: [published] 11 | 12 | permissions: 13 | contents: read 14 | 15 | jobs: 16 | build: 17 | permissions: 18 | contents: write # for actions/upload-release-asset to upload release asset 19 | runs-on: macos-latest 20 | 21 | env: 22 | PROJECT_NAME: ${{ github.event.repository.name }} 23 | PROJECT_BUILD_PATH: ${{ github.event.repository.name }}/src 24 | PROJECT_RELEASE_PATH: ${{ github.event.repository.name }}_dev_macos 25 | PROJECT_CUSTOM_FLAGS: "" 26 | PROJECT_RESOURCES_PATH: src/resources 27 | 28 | steps: 29 | - name: Checkout this repo 30 | uses: actions/checkout@master 31 | with: 32 | path: ${{ env.PROJECT_NAME }} 33 | 34 | - name: Checkout raylib repo 35 | uses: actions/checkout@v4 36 | with: 37 | repository: raysan5/raylib 38 | path: raylib 39 | 40 | - name: Setup Release Paths 41 | run: | 42 | echo "PROJECT_RELEASE_PATH=${{ env.PROJECT_NAME }}_v${{ github.event.release.tag_name }}_macos" >> $GITHUB_ENV 43 | shell: bash 44 | if: github.event_name == 'release' && github.event.action == 'published' 45 | 46 | - name: Setup Environment 47 | run: | 48 | mkdir ${{ env.PROJECT_RELEASE_PATH }} 49 | cd ${{ env.PROJECT_RELEASE_PATH }} 50 | mkdir ${{ env.PROJECT_NAME }}.app 51 | cd ${{ env.PROJECT_NAME }}.app 52 | mkdir Contents 53 | cd Contents 54 | mkdir MacOS 55 | mkdir Resources 56 | cd ../../.. 57 | ls 58 | shell: bash 59 | 60 | # Generating static library, note that i386 architecture is deprecated 61 | # Defining GL_SILENCE_DEPRECATION because OpenGL is deprecated on macOS 62 | - name: Build raylib Library 63 | run: | 64 | cd raylib/src 65 | clang --version 66 | 67 | # Extract version numbers from Makefile 68 | brew install grep 69 | RAYLIB_API_VERSION=`ggrep -Po 'RAYLIB_API_VERSION\s*=\s\K(.*)' Makefile` 70 | RAYLIB_VERSION=`ggrep -Po 'RAYLIB_VERSION\s*=\s\K(.*)' Makefile` 71 | 72 | # Build raylib x86_64 static 73 | make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC CUSTOM_CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION" 74 | mv -v -f libraylib.a libraylib_x86_64.a 75 | make clean 76 | 77 | # Build raylib arm64 static 78 | make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC CUSTOM_CFLAGS="-target arm64-apple-macos11 -DGL_SILENCE_DEPRECATION" -B 79 | mv -v -f libraylib.a libraylib_arm64.a 80 | make clean 81 | 82 | # Join x86_64 and arm64 static 83 | lipo -create -output libraylib.a libraylib_x86_64.a libraylib_arm64.a 84 | lipo libraylib.a -detailed_info 85 | cd ../.. 86 | 87 | - name: Build Product 88 | run: | 89 | cd ${{ env.PROJECT_NAME }}/src 90 | 91 | # Build project x86_64 binary 92 | # TODO: Link with x86_64 raylib library: libraylib_x86_64.a 93 | make PLATFORM=PLATFORM_DESKTOP BUILD_MODE=RELEASE PROJECT_CUSTOM_FLAGS=${{ env.PROJECT_CUSTOM_FLAGS }} PROJECT_BUILD_PATH=. RAYLIB_SRC_PATH=../../raylib/src PROJECT_CUSTOM_FLAGS="-target x86_64-apple-macos10.12" 94 | mv -v -f ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_x86_64 95 | make clean 96 | 97 | # Build project arm64 binary 98 | # TODO: Link with arm64 raylib library: libraylib_arm.a 99 | make PLATFORM=PLATFORM_DESKTOP BUILD_MODE=RELEASE PROJECT_CUSTOM_FLAGS=${{ env.PROJECT_CUSTOM_FLAGS }} PROJECT_BUILD_PATH=. RAYLIB_SRC_PATH=../../raylib/src PROJECT_CUSTOM_FLAGS="-target arm64-apple-macos11" 100 | mv -v -f ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_arm64 101 | make clean 102 | 103 | # Join x86_64 and arm64 binaries 104 | lipo -create -output ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_x86_64 ${{ env.PROJECT_NAME }}_arm64 105 | lipo ${{ env.PROJECT_NAME }} -detailed_info 106 | cd .. 107 | 108 | - name: Generate Artifacts 109 | run: | 110 | ls ${{ env.PROJECT_BUILD_PATH }} 111 | cp ${{ env.PROJECT_BUILD_PATH }}/${{ env.PROJECT_NAME }} ${{ env.PROJECT_RELEASE_PATH }}/${{ env.PROJECT_NAME }}.app/Contents/MacOS 112 | cp ${{ env.PROJECT_NAME }}/src/raylib.icns ${{ env.PROJECT_RELEASE_PATH }}/${{ env.PROJECT_NAME }}.app/Contents/Resources 113 | cp ${{ env.PROJECT_NAME }}/src/Info.plist ${{ env.PROJECT_RELEASE_PATH }}/${{ env.PROJECT_NAME }}.app/Contents 114 | cp -r ${{ env.PROJECT_NAME }}/${{ env.PROJECT_RESOURCES_PATH }} ${{ env.PROJECT_RELEASE_PATH }}/${{ env.PROJECT_NAME }}.app/Contents 115 | cp ${{ env.PROJECT_NAME }}/README.md ${{ env.PROJECT_RELEASE_PATH }} 116 | cp ${{ env.PROJECT_NAME }}/LICENSE ${{ env.PROJECT_RELEASE_PATH }} 117 | ls ${{ env.PROJECT_RELEASE_PATH }} 118 | 7z a ./${{ env.PROJECT_RELEASE_PATH }}.zip ./${{ env.PROJECT_RELEASE_PATH }} 119 | 120 | - name: Upload Artifacts 121 | uses: actions/upload-artifact@v4 122 | with: 123 | name: ${{ env.PROJECT_RELEASE_PATH }}.zip 124 | path: ./${{ env.PROJECT_RELEASE_PATH }}.zip 125 | 126 | - name: Upload Artifact to Release 127 | uses: softprops/action-gh-release@v1 128 | with: 129 | files: ${{ env.PROJECT_RELEASE_PATH }}.zip 130 | env: 131 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 132 | if: github.event_name == 'release' && github.event.action == 'published' 133 | -------------------------------------------------------------------------------- /.github/workflows/webassembly.yml: -------------------------------------------------------------------------------- 1 | name: WebAssembly 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | paths: 7 | - 'src/**' 8 | - '.github/workflows/webassembly.yml' 9 | release: 10 | types: [published] 11 | 12 | permissions: 13 | contents: read 14 | 15 | jobs: 16 | build: 17 | permissions: 18 | contents: write # for actions/upload-release-asset to upload release asset 19 | runs-on: windows-latest 20 | 21 | env: 22 | PROJECT_NAME: ${{ github.event.repository.name }} 23 | PROJECT_BUILD_PATH: ${{ github.event.repository.name }}\\src 24 | PROJECT_RELEASE_PATH: ${{ github.event.repository.name }}_dev_wasm 25 | 26 | steps: 27 | - name: Checkout this repo 28 | uses: actions/checkout@master 29 | with: 30 | path: ${{ env.PROJECT_NAME }} 31 | 32 | - name: Checkout raylib repo 33 | uses: actions/checkout@v4 34 | with: 35 | repository: raysan5/raylib 36 | path: raylib 37 | 38 | - name: Setup emsdk 39 | uses: mymindstorm/setup-emsdk@v14 40 | with: 41 | version: 3.1.64 42 | actions-cache-folder: 'emsdk-cache' 43 | 44 | - name: Setup Release Paths 45 | run: | 46 | echo "PROJECT_RELEASE_PATH=${{ env.PROJECT_NAME }}_v${{ github.event.release.tag_name }}_wasm" >> $GITHUB_ENV 47 | shell: bash 48 | if: github.event_name == 'release' && github.event.action == 'published' 49 | 50 | - name: Setup Environment 51 | run: | 52 | mkdir ${{ env.PROJECT_RELEASE_PATH }} 53 | dir 54 | 55 | - name: Build raylib Library 56 | run: | 57 | cd raylib/src 58 | emcc -v 59 | make PLATFORM=PLATFORM_WEB RAYLIB_BUILD_MODE=RELEASE RAYLIB_LIBTYPE=STATIC EMSDK_PATH="D:/a/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}/emsdk-cache/emsdk-main" RAYLIB_PROJECT_RELEASE_PATH=. -B 60 | 61 | - name: Build Product 62 | run: | 63 | cd ${{ env.PROJECT_NAME }}/src 64 | make PLATFORM=PLATFORM_WEB BUILD_MODE=RELEASE EMSDK_PATH="D:/a/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}/emsdk-cache/emsdk-main" PROJECT_BUILD_PATH=. RAYLIB_SRC_PATH=../../raylib/src -B 65 | 66 | - name: Generate Artifacts 67 | run: | 68 | dir ${{ env.PROJECT_BUILD_PATH }} 69 | copy /Y ${{ env.PROJECT_BUILD_PATH }}\${{ env.PROJECT_NAME }}.wasm ${{ env.PROJECT_RELEASE_PATH }}\${{ env.PROJECT_NAME }}.wasm 70 | copy /Y ${{ env.PROJECT_BUILD_PATH }}\${{ env.PROJECT_NAME }}.data ${{ env.PROJECT_RELEASE_PATH }}\${{ env.PROJECT_NAME }}.data 71 | copy /Y ${{ env.PROJECT_BUILD_PATH }}\${{ env.PROJECT_NAME }}.js ${{ env.PROJECT_RELEASE_PATH }}\${{ env.PROJECT_NAME }}.js 72 | copy /Y ${{ env.PROJECT_BUILD_PATH }}\${{ env.PROJECT_NAME }}.html ${{ env.PROJECT_RELEASE_PATH }}\index.html 73 | copy /Y ${{ env.PROJECT_NAME }}\README.md ${{ env.PROJECT_RELEASE_PATH }}\README.md 74 | copy /Y ${{ env.PROJECT_NAME }}\LICENSE ${{ env.PROJECT_RELEASE_PATH }}\LICENSE 75 | dir ${{ env.PROJECT_RELEASE_PATH }} 76 | 7z a -tzip -r .\${{ env.PROJECT_RELEASE_PATH }}.zip .\${{ env.PROJECT_RELEASE_PATH }}\* 77 | shell: cmd 78 | 79 | - name: Upload Artifacts 80 | uses: actions/upload-artifact@v4 81 | with: 82 | name: ${{ env.PROJECT_RELEASE_PATH }}.zip 83 | path: ./${{ env.PROJECT_RELEASE_PATH }}.zip 84 | 85 | - name: Upload Artifact to Release 86 | uses: softprops/action-gh-release@v1 87 | with: 88 | files: ${{ env.PROJECT_RELEASE_PATH }}.zip 89 | env: 90 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 91 | if: github.event_name == 'release' && github.event.action == 'published' 92 | -------------------------------------------------------------------------------- /.github/workflows/windows.yml: -------------------------------------------------------------------------------- 1 | name: Windows 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | paths: 7 | - 'src/**' 8 | - '.github/workflows/windows.yml' 9 | release: 10 | types: [published] 11 | 12 | permissions: 13 | contents: read 14 | 15 | jobs: 16 | build: 17 | permissions: 18 | contents: write # for actions/upload-release-asset to upload release asset 19 | runs-on: windows-latest 20 | 21 | env: 22 | PROJECT_NAME: raylib_game 23 | PROJECT_REPO_NAME: ${{ github.event.repository.name }} 24 | PROJECT_BUILD_PATH: "${{ github.event.repository.name }}\\projects\\VS2022\\build\\raylib_game\\bin\\x64\\Release" 25 | PROJECT_RELEASE_PATH: ${{ github.event.repository.name }}_dev_win_x64 26 | PROJECT_RESOURCES_PATH: resources 27 | 28 | steps: 29 | - name: Checkout this repo 30 | uses: actions/checkout@master 31 | with: 32 | path: ${{ env.PROJECT_REPO_NAME }} 33 | 34 | - name: Checkout raylib repo 35 | uses: actions/checkout@v4 36 | with: 37 | repository: raysan5/raylib 38 | path: raylib 39 | 40 | # NOTE: Visual Studio project build configuration already defines all required directories where project is generated: 41 | # $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ 42 | - name: Setup Release Paths 43 | run: | 44 | echo "PROJECT_RELEASE_PATH=${{ env.PROJECT_NAME }}_v${{ github.event.release.tag_name }}_win_x64" >> $GITHUB_ENV 45 | shell: bash 46 | if: github.event_name == 'release' && github.event.action == 'published' 47 | 48 | - name: Setup Environment 49 | run: | 50 | mkdir ${{ env.PROJECT_RELEASE_PATH }} 51 | dir 52 | shell: cmd 53 | 54 | # Setup MSBuild.exe path if required 55 | - name: Setup MSBuild path 56 | uses: microsoft/setup-msbuild@v2 57 | 58 | - name: Build raylib Library + Product (VS2022 solution) 59 | run: | 60 | dir 61 | cd ${{ env.PROJECT_REPO_NAME }}/projects/VS2022 62 | msbuild.exe ${{ env.PROJECT_NAME }}.sln /target:${{ env.PROJECT_NAME }} /property:Configuration=Release /property:Platform=x64 /property:RaylibSrcPath="..\..\..\..\raylib\src" 63 | cd ../.. 64 | shell: cmd 65 | 66 | - name: Generate Artifacts 67 | run: | 68 | dir ${{ env.PROJECT_BUILD_PATH }} 69 | copy /Y ${{ env.PROJECT_BUILD_PATH }}\${{ env.PROJECT_NAME }}.exe ${{ env.PROJECT_RELEASE_PATH }}\${{ env.PROJECT_NAME }}.exe 70 | xcopy ${{ env.PROJECT_REPO_NAME }}\src\${{ env.PROJECT_RESOURCES_PATH }} ${{ env.PROJECT_RELEASE_PATH }}\${{ env.PROJECT_RESOURCES_PATH }} /s /e /i 71 | copy /Y ${{ env.PROJECT_REPO_NAME }}\README.md ${{ env.PROJECT_RELEASE_PATH }}\README.md 72 | copy /Y ${{ env.PROJECT_REPO_NAME }}\LICENSE ${{ env.PROJECT_RELEASE_PATH }}\LICENSE 73 | dir ${{ env.PROJECT_RELEASE_PATH }} 74 | 7z a .\${{ env.PROJECT_RELEASE_PATH }}.zip .\${{ env.PROJECT_RELEASE_PATH }} 75 | shell: cmd 76 | 77 | - name: Upload Artifacts 78 | uses: actions/upload-artifact@v4 79 | with: 80 | name: ${{ env.PROJECT_RELEASE_PATH }}.zip 81 | path: ./${{ env.PROJECT_RELEASE_PATH }}.zip 82 | 83 | - name: Upload Artifact to Release 84 | uses: softprops/action-gh-release@v1 85 | with: 86 | files: ${{ env.PROJECT_RELEASE_PATH }}.zip 87 | env: 88 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 89 | if: github.event_name == 'release' && github.event.action == 'published' 90 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | *.hex 38 | 39 | # Debug files 40 | *.dSYM/ 41 | *.su 42 | *.idb 43 | *.pdb 44 | 45 | # Kernel Module Compile Results 46 | *.mod* 47 | *.cmd 48 | .tmp_versions/ 49 | modules.order 50 | Module.symvers 51 | Mkfile.old 52 | dkms.conf 53 | 54 | # Visual Studio files 55 | [Dd]ebug/ 56 | [Dd]ebug.DLL/ 57 | [R]elease/ 58 | [Rr]elease.DLL/ 59 | *.user 60 | *.aps 61 | .vs 62 | 63 | # Clangd LSP 64 | .cache 65 | compile_commands.json 66 | 67 | # Build folder 68 | [Bb]uild 69 | 70 | # Android 71 | *apk* 72 | android.* 73 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19...3.24) 2 | 3 | # Generate compile_commands.json 4 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 5 | 6 | # Not ideal to use this global variable, but necessary to make sure that tooling and projects use the same version 7 | #set(CMAKE_CXX_STANDARD 11) 8 | set(CMAKE_C_STANDARD 99) 9 | 10 | # strongly encouraged to enable this globally to avoid conflicts between -Wpedantic being enabled and -std=c++20 and -std=gnu++20 for 11 | # example when compiling with PCH enabled 12 | #set(CMAKE_CXX_EXTENSIONS OFF) 13 | set(CMAKE_C_EXTENSIONS ON) 14 | 15 | # Set the project name to your project name, my project isn't very descriptive 16 | project(raylib_game 17 | VERSION 0.1.0 18 | LANGUAGES C CXX) 19 | 20 | # ---- Add dependencies via CPM ---- 21 | ## https://github.com/cpm-cmake/CPM.cmake 22 | set(CPM_DOWNLOAD_VERSION 0.40.2) 23 | if(CPM_SOURCE_CACHE) 24 | # Expand relative path. This is important if the provided path contains a tilde (~) 25 | get_filename_component(CPM_SOURCE_CACHE ${CPM_SOURCE_CACHE} ABSOLUTE) 26 | set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") 27 | elseif(DEFINED ENV{CPM_SOURCE_CACHE}) 28 | set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") 29 | else() 30 | set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") 31 | endif() 32 | if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION})) 33 | message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}") 34 | file(DOWNLOAD https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake ${CPM_DOWNLOAD_LOCATION}) 35 | endif() 36 | include(${CPM_DOWNLOAD_LOCATION}) 37 | ## add raylib (3rd-party) https://github.com/raysan5/raylib 38 | cpmaddpackage( 39 | NAME 40 | raylib 41 | GITHUB_REPOSITORY 42 | raysan5/raylib 43 | GIT_TAG 44 | #5.5 45 | master # use up-to-date branch 46 | ) 47 | target_compile_options(raylib PRIVATE $<$:-Wno-error=implicit-function-declaration>) 48 | target_compile_options(raylib PRIVATE $<$:-Wno-unused-result>) 49 | target_compile_options(raylib PRIVATE $<$:-Wno-stringop-overflow>) 50 | target_compile_options(raylib PRIVATE $<$:-Wno-implicit-const-int-float-conversion>) 51 | target_compile_features(raylib PRIVATE c_std_99) 52 | if("${PLATFORM}" STREQUAL "Desktop") 53 | target_compile_features(glfw PRIVATE c_std_99) 54 | endif() 55 | 56 | # ########################################################################################################################################## 57 | # Project 58 | # ########################################################################################################################################## 59 | 60 | add_subdirectory(src) 61 | 62 | # If MSVC is being used, and ASAN is enabled, we need to set the debugger environment so that it behaves well with MSVC's debugger, and we 63 | # can run the target from visual studio 64 | if(MSVC) 65 | get_all_installable_targets(all_targets) 66 | message("all_targets=${all_targets}") 67 | set_target_properties(${all_targets} PROPERTIES VS_DEBUGGER_ENVIRONMENT "PATH=$(VC_ExecutablePath_x64);%PATH%") 68 | endif() 69 | -------------------------------------------------------------------------------- /CONVENTIONS.md: -------------------------------------------------------------------------------- 1 | ## C Coding Style Conventions 2 | 3 | Code element | Convention | Example 4 | --- | :---: | --- 5 | Defines | ALL_CAPS | `#define PLATFORM_DESKTOP` 6 | Macros | ALL_CAPS | `#define MIN(a,b) (((a)<(b))?(a):(b))` 7 | Variables | lowerCase | `int screenWidth = 0;`, `float targetFrameTime = 0.016f;` 8 | Local variables | lowerCase | `Vector2 playerPosition = { 0 };` 9 | Global variables | lowerCase | `bool fullscreen = false;` 10 | Constants | lowerCase | `const int maxValue = 8;` 11 | Pointers | MyType *pointer | `Texture2D *array = NULL;` 12 | float values | always x.xf | `float gravity = 10.0f` 13 | Operators | value1*value2 | `int product = value*6;` 14 | Operators | value1/value2 | `int division = value/4;` 15 | Operators | value1 + value2 | `int sum = value + 10;` 16 | Operators | value1 - value2 | `int res = value - 5;` 17 | Enum | TitleCase | `enum TextureFormat` 18 | Enum members | ALL_CAPS | `PIXELFORMAT_UNCOMPRESSED_R8G8B8` 19 | Struct | TitleCase | `struct Texture2D`, `struct Material` 20 | Struct typedef | TitleCase | `typedef struct Texture { ... } Texture;` 21 | Struct members | lowerCase | `texture.width`, `color.r` 22 | Functions | TitleCase | `InitWindow()`, `LoadImageFromMemory()` 23 | Functions params | lowerCase | `width`, `height` 24 | Ternary Operator | (condition)? result1 : result2 | `printf("Value is 0: %s", (value == 0)? "yes" : "no");` 25 | 26 | Other conventions: 27 | - All defined variables are ALWAYS initialized 28 | - Four spaces are used, instead of TABS 29 | - Trailing spaces are always avoided 30 | - Control flow statements are followed **by a space**: 31 | ```c 32 | if (condition) value = 0; 33 | 34 | while (!WindowShouldClose()) 35 | { 36 | 37 | } 38 | 39 | for (int i = 0; i < NUM_VALUES; i++) printf("%i", i); 40 | 41 | switch (value) 42 | { 43 | case 0: 44 | { 45 | 46 | } break; 47 | case 2: break; 48 | default: break; 49 | } 50 | ``` 51 | - All conditions are always between parenthesis, but not boolean values: 52 | ```c 53 | if ((value > 1) && (value < 50) && valueActive) 54 | { 55 | 56 | } 57 | ``` 58 | - Braces and curly brackets always open-close in aligned mode: 59 | ```c 60 | void SomeFunction() 61 | { 62 | // TODO: Do something here! 63 | } 64 | ``` 65 | 66 | ## Files and Directories Naming Conventions 67 | 68 | - Directories are named using `snake_case`: `resources/models`, `resources/fonts` 69 | - Files are named using `snake_case`: `main_title.png`, `cubicmap.png`, `sound.wav` 70 | 71 | _NOTE: Spaces and special characters are always avoided in the files/dir naming!_ 72 | 73 | ## Games/Examples Directories Organization Conventions 74 | 75 | - Resource files are organized by context and usage in the game. Loading requirements for data are also considered (grouping data when required). 76 | - Descriptive names are used for the files, just reading the name of the file it should be possible to know what is that file and where fits in the game. 77 | 78 | ``` 79 | resources/audio/fx/long_jump.wav 80 | resources/audio/music/main_theme.ogg 81 | resources/screens/logo/logo.png 82 | resources/screens/title/title.png 83 | resources/screens/gameplay/background.png 84 | resources/characters/player.png 85 | resources/characters/enemy_slime.png 86 | resources/common/font_arial.ttf 87 | resources/common/gui.png 88 | ``` 89 | _NOTE: Some resources require to be loaded all at once while other require to be loaded only at initialization (gui, font)._ 90 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021-2025 Ramon Santamaria (@raysan5) 2 | 3 | This software is provided "as-is", without any express or implied warranty. In no event 4 | will the authors be held liable for any damages arising from the use of this software. 5 | 6 | Permission is granted to anyone to use this software for any purpose, including commercial 7 | applications, and to alter it and redistribute it freely, subject to the following restrictions: 8 | 9 | 1. The origin of this software must not be misrepresented; you must not claim that you 10 | wrote the original software. If you use this software in a product, an acknowledgment 11 | in the product documentation would be appreciated but is not required. 12 | 13 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented 14 | as being the original software. 15 | 16 | 3. This notice may not be removed or altered from any source distribution. 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ----------------------------------- 2 | 3 | _DISCLAIMER:_ 4 | 5 | Welcome to the **raylib gamejam template**! 6 | 7 | This template provides a base structure to start developing a small raylib game in plain C for any of the proposed **raylib gamejams**! 8 | 9 | Please, considering the following usual gamejam restrictions: 10 | 11 | - Game must be made with raylib 12 | - Game must be compiled for web 13 | - _Specific gamejam restrictions if defined_ 14 | 15 | NOTE: Several GitHub Actions workflows have been preconfigured to automatically build your game for Windows, Linux and WebAssembly on each commit. Those workflows automatically sync with latest version of raylib available to build. 16 | 17 | The repo is also pre-configured with a default `LICENSE` (zlib/libpng) and a `README.md` (this one) to be properly filled by users. Feel free to change the LICENSE as required. 18 | 19 | All the sections defined by `$(Data to Fill)` are expected to be edited and filled properly. It's recommended to delete this disclaimer message after editing this `README.md` file. 20 | 21 | _GETTING STARTED:_ 22 | 23 | First press the 'Use this template' button to clone the repo. 24 | 25 | This template does not include a copy of raylib itself. By default it expects to find raylib in the same folder as the one to which you've cloned this template. To start using this template with raylib 5.0, you can do the following: 26 | 27 | ```sh 28 | mkdir ~/raylib-gamejam && cd ~/raylib-gamejam 29 | git clone --depth 1 --branch 5.0 https://github.com/raysan5/raylib 30 | make -C raylib/src 31 | git clone https://github.com/$(User Name)/$(Repo Name).git 32 | cd $(Repo Name) 33 | make -C src 34 | src/raylib_game 35 | ``` 36 | 37 | This template has been created to be used with raylib (www.raylib.com) and it's licensed under an unmodified zlib/libpng license. 38 | 39 | _Copyright (c) 2022-2025 Ramon Santamaria ([@raysan5](https://twitter.com/raysan5))_ 40 | 41 | ----------------------------------- 42 | 43 | ## $(Game Title) 44 | 45 | ![$(Game Title)](screenshots/screenshot000.png "$(Game Title)") 46 | 47 | ### Description 48 | 49 | $(Your Project Description) 50 | 51 | ### Features 52 | 53 | - $(Project Feature 01) 54 | - $(Project Feature 02) 55 | - $(Project Feature 03) 56 | 57 | ### Controls 58 | 59 | Keyboard/Mouse: 60 | - $(Project Controls 01) 61 | - $(Project Controls 02) 62 | - $(Project Controls 03) 63 | 64 | ### Screenshots 65 | 66 | _TODO: Show your game to the world, animated GIFs recommended!._ 67 | 68 | ### Developers 69 | 70 | - $(Developer 01) - $(Role/Tasks Developed) 71 | - $(Developer 02) - $(Role/Tasks Developed) 72 | - $(Developer 03) - $(Role/Tasks Developed) 73 | 74 | ### Links 75 | 76 | - YouTube Gameplay: $(YouTube Link) 77 | - itch.io Release: $(itch.io Game Page) 78 | - Steam Release: $(Steam Game Page) 79 | 80 | ### License 81 | 82 | This project sources are licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](LICENSE) for further details. 83 | 84 | $(Additional Licenses) 85 | 86 | *Copyright (c) $(Year) $(User Name) ($(User Twitter/GitHub Name))* 87 | -------------------------------------------------------------------------------- /projects/VS2022/raylib/raylib.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug.DLL 6 | Win32 7 | 8 | 9 | Debug.DLL 10 | x64 11 | 12 | 13 | Debug 14 | Win32 15 | 16 | 17 | Debug 18 | x64 19 | 20 | 21 | Release.DLL 22 | Win32 23 | 24 | 25 | Release.DLL 26 | x64 27 | 28 | 29 | Release 30 | Win32 31 | 32 | 33 | Release 34 | x64 35 | 36 | 37 | 38 | {E89D61AC-55DE-4482-AFD4-DF7242EBC859} 39 | Win32Proj 40 | raylib 41 | 10.0 42 | C:\raylib\raylib\src 43 | 44 | 45 | 46 | StaticLibrary 47 | true 48 | $(DefaultPlatformToolset) 49 | Unicode 50 | 51 | 52 | StaticLibrary 53 | true 54 | $(DefaultPlatformToolset) 55 | Unicode 56 | 57 | 58 | DynamicLibrary 59 | true 60 | $(DefaultPlatformToolset) 61 | Unicode 62 | 63 | 64 | DynamicLibrary 65 | true 66 | $(DefaultPlatformToolset) 67 | Unicode 68 | 69 | 70 | StaticLibrary 71 | false 72 | $(DefaultPlatformToolset) 73 | Unicode 74 | 75 | 76 | StaticLibrary 77 | false 78 | $(DefaultPlatformToolset) 79 | Unicode 80 | 81 | 82 | DynamicLibrary 83 | false 84 | $(DefaultPlatformToolset) 85 | Unicode 86 | 87 | 88 | DynamicLibrary 89 | false 90 | $(DefaultPlatformToolset) 91 | Unicode 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ 125 | $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ 126 | 127 | 128 | $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ 129 | $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ 130 | 131 | 132 | $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ 133 | $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ 134 | 135 | 136 | $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ 137 | $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ 138 | 139 | 140 | $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ 141 | $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ 142 | 143 | 144 | $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ 145 | $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ 146 | 147 | 148 | $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ 149 | $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ 150 | 151 | 152 | $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ 153 | $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ 154 | 155 | 156 | 157 | 158 | 159 | Level3 160 | Disabled 161 | _CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_33;PLATFORM_DESKTOP 162 | CompileAsC 163 | $(RaylibSrcPath)\external\glfw\include 164 | 165 | 166 | Windows 167 | 168 | 169 | %(AdditionalLibraryDirectories) 170 | 171 | 172 | 173 | 174 | 175 | 176 | Level3 177 | Disabled 178 | _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_33;PLATFORM_DESKTOP 179 | CompileAsC 180 | $(RaylibSrcPath)\external\glfw\include 181 | 182 | 183 | Windows 184 | 185 | 186 | %(AdditionalLibraryDirectories) 187 | 188 | 189 | 190 | 191 | 192 | 193 | Level3 194 | Disabled 195 | _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_33;PLATFORM_DESKTOP;BUILD_LIBTYPE_SHARED 196 | CompileAsC 197 | $(RaylibSrcPath)\external\glfw\include 198 | MultiThreadedDebug 199 | 200 | 201 | Windows 202 | kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 203 | 204 | 205 | %(AdditionalLibraryDirectories) 206 | 207 | 208 | 209 | 210 | 211 | 212 | Level3 213 | Disabled 214 | _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_33;PLATFORM_DESKTOP;BUILD_LIBTYPE_SHARED 215 | CompileAsC 216 | $(RaylibSrcPath)\external\glfw\include 217 | MultiThreadedDebug 218 | 219 | 220 | Windows 221 | kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 222 | 223 | 224 | %(AdditionalLibraryDirectories) 225 | 226 | 227 | 228 | 229 | Level3 230 | 231 | 232 | MaxSpeed 233 | true 234 | true 235 | _CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_33;PLATFORM_DESKTOP 236 | $(RaylibSrcPath)\external\glfw\include 237 | CompileAsC 238 | MultiThreaded 239 | 240 | 241 | Windows 242 | true 243 | true 244 | 245 | 246 | 247 | 248 | Level3 249 | 250 | 251 | MaxSpeed 252 | true 253 | true 254 | _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_33;PLATFORM_DESKTOP 255 | $(RaylibSrcPath)\external\glfw\include 256 | CompileAsC 257 | 258 | MultiThreaded 259 | 260 | 261 | Windows 262 | true 263 | true 264 | 265 | 266 | 267 | 268 | Level3 269 | 270 | 271 | MaxSpeed 272 | true 273 | true 274 | _CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_33;PLATFORM_DESKTOP;BUILD_LIBTYPE_SHARED 275 | $(RaylibSrcPath)\external\glfw\include 276 | CompileAsC 277 | MultiThreaded 278 | 279 | 280 | Windows 281 | true 282 | true 283 | kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 284 | 285 | 286 | 287 | 288 | Level3 289 | 290 | 291 | MaxSpeed 292 | true 293 | true 294 | _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_33;PLATFORM_DESKTOP;BUILD_LIBTYPE_SHARED 295 | $(RaylibSrcPath)\external\glfw\include 296 | CompileAsC 297 | MultiThreaded 298 | 299 | 300 | 301 | Windows 302 | true 303 | true 304 | kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | -------------------------------------------------------------------------------- /projects/VS2022/raylib_game.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31912.275 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raylib", "raylib\raylib.vcxproj", "{E89D61AC-55DE-4482-AFD4-DF7242EBC859}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raylib_game", "raylib_game\raylib_game.vcxproj", "{0981CA98-E4A5-4DF1-987F-A41D09131EFC}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug.DLL|x64 = Debug.DLL|x64 13 | Debug.DLL|x86 = Debug.DLL|x86 14 | Debug|x64 = Debug|x64 15 | Debug|x86 = Debug|x86 16 | Release.DLL|x64 = Release.DLL|x64 17 | Release.DLL|x86 = Release.DLL|x86 18 | Release|x64 = Release|x64 19 | Release|x86 = Release|x86 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 23 | {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 24 | {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 25 | {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 26 | {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x64.ActiveCfg = Debug|x64 27 | {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x64.Build.0 = Debug|x64 28 | {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x86.ActiveCfg = Debug|Win32 29 | {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x86.Build.0 = Debug|Win32 30 | {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 31 | {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release.DLL|x64.Build.0 = Release.DLL|x64 32 | {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 33 | {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release.DLL|x86.Build.0 = Release.DLL|Win32 34 | {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x64.ActiveCfg = Release|x64 35 | {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x64.Build.0 = Release|x64 36 | {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x86.ActiveCfg = Release|Win32 37 | {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x86.Build.0 = Release|Win32 38 | {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 39 | {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 40 | {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 41 | {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 42 | {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug|x64.ActiveCfg = Debug|x64 43 | {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug|x64.Build.0 = Debug|x64 44 | {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug|x86.ActiveCfg = Debug|Win32 45 | {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug|x86.Build.0 = Debug|Win32 46 | {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 47 | {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x64.Build.0 = Release.DLL|x64 48 | {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 49 | {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x86.Build.0 = Release.DLL|Win32 50 | {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x64.ActiveCfg = Release|x64 51 | {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x64.Build.0 = Release|x64 52 | {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.ActiveCfg = Release|Win32 53 | {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.Build.0 = Release|Win32 54 | EndGlobalSection 55 | GlobalSection(SolutionProperties) = preSolution 56 | HideSolutionNode = FALSE 57 | EndGlobalSection 58 | GlobalSection(ExtensibilityGlobals) = postSolution 59 | SolutionGuid = {E926C768-6307-4423-A1EC-57E95B1FAB29} 60 | EndGlobalSection 61 | EndGlobal 62 | -------------------------------------------------------------------------------- /projects/VS2022/raylib_game/raylib_game.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug.DLL 6 | Win32 7 | 8 | 9 | Debug.DLL 10 | x64 11 | 12 | 13 | Debug 14 | Win32 15 | 16 | 17 | Debug 18 | x64 19 | 20 | 21 | Release.DLL 22 | Win32 23 | 24 | 25 | Release.DLL 26 | x64 27 | 28 | 29 | Release 30 | Win32 31 | 32 | 33 | Release 34 | x64 35 | 36 | 37 | 38 | {0981CA98-E4A5-4DF1-987F-A41D09131EFC} 39 | Win32Proj 40 | raylib_game 41 | raylib_game 42 | 10.0 43 | 44 | 45 | 46 | Application 47 | true 48 | $(DefaultPlatformToolset) 49 | Unicode 50 | $(SolutionDir)..\..\src 51 | 52 | 53 | Application 54 | true 55 | $(DefaultPlatformToolset) 56 | Unicode 57 | $(SolutionDir)..\..\src 58 | 59 | 60 | Application 61 | true 62 | $(DefaultPlatformToolset) 63 | Unicode 64 | $(SolutionDir)..\..\src 65 | 66 | 67 | Application 68 | true 69 | $(DefaultPlatformToolset) 70 | Unicode 71 | $(SolutionDir)..\..\src 72 | 73 | 74 | Application 75 | false 76 | $(DefaultPlatformToolset) 77 | true 78 | Unicode 79 | $(SolutionDir)..\..\src 80 | 81 | 82 | Application 83 | false 84 | $(DefaultPlatformToolset) 85 | true 86 | Unicode 87 | $(SolutionDir)..\..\src 88 | 89 | 90 | Application 91 | false 92 | $(DefaultPlatformToolset) 93 | true 94 | Unicode 95 | $(SolutionDir)..\..\src 96 | 97 | 98 | Application 99 | false 100 | $(DefaultPlatformToolset) 101 | true 102 | Unicode 103 | $(SolutionDir)..\..\src 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | true 137 | $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ 138 | $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ 139 | 140 | 141 | true 142 | $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ 143 | $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ 144 | 145 | 146 | true 147 | $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ 148 | $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ 149 | 150 | 151 | true 152 | $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ 153 | $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ 154 | 155 | 156 | false 157 | $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ 158 | $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ 159 | 160 | 161 | false 162 | $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ 163 | $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ 164 | 165 | 166 | false 167 | $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ 168 | $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ 169 | 170 | 171 | false 172 | $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ 173 | $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ 174 | 175 | 176 | 177 | 178 | 179 | Level3 180 | Disabled 181 | _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) 182 | CompileAsC 183 | $(SolutionDir)..\..\src;$(SolutionDir)..\..\src\external;$(SolutionDir)..\..\..\raylib\src;%(AdditionalIncludeDirectories) 184 | 185 | 186 | Console 187 | true 188 | $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ 189 | raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 190 | 191 | 192 | 193 | 194 | 195 | 196 | Level3 197 | Disabled 198 | _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) 199 | CompileAsC 200 | $(SolutionDir)..\..\src;$(SolutionDir)..\..\src\external;$(SolutionDir)..\..\..\raylib\src;%(AdditionalIncludeDirectories) 201 | /FS %(AdditionalOptions) 202 | 203 | 204 | Console 205 | true 206 | $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ 207 | raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 208 | 209 | 210 | 211 | 212 | 213 | 214 | Level3 215 | Disabled 216 | _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) 217 | CompileAsC 218 | $(SolutionDir)..\..\src;$(SolutionDir)..\..\src\external;$(SolutionDir)..\..\..\raylib\src;%(AdditionalIncludeDirectories) 219 | 220 | 221 | Console 222 | true 223 | $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ 224 | raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 225 | 226 | 227 | xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" 228 | Copy Debug DLL to output directory 229 | 230 | 231 | 232 | 233 | 234 | 235 | Level3 236 | Disabled 237 | _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) 238 | CompileAsC 239 | $(SolutionDir)..\..\src;$(SolutionDir)..\..\src\external;$(SolutionDir)..\..\..\raylib\src;%(AdditionalIncludeDirectories) 240 | 241 | 242 | Console 243 | true 244 | $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ 245 | raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 246 | 247 | 248 | xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" 249 | Copy Debug DLL to output directory 250 | 251 | 252 | 253 | 254 | Level3 255 | 256 | 257 | MaxSpeed 258 | true 259 | true 260 | _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) 261 | $(SolutionDir)..\..\src;$(SolutionDir)..\..\src\external;$(SolutionDir)..\..\..\raylib\src;%(AdditionalIncludeDirectories) 262 | CompileAsC 263 | true 264 | MultiThreaded 265 | Speed 266 | 267 | 268 | Console 269 | true 270 | true 271 | true 272 | raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 273 | $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ 274 | 275 | 276 | 277 | 278 | Level3 279 | 280 | 281 | MaxSpeed 282 | true 283 | true 284 | _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) 285 | $(SolutionDir)..\..\src;$(SolutionDir)..\..\src\external;$(SolutionDir)..\..\..\raylib\src;%(AdditionalIncludeDirectories) 286 | CompileAsC 287 | true 288 | MultiThreaded 289 | Speed 290 | 291 | 292 | Console 293 | true 294 | true 295 | true 296 | raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 297 | $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ 298 | 299 | 300 | 301 | 302 | Level3 303 | 304 | 305 | MaxSpeed 306 | true 307 | true 308 | _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) 309 | $(SolutionDir)..\..\src;$(SolutionDir)..\..\src\external;$(SolutionDir)..\..\..\raylib\src;%(AdditionalIncludeDirectories) 310 | CompileAsC 311 | true 312 | 313 | 314 | Console 315 | true 316 | true 317 | true 318 | raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 319 | $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ 320 | 321 | 322 | xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" 323 | 324 | 325 | Copy Release DLL to output directory 326 | 327 | 328 | 329 | 330 | Level3 331 | 332 | 333 | MaxSpeed 334 | true 335 | true 336 | _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) 337 | $(SolutionDir)..\..\src;$(SolutionDir)..\..\src\external;$(SolutionDir)..\..\..\raylib\src;%(AdditionalIncludeDirectories) 338 | CompileAsC 339 | true 340 | 341 | 342 | Console 343 | true 344 | true 345 | true 346 | raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 347 | $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ 348 | 349 | 350 | xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" 351 | 352 | 353 | Copy Release DLL to output directory 354 | 355 | 356 | 357 | 358 | {e89d61ac-55de-4482-afd4-df7242ebc859} 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | -------------------------------------------------------------------------------- /screenshots/screenshot000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raysan5/raylib-gamejam-template/825f431a45c06516d19a9996f288b0c48d4fe87b/screenshots/screenshot000.png -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(raylib_game) 2 | # @NOTE: add more source files here 3 | target_sources(raylib_game PRIVATE raylib_game.c) 4 | 5 | target_include_directories(raylib_game PRIVATE "$") 6 | target_link_libraries(raylib_game raylib) 7 | if(NOT WIN32) 8 | target_link_libraries(raylib_game m) 9 | endif() 10 | 11 | # Web Configurations 12 | if (${PLATFORM} STREQUAL "Web") 13 | set_target_properties(raylib_game PROPERTIES SUFFIX ".html") # Tell Emscripten to build an example.html file. 14 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s USE_GLFW=3 -s FORCE_FILESYSTEM=1 -s WASM=1") 15 | 16 | set(web_link_flags) 17 | if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo) 18 | set(web_link_flags "${web_link_flags} -s ASSERTIONS=1") 19 | endif() 20 | set(web_link_flags "${web_link_flags} --preload-file ${CMAKE_CURRENT_SOURCE_DIR}/resources@resources --use-preload-plugins") 21 | set(web_link_flags "${web_link_flags} --shell-file ${CMAKE_CURRENT_SOURCE_DIR}/minshell.html") 22 | 23 | set_target_properties(raylib_game PROPERTIES LINK_FLAGS "${web_link_flags}") 24 | endif() 25 | 26 | # Checks if OSX and links appropriate frameworks (only required on MacOS) 27 | if(APPLE) 28 | target_link_libraries(raylib_game "-framework IOKit") 29 | target_link_libraries(raylib_game "-framework Cocoa") 30 | target_link_libraries(raylib_game "-framework OpenGL") 31 | endif() 32 | 33 | # misc 34 | set_target_properties(raylib_game PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}") 35 | # set the startup project for the "play" button in MSVC 36 | set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT raylib_game) 37 | -------------------------------------------------------------------------------- /src/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | gamejam_template 9 | CFBundleIconFile 10 | raylib.icns 11 | CFBundleIdentifier 12 | com.raylibtech.gamejam_template 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | gamejam_template 17 | CFBundlePackageType 18 | APPL 19 | CFBundleVersion 20 | 1.0 21 | CFBundleShortVersionString 22 | 1.0.0 23 | LSMinimumSystemVersion 24 | 10.12 25 | NSHumanReadableCopyright 26 | Copyright (c) 2025 raylib technologies (@raylibtech) 27 | CFBundleSignature 28 | ???? 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/Makefile: -------------------------------------------------------------------------------- 1 | #************************************************************************************************** 2 | # 3 | # raylib makefile for Desktop platforms, Web (Wasm), Raspberry Pi (DRM mode) and Android 4 | # 5 | # Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) 6 | # 7 | # This software is provided "as-is", without any express or implied warranty. In no event 8 | # will the authors be held liable for any damages arising from the use of this software. 9 | # 10 | # Permission is granted to anyone to use this software for any purpose, including commercial 11 | # applications, and to alter it and redistribute it freely, subject to the following restrictions: 12 | # 13 | # 1. The origin of this software must not be misrepresented; you must not claim that you 14 | # wrote the original software. If you use this software in a product, an acknowledgment 15 | # in the product documentation would be appreciated but is not required. 16 | # 17 | # 2. Altered source versions must be plainly marked as such, and must not be misrepresented 18 | # as being the original software. 19 | # 20 | # 3. This notice may not be removed or altered from any source distribution. 21 | # 22 | #************************************************************************************************** 23 | 24 | .PHONY: all clean 25 | 26 | # Define required environment variables 27 | #------------------------------------------------------------------------------------------------ 28 | # Define target platform: PLATFORM_DESKTOP, PLATFORM_WEB, PLATFORM_DRM, PLATFORM_ANDROID 29 | PLATFORM ?= PLATFORM_DESKTOP 30 | 31 | # Define project variables 32 | PROJECT_NAME ?= raylib_game 33 | PROJECT_VERSION ?= 1.0 34 | PROJECT_BUILD_PATH ?= . 35 | PROJECT_SOURCE_FILES ?= raylib_game.c 36 | 37 | # raylib library variables 38 | RAYLIB_SRC_PATH ?= C:/raylib/raylib/src 39 | RAYLIB_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH) 40 | RAYLIB_LIB_PATH ?= $(RAYLIB_SRC_PATH) 41 | 42 | # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) 43 | RAYLIB_LIBTYPE ?= STATIC 44 | 45 | # Define compiler path on Windows 46 | COMPILER_PATH ?= C:\raylib\w64devkit\bin 47 | 48 | # Build mode for project: DEBUG or RELEASE 49 | BUILD_MODE ?= RELEASE 50 | 51 | # PLATFORM_WEB: Default properties 52 | BUILD_WEB_ASYNCIFY ?= FALSE 53 | BUILD_WEB_SHELL ?= minshell.html 54 | BUILD_WEB_HEAP_SIZE ?= 128MB 55 | BUILD_WEB_STACK_SIZE ?= 1MB 56 | BUILD_WEB_ASYNCIFY_STACK_SIZE ?= 1048576 57 | BUILD_WEB_RESOURCES ?= TRUE 58 | BUILD_WEB_RESOURCES_PATH ?= resources 59 | 60 | # Determine PLATFORM_OS in case PLATFORM_DESKTOP selected 61 | ifeq ($(PLATFORM),PLATFORM_DESKTOP) 62 | # No uname.exe on MinGW!, but OS=Windows_NT on Windows! 63 | # ifeq ($(UNAME),Msys) -> Windows 64 | ifeq ($(OS),Windows_NT) 65 | PLATFORM_OS = WINDOWS 66 | export PATH := $(COMPILER_PATH):$(PATH) 67 | else 68 | UNAMEOS = $(shell uname) 69 | ifeq ($(UNAMEOS),Linux) 70 | PLATFORM_OS = LINUX 71 | endif 72 | ifeq ($(UNAMEOS),FreeBSD) 73 | PLATFORM_OS = BSD 74 | endif 75 | ifeq ($(UNAMEOS),OpenBSD) 76 | PLATFORM_OS = BSD 77 | endif 78 | ifeq ($(UNAMEOS),NetBSD) 79 | PLATFORM_OS = BSD 80 | endif 81 | ifeq ($(UNAMEOS),DragonFly) 82 | PLATFORM_OS = BSD 83 | endif 84 | ifeq ($(UNAMEOS),Darwin) 85 | PLATFORM_OS = OSX 86 | endif 87 | endif 88 | endif 89 | ifeq ($(PLATFORM),PLATFORM_DRM) 90 | UNAMEOS = $(shell uname) 91 | ifeq ($(UNAMEOS),Linux) 92 | PLATFORM_OS = LINUX 93 | endif 94 | endif 95 | 96 | ifeq ($(PLATFORM_OS),WINDOWS) 97 | ifeq ($(PLATFORM),PLATFORM_WEB) 98 | # Emscripten required variables 99 | EMSDK_PATH ?= C:/raylib/emsdk 100 | EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten 101 | CLANG_PATH = $(EMSDK_PATH)/upstream/bin 102 | PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-nuget_64bit 103 | NODE_PATH = $(EMSDK_PATH)/node/20.18.0_64bit/bin 104 | export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH):$$(PATH) 105 | endif 106 | endif 107 | 108 | # Define default C compiler: CC 109 | #------------------------------------------------------------------------------------------------ 110 | CC = gcc 111 | 112 | ifeq ($(PLATFORM),PLATFORM_DESKTOP) 113 | ifeq ($(PLATFORM_OS),OSX) 114 | # OSX default compiler 115 | CC = clang 116 | endif 117 | ifeq ($(PLATFORM_OS),BSD) 118 | # FreeBSD, OpenBSD, NetBSD, DragonFly default compiler 119 | CC = clang 120 | endif 121 | endif 122 | ifeq ($(PLATFORM),PLATFORM_WEB) 123 | # HTML5 emscripten compiler 124 | # WARNING: To compile to HTML5, code must be redesigned 125 | # to use emscripten.h and emscripten_set_main_loop() 126 | CC = emcc 127 | endif 128 | ifeq ($(PLATFORM),PLATFORM_DRM) 129 | ifeq ($(USE_RPI_CROSS_COMPILER),TRUE) 130 | # Define RPI cross-compiler 131 | #CC = armv6j-hardfloat-linux-gnueabi-gcc 132 | CC = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-gcc 133 | endif 134 | endif 135 | 136 | 137 | # Define default make program: MAKE 138 | #------------------------------------------------------------------------------------------------ 139 | MAKE ?= make 140 | 141 | ifeq ($(PLATFORM),PLATFORM_DESKTOP) 142 | ifeq ($(PLATFORM_OS),WINDOWS) 143 | MAKE = mingw32-make 144 | endif 145 | endif 146 | 147 | # Define compiler flags: CFLAGS 148 | #------------------------------------------------------------------------------------------------ 149 | # -O1 defines optimization level 150 | # -g include debug information on compilation 151 | # -s strip unnecessary data from build 152 | # -Wall turns on most, but not all, compiler warnings 153 | # -std=c99 defines C language mode (standard C from 1999 revision) 154 | # -std=gnu99 defines C language mode (GNU C from 1999 revision) 155 | # -Wno-missing-braces ignore invalid warning (GCC bug 53119) 156 | # -Wno-unused-value ignore unused return values of some functions (i.e. fread()) 157 | # -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec 158 | CFLAGS = -std=c99 -Wall -Wno-missing-braces -Wno-unused-value -Wno-pointer-sign -D_DEFAULT_SOURCE $(PROJECT_CUSTOM_FLAGS) 159 | #CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes 160 | 161 | ifeq ($(BUILD_MODE),DEBUG) 162 | CFLAGS += -g -D_DEBUG 163 | else 164 | ifeq ($(PLATFORM),PLATFORM_WEB) 165 | ifeq ($(BUILD_WEB_ASYNCIFY),TRUE) 166 | CFLAGS += -O3 167 | else 168 | CFLAGS += -Os 169 | endif 170 | else 171 | ifeq ($(PLATFORM_OS),OSX) 172 | CFLAGS += -O2 173 | else 174 | CFLAGS += -s -O2 175 | endif 176 | endif 177 | endif 178 | ifeq ($(PLATFORM),PLATFORM_DRM) 179 | CFLAGS += -std=gnu99 -DEGL_NO_X11 180 | endif 181 | 182 | # Define include paths for required headers: INCLUDE_PATHS 183 | #------------------------------------------------------------------------------------------------ 184 | INCLUDE_PATHS += -I. -Iexternal -I$(RAYLIB_INCLUDE_PATH) 185 | 186 | # Define additional directories containing required header files 187 | ifeq ($(PLATFORM),PLATFORM_DRM) 188 | # DRM required libraries 189 | INCLUDE_PATHS += -I/usr/include/libdrm 190 | endif 191 | ifeq ($(PLATFORM),PLATFORM_DESKTOP) 192 | ifeq ($(PLATFORM_OS),BSD) 193 | # Consider -L$(RAYLIB_H_INSTALL_PATH) 194 | INCLUDE_PATHS += -I/usr/local/include 195 | endif 196 | endif 197 | 198 | # Define library paths containing required libs: LDFLAGS 199 | #------------------------------------------------------------------------------------------------ 200 | LDFLAGS = -L. -L$(RAYLIB_LIB_PATH) 201 | 202 | ifeq ($(PLATFORM),PLATFORM_DESKTOP) 203 | ifeq ($(PLATFORM_OS),WINDOWS) 204 | # NOTE: The resource .rc file contains windows executable icon and properties 205 | LDFLAGS += $(RAYLIB_SRC_PATH)/raylib.rc.data 206 | # -Wl,--subsystem,windows hides the console window 207 | ifeq ($(BUILD_MODE), RELEASE) 208 | LDFLAGS += -Wl,--subsystem,windows 209 | endif 210 | endif 211 | ifeq ($(PLATFORM_OS),BSD) 212 | # Consider -L$(RAYLIB_INSTALL_PATH) 213 | LDFLAGS += -Lsrc -L/usr/local/lib 214 | endif 215 | ifeq ($(PLATFORM_OS),LINUX) 216 | # Reset everything. 217 | # Precedence: immediately local, installed version, raysan5 provided libs 218 | #LDFLAGS += -L$(RAYLIB_RELEASE_PATH) 219 | endif 220 | endif 221 | ifeq ($(PLATFORM),PLATFORM_WEB) 222 | # -Os # size optimization 223 | # -O2 # optimization level 2, if used, also set --memory-init-file 0 224 | # -sUSE_GLFW=3 # Use glfw3 library (context/input management) 225 | # -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL! 226 | # -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB) 227 | # -sUSE_PTHREADS=1 # multithreading support 228 | # -sWASM=0 # disable Web Assembly, emitted by default 229 | # -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS 230 | # -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data 231 | # -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off) 232 | # -sMINIFY_HTML=0 # minify generated html from shell.html 233 | # --profiling # include information for code profiling 234 | # --memory-init-file 0 # to avoid an external memory initialization code file (.mem) 235 | # --preload-file resources # specify a resources folder for data compilation 236 | # --source-map-base # allow debugging in browser with source map 237 | # --shell-file shell.html # define a custom shell .html and output extension 238 | LDFLAGS += -sUSE_GLFW=3 -sTOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -sSTACK_SIZE=$(BUILD_WEB_STACK_SIZE) -sFORCE_FILESYSTEM=1 -sMINIFY_HTML=0 239 | 240 | # Build using asyncify 241 | ifeq ($(BUILD_WEB_ASYNCIFY),TRUE) 242 | LDFLAGS += -sASYNCIFY -sASYNCIFY_STACK_SIZE=$(BUILD_WEB_ASYNCIFY_STACK_SIZE) 243 | endif 244 | 245 | # Add resources building if required 246 | ifeq ($(BUILD_WEB_RESOURCES),TRUE) 247 | LDFLAGS += --preload-file $(BUILD_WEB_RESOURCES_PATH) 248 | endif 249 | 250 | # Add debug mode flags if required 251 | ifeq ($(BUILD_MODE),DEBUG) 252 | LDFLAGS += -sASSERTIONS=1 --profiling 253 | endif 254 | 255 | # Define a custom shell .html and output extension 256 | LDFLAGS += --shell-file $(BUILD_WEB_SHELL) 257 | EXT = .html 258 | endif 259 | 260 | # Define libraries required on linking: LDLIBS 261 | # NOTE: To link libraries (lib.so or lib.a), use -l 262 | #------------------------------------------------------------------------------------------------ 263 | ifeq ($(PLATFORM),PLATFORM_DESKTOP) 264 | ifeq ($(PLATFORM_OS),WINDOWS) 265 | # Libraries for Windows desktop compilation 266 | # NOTE: WinMM library required to set high-res timer resolution 267 | LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm -lcomdlg32 -lole32 268 | # Required for physac examples 269 | ifeq ($(RAYLIB_LIBTYPE),SHARED) 270 | LDLIBS += -lpthread 271 | else 272 | LDLIBS += -static -lpthread 273 | endif 274 | endif 275 | ifeq ($(PLATFORM_OS),LINUX) 276 | # Libraries for Debian GNU/Linux desktop compiling 277 | # NOTE: Required packages: libegl1-mesa-dev 278 | LDLIBS = -lraylib -lGL -lm -lpthread -ldl -lrt 279 | 280 | # On Wayland windowing system, additional libraries requires 281 | ifeq ($(USE_WAYLAND_DISPLAY),TRUE) 282 | LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon 283 | else 284 | # On X11 requires also below libraries 285 | LDLIBS += -lX11 286 | # NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them 287 | #LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor 288 | endif 289 | # Explicit link to libc 290 | ifeq ($(RAYLIB_LIBTYPE),SHARED) 291 | LDLIBS += -lc 292 | endif 293 | endif 294 | ifeq ($(PLATFORM_OS),OSX) 295 | # Libraries for OSX 10.9 desktop compiling 296 | # NOTE: Required packages: libopenal-dev libegl1-mesa-dev 297 | LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo 298 | endif 299 | ifeq ($(PLATFORM_OS),BSD) 300 | # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling 301 | # NOTE: Required packages: mesa-libs 302 | LDLIBS = -lraylib -lGL -lpthread -lm 303 | 304 | # On XWindow requires also below libraries 305 | LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor 306 | endif 307 | endif 308 | ifeq ($(PLATFORM),PLATFORM_WEB) 309 | # Libraries for web (HTML5) compiling 310 | LDLIBS = $(RAYLIB_LIB_PATH)/libraylib.web.a 311 | endif 312 | ifeq ($(PLATFORM),PLATFORM_DRM) 313 | # Libraries for DRM compiling 314 | # NOTE: Required packages: libasound2-dev (ALSA) 315 | LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl 316 | endif 317 | 318 | 319 | # Define all object files from source files 320 | #------------------------------------------------------------------------------------------------ 321 | OBJS = $(patsubst %.c, %.o, $(PROJECT_SOURCE_FILES)) 322 | 323 | # Define processes to execute 324 | #------------------------------------------------------------------------------------------------ 325 | # For Android platform we call a custom Makefile.Android 326 | ifeq ($(PLATFORM),PLATFORM_ANDROID) 327 | MAKEFILE_TARGET = -f Makefile.Android 328 | export PROJECT_NAME 329 | export PROJECT_SOURCE_FILES 330 | else 331 | MAKEFILE_TARGET = $(PROJECT_NAME) 332 | endif 333 | 334 | # Default target entry 335 | # NOTE: We call this Makefile target or Makefile.Android target 336 | all: 337 | $(MAKE) $(MAKEFILE_TARGET) 338 | 339 | # Project target defined by PROJECT_NAME 340 | $(PROJECT_NAME): $(OBJS) 341 | $(CC) -o $(PROJECT_BUILD_PATH)/$(PROJECT_NAME)$(EXT) $(OBJS) $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) 342 | 343 | # Compile source files 344 | # NOTE: This pattern will compile every module defined on $(OBJS) 345 | %.o: %.c 346 | $(CC) -c $< -o $@ $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) 347 | 348 | # Clean everything 349 | clean: 350 | ifeq ($(PLATFORM),PLATFORM_DESKTOP) 351 | ifeq ($(PLATFORM_OS),WINDOWS) 352 | del *.o *.exe /s 353 | endif 354 | ifeq ($(PLATFORM_OS),LINUX) 355 | find . -type f -executable -delete 356 | rm -fv *.o 357 | endif 358 | ifeq ($(PLATFORM_OS),OSX) 359 | rm -f *.o external/*.o $(PROJECT_NAME) 360 | endif 361 | endif 362 | ifeq ($(PLATFORM),PLATFORM_DRM) 363 | find . -type f -executable -delete 364 | rm -fv *.o 365 | endif 366 | ifeq ($(PLATFORM),PLATFORM_WEB) 367 | del *.o *.html *.js 368 | endif 369 | @echo Cleaning done 370 | 371 | -------------------------------------------------------------------------------- /src/Makefile.Android: -------------------------------------------------------------------------------- 1 | #************************************************************************************************** 2 | # 3 | # raylib makefile for Android project (APK building) 4 | # 5 | # Copyright (c) 2017-2025 Ramon Santamaria (@raysan5) 6 | # 7 | # This software is provided "as-is", without any express or implied warranty. In no event 8 | # will the authors be held liable for any damages arising from the use of this software. 9 | # 10 | # Permission is granted to anyone to use this software for any purpose, including commercial 11 | # applications, and to alter it and redistribute it freely, subject to the following restrictions: 12 | # 13 | # 1. The origin of this software must not be misrepresented; you must not claim that you 14 | # wrote the original software. If you use this software in a product, an acknowledgment 15 | # in the product documentation would be appreciated but is not required. 16 | # 17 | # 2. Altered source versions must be plainly marked as such, and must not be misrepresented 18 | # as being the original software. 19 | # 20 | # 3. This notice may not be removed or altered from any source distribution. 21 | # 22 | #************************************************************************************************** 23 | 24 | SHELL=cmd 25 | 26 | # Define required raylib variables 27 | PLATFORM ?= PLATFORM_ANDROID 28 | RAYLIB_PATH ?= ..\..\raylib 29 | 30 | # Define Android architecture (armeabi-v7a, arm64-v8a, x86, x86-64) and API version 31 | # Starting in 2019 using ARM64 is mandatory for published apps, 32 | # Starting on August 2020, minimum required target API is Android 10 (API level 29) 33 | ANDROID_ARCH ?= ARM64 34 | ANDROID_API_VERSION ?= 29 35 | 36 | ifeq ($(ANDROID_ARCH),ARM) 37 | ANDROID_ARCH_NAME = armeabi-v7a 38 | endif 39 | ifeq ($(ANDROID_ARCH),ARM64) 40 | ANDROID_ARCH_NAME = arm64-v8a 41 | endif 42 | ifeq ($(ANDROID_ARCH),x86) 43 | ANDROID_ARCH_NAME = x86 44 | endif 45 | ifeq ($(ANDROID_ARCH),x86_64) 46 | ANDROID_ARCH_NAME = x86_64 47 | endif 48 | 49 | # Required path variables 50 | # NOTE: JAVA_HOME must be set to JDK (using OpenJDK 13) 51 | JAVA_HOME ?= C:/open-jdk 52 | ANDROID_HOME ?= C:/android-sdk 53 | ANDROID_NDK ?= C:/android-ndk 54 | ANDROID_TOOLCHAIN ?= $(ANDROID_NDK)/toolchains/llvm/prebuilt/windows-x86_64 55 | ANDROID_BUILD_TOOLS ?= $(ANDROID_HOME)/build-tools/29.0.3 56 | ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools 57 | 58 | # Android project configuration variables 59 | PROJECT_NAME ?= raylib_game 60 | PROJECT_LIBRARY_NAME ?= main 61 | PROJECT_BUILD_ID ?= android 62 | PROJECT_BUILD_PATH ?= $(PROJECT_BUILD_ID).$(PROJECT_NAME) 63 | PROJECT_RESOURCES_PATH ?= resources 64 | PROJECT_SOURCE_FILES ?= simple_game.c 65 | 66 | # Some source files are placed in directories, when compiling to some 67 | # output directory other than source, that directory must pre-exist. 68 | # Here we get a list of required folders that need to be created on 69 | # code output folder $(PROJECT_BUILD_PATH)\obj to avoid GCC errors. 70 | PROJECT_SOURCE_DIRS = $(sort $(dir $(PROJECT_SOURCE_FILES))) 71 | 72 | # Android app configuration variables 73 | APP_LABEL_NAME ?= rGame 74 | APP_COMPANY_NAME ?= raylib 75 | APP_PRODUCT_NAME ?= rgame 76 | APP_VERSION_CODE ?= 1 77 | APP_VERSION_NAME ?= 1.0 78 | APP_ICON_LDPI ?= $(RAYLIB_PATH)\logo\raylib_36x36.png 79 | APP_ICON_MDPI ?= $(RAYLIB_PATH)\logo\raylib_48x48.png 80 | APP_ICON_HDPI ?= $(RAYLIB_PATH)\logo\raylib_72x72.png 81 | APP_SCREEN_ORIENTATION ?= landscape 82 | APP_KEYSTORE_PASS ?= raylib 83 | 84 | # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) 85 | RAYLIB_LIBTYPE ?= STATIC 86 | 87 | # Library path for libraylib.a/libraylib.so 88 | RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src 89 | 90 | # Shared libs must be added to APK if required 91 | # NOTE: Generated NativeLoader.java automatically load those libraries 92 | ifeq ($(RAYLIB_LIBTYPE),SHARED) 93 | PROJECT_SHARED_LIBS = lib/$(ANDROID_ARCH_NAME)/libraylib.so 94 | endif 95 | 96 | # Compiler and archiver 97 | ifeq ($(ANDROID_ARCH),ARM) 98 | CC = $(ANDROID_TOOLCHAIN)/bin/armv7a-linux-androideabi$(ANDROID_API_VERSION)-clang 99 | AR = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-ar 100 | endif 101 | ifeq ($(ANDROID_ARCH),ARM64) 102 | CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android$(ANDROID_API_VERSION)-clang 103 | AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar 104 | endif 105 | ifeq ($(ANDROID_ARCH),x86) 106 | CC = $(ANDROID_TOOLCHAIN)/bin/i686-linux-android$(ANDROID_API_VERSION)-clang 107 | AR = $(ANDROID_TOOLCHAIN)/bin/i686-linux-android-ar 108 | endif 109 | ifeq ($(ANDROID_ARCH),x86_64) 110 | CC = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android$(ANDROID_API_VERSION)-clang 111 | AR = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android-ar 112 | endif 113 | 114 | # Compiler flags for arquitecture 115 | ifeq ($(ANDROID_ARCH),ARM) 116 | CFLAGS = -std=c99 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 117 | endif 118 | ifeq ($(ANDROID_ARCH),ARM64) 119 | CFLAGS = -std=c99 -march=armv8-a -mfix-cortex-a53-835769 120 | endif 121 | # Compilation functions attributes options 122 | CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIC 123 | # Compiler options for the linker 124 | CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical-prefixes 125 | # Preprocessor macro definitions 126 | CFLAGS += -D__ANDROID__ -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION) 127 | 128 | # Paths containing required header files 129 | INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src 130 | 131 | # Linker options 132 | LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a 133 | LDFLAGS += -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings 134 | # Force linking of library module to define symbol 135 | LDFLAGS += -u ANativeActivity_onCreate 136 | # Library paths containing required libs 137 | LDFLAGS += -L. -L$(PROJECT_BUILD_PATH)/obj -L$(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME) 138 | 139 | # Define any libraries to link into executable 140 | # if you want to link libraries (libname.so or libname.a), use the -lname 141 | LDLIBS = -lm -lc -lraylib -llog -landroid -lEGL -lGLESv2 -lOpenSLES -ldl 142 | 143 | # Generate target objects list from PROJECT_SOURCE_FILES 144 | OBJS = $(patsubst %.c, $(PROJECT_BUILD_PATH)/obj/%.o, $(PROJECT_SOURCE_FILES)) 145 | 146 | # Android APK building process... some steps required... 147 | # NOTE: typing 'make' will invoke the default target entry called 'all', 148 | all: clear \ 149 | create_temp_project_dirs \ 150 | copy_project_required_libs \ 151 | copy_project_resources \ 152 | generate_loader_script \ 153 | generate_android_manifest \ 154 | generate_apk_keystore \ 155 | config_project_package \ 156 | compile_project_code \ 157 | compile_project_class \ 158 | compile_project_class_dex \ 159 | create_project_apk_package \ 160 | zipalign_project_apk_package \ 161 | sign_project_apk_package 162 | 163 | # Clear old files and directories that needs to be removed before building 164 | clear: 165 | if exist $(PROJECT_BUILD_PATH)/bin rmdir $(PROJECT_BUILD_PATH)/bin 166 | 167 | # Create required temp directories for APK building 168 | create_temp_project_dirs: 169 | if not exist $(PROJECT_BUILD_PATH) mkdir $(PROJECT_BUILD_PATH) 170 | if not exist $(PROJECT_BUILD_PATH)\obj mkdir $(PROJECT_BUILD_PATH)\obj 171 | if not exist $(PROJECT_BUILD_PATH)\src mkdir $(PROJECT_BUILD_PATH)\src 172 | if not exist $(PROJECT_BUILD_PATH)\src\com mkdir $(PROJECT_BUILD_PATH)\src\com 173 | if not exist $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME) mkdir $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME) 174 | if not exist $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME)\$(APP_PRODUCT_NAME) mkdir $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME)\$(APP_PRODUCT_NAME) 175 | if not exist $(PROJECT_BUILD_PATH)\lib mkdir $(PROJECT_BUILD_PATH)\lib 176 | if not exist $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME) mkdir $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME) 177 | if not exist $(PROJECT_BUILD_PATH)\bin mkdir $(PROJECT_BUILD_PATH)\bin 178 | if not exist $(PROJECT_BUILD_PATH)\res mkdir $(PROJECT_BUILD_PATH)\res 179 | if not exist $(PROJECT_BUILD_PATH)\res\drawable-ldpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-ldpi 180 | if not exist $(PROJECT_BUILD_PATH)\res\drawable-mdpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-mdpi 181 | if not exist $(PROJECT_BUILD_PATH)\res\drawable-hdpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-hdpi 182 | if not exist $(PROJECT_BUILD_PATH)\res\values mkdir $(PROJECT_BUILD_PATH)\res\values 183 | if not exist $(PROJECT_BUILD_PATH)\assets mkdir $(PROJECT_BUILD_PATH)\assets 184 | if not exist $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) mkdir $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) 185 | if not exist $(PROJECT_BUILD_PATH)\obj\screens mkdir $(PROJECT_BUILD_PATH)\obj\screens 186 | $(foreach dir, $(PROJECT_SOURCE_DIRS), $(call create_dir, $(dir))) 187 | 188 | define create_dir 189 | if not exist $(PROJECT_BUILD_PATH)\obj\$(1) mkdir $(PROJECT_BUILD_PATH)\obj\$(1) 190 | endef 191 | 192 | # Copy required shared libs for integration into APK 193 | # NOTE: If using shared libs they are loaded by generated NativeLoader.java 194 | copy_project_required_libs: 195 | ifeq ($(RAYLIB_LIBTYPE),SHARED) 196 | copy /Y $(RAYLIB_LIB_PATH)\libraylib.so $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME)\libraylib.so 197 | endif 198 | ifeq ($(RAYLIB_LIBTYPE),STATIC) 199 | copy /Y $(RAYLIB_LIB_PATH)\libraylib.a $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME)\libraylib.a 200 | endif 201 | 202 | # Copy project required resources: strings.xml, icon.png, assets 203 | # NOTE: Required strings.xml is generated and game resources are copied to assets folder 204 | # TODO: Review xcopy usage, it can not be found in some systems! 205 | copy_project_resources: 206 | copy $(APP_ICON_LDPI) $(PROJECT_BUILD_PATH)\res\drawable-ldpi\icon.png /Y 207 | copy $(APP_ICON_MDPI) $(PROJECT_BUILD_PATH)\res\drawable-mdpi\icon.png /Y 208 | copy $(APP_ICON_HDPI) $(PROJECT_BUILD_PATH)\res\drawable-hdpi\icon.png /Y 209 | @echo ^ > $(PROJECT_BUILD_PATH)/res/values/strings.xml 210 | @echo ^^$(APP_LABEL_NAME)^^ >> $(PROJECT_BUILD_PATH)/res/values/strings.xml 211 | if exist $(PROJECT_RESOURCES_PATH) C:\Windows\System32\xcopy $(PROJECT_RESOURCES_PATH) $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) /Y /E /F 212 | 213 | # Generate NativeLoader.java to load required shared libraries 214 | # NOTE: Probably not the bet way to generate this file... but it works. 215 | generate_loader_script: 216 | @echo package com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME); > $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java 217 | @echo. >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java 218 | @echo public class NativeLoader extends android.app.NativeActivity { >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java 219 | @echo static { >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java 220 | ifeq ($(RAYLIB_LIBTYPE),SHARED) 221 | @echo System.loadLibrary("raylib"); >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java 222 | endif 223 | @echo System.loadLibrary("$(PROJECT_LIBRARY_NAME)"); >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java 224 | @echo } >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java 225 | @echo } >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java 226 | 227 | # Generate AndroidManifest.xml with all the required options 228 | # NOTE: Probably not the bet way to generate this file... but it works. 229 | generate_android_manifest: 230 | @echo ^ > $(PROJECT_BUILD_PATH)/AndroidManifest.xml 231 | @echo ^> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 232 | @echo package="com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME)" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 233 | @echo android:versionCode="$(APP_VERSION_CODE)" android:versionName="$(APP_VERSION_NAME)" ^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 234 | @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 235 | @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 236 | @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 237 | @echo ^> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 238 | @echo android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 239 | @echo android:configChanges="orientation|keyboard|keyboardHidden|screenSize" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 240 | @echo android:screenOrientation="$(APP_SCREEN_ORIENTATION)" android:launchMode="singleTask" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 241 | @echo android:clearTaskOnLaunch="true" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 242 | @echo android:exported="true"^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 243 | @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 244 | @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 245 | @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 246 | @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 247 | @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 248 | @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 249 | @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 250 | @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml 251 | 252 | # Generate storekey for APK signing: $(PROJECT_NAME).keystore 253 | # NOTE: Configure here your Distinguished Names (-dname) if required! 254 | generate_apk_keystore: 255 | if not exist $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore $(JAVA_HOME)/bin/keytool -genkeypair -validity 10000 -dname "CN=$(APP_COMPANY_NAME),O=Android,C=ES" -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -alias $(PROJECT_NAME)Key -keyalg RSA 256 | 257 | # Config project package and resource using AndroidManifest.xml and res/values/strings.xml 258 | # NOTE: Generates resources file: src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java 259 | config_project_package: 260 | $(ANDROID_BUILD_TOOLS)/aapt package -f -m -S $(PROJECT_BUILD_PATH)/res -J $(PROJECT_BUILD_PATH)/src -M $(PROJECT_BUILD_PATH)/AndroidManifest.xml -I $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar 261 | 262 | # Compile project code into a shared library: lib/lib$(PROJECT_LIBRARY_NAME).so 263 | compile_project_code: $(OBJS) 264 | $(CC) -o $(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME)/lib$(PROJECT_LIBRARY_NAME).so $(OBJS) -shared $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) 265 | 266 | # Compile all .c files required into object (.o) files 267 | # NOTE: Those files will be linked into a shared library 268 | $(PROJECT_BUILD_PATH)/obj/%.o:%.c 269 | $(CC) -c $^ -o $@ $(INCLUDE_PATHS) $(CFLAGS) --sysroot=$(ANDROID_TOOLCHAIN)/sysroot 270 | 271 | # Compile project .java code into .class (Java bytecode) 272 | compile_project_class: 273 | $(JAVA_HOME)/bin/javac -verbose --source 11 --target 11 -d $(PROJECT_BUILD_PATH)/obj --system $(JAVA_HOME) --class-path $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar;$(PROJECT_BUILD_PATH)/obj --source-path $(PROJECT_BUILD_PATH)/src $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java 274 | 275 | # Compile .class files into Dalvik executable bytecode (.dex) 276 | # NOTE: Since Android 5.0, Dalvik interpreter (JIT) has been replaced by ART (AOT) 277 | compile_project_class_dex: 278 | $(ANDROID_BUILD_TOOLS)/d8 $(PROJECT_BUILD_PATH)/obj/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/*.class --release --output $(PROJECT_BUILD_PATH)/bin --lib $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar 279 | 280 | # Create Android APK package: bin/$(PROJECT_NAME).unaligned.apk 281 | # NOTE: Requires compiled classes.dex and lib$(PROJECT_LIBRARY_NAME).so 282 | # NOTE: Use -A resources to define additional directory in which to find raw asset files 283 | create_project_apk_package: 284 | $(ANDROID_BUILD_TOOLS)/aapt package -f -M $(PROJECT_BUILD_PATH)/AndroidManifest.xml -S $(PROJECT_BUILD_PATH)/res -A $(PROJECT_BUILD_PATH)/assets -I $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar -F $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).unaligned.apk $(PROJECT_BUILD_PATH)/bin 285 | cd $(PROJECT_BUILD_PATH) && $(ANDROID_BUILD_TOOLS)/aapt add bin/$(PROJECT_NAME).unaligned.apk lib/$(ANDROID_ARCH_NAME)/lib$(PROJECT_LIBRARY_NAME).so $(PROJECT_SHARED_LIBS) 286 | 287 | # Create zip-aligned APK package: bin/$(PROJECT_NAME).aligned.apk 288 | zipalign_project_apk_package: 289 | $(ANDROID_BUILD_TOOLS)/zipalign -p -f 4 $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).unaligned.apk $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).aligned.apk 290 | 291 | # Create signed APK package using generated Key: $(PROJECT_NAME).apk 292 | sign_project_apk_package: 293 | $(ANDROID_BUILD_TOOLS)/apksigner sign --ks $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore --ks-pass pass:$(APP_KEYSTORE_PASS) --key-pass pass:$(APP_KEYSTORE_PASS) --out $(PROJECT_NAME).apk --ks-key-alias $(PROJECT_NAME)Key $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).aligned.apk 294 | 295 | # Install $(PROJECT_NAME).apk to default emulator/device 296 | # NOTE: Use -e (emulator) or -d (device) parameters if required 297 | install: 298 | $(ANDROID_PLATFORM_TOOLS)/adb install $(PROJECT_NAME).apk 299 | 300 | # Check supported ABI for the device (armeabi-v7a, arm64-v8a, x86, x86_64) 301 | check_device_abi: 302 | $(ANDROID_PLATFORM_TOOLS)/adb shell getprop ro.product.cpu.abi 303 | 304 | # Monitorize output log coming from device, only raylib tag 305 | logcat: 306 | $(ANDROID_PLATFORM_TOOLS)/adb logcat -c 307 | $(ANDROID_PLATFORM_TOOLS)/adb logcat raylib:V *:S 308 | 309 | # Install and monitorize $(PROJECT_NAME).apk to default emulator/device 310 | deploy: 311 | $(ANDROID_PLATFORM_TOOLS)/adb install $(PROJECT_NAME).apk 312 | $(ANDROID_PLATFORM_TOOLS)/adb logcat -c 313 | $(ANDROID_PLATFORM_TOOLS)/adb logcat raylib:V *:S 314 | 315 | #$(ANDROID_PLATFORM_TOOLS)/adb logcat *:W 316 | 317 | # Clean everything 318 | clean: 319 | del $(PROJECT_BUILD_PATH)\* /f /s /q 320 | rmdir $(PROJECT_BUILD_PATH) /s /q 321 | @echo Cleaning done 322 | -------------------------------------------------------------------------------- /src/minshell.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | raylib web game 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 53 | 54 | 72 | 73 | 74 | 75 |

76 | 96 | {{{ SCRIPT }}} 97 | 98 | 99 | -------------------------------------------------------------------------------- /src/raylib.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raysan5/raylib-gamejam-template/825f431a45c06516d19a9996f288b0c48d4fe87b/src/raylib.icns -------------------------------------------------------------------------------- /src/raylib.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raysan5/raylib-gamejam-template/825f431a45c06516d19a9996f288b0c48d4fe87b/src/raylib.ico -------------------------------------------------------------------------------- /src/raylib_game.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * 3 | * raylib gamejam template 4 | * 5 | * Template originally created with raylib 4.5-dev, last time updated with raylib 5.0 6 | * 7 | * Template licensed under an unmodified zlib/libpng license, which is an OSI-certified, 8 | * BSD-like license that allows static linking with closed source software 9 | * 10 | * Copyright (c) 2022-2025 Ramon Santamaria (@raysan5) 11 | * 12 | ********************************************************************************************/ 13 | 14 | #include "raylib.h" 15 | 16 | #if defined(PLATFORM_WEB) 17 | #define CUSTOM_MODAL_DIALOGS // Force custom modal dialogs usage 18 | #include // Emscripten library - LLVM to JavaScript compiler 19 | #endif 20 | 21 | #include // Required for: printf() 22 | #include // Required for: 23 | #include // Required for: 24 | 25 | //---------------------------------------------------------------------------------- 26 | // Defines and Macros 27 | //---------------------------------------------------------------------------------- 28 | // Simple log system to avoid printf() calls if required 29 | // NOTE: Avoiding those calls, also avoids const strings memory usage 30 | #define SUPPORT_LOG_INFO 31 | #if defined(SUPPORT_LOG_INFO) 32 | #define LOG(...) printf(__VA_ARGS__) 33 | #else 34 | #define LOG(...) 35 | #endif 36 | 37 | //---------------------------------------------------------------------------------- 38 | // Types and Structures Definition 39 | //---------------------------------------------------------------------------------- 40 | typedef enum { 41 | SCREEN_LOGO = 0, 42 | SCREEN_TITLE, 43 | SCREEN_GAMEPLAY, 44 | SCREEN_ENDING 45 | } GameScreen; 46 | 47 | // TODO: Define your custom data types here 48 | 49 | //---------------------------------------------------------------------------------- 50 | // Global Variables Definition 51 | //---------------------------------------------------------------------------------- 52 | static const int screenWidth = 800; 53 | static const int screenHeight = 450; 54 | 55 | static RenderTexture2D target = { 0 }; // Render texture to render our game 56 | 57 | // TODO: Define global variables here, recommended to make them static 58 | 59 | //---------------------------------------------------------------------------------- 60 | // Module Functions Declaration 61 | //---------------------------------------------------------------------------------- 62 | static void UpdateDrawFrame(void); // Update and Draw one frame 63 | 64 | //------------------------------------------------------------------------------------ 65 | // Program main entry point 66 | //------------------------------------------------------------------------------------ 67 | int main(void) 68 | { 69 | #if !defined(_DEBUG) 70 | SetTraceLogLevel(LOG_NONE); // Disable raylib trace log messages 71 | #endif 72 | 73 | // Initialization 74 | //-------------------------------------------------------------------------------------- 75 | InitWindow(screenWidth, screenHeight, "raylib gamejam template"); 76 | 77 | // TODO: Load resources / Initialize variables at this point 78 | 79 | // Render texture to draw full screen, enables screen scaling 80 | // NOTE: If screen is scaled, mouse input should be scaled proportionally 81 | target = LoadRenderTexture(screenWidth, screenHeight); 82 | SetTextureFilter(target.texture, TEXTURE_FILTER_BILINEAR); 83 | 84 | #if defined(PLATFORM_WEB) 85 | emscripten_set_main_loop(UpdateDrawFrame, 60, 1); 86 | #else 87 | SetTargetFPS(60); // Set our game frames-per-second 88 | //-------------------------------------------------------------------------------------- 89 | 90 | // Main game loop 91 | while (!WindowShouldClose()) // Detect window close button 92 | { 93 | UpdateDrawFrame(); 94 | } 95 | #endif 96 | 97 | // De-Initialization 98 | //-------------------------------------------------------------------------------------- 99 | UnloadRenderTexture(target); 100 | 101 | // TODO: Unload all loaded resources at this point 102 | 103 | CloseWindow(); // Close window and OpenGL context 104 | //-------------------------------------------------------------------------------------- 105 | 106 | return 0; 107 | } 108 | 109 | //-------------------------------------------------------------------------------------------- 110 | // Module functions definition 111 | //-------------------------------------------------------------------------------------------- 112 | // Update and draw frame 113 | void UpdateDrawFrame(void) 114 | { 115 | // Update 116 | //---------------------------------------------------------------------------------- 117 | // TODO: Update variables / Implement example logic at this point 118 | //---------------------------------------------------------------------------------- 119 | 120 | // Draw 121 | //---------------------------------------------------------------------------------- 122 | // Render game screen to a texture, 123 | // it could be useful for scaling or further shader postprocessing 124 | BeginTextureMode(target); 125 | ClearBackground(RAYWHITE); 126 | 127 | // TODO: Draw your game screen here 128 | DrawText("Welcome to raylib NEXT gamejam!", 150, 140, 30, BLACK); 129 | DrawRectangleLinesEx((Rectangle){ 0, 0, screenWidth, screenHeight }, 16, BLACK); 130 | 131 | EndTextureMode(); 132 | 133 | // Render to screen (main framebuffer) 134 | BeginDrawing(); 135 | ClearBackground(RAYWHITE); 136 | 137 | // Draw render texture to screen, scaled if required 138 | DrawTexturePro(target.texture, (Rectangle){ 0, 0, (float)target.texture.width, -(float)target.texture.height }, (Rectangle){ 0, 0, (float)target.texture.width, (float)target.texture.height }, (Vector2){ 0, 0 }, 0.0f, WHITE); 139 | 140 | // TODO: Draw everything that requires to be drawn at this point, maybe UI? 141 | 142 | EndDrawing(); 143 | //---------------------------------------------------------------------------------- 144 | } -------------------------------------------------------------------------------- /src/raylib_game.rc: -------------------------------------------------------------------------------- 1 | GLFW_ICON ICON "raylib.ico" 2 | 3 | 1 VERSIONINFO 4 | FILEVERSION 1,0,0,0 5 | PRODUCTVERSION 1,0,0,0 6 | BEGIN 7 | BLOCK "StringFileInfo" 8 | BEGIN 9 | //BLOCK "080904E4" // English UK 10 | BLOCK "040904E4" // English US 11 | BEGIN 12 | VALUE "CompanyName", "raylib technologies" 13 | VALUE "FileDescription", "raylib-game | A great game" 14 | VALUE "FileVersion", "1.0" 15 | VALUE "InternalName", "raylib-game" 16 | VALUE "LegalCopyright", "(c) 2025 raylib technologies (@raylibtech)" 17 | //VALUE "OriginalFilename", "raylib_app.exe" 18 | VALUE "ProductName", "raylib-game" 19 | VALUE "ProductVersion", "1.0" 20 | END 21 | END 22 | BLOCK "VarFileInfo" 23 | BEGIN 24 | //VALUE "Translation", 0x809, 1252 // English UK 25 | VALUE "Translation", 0x409, 1252 // English US 26 | END 27 | END 28 | -------------------------------------------------------------------------------- /src/resources/README.txt: -------------------------------------------------------------------------------- 1 | Place in this folder your game assets/resources! 2 | 3 | --------------------------------------------------------------------------------