Skip to main content

Documentation 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.

Fazen is the entry point for every Fazen2d application. Constructing it initializes ConsoleHandler, GraphicsRenderer, keyboard, mouse, and timer subsystems — giving you a fully configured console window, a pre-allocated back-buffer, and ready-to-use input polling in a single line of code.
#include "include/headers/Fazen.h"

Constructor

Fazen(int s_width, int s_height);
s_width
int
required
Number of console columns. Sets the horizontal extent of the console buffer and window. Passed directly to ConsoleHandler during initialization.
s_height
int
required
Number of console rows. Sets the vertical extent of the console buffer and window. Passed directly to ConsoleHandler during initialization.

Public Members

MemberTypeDescription
consoleConsoleHandlerManages console buffer setup and dimensions. Holds the CHAR_INFO back-buffer and all static state used throughout the engine.
graphicsGraphicsRendererBackground clear, draw dispatch, and buffer flush. Orchestrates each frame’s render pipeline.
keyboardHandlerKeyboardHandlerKey press and release queries. Use CheckForUserExit() to detect the user closing or pressing the exit key.
mouseHandlerMouseHandlerMouse position and click state. Reads raw input events from the console input handle.
timerTimeManagerFrame elapsed time measurement. Use for frame-rate-independent movement and animation.

Usage Example

#include "include/headers/Fazen.h"

int main() {
    Fazen game(100, 50);   // 100 cols, 50 rows

    while (!game.keyboardHandler.CheckForUserExit()) {
        game.graphics.background(whiteB);
        // ... draw shapes
        game.graphics.display();
    }
}

Notes

Only one Fazen instance should exist per application because ConsoleHandler uses static state. Creating two instances with different dimensions produces undefined behavior — the second constructor call will silently overwrite the shared static fields (handles, buffer pointer, and dimensions) set by the first.

Build docs developers (and LLMs) love