I would check that the bg_tex texture is valid and also that the bg_r contains correct values.
The x field is being set in the while loop but check that the y, w and h fields are valid too. I have sometimes made the mistake by not setting the w and h fields correctly, which has ended up having a rect of (0, 0) in size, which, together with that rect, won’t render anything.
You should still leave out the continue statement, since it’s not needed, and replace it with break or leave out the default case entirely. It would only be useful if you had some additional code after the switch statement in the while loop that you wanted to skip. As your code currently stands, there’s nothing after the switch block, so it jumps back up to the top of that while loop anyway.
As to the rest of it, if simply adding one variable (the SDL_Event) breaks your code then you might have stack corruption. Are you surebg_tex and bg_r are valid with the SDL_Event?
Also, why are you calling SDL_Delay()? If you want vertical sync, create your renderer with the SDL_RENDERER_PRESENTVSYNC flag, since that will make it hook into the OS’s hooks for syncing up with the display. SDL_Delay() guarantees only that it will delay for at least that much time; it could delay for a lot longer.