Skip to content

harfang3d/tutorials-cpp-hg2

Repository files navigation

HARFANG® 3.2.5+ Tutorials

These tutorials demonstrate the usage of the HARFANG 3.0 C++ API.

To run the tutorials:

  1. Download or clone this repository to your computer (eg. in d:/hg_cpp_tutorials).
  2. Download the C++ SDK for your platform from here.
  3. Download assetc for your platform from here to compile the tutorial resources.

If you want to know more about HARFANG, please visit the official website.

Build instructions

We will use CMake build system to compile both the C++ source code and resources of the tutorials.

First create a build directory.

mkdir build
cd build

We will now invoke CMake configuration.

cmake .. \
    -DHG_CPPSDK_PATH=<the directory where the Harfang C++ SDK was installed> \
    -DHG_ASSETC_PATH=<the directory where the assetc was installed> \
    -DCMAKE_INSTALL_PREFIX=<see below>

CMAKE_INSTALL_PREFIX is the directory where the tutorial executables, their dependencies and compiled resources will be copied.

You can also use CMake GUI to configure your project.

The tutorials can now be built using:

cmake --build . --target install

Under Windows, when using MSVC, you can also pass the configuration

cmake --build . --config Release --target install

Screenshots

  • Basic window Basic window

  • Mouse flight Basic window

  • Physics pool of objects Physics pool

  • Scene instances Instances

  • Scene with many nodes Many object nodes