Find a file
Vyacheslav Ivanov 1bdc9cf759
fix: optimization: PVS-Studio warning V835
Passing cheap-to-copy arguments by reference can sometimes lead to decreased performance. This change ensures that the argument is passed by value, which is more efficient in cases where the argument is inexpensive to copy.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-02 02:38:54 +03:00
.github update FUNDING.yml 2024-07-31 20:55:10 +03:00
dev move fix_dylibs.sh to /dev 2024-06-14 03:29:55 +03:00
doc add on_update, on_render to docs & change entities tps to 20 2024-08-01 16:04:27 +03:00
res add on_update, on_render to docs & change entities tps to 20 2024-08-01 16:04:27 +03:00
src fix: optimization: PVS-Studio warning V835 2024-08-02 02:38:54 +03:00
.clang-format add .clang-format 2024-07-19 07:07:39 +03:00
.gitignore update .gitignore 2024-07-17 12:18:37 +03:00
CHANGELOG.md update CHANGELOG.md 2024-07-31 22:01:32 +03:00
CMakeLists.txt set default value of VOXELENGINE_BUILD_WINDOWS_VCPKG to ON 2024-06-14 16:32:21 +03:00
Dockerfile fix: Dockerfile EnTT post-installation cleanup 2024-06-14 03:44:21 +03:00
flake.lock Nix flakes 2024-07-01 17:32:11 +03:00
flake.nix Nix flakes 2024-07-01 17:32:11 +03:00
README.md update README.md 2024-07-31 21:05:39 +03:00
run.sh feat(ci): upload artifacts and make release 2023-12-27 17:08:13 +03:00
vcpkg.json add EnTT library requirement 2024-06-11 21:20:52 +03:00

Latest release

Controls

  • Esc - pause
  • Tab - open inventory
  • W A S D - movement
  • Space - jump
  • Q - drop item
  • LMB - remove block
  • RMB - place block
  • F - toggle flight mode
  • N - noclip mode
  • F1 - toggle interface
  • F2 - save screenshot
  • F3 - debug mode
  • F5 - reload chunks

Build with CMake

git clone --recursive https://github.com/MihailRis/VoxelEngine-Cpp.git
cd VoxelEngine-Cpp
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .

Install libraries

Install EnTT

git clone https://github.com/skypjack/entt.git
cd entt/build
cmake -DCMAKE_BUILD_TYPE=Release ..
sudo make install

Debian-based distro:

sudo apt install libglfw3-dev libglfw3 libglew-dev libglm-dev libpng-dev libopenal-dev libluajit-5.1-dev libvorbis-dev

CMake missing LUA_INCLUDE_DIR and LUA_LIBRARIES fix:

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 distro:

sudo dnf install glfw-devel glfw glew-devel glm-devel libpng-devel libvorbis-devel openal-devel luajit-devel

Arch-based distro:

If you use X11

sudo pacman -S glfw-x11 glew glm libpng libvorbis openal luajit

If you use Wayland

sudo pacman -S glfw-wayland glew glm libpng libvorbis openal luajit

macOS:

brew install glfw3 glew glm libpng libvorbis lua luajit openal-soft skypjack/entt/entt

If homebrew for some reason could not install the necessary packages: lua luajit openal-soft, then download, install and compile them manually (Lua, LuaJIT and OpenAL).

Build using Docker

Step 0. Install docker on your system

See https://docs.docker.com/engine/install

Step 1. Build docker container

docker build -t voxel-engine .

Step 2. Build project using the docker container

docker run --rm -it -v$(pwd):/project voxel-engine bash -c "cmake -DCMAKE_BUILD_TYPE=Release -Bbuild && cmake --build build"

Step 3. Run project using the docker container

docker run --rm -it -v$(pwd):/project -v/tmp/.X11-unix:/tmp/.X11-unix -v${XAUTHORITY}:/home/user/.Xauthority:ro -eDISPLAY --network=host voxel-engine ./build/VoxelEngine

Build with CMake and vcpkg for Windows

git clone --recursive https://github.com/MihailRis/VoxelEngine-Cpp.git
cd VoxelEngine-Cpp
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON ..
del CMakeCache.txt
rmdir /s /q CMakeFiles
cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON ..
cmake --build . --config Release

note: you can use rm CMakeCache.txt and rm -rf CMakeFiles while using Git Bash

If you have issues during the vcpkg integration, try navigate to vcpkg\downloads and extract PowerShell-[version]-win-x86 to vcpkg\downloads\tools as powershell-core-[version]-windows. Then rerun cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON ..