A Minecraft-like voxel game built with C++, OpenGL, and GLFW.
- Voxel World: 16×16×256 chunk-based world system
- Procedural Terrain Generation: Noise-based terrain generation using fractal brownian motion
- First-person Camera: WASD movement with mouse look controls
- Texture Atlas: Single texture atlas for all block types
- Chunk Loading: Dynamic chunk management
- Basic Lighting: Simple diffuse lighting
- Save/Load Functionality: Save and load world data
- Cross-platform: Built with CMake for easy cross-platform development
- GLFW 3.3: Window creation and input handling
- OpenGL: Graphics rendering
- GLEW: OpenGL extension loading
- CMake: Version 3.16 or higher
- Ninja: Build system
- vcpkg: Package manager for dependencies
- MSVC: Microsoft Visual C++ compiler (Windows)
-
Clone the repository
git clone git@github.com:zbbsdsb/cppcraft.git cd cppcraft -
Create a build directory
mkdir build cd build -
Configure with CMake
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE="<path-to-vcpkg>/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x86-windows .. -
Build the project
ninja
-
Run the game
.\cppcraft.exe
- WASD: Move forward, left, backward, right
- Space: Jump
- Left Shift: Crouch
- Mouse: Look around
- Tab: Toggle mouse lock
- Escape: Exit game
cppcraft/
├── include/ # Header files
│ ├── mesher/ # Mesh generation
│ ├── platform/ # Window, input, time management
│ ├── renderer/ # OpenGL rendering
│ └── world/ # Voxel world management
├── src/ # Source files
│ ├── mesher/ # Mesh generation implementation
│ ├── platform/ # Platform-specific implementation
│ ├── renderer/ # Rendering implementation
│ └── world/ # World management implementation
├── assets/ # Game assets
│ └── textures/ # Texture atlas
├── CMakeLists.txt # CMake configuration
└── README.md # This file
MIT License - see LICENSE file for details.
zbbsdsb