/sfml-imgui-labs

ImGui + SFML sandbox

Primary LanguageC++

sfml-imgui-labs

SFML / Dear ImGui / ImGui-SFML sandbox project.

Prerequisites

  • ninja
  • cmake
  • c++ compiler (clang, gcc, etc.)

1. Installing and Setting Up Ninja

On macOS, you can use the Homebrew package manager:

brew install ninja

If you already have Ninja installed, ensure it's available in your PATH. You can test this by running:

ninja --version

If this returns a version number, it means Ninja is correctly installed and available in the PATH.


2. C++ Compiler

Ensure you have a C++ compiler installed. On macOS, you typically use Clang, which comes with Xcode. If you haven't already, install Xcode and the Xcode Command Line Tools:

Expand
xcode-select --install

3. Optional: Fetching dependencies

This project comes with the dependencies pre-installed. If necessary, the dependencies can be re-installed using the below commands:

Expand
rm -rf dependencies
mkdir dependencies && cd dependencies
git submodule add https://github.com/SFML/SFML.git dependencies/sfml
git submodule add https://github.com/eliasdaler/imgui-sfml.git dependencies/imgui-sfml

4. Building

rm -rf cmake-build-debug
mkdir cmake-build-debug && cd cmake-build-debug

To specify the compiler for CMake, you can set the CMAKE_CXX_COMPILER variable:

cmake -DCMAKE_CXX_COMPILER=/usr/bin/c++ ..

Replace /usr/bin/c++ with the path to your preferred C++ compiler if it's different.

It will take some time to fetch SFML. Afterwards, the build will finish with similar output as shown below:

cmake --build .
./src/square_grid_2


References