Skip to content

A Tetris game written in raw openGL with minimal dependencies

Notifications You must be signed in to change notification settings

TommyXR/TetrisGL

Repository files navigation

TetrisGL

This is an implementation of Tetris following the official Tetris Design Guideline as closely as possible. It is written with modern C++ and OpenGL.

Design decisions

Tetris grid

I was hesitating between using a deque and a vector of arrays for the mino grid. Even if a lot of push and pop operations are needed, I thought maybe iterating through the grid every frame could make vector faster because of memory being contiguous. I ended up making a benchmark to compare, and it turned out deque is better.

Time

At first, I was refering to time using std::milliseconds. However, the engine ended up being too fast for this, so I had to go with std::nanoseconds

About

A Tetris game written in raw openGL with minimal dependencies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published