From: Stan_Lewry Date: Tue, 1 Oct 2024 20:04:26 +0000 (+0100) Subject: add additional input X-Git-Url: https://stanlewry.com/index.cgi?a=commitdiff_plain;h=676202abf80f25954d0363954699274629f365f5;p=2DEngine.git add additional input --- 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);