From 676202abf80f25954d0363954699274629f365f5 Mon Sep 17 00:00:00 2001 From: Stan_Lewry Date: Tue, 1 Oct 2024 21:04:26 +0100 Subject: [PATCH] add additional input --- 2DEngine.cpp | 2 ++ 2DEngine.h | 1 + 2 files changed, 3 insertions(+) diff --git a/2DEngine.cpp b/2DEngine.cpp index 2114b6c..710c9dd 100644 --- a/2DEngine.cpp +++ b/2DEngine.cpp @@ -128,6 +128,7 @@ namespace S2DE { case SDLK_LEFT: inputState->left = true; break; case SDLK_RIGHT: inputState->right = true; break; case SDLK_RETURN: inputState->rtrn = true; break; + case SDLK_ESCAPE: inputState->escape = true; break; } break; case SDL_KEYUP: @@ -138,6 +139,7 @@ namespace S2DE { case SDLK_LEFT: inputState->left = false; break; case SDLK_RIGHT: inputState->right = false; break; case SDLK_RETURN: inputState->rtrn = false; break; + case SDLK_ESCAPE: inputState->escape = false; break; } } } diff --git a/2DEngine.h b/2DEngine.h index c50a28e..57fe6e0 100644 --- a/2DEngine.h +++ b/2DEngine.h @@ -37,6 +37,7 @@ namespace S2DE { bool up, down, left, right; bool quit; bool rtrn; + bool escape; }; __declspec(dllexport) void updateInputState(InputState* inputState); -- 2.20.1