https://github.com/demonstrandum/playground
C++ Starting point for windowed applications using GLFW with BGFX including ImGui to get started. Builds cross-platform with Bazel.
https://github.com/demonstrandum/playground
bazel bgfx cpp freetype glfw imgui linalg
Last synced: 12 months ago
JSON representation
C++ Starting point for windowed applications using GLFW with BGFX including ImGui to get started. Builds cross-platform with Bazel.
- Host: GitHub
- URL: https://github.com/demonstrandum/playground
- Owner: Demonstrandum
- Created: 2023-02-17T18:08:43.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-18T17:44:40.000Z (almost 3 years ago)
- Last Synced: 2025-02-16T10:44:52.739Z (about 1 year ago)
- Topics: bazel, bgfx, cpp, freetype, glfw, imgui, linalg
- Language: C++
- Homepage:
- Size: 1.2 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Playground
Getting something drawing on the screen is a pain.
This is a simple starting point for a windowed cross-platform graphical application.
- Windowing: GLFW
- Graphics: BGFX (API over OpenGL, DirectX, Vulkan, Metal, &c.)
- Debug GUI: ImGui
- Linear algebra library: `linalg.h`
- Text rendering: FreeType2
See `example.cpp` for short example usage.
## Build
Bazel takes care of building everything on every platform.
You don't need to clone `glfw`, `bx`, `bimg`, `bgfx`, `imgui`, &c., and figure out how to compile them,
Bazel takes care of cloning and building (see `WORKSPACE` and `bgfx.BUILD` (&c.) files).
```sh
# build with
bazel build //src:playground
# or run example immediately
bazel run //:playground-example
```
### Notes
Install Bazel, see [bazel.build/install](https://bazel.build/install).
- On Windows you will need to install Visual Studio (the IDE) or at least the Windows {10,11} SDK to use the MSVC compiler. After Bazel is installed (recommend through Chocolatey, `choco install bazel`), you need to modify your users environment variables to have `BAZEL_VC` point to your `VC` folder containing your compiler tools.
- macOS and *nix environments are more straightforward. Just install Bazel with `brew install bazel` or through your native package manager. Make sure Java version ≥11 is available/default.

## TODO
- [x] macOS working (checked on `arm/aarch64`: Ventura)
- [x] Windows working (checked on `arm/aarch64`: Windows 11)
- [x] Linux working (checked on `arm/aarch64`: Asahi Linux X11/Wayland)
- [ ] Wayland has serious fractional scaling issues and no support for GNOME native window decoration. Upstream problems.
- [ ] *BSD working (not checked)
- [x] macOS native window customisation
- [ ] Windows native window customisation
- [ ] Linux Qt/Gtk native window customisation