A Tetris implementation for Windows and Mac. Written in C++ with SDL2 and SDL2_gpu.
The following tools must be installed on your system:
- C++ 17
- CMake 3.2
- SDL2 2.26
- SDL2_gpu 0.12
To ensure that SDL2 and SDL2_gpu are visible to CMake, follow the steps below:
- Download and extract the SDL2 precompiled binaries (SDL2-[version].zip)
- Download and extract the SDL2_gpu precompiled binaries (SDL2_gpu-[version]-msvc.zip)
- Create environment variable
SDL2_ROOT
and set it to the path to the extracted SDL2 directory. - Create environment variable
SDL2_GPU_ROOT
and set it to the path to extracted SDL2_gpu directory.
Note:
SDL2_gpu requires that SDL2 is installed to default directories; using a package manager to install SDL2 may break this.
- Build and install SDL2 to default directories, from source.
- Build and install SDL2_gpu to default directories, from source.
In the root directory of the repo:
- Run the
build
script for your platform. - Run the
run
script for your platform.
Press the arrow keys
to move the piece.
Press the Z
key to rotate the piece left.
Press the X
key to rotate the piece right.
Press the P
key to pause.
Press the R
key to restart.
Press the F
key to toggle fullscreen / windowed mode.
Press the Q
key to quit.