In this quickstart you’ll get Fazen2d running on your machine, compile the project with a single command, and have an animated program drawing a red box, a blue line, and a green circle on a white console background — all exitable with the ESC key. No external libraries, no package manager, just a compiler andDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/adi3120/Fazen2d/llms.txt
Use this file to discover all available pages before exploring further.
make.
Prerequisites
Before you begin, make sure you have the following available on your Windows machine:- Windows 10 or later — Fazen2d uses Win32 Console APIs that require a modern Windows console host.
- g++ with C++11 support — available via MinGW or MSYS2. The Makefile compiles with
g++ -std=c++11. - GNU Make — included with MinGW/MSYS2, or installable via Chocolatey (
choco install make). If you prefer, you can compile manually withoutmake(see Step 1 below).
Step 1: Clone, Build, and Run
Clone the repository
Open a Windows command prompt or Git Bash in the directory where you want to place the project, then run:This downloads the full source tree, including all headers under
include/headers/, all implementation files under include/, main.cpp, and the Makefile.Build with Make
From inside the The Makefile compiles every
Fazen2d directory, run:.cpp file found under include/ (one per subsystem — Box.cpp, Circle.cpp, ConsoleHandler.cpp, and so on) together with main.cpp, all with the -std=c++11 flag, and links the resulting object files into an executable named a in the project root.If you don’t have make installed, you can compile manually:Your First Program
The code below is a lightly annotated version ofmain.cpp — the canonical Fazen2d demo. Every Fazen2d program follows the same three-step loop inside while (true): clear → draw → display.
main.cpp
| Line | What it does |
|---|---|
Fazen game(100, 100) | Constructs the engine, allocating a CHAR_INFO[100 × 100] back-buffer and configuring the console font and window size via ConsoleHandler. |
Box / Line / Circle constructors | Create shape objects with a position, size or endpoints, and a ConsoleColor constant from Colors.h (redF, blueF, greenF). |
game.graphics.background(whiteB) | Fills every cell in the back-buffer with a space character at the whiteB (white background) attribute — effectively clearing the screen each frame. |
game.graphics.draw(shape) | Calls the shape’s draw() override, which writes Unicode characters and color attributes into the back-buffer cells that the shape occupies. |
shape.translate(dx, dy) | Shifts the shape’s position by (dx, dy) console cells per frame, producing smooth diagonal movement. |
game.graphics.display() | Flushes the entire back-buffer to the visible console in one call to WriteConsoleOutputW, ensuring a flicker-free update. |
game.keyboardHandler.CheckForUserExit() | Checks whether the ESC key (VK_ESCAPE) is currently pressed via GetAsyncKeyState; returns true to break the loop and exit. |
What You Should See
Once the program is running, the console will show a white background filling the entire window. A red filled rectangle (theBox) glides diagonally down and to the right at a slow pace. A blue diagonal line streaks across the screen moving faster than the box. A green filled circle also travels diagonally, moving at the same speed as the line. All three shapes start in the upper-left region of the buffer and migrate toward the lower-right corner over time. The animation runs continuously at the speed your CPU can drive the render loop. Press ESC at any point to exit the program cleanly.
Next Steps
System Requirements
Review the full list of OS, compiler, and console requirements before deploying Fazen2d in your own project.
Build Guide
Learn how the Makefile works in detail, how to do a manual compilation, and how to integrate Fazen2d source into an existing project.
Frame Loop
Understand the clear–draw–display cycle, double-buffering internals, and how to add frame-rate-independent timing to your loop.
API Reference
Explore the full public API — every class, constructor, method signature, and color constant available in Fazen2d.