Skip to content

Commit

Permalink
feat: 🎉 Made a window
Browse files Browse the repository at this point in the history
  • Loading branch information
Polaris66 committed Jul 25, 2023
0 parents commit e077dac
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 0 deletions.
Empty file added Cell.cpp
Empty file.
Empty file added Grid.cpp
Empty file.
11 changes: 11 additions & 0 deletions headers/Cell.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class Cell
{
private:
bool nextAliveState;

public:
bool alive;
void update();

Cell();
};
16 changes: 16 additions & 0 deletions headers/Grid.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <Cell.hpp>

class Grid
{
private:
Cell *cells = nullptr;

public:
int width, height;
Grid(int _width, int _height);
~Grid();

void update();

Cell &getCell(int xpos, int ypos, int localWidth);
};
23 changes: 23 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <SFML/Graphics.hpp>

int main()
{
int width = 800;
int height = 600;
// Create the main window
sf::RenderWindow window(sf::VideoMode(width, height), "Game of Life");

// Main Loop
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
// Close window
if (event.type == sf::Event::Closed)
{
window.close();
}
}
}
}
Binary file added main.o
Binary file not shown.
Binary file added sfml-app
Binary file not shown.

0 comments on commit e077dac

Please sign in to comment.