Skip to content

train-it-eu/irrlicht-example

Repository files navigation

Modern C++ Design: Part I Workshop Preparation

Development Environment Setup

Docker

The workshop is intended to run on a Docker container based on a provided image. The image provides gcc, clang, CMake, Ninja, debuggers, clang-format, pre-configured Conan package manager, and more...

To install Docker please follow the point #1 of a detailed installation instruction in Developing inside a Container section of VSCode documentation.

Note: WSL 2 improves the performance of Docker on Windows. It is also a really powerful tool for daily C++ programming use. If you do not use it currently, please consider installing it.

XServer

Irrlicht is an open source realtime 3D engine written in C++. In order to see 3D graphics we will need to export docker container's display to the host's XServer.

Windows

  1. Install VcXsrv Windows X Server.
  2. Run XLaunch from the start menu and follow the configuration steps:
    • Next on "Display settings"
    • Next on "Client startup"
    • Check "Disable access control" on "Extra settings" and Next
    • Finish on "Finish configuration"
  3. Uncomment appropriate line in "remoteEnv" part of devcontainer.json file.

Mac OS

  1. Install XQuartz and use it in a similar way as in the above Windows case.
  2. Uncomment appropriate line in "remoteEnv" part of devcontainer.json file.

Linux

  1. Run the following command
xhost +SI:localuser:root
  1. Uncomment appropriate line in "remoteEnv" part of devcontainer.json file.

Visual Studio Code

The usage of Visual Studio Code is strongly suggested for this workshop. Make sure to enable at least the following extensions:

Alternative Development Environments

You can try to use your own development environment for this workshop but in such a case please make sure that you:

  • have a C++20-ready compiler,
  • installed recent version of CMake
  • installed Conan package manager and provided a profile for your compiler
  • [Windows only] [optional] installed DirectX SDK
  • can compile and run the provided example.

Compilation

  1. When you open this folder in a VSCode it will ask:

    Folder contains a Dev Container configuration file. Reopen folder to develop in a container (learn more).

    • If on Windows and WSL 2 is not available:
      • choose Clone in Volume,
      • either provide a clone URL directly (https://github.com/train-it-eu/irrlicht-example.git) or choose "Clone a repository form GitHub in a Container Volume", and type "train-it-eu/irrlicht-example",
      • choose a volume for the repository (unique, current, other).
    • Otherwise, choose Reopen in Container.
  2. Wait a moment for the container to initialize.

  3. In order to install the dependencies with Conan package manager open the TERMINAL tab in VSCode (click + to open a new bash shell if needed). In the new shell type the following:

    • conan install . -pr gcc12 -b missing
  4. After the dependencies are built select CMake configure and build presets in VSCode status bar (please use the conan-gcc-12-release version unless you will install debug dependencies with Conan as well).

    • in case a preset will not visible in the VSCode IDE use the "CMake: Reset CMake Tools Extension State" command
  5. Build the release version of the project.

  6. Run the example app (choose "Software Renderer" in case of a Docker container usage). Ensure that a spinning triangle is being displayed in you XServer window.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published