The C++ version of TetrisAnalyzer now uses GLFW, an actively maintained, MIT-licensed alternative to GLUT that provides native windowing and input on every platform.
Note that this version is not as performance-optimized as the Scala implementation and is actually slower. With proper optimization, it should be at least twice as fast as the Scala version.
For max speed:
- Next: off
- Level: 1
- Sliding: off
- Step: off
- Animate: off
- Delay: 0
- Install dependencies (Homebrew example):
brew install cmake glfw
- Configure and build with CMake:
cmake -S . -B build cmake --build build - Launch the analyzer:
./build/TetrisAnalyzer
GLFW is native on macOS (Cocoa), so no XQuartz or additional setup is required. On Linux, install the equivalent packages
(cmake, libglfw3-dev, etc.) and run the same commands. On Windows you can also use the CMake workflow by pointing to
the GLFW binaries and linking against opengl32, glu32, and glfw3.
- Install Microsoft Visual C++ 6.0.
- Download the GLFW prebuilt binaries for Windows and copy:
glfw3.h(the wholeGLFWinclude folder) →C:\Program Files\Microsoft Visual Studio\VC98\Includeglfw3.lib→C:\Program Files\Microsoft Visual Studio\VC98\Libglfw3.dllsomewhere on yourPATH(for exampleC:\Windows\System32) or next to the executable.
- Open
legacy/TetrisApp.dswin Visual C++. - Configure Precompiled Headers via
Project → Settings:StdAfx.cpp: Create precompiled header, through headerstdafx.h.TetrisApp.cpp: Use the precompiled header file (.pch).
- Link against
opengl32.lib,glu32.lib, andglfw3.lib, then build and run.
