A simple OpenGL tetris game, written in C.
C C++ Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
include Initial commit Nov 5, 2012
nglu Initial commit Nov 5, 2012
scene.blend Initial commit Nov 5, 2012



A simple OpenGL tetris game, written in C.

Video for the text averse: http://www.youtube.com/watch?v=vWmDVjVb9eM

Why tetris, and why in C? Well, because everyone still likes tetris, and because writing any game in C is considered to be challenging. Although, for anyone who actually knows C fairly well, I think the word "tedious" would be more descriptive.

In either case, the tetris game itself is only a few files, the largest of which is no longer than 364 lines. There is quite a bit of boiler-plate code in the nglu directory, but it's still fairly manageable (in my opinion).

All the geometry in the game (the cube, and the characters used for basic text) were exported from blender, using glrawd. The relevant .blend ships with this project (scene.blend), so feel free to take a look.


  • SDL
  • OpenGL
  • GLEW


CMake is the build system used, so be sure to get that first, and then do the following, in the same directory where wtetris was stored:

mkdir build_wtetris
cd build_wtetris
cmake ../wtetris

Assuming successful compilation, you should be able to run the resulting program with ./wtetris.