-
C++ compiler (MinGW, Linux GCC tested)
-
Box2D library.
-
Either one of these libraries:
- Allegro 5.0/5.2;
- SDL 1.2;
- SDL 2.0;
- SFML 1.5/1.6(very experimental);
- SFML 2.x(very experimental);
- (or a custom fgeal implementation)
Assuming you are on Linux, you can build it using 'make':
- If you don't have 'make' installed, install it.
- Open the project folder.
- Copy one of the folders inside
/build- the choice depends on the library to be used as backend. - Paster the folder in the root of the folder where the project is located.
- Open a terminal and navigate to the copied folder.
- Execute the configure script:
./configure.sh. - If the previous script ended ok, build using the makefile:
make
Make sure that the submodules are included in the source folder (currently futil, fgeal and rapidxml, all in the
src_libsfolder). If you cloned the repository without the--recursiveoption, they are probably absent.
The Box2D library needs to be properly installed on your compiler. Head to https://github.com/erincatto/Box2D to find instructions about how to build it or grab a binary.
-
To use Allegro 5.0 as backend, besides the main library, the following Allegro 5.0 addons are required:
- Image I/O addon;
- Font addon;
- TTF addon;
- Primitives addon;
- Audio addon;
- Audio codecs addon;
-
To use SDL 1.2 as backend, besides the main library, the following extension libraries are required:
- SDL_image
- SDL_ttf
- SDL_gfx
- SDL_mixer
-
To use SDL 2.0 as backend, besides the main library, the following extension libraries are required:
- SDL2_image
- SDL2_ttf
- SDL2_gfx
- SDL2_mixer
-
To use SFML as backend (experimental), all main SFML libraries are required:
- sfml-system
- sfml-window
- sfml-graphics
- sfml-audio
Run the program by executing the produced binary in the same folder where the resources folder is located: ./<your-copied-folder>/terrarium.
The
resources/folder must be in the same folder as the executable to work.
Also the required libraries must be accessible, either in the system's Path variable or in the same folder.
A quick solution is to copy
Box2D.dll/libBox2D.soand the backend libraries to the executable folder and execute withLD_LIBRARY_PATH=./<your-copied-folder> ./<your-copied-folder>/terrarium.
You can also use eclipse to build the project (tested to work with MinGW and Linux GCC). Here is how:
- Get the Eclipse IDE for C/C++ Developers. Link: https://www.eclipse.org/downloads/packages/
- When using MinGW, make sure the g++ program is on the OS path variable. On Windows you need to add the
.../MinGW/bindirectory to your PATH variable.
- Clone the code from this repository (make sure to use the
--recursiveoptions) - If you simply downloaded, you'll probably need to download the submodules as well (futil, fgeal and rapidxml)
- Import the project using the Import Projects wizard.
- If you want to clone from Eclipse, select workspace and on the projects pane left-click and select
Import -> Projects from git. ChooseClone URI. On the URI field, paste the repository address https://gitlab.com/hydren/terrarium.git. Click next and the choosemasterand next. Wait for the download and then selectImport existing projectsand then next and finish. Note that this method does not download the submodules automatically. - Left-click project and select build configuration according to your environment (i.e.
linux-gcc-sdl1.2-releasefor Linux with SDL 1.2 backend,win32-mingw-allegro5.0-releasefor Windows with Allegro 5.0 backend) and then build. - Any problems indicates that something probably went wrong with previous steps (missing/wrongly installed libraries, missing/wrongly installed submodules)
- If something wents wrong because of some cross-gcc stuff, install the
C/C++ GCC Cross Compiler Supportplugin on Eclipse viaInstall new softwareoption on Eclipse.
- Run the program by left clicking on the executable (created inside the build folder - usually
/linux-gcc-<backend>-release/,/win32-mingw-<backend>-release/, etc) and selectingRun as application. - Alternatively, open the project folder using your file explorer and run directly the executable inside the build folder. Note that this way requires that all required DLLs be present on the build folder or in the system's path.