Skip to content
Dmitry Mamontov edited this page Mar 10, 2017 · 12 revisions

Introduction

Currently, there are three ways to compile Saddy:

  • On Windows, using Microsoft Visual C++ 2010
  • On Windows, using MinGW-w64 5.2.0+
  • On Linux, using GCC

Cloning

To get source files and be ready to compile, please run

git clone https://github.com/mamontov-cpp/saddy-graphics-engine-2d.git
cd saddy-graphics-engine-2d
git submodule init
git submodule update
git submodule status

Prerequisites

If you want to use atlasgen tool (Ruby version), make sure that Ruby installed with devil and json gem.

If you want to compile atlsasgen, exporter or ifaceed make sure, that Qt is installed and configured. To build ifaceed in Ubuntu, using Qt5, please install qtscript5-dev (besides having Qt5 installed of course).

If you want to compile all or freetype plugin, make sure that FREETYPE_INCLUDE and FREETYPE_LIB is set to corresponsing locations on Windows (since 1.6.0 use FREETYPE_DIR to specify, where Freetype is located). Please configure FREETYPE_INCLUDE and FREETYPE_LIB paths to point to include and library files for Freetype library. An example for FREETYPE_INCLUDE path: C:\Program Files\GnuWin32\include\freetype2

Make sure, that your freetype include folder contains ft2build.h file, ftconfig.h at the top. If not - copy them from inner subfolders, where freetype is installed.

If you want to compile all or irrklang plugin, make sure, that IRRKLANG_ROOT is set to point to irrklang location. This applies both for Linux and Windows. In case of x32 architecture IRRKLANG_ROOT must point to main irrklang folder (not the folder, which __MACOSX folder is located in). In case of x64 architecture please rename bin/linux-gcc-64 subfolder to bin/linux-gcc in IrrKlang folder.

Building Saddy as full-featured toolkit

For MSVC, run Qt command prompt, used to run with MSVC, change folder to where Saddy is located and type build-all-msvc.bat Debug for debug build, or build-all-msvc.bat Release for release build.

For MinGW, run Qt command prompt, used to run with MinGW, change folder to where Saddy is located and type build-all-mingw.bat Debug for debug build, or build-all-mingw.bat Release for release build. Note, that you must install CMake and it must be accessible from shell to compile.

For Linux, using GCC, change folder to where Saddy is located in terminal and type build-all-linux-gcc.sh Debug for debug build, or build-all-linux-gcc.sh Release for release build. Note, that you must install CMake and it must be accessible from shell to compile.

Building separate subprojects

For MSVC, every subproject (plugin, example, test) has a solution or project or attached to it. You can use it to build a project.

For MinGW, every subproject (plugin, example, test), except for ones using Qt, has corresponsing executable debug.bat or release.bat to build it

For Linux, using GCC every subproject (plugin, example, test), except for ones using Qt, has corresponsing executable debug.sb or release.bat to build it

For Qt-based subprojects use qmake.

Other

Saddy has a tool for creating texture mapped fonts (exporter). See exporter folder in plugins. It uses Qt as a backend.

Also it has a tool for creating texture atlases. See atlasgen (for Ruby as backend) or atlasgenc (for Qt as backend)

Modifying sources

It is required to have GNU expand tool reachable. When modifying sources. please add following lines for development to your .git/config:

[filter "spabs"]
    clean = expand --initial -t 4
    smudge = expand --initial -t 4
    required
[merge]
    renormalize = true

to make sure, that all tabs will be converted to spaces in repository. Also, you could rename "expand" to "expand-gnu" in Windows to solve potential conflict with local Windows utility.