-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCommon.hpp
More file actions
25 lines (19 loc) · 722 Bytes
/
Common.hpp
File metadata and controls
25 lines (19 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Conway's Game of Life
// Copyright (c) 2025 Faraz Fallahi <fffaraz@gmail.com>
#pragma once
#include "DoubleBuffer.hpp"
#include "Grid.hpp"
#include <iostream>
#include <thread>
constexpr int GRID_SIZE = 512; // Size of the grid in cells
constexpr int CELL_SIZE = 1; // Size of each cell in pixels
constexpr int targetFPS = 30;
DoubleBuffer<Grid<GRID_SIZE>> grid;
void printInfo()
{
std::cout << "Conway's Game of Life\n";
std::cout << "https://github.com/fffaraz/GameOfLife\n";
std::cout << "Grid size: " << GRID_SIZE << " x " << GRID_SIZE << "\n";
std::cout << "Cell size: " << CELL_SIZE << " pixels\n";
std::cout << "Hardware concurrency: " << std::thread::hardware_concurrency() << "\n";
}