Quit on Ctrl-Q
This commit is contained in:
parent
837b3466a5
commit
718941eacd
|
@ -1,5 +1,6 @@
|
||||||
#include "gamecore.h"
|
#include "gamecore.h"
|
||||||
#include "mathutils.h"
|
#include "mathutils.h"
|
||||||
|
#include "debug.h"
|
||||||
#include <SDL/SDL.h>
|
#include <SDL/SDL.h>
|
||||||
|
|
||||||
int GameCore::MAX_MOVE_DISTANCE = 100;
|
int GameCore::MAX_MOVE_DISTANCE = 100;
|
||||||
|
@ -70,3 +71,9 @@ void GameCore::on_rbutton_down(int mX, int mY)
|
||||||
{
|
{
|
||||||
data.clear_current_vertex();
|
data.clear_current_vertex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GameCore::on_key_down(SDLKey sym, SDLMod mod, Uint16 unicode)
|
||||||
|
{
|
||||||
|
if (sym == SDLK_q && mod & KMOD_CTRL) is_running = false;
|
||||||
|
}
|
||||||
|
|
|
@ -24,6 +24,8 @@ class GameCore : public MainEvent
|
||||||
void on_exit();
|
void on_exit();
|
||||||
void on_lbutton_down(int x, int y);
|
void on_lbutton_down(int x, int y);
|
||||||
void on_rbutton_down(int mX, int mY);
|
void on_rbutton_down(int mX, int mY);
|
||||||
|
void on_key_down(SDLKey sym, SDLMod mod, Uint16 unicode);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool init();
|
bool init();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user