You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Adam Zielonka 65f4bfe832 Update readme 2 years ago
cpp Rewrite some ifs in drawBoard functions 3 years ago
docs Update readme 3 years ago
.gitignore FIx problem with array 3 years ago
LICENSE Add LICENSE 3 years ago Update readme 2 years ago


In June 2015, I was finishing my second year of my studies and I prepared this game to pass classes from Computer graphics and visualization (Polish: Grafika komputerowa i wizualizacja).


To build this game, you need: g++ and OpenGL libraries (gl.h, glu.h, glut.h).

$ sudo add-apt-repository universe
$ sudo apt update && sudo apt install g++ mesa-common-dev libglu1-mesa-dev freeglut3-dev -y

This command has been checked in Ubuntu 18.10.

Build & Run

$ g++ -o tetris.out tetris.cpp -lGL -lGLU -lglut -lm
$ ./tetris.out

Run on WSL

On Windows:

  • Install & Run VcXsrv
  • Choose: Multiple windows
  • Display number: 0
  • Start no client
  • Disable: Native OpenGL
  • (WSL2) Enable: Disable access control

After this, on WSL1:

$ export DISPLAY=localhost:0
$ ./tetris.out

on WSL2

$ export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0.0
$ ./tetris.out

You can find more on this link: Does WSL support openGL? and Can't use X-Server in WSL 2