From 0179459ac5de29f6f1aab84af52a24b63f097554 Mon Sep 17 00:00:00 2001 From: Barry Kane Date: Thu, 2 Mar 2023 14:40:14 +0000 Subject: [PATCH] Allow SDL2 Experiment 17 to have joystick input while unfocused --- SDL2-Bits-And-Pieces/Experiment-17/SDL2-Experiment-17.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SDL2-Bits-And-Pieces/Experiment-17/SDL2-Experiment-17.c b/SDL2-Bits-And-Pieces/Experiment-17/SDL2-Experiment-17.c index e99a4fa..af97df0 100644 --- a/SDL2-Bits-And-Pieces/Experiment-17/SDL2-Experiment-17.c +++ b/SDL2-Bits-And-Pieces/Experiment-17/SDL2-Experiment-17.c @@ -233,7 +233,8 @@ int main(int argc, char ** argv) // Initialize image loading: IMG_Init(IMG_INIT_PNG); SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "2"); - + SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); + // Create an SDL window and rendering context in that window: SDL_Window * window = SDL_CreateWindow("SDL_TEST", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 700, 700, 0); SDL_Renderer * renderer = SDL_CreateRenderer(window, -1, rendererFlags);