https://github.com/squidmin/sfml-imgui-labs
ImGui + SFML sandbox
https://github.com/squidmin/sfml-imgui-labs
cmake cpp imgui imgui-sfml imgui-sfml-library sfml
Last synced: about 1 year ago
JSON representation
ImGui + SFML sandbox
- Host: GitHub
- URL: https://github.com/squidmin/sfml-imgui-labs
- Owner: squidmin
- Created: 2023-09-04T16:41:58.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-04T01:20:33.000Z (over 2 years ago)
- Last Synced: 2025-02-07T13:54:12.620Z (over 1 year ago)
- Topics: cmake, cpp, imgui, imgui-sfml, imgui-sfml-library, sfml
- Language: C++
- Homepage:
- Size: 24.4 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:
```shell
brew install ninja
```
If you already have Ninja installed, ensure it's available in your `PATH`. You can test this by running:
```shell
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
```shell
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
```shell
rm -rf dependencies
mkdir dependencies && cd dependencies
```
```shell
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
```shell
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:
```shell
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:

```sh
cmake --build .
./src/square_grid_2
```

---
## References
- **SFML documentation**: https://www.sfml-dev.org/documentation/2.6.0/
- **ImGui documentation**: https://imgui-test.readthedocs.io/en/latest/