Visual Studio and MSVC

Before starting download and install CMake. In order to build the nCine library using Visual Studio you need to clone some git repositories:

  • nCine, this is the main project
  • nCine-libraries, this project contains CMake scripts to build dependencies libraries
  • nCine-data, the data files for the nCine tests (optional but recommended)
  • ncPong, a Pong game built with the nCine that is useful as an example project (optional)
  • ncPong-data, the data files for the Pong game (optional)

For the nCine project to automatically find the dependencies and the data it is important to clone all the repositories in the same directory.

Build the dependency libraries

Open the CMake GUI and set the path to the source code (the nCine-libraries directory) and a different path to build the binaries.

Press the Configure button and then confirm the creation of the build directory. You can now choose the project generator from a list of different Visual Studio versions and architecture combinations.

Now press the Generate button and then open the nCine-libraries.sln solution file that has been just generated in the build directory.

Build the solution to have all the dependency libraries generated in the nCine-external directory among the others you have cloned from git.

Build the nCine library

Building the nCine library is not much different from building its dependencies: the first step is opening the CMake GUI.

Configure the generation step just as you made before but this time you will have more CMake options in the table that you can tweak if needed.

Tweak the options to suit your needs then generate the nCine.sln file for Visual Studio.

Build the ncPong example

The same steps can be applied to the ncPong example game.

Open the CMake gui, select the ncPong source directory and build one, configure the project and generate a ncPong.sln solution file.

MSYS2 and MinGW-w64

Before starting be sure that the CMake package mingw-w64-x86_64-cmake is installed in the system. Also clone the following git repositories:

  • nCine, this is the main project
  • nCine-data, the data files for the nCine tests (optional but recommended)
  • ncPong, a Pong game built with the nCine that is useful as an example project (optional)
  • ncPong-data, the data files for the Pong game (optional)

For the nCine project to automatically find the dependencies and the data it is important to clone all the repositories in the same directory.

Install the dependencies libraries

In order to build the nCine library the following libraries need to be installed in the system:

  • mingw-w64-x86_64-glew
  • mingw-w64-x86_64-glfw
  • mingw-w64-x86_64-libogg
  • mingw-w64-x86_64-libpng
  • mingw-w64-x86_64-libvorbis
  • mingw-w64-x86_64-libwebp
  • mingw-w64-x86_64-openal

Build the nCine library

To generate the Makefile for the nCine library open a MSYS2 shell and type:

cmake -G"MSYS Makefiles" -HnCine -BnCine-build

This time you will have more CMake options that you can tweak if needed.

To compile it invoke the make command (replace {cores} with the number of available CPU cores):

make -C nCine-build -j{cores}

Build the ncPong example

The same steps can be applied to the ncPong example game:

cmake -G"MSYS Makefiles" -HncPong -BncPong-build
make -C ncPong-build -j{cores}