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.
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
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 haveBAZEL_VC
point to yourVC
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 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