nuclear@0: #include nuclear@0: #include nuclear@0: #include "opengl.h" nuclear@0: #include "part.h" nuclear@0: #include "game_part.h" nuclear@0: #include "menu_part.h" nuclear@0: nuclear@0: static int width, height; nuclear@0: nuclear@0: nuclear@0: MainMenu::~MainMenu() {} nuclear@0: nuclear@0: void MainMenu::draw() const nuclear@0: { nuclear@0: glClear(GL_COLOR_BUFFER_BIT); nuclear@0: nuclear@0: imtk_begin(); nuclear@0: nuclear@0: imtk_layout_start(width / 2, height / 2); nuclear@0: imtk_layout_dir(IMTK_VERTICAL); nuclear@0: imtk_layout_spacing(10); nuclear@0: nuclear@0: if(imtk_button(IMUID, "Play", IMTK_AUTO, IMTK_AUTO)) { nuclear@0: cur_part = game_part; nuclear@0: } nuclear@0: if(imtk_button(IMUID, "Quit", IMTK_AUTO, IMTK_AUTO)) { nuclear@0: exit(0); nuclear@0: } nuclear@0: nuclear@0: imtk_end(); nuclear@0: } nuclear@0: nuclear@0: void MainMenu::reshape(int x, int y) nuclear@0: { nuclear@0: imtk_set_viewport(x, y); nuclear@0: width = x; nuclear@0: height = y; nuclear@0: } nuclear@0: nuclear@0: void MainMenu::mouse_button(int bn, bool pressed) nuclear@0: { nuclear@0: imtk_inp_mouse(bn, pressed ? 1 : 0); nuclear@0: } nuclear@0: nuclear@0: void MainMenu::mouse_motion(int x, int y) nuclear@0: { nuclear@0: imtk_inp_motion(x, y); nuclear@0: }