diff --git a/src/sdl.c b/src/sdl.c index a49d02e..95b3a1f 100644 --- a/src/sdl.c +++ b/src/sdl.c @@ -50,7 +50,6 @@ void sdl_init(int width, int height, bool fullscreen) { exit(1); } - SDL_SetRelativeMouseMode(SDL_TRUE); renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); if (!renderer) { printf("SDL_CreateRenderer failed: %s\n", SDL_GetError()); @@ -72,6 +71,9 @@ void sdl_init(int width, int height, bool fullscreen) { void sdl_loop() { SDL_Event event; + + SDL_SetRelativeMouseMode(SDL_TRUE); + while(!done && SDL_WaitEvent(&event)) { switch (sdlinput_handle_event(&event)) { case SDL_QUIT_APPLICATION: