This project is a particle simulation using SDL2, designed to be built and run either as a native application or as a web application using Emscripten. The build script provided supports cleaning the build directory and setting the target platform.
g++
(GNU Compiler Collection)SDL2
development libraries
Emscripten
SDKSDL2
development libraries
sudo apt-get install libsdl2-dev
brew install sdl2
Follow the instructions on the Emscripten website to install the SDK.
The build script build.sh
supports the following options:
clean
: Cleans the build directory before building.native
: Builds the project as a native application.execute
: Executes the project as once build is complete.- Default (no arguments): Builds the project as a web application.
To build and run the project as a web application, simply run the script without any arguments:
./build.sh
To additionally start a local http server use:
./build.sh execute
This will build the project for the web and start a local HTTP server to serve the application.
To build the project as a native application, use the native
argument:
./build.sh native
The native executable will be located in the build
directory as main.elf
.
To additionally execute the built file, use:
./build.sh execute native
To clean the build directory before building, use the clean
argument:
./build.sh clean
./build.sh clean native
.
├── assets # Assets directory
├── build # Build directory (generated during build process)
├── index.html # HTML file for the web build
├── main.cpp # Main source file
├── build.sh # Build script
└── README.md # This README file
- SDL2 Not Found: Ensure SDL2 is installed and the development libraries are available on your system.
- Emscripten Not Found: Ensure the Emscripten SDK is installed and sourced correctly.
- Web Build Failed: Ensure Emscripten is installed and properly configured.
- Native Build Failed: Ensure
g++
and SDL2 development libraries are installed.
This project is licensed under the MIT License.