back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
blob: 4224965902c4b9153ecd0541f6df29a446eaf9de (plain)
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
26
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Sys_Menu_Bar.H>
#include <stdlib.h>
#include <time.h>

#include "puzzle.hpp"
#include "gameplay.hpp"
#include "menu_callbacks.hpp"

int main()
{
    srand(time(nullptr));
    Fl_Window *win = new Fl_Window(325, 355, "Picture puzzle");
    Fl_Sys_Menu_Bar *sys_bar = new Fl_Sys_Menu_Bar(0, 0, 165, 20, nullptr);
    sys_bar->add("&File/&Load picture", nullptr, load_file_callback);
    sys_bar->add("&File/&Exit", nullptr, exit_callback);
    sys_bar->add("&Option/&Show solution", nullptr, solve_problem_callback);
    sys_bar->add("&About", nullptr, about_callback);
    GameParams *params = GameParams::SetUpParams(win);
    PuzzleGame::StartGame(params);
    win->show();
    return Fl::run();
    return 0;
}