The native Wayland backend had no window controls: no title, no close button, no way to move or resize the window, and the fullscreen toggle could throw the window to another monitor. GNOME does not implement zxdg_decoration_manager_v1, so there is nobody to draw a frame for us: the backend now falls back to its own decorations when the compositor offers no server side ones, and the engine draws the visible part. The bar itself is drawn by the engine (WindowBar.cpp) through the usual batch and font, so it uses the same assets as the rest of the UI and the backend only owns the behaviour: hit zones, cursor shapes, click interception and the xdg-shell requests. Its geometry follows the desktop's button layout, read and subscribed through xdg-desktop-portal over sd-bus (libsystemd is an optional dependency, gsettings is only a startup fallback). Controls behave like they do elsewhere: - pressing anywhere on the bar starts a move once the pointer leaves a 5 px radius, so dragging works from the buttons as well; - a button acts on release, only if the pointer stayed on it; - a double click on the bar toggles maximize; - the top edge and the top corners resize, the top 8 px of the sides, the sides and the bottom are 8 px wide resize strips; - right and middle clicks and the scroll wheel over the bar never reach the game. The in-game user interface is offset below the bar while menus keep the whole window, so the translucent bar shows the menu background through itself and never covers the HUD. The HUD lays its elements out against the content height and the cursor is translated once, which fixes items following the mouse one row above the pointer in game. The window size is now written to the settings when the window is resized in windowed mode and applied on the first configure, so the window opens with the size it was left with, and leaving fullscreen or borderless mode restores it instead of overwriting the settings with the fullscreen size (an unconditional unmaximize made the compositor restore the maximized geometry). Measured: menu layout unchanged (706 bright pixels in the same place), gui viewport 1123x751 in menus against 1123x721 in game, 1123x751 -> 2560x1080 -> 1123x751 round trip keeps the settings, a saved 1000x640 opens as 1000x640, no errors in the log. |
||
|---|---|---|
| .github | ||
| dev | ||
| doc | ||
| res | ||
| src | ||
| test | ||
| vctest | ||
| .clang-format | ||
| .cmake-format.py | ||
| .gitignore | ||
| CHANGELOG.md | ||
| CMakeLists.txt | ||
| CMakePresets.json | ||
| compile_flags.txt | ||
| Dockerfile | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| README.md | ||
| run.sh | ||
| vcpkg.json | ||
VoxelCore
Latest release
Build project in Linux
Install libraries
Install EnTT
Installing last version that supports C++17.
git clone --branch v3.16.0 https://github.com/skypjack/entt.git
cd entt
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DENTT_INSTALL=ON ..
sudo make install
Warning
If you are using ALT Linux, do not use this EnTT installation method.
ALT Linux based distros
su -
apt-get install entt-devel libglfw3-devel libGLEW-devel libglm-devel libpng-devel libvorbis-devel libopenal-devel libluajit-devel libstdc++13-devel-static libcurl-devel libfreetype-devel libssl-devel
Debian based distros
sudo apt install libglfw3 libglfw3-dev libglew-dev libglm-dev libpng-dev libopenal-dev libluajit-5.1-dev libvorbis-dev libcurl4-openssl-dev libssl-dev libfreetype6-dev
Tip
CMake missing
LUA_INCLUDE_DIRandLUA_LIBRARIESfix:sudo ln -s /usr/lib/x86_64-linux-gnu/libluajit-5.1.a /usr/lib/x86_64-linux-gnu/liblua5.1.a sudo ln -s /usr/include/luajit-2.1 /usr/include/lua
RHEL based distros
sudo dnf install glfw-devel glew-devel glm-devel libpng-devel libvorbis-devel openal-soft-devel luajit-devel libcurl-devel libfreetype-devel openssl-devel
Arch based distros
sudo pacman -S glfw glew glm libpng libvorbis openal luajit curl freetype2 openssl
Building engine with CMake
git clone --recursive https://github.com/MihailRis/VoxelCore.git
cd VoxelCore
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --parallel
Tip
Use
--parallelto utilize all CPU cores during build.
Building project in macOS
Install libraries
brew install glfw3 glew glm libpng libvorbis lua luajit libcurl openal-soft skypjack/entt/entt freetype
Tip
If Homebrew fails to install
lua,luajit, oropenal-soft, download, compile, and install them manually.
Building engine with CMake
git clone --recursive https://github.com/MihailRis/VoxelCore.git
cd VoxelCore
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --parallel
Building in Windows
Note
Requirements: vcpkg, CMake, Git, and Visual Studio (with C++ tools).
There are two options to use vcpkg:
- If you have Visual Studio installed, the VCPKG_ROOT environment variable is often already set in the Developer Command Prompt for VS.
- Otherwise, install vcpkg manually:
cd C:\
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
Then set the VCPKG_ROOT environment variable and add it to PATH:
$env:VCPKG_ROOT = "C:\vcpkg"
$env:PATH = "$env:VCPKG_ROOT;$env:PATH"
Tip
For troubleshooting, refer to the official vcpkg documentation.
After installing vcpkg, build the project:
git clone --recursive https://github.com/MihailRis/VoxelCore.git
cd VoxelCore
cmake --preset default-vs-msvc-windows
cmake --build --preset default-vs-msvc-windows
Note
Make sure your
CMakeUserPresets.json(if used) contains the correctVCPKG_ROOTpath.
Building with CLion (MinGW / Ninja)
Note
Requirements: vcpkg, Git, and CLion (bundled with CMake, Ninja and MinGW toolchain).
Warning
Avoid installing tools in paths with spaces (e.g.
Program Files). This may break MinGW builds (especiallywindres).
Install vcpkg manually as described in the Visual Studio section.
Configure CLion
Open the project in CLion and configure CMake profile:
Settings → Build, Execution, Deployment → CMake
Reload CMake project and build the engine.
Build using Docker
Note
First, install Docker Engine: https://docs.docker.com/engine/install
On Linux
Step 1. Build Docker image
docker build -t voxel-engine .
Step 2. Build project inside container
docker run --rm -it -v "$(pwd):/project" voxel-engine bash -c "cmake -DCMAKE_BUILD_TYPE=Release -Bbuild && cmake --build build --parallel"
Step 3. Run the application (requires X11 forwarding)
docker run --rm -it \
-v "$(pwd):/project" \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v "$XAUTHORITY:/home/user/.Xauthority:ro" \
-e DISPLAY="$DISPLAY" \
--network=host \
voxel-engine ./build/VoxelCore
On Windows
Note
You need an X server like VcXsrv to display the GUI.
Step 1. Install and run VcXsrv
Launch with:
.\vcxsrv.exe :0 -multiwindow -ac
Step 2. Build Docker image
docker build -t voxel-engine .
Step 3. Build project
docker run --rm -it -v "${PWD}:/project" voxel-engine bash -c "cmake -DCMAKE_BUILD_TYPE=Release -Bbuild && cmake --build build --parallel"
Step 4. Run the application
docker run --rm -it -v "${PWD}:/project" -e DISPLAY=host.docker.internal:0.0 --network=host voxel-engine ./build/VoxelCore