From 011b57f0512b34dbf15e535c4781ac865254fb1e Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Sun, 5 Jun 2022 14:11:46 +0300 Subject: [PATCH] Added esc to quit on No Maze screen --- src/no_maze.cpp | 6 ++++++ src/no_maze.h | 1 + y3s2-gui-project.spec | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/no_maze.cpp b/src/no_maze.cpp index 2e1f367..091cebf 100644 --- a/src/no_maze.cpp +++ b/src/no_maze.cpp @@ -20,3 +20,9 @@ void NoMazeScreen::display() { glFlush(); glutSwapBuffers(); } + +void NoMazeScreen::keyboard(unsigned char key, int x, int y) { + if (key == '\e') { + exit(EXIT_SUCCESS); + } +} diff --git a/src/no_maze.h b/src/no_maze.h index 310ee7a..085bfef 100644 --- a/src/no_maze.h +++ b/src/no_maze.h @@ -4,4 +4,5 @@ struct NoMazeScreen : public GlutEvents { virtual void display(); + virtual void keyboard(unsigned char key, int x, int y); }; diff --git a/y3s2-gui-project.spec b/y3s2-gui-project.spec index 7b69f7b..5317835 100644 --- a/y3s2-gui-project.spec +++ b/y3s2-gui-project.spec @@ -1,5 +1,5 @@ Name: y3s2-gui-project -Version: 1.0.5 +Version: 1.0.6 Release: 1%{?dist} Summary: Maze project in OpenGL for Graphics and User Interfaces lecture in year 3, semester 2