Skip to content

A simple game of Tetris using OpenGL to render the field.

License

Notifications You must be signed in to change notification settings

veigaribo/opengl-tetris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Tetris Clone

Controls

Key Action
A / H / ← Move current piece to the left
S / J / ↓ Move current piece down
D / L / → Move current piece to the right
Z / ␣ Rotate current piece clockwise

Building

To build, you will need the following C/C++ libraries and headers available:

  • GLFW (Graphics Library Framework)
  • GLEW (The OpenGL Extension Wrangler)

Ubuntu (and likely most Debian-based distributions as well):

# apt install libglfw3 libglfw3-dev libglew2.1 libglew-dev

Fedora:

# dnf install glfw glfw-devel libGLEW glew-devel

Arch Linux:

# pacman -S glfw glew

Then, to compile it using GCC, just run

make tetris

or simply

make

(Assumes the pkg-config command is globally available)

Additionally

make DEBUG=1

compiles with the -g flag (for debug information) and no -O,

make TRACK_FPS=1

will flood your stdout with some measure of frames per second when the game is ran,

make FAST_RENDER=1

will render the game by mapping each tile of the field to a texel instead of doing more complex vertex / triangle stuff, which I think is pretty neat, but doesn't seem faster at all... I mean, it's still about 10000 FPS on my machine but...

Of course, you can mix those flags whatever way you like.

About

A simple game of Tetris using OpenGL to render the field.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published