5becf056c6fc247129affc2298de8cac5486b763
Simian
Simian is a Raylib + AngelScript test project on Windows and Linux.
It demonstrates how to integrate Raylib for graphics and AngelScript for scripting, including the scriptstdstring add-on.
Refactored Architecture
The project has been refactored from a single main.cpp file into a more maintainable modular structure:
Core Components
- Application (
Application.h/cpp) - Main application lifecycle and game loop - ScriptEngine (
ScriptEngine.h/cpp) - AngelScript engine management and script compilation - ScriptBindings (
ScriptBindings.h/cpp) - C++ to AngelScript function bindings - HotReload (
HotReload.h/cpp) - File monitoring for automatic script reloading - main.cpp - Minimal entry point
Directory Structure
Simian/
├─ include/ # Header files
│ ├─ Application.h
│ ├─ ScriptEngine.h
│ ├─ ScriptBindings.h
│ └─ HotReload.h
├─ src/ # Source files
│ ├─ Application.cpp
│ ├─ ScriptEngine.cpp
│ ├─ ScriptBindings.cpp
│ └─ HotReload.cpp
├─ external/ # Dependencies
├─ scripts/ # AngelScript files
├─ main.cpp # Entry point
└─ CMakeLists.txt # Build configuration
Requirements
Windows
- Windows 10/11 (tested)
- Visual Studio 2022 with Desktop development with C++ workload
- CMake 3.25+
- Git
- Optional: VSCode for editing
Linux
- Ubuntu 20.04+ or equivalent Linux distribution
- GCC 9+ or Clang 10+
- CMake 3.25+
- Git
- Development libraries:
sudo apt install build-essential cmake git
Getting Started
1. Clone the repository with submodules
git clone --recurse-submodules <your-repo-url>
cd Simian
If you forgot --recurse-submodules, run:
git submodule update --init --recursive
This will pull Raylib and AngelScript into external/.
2. Build with CMake
Windows (Visual Studio)
# Create build folder
mkdir build
cd build
# Generate Visual Studio solution (64-bit)
cmake -G "Visual Studio 17 2022" -A x64 ..
# Build Release version
cmake --build . --config Release
After building, the executable will be at:
build\Release\simian.exe
Linux (Unix Makefiles)
# Create build folder
mkdir build
cd build
# Generate Unix Makefiles
cmake -G "Unix Makefiles" ..
# Build
cmake --build .
After building, the executable will be at:
build/simian
3. Run the project
Windows
build\Release\simian.exe
Linux
./build/simian
You should see a Raylib window open and the console will output:
[Script] Hello from AngelScript!
Project Structure
Simian/
├─ external/
│ ├─ raylib/ # Git submodule
│ └─ angelscript/ # Git submodule (includes scriptstdstring add-on)
├─ scripts/ # Optional: .as scripts to be loaded at runtime
├─ main.cpp # Entry point (Raylib + AngelScript)
├─ CMakeLists.txt # Build configuration
└─ README.md
Notes
- AngelScript
stringsupport is enabled viascriptstdstringadd-on. - Hot-reloading scripts can be implemented by loading
.asfiles from thescripts/folder. - Update submodules with:
cd external/raylib
git pull origin master
cd ../angelscript
git pull origin master
cd ../..
git add external/raylib external/angelscript
git commit -m "Update submodules"
CMake Targets
simian— main executableraylib— static library submoduleangelscript— static library submodulescriptstdstring— static library add-on for AngelScript
Tips
Windows
- Always use VS2022 Developer Command Prompt or VSCode terminal configured for MSVC.
Linux
- Make sure you have the required development packages installed.
- On some distributions you may need additional X11 development libraries.
General
- Pin submodules to specific commits for reproducible builds.
- To clean build: delete the
build/folder and regenerate with CMake.
License
- Raylib: Zlib License
- AngelScript: MIT License
- Simian: Not open source (Yet)
Description
Languages
C
91%
C++
7.6%
CMake
1.1%
Just
0.3%