Rainbow is a scriptable, cross-platform, 2D game engine written in C++.
Copyright © 2010-14 Bifrost Entertainment AS and Tommy Nguyen.
Distributed under the MIT License (see accompanying file
LICENSE or copy at
http://opensource.org/licenses/MIT). Licenses for third-party software can be
found in file
- Mac OS X
Rainbow integrates FMOD Studio. Its API is available at the scripting layer.
A custom solution based on OpenAL and OpenSL ES (Android-only) is also available, with support for the following formats:
- Android: Any format supported by Android's OpenSL ES implementation
- Linux/Mac OS X/Windows: Ogg Vorbis
- iOS/Mac OS X (additionally): Any format listed in the Multimedia Programming Guide
Uses mostly OpenGL ES 2.0 compatible features:
- Sprites-based rendering with implicit batching
- Text rendering (supports TrueType and OpenType through FreeType)
- Texture atlas (PNG and PVRTC)
- Accelerometer (Android and iOS)
- Keyboard and mouse (Linux/Mac OS X/Windows)
- Microphone (Android and iOS)
- Touch (Android and iOS)
- Lua scripting language with debugging console and hot reloading
- Physics (Box2D)
- Scene graph
- TestFlight integration
build- Contains compilation-related files.
lib- Libraries necessary to compile Rainbow.
lua- Convenience libraries for implementing apps or games.
src- Rainbow source files.
tests- Rainbow unit tests.
tools- Tools such as the build script.
First of all, clone the repository:
$ git clone --recursive https://bitbucket.org/tido/rainbow.git
The repository only includes some of the libraries required to build Rainbow. The remaining requisites is listed on each platform's section. They must be installed or copied into the repository before you can start building Rainbow.
Easiest way to build Rainbow is to use the provided build scripts:
$ mkdir rainbow-build $ cd rainbow-build $ /path/to/rainbow/tools/build.sh [platform] [options]
build.sh help to get an overview of options and configurations.
can be omitted if compiling a native build (i.e. not cross-compiling).
If you have problems running
build.sh, please make sure it has execution
$ chmod +x /path/to/rainbow/tools/build.sh
Windows-users have to use
build.bat instead. For iOS builds, see the
Building with FMOD Studio
The default audio backend for desktop builds is currently FMOD Studio.
Download and extract/install it, then copy the
header files to
rainbow/lib/FMOD/inc/ and the libraries to
If you don't want to use FMOD Studio, run
Once you've installed both, open
rainbow/tools/build-android.sh and change
NDK_HOME to point at the NDK. The build script will create a debuggable and
installable APK but is currently only available on Linux/Mac OS X. You can still
compile for Android on Windows, it just requires some manual labour.
Follow the steps outlined earlier and specify
$ /path/to/rainbow/tools/build.sh android [options]
Use the provided Xcode project under
Linux (and cross-compiling for Windows)
- Ogg Vorbis (only with
- OpenAL Soft (only with
- MinGW or MinGW-w64 (optional)
You can install most of these using your favourite package manager. For SDL,
download the source code and extract its content to
Clang is the default compiler but you can use GCC, or any
other compiler for that matter, by prefixing
Windows builds can be built using MinGW or MinGW-w64 by issuing
platform. However, this method hasn't been maintained in quite some time and may
no longer work.
Mac OS X
- OpenAL Soft (only with
- Visual Studio Express for Windows Desktop (2013 or later)
Download OpenAL Soft and place the files under
rainbow\build\windows\lib\. Finally, download SDL development libraries
and move its content to
Alternatively, see "Linux" for cross-compilation.
See documentation under
doc, and the demos under
demos. Note: In order to
run a demo, you'll need to copy some files into the folder of the demo you want
lua/*(you may not need all but it's easier to just copy everything)
src/Graphics/Shaders(copy the folder, not needed for Android/iOS)
Some demos may use resources that (unfortunately) cannot be distributed with Rainbow.
Once you've copied all the necessary files, run
rainbow inside the folder:
$ cd /path/to/demo $ rainbow
Or with the path as argument:
$ rainbow /path/to/demo