Skip to content
Snippets Groups Projects
Commit 3b040fb7 authored by Borostyán József Bálint's avatar Borostyán József Bálint :flag_al:
Browse files

Upload New File

parent d8a94bd7
No related branches found
No related tags found
No related merge requests found
main.cpp 0 → 100644
#include "graphics.hpp"
#include "menu.hpp"
#include "jatekmester.hpp"
#include "jatekter.hpp"
#include <vector>
#include <memory>
using namespace genv;
class App {
std::vector<std::shared_ptr<Widget>> widgets;
std::shared_ptr<JatekTer> jatekter;
std::shared_ptr<Menu> menu;
JatekMester jatek;
public:
App() : jatek(6, 7) {
gout.open(600, 400);
menu = std::make_shared<Menu>(0, 0, 600, 400, [this]() {
widgets.clear();
jatek = JatekMester(6, 7);
jatekter = std::make_shared<JatekTer>(50, 50, 50, jatek);
widgets.push_back(jatekter);
});
widgets.push_back(menu);
}
void run() {
event ev;
while (gin >> ev) {
gout << color(100, 100, 100) << move_to(0, 0) << box(600, 400);
for (auto w : widgets) {
w->handle(ev);
w->draw();
}
gout << refresh;
}
}
};
int main() {
App app;
app.run();
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment