Skip to content

C++ Starting point for windowed applications using GLFW with BGFX including ImGui to get started. Builds cross-platform with Bazel.

Notifications You must be signed in to change notification settings

Demonstrandum/Playground

Repository files navigation

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).

# build with
bazel build //src:playground
# or run example immediately
bazel run //:playground-example

Notes

Install Bazel, see 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.

macos-screenshot

TODO

  • macOS working (checked on arm/aarch64: Ventura)
  • Windows working (checked on arm/aarch64: Windows 11)
  • 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)
  • macOS native window customisation
  • Windows native window customisation
  • Linux Qt/Gtk native window customisation

About

C++ Starting point for windowed applications using GLFW with BGFX including ImGui to get started. Builds cross-platform with Bazel.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages