Grab mouse only once streaming has started

This commit is contained in:
Cameron Gutman
2022-01-09 19:41:56 -06:00
parent bbdd7e5b24
commit 5761f533ab

View File

@@ -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: