Skip to content

How to build the engine

Michele edited this page Apr 24, 2020 · 13 revisions

Instructions to build the engine from the source code

  • Requirements

    • Windows (currently the project is made to work only on Windows)
    • Visual Studio >= 2017
    • Cmake (at least 3.10.x)
    • git
    • a GPU with vulkan support (Vulkan 1.1) - check GPU support
  • Notes for Visual Studio > 2017

If you are using Visual Studio > 2017 (2019 for example) note that the project might generate errors compilings with the tools v142. This project is made to compile on v141.

  • Cloning and downloading the repository

The best way to clone and download the repository is to execute this command that download also submodules:

git clone --recurse-submodules https://github.com/ScrappyCocco/ScrapEngine.git

otherwise you can download the repository clicking the green button "Clone or download" > "Download ZIP" in the repository main page.

  • Downloading submodules

If you executed the git clone command with

--recurse-submodules

you can skip this part.

Otherwise the best way to clone and download all submodules, is to enter the repository directory once downloaded and execute:

git submodule update --init --recursive
  • Building submodules

For every submodule listed down there you have to follow these steps:

  1. Enter the submodule directory and execute mkdir build and cd build
  2. Execute cmake -G "Visual Studio 15 2017 Win64" ..
  3. Open the generated solution (.sln) and build it both in Debug mode and in Release mode.

Submodules to build: (you can find all of them in external/)

  1. assimp;
  2. enkits;
  3. glfw (this is the only one that can give you some problems, you need to define _GLFW_WIN32 in cmake (as bool 'true'), you can use cmake-gui to do it easily. For more information see building glfw manually);
  4. openal-soft (if the compilation fails, check that the every generated project use Windows SDK <= 10.0.17134.0);
  5. reactphysics.
  • Building and running the engine

First: go to external\assimp\include\assimp and copy config.h.in to another file config.h (notice the .h and no longer .in).

If the engine compilation fails again, comment line 977:

//#cmakedefine ASSIMP_DOUBLE_PRECISION 1

Once you built all the submodules described in the point above, open ScrapEngine.sln and run it.

It should automatically find all the necessary external files if you did everything correctly, and should start the example game.

If you need help to run the example game, see How to execute SimpleGame.

  • Something in the build doesn't work

If you find something wrong or are not able to build the project, please contact me opening an issue.