[quake3-commits] [ioquake/ioq3] c6a61d: Fix SDL2 losing event subsystem

Zack Middleton zturtleman at gmail.com
Fri Oct 18 17:38:16 EDT 2013


  Branch: refs/heads/sdl2
  Home:   https://github.com/ioquake/ioq3
  Commit: c6a61d212a0bb7b56e53ea3802d2244309577c05
      https://github.com/ioquake/ioq3/commit/c6a61d212a0bb7b56e53ea3802d2244309577c05
  Author: Zack Middleton <zturtleman at gmail.com>
  Date:   2013-10-18 (Fri, 18 Oct 2013)

  Changed paths:
    M code/sdl/sdl_input.c

  Log Message:
  -----------
  Fix SDL2 losing event subsystem

Quiting SDL Video or Joystick subsystem implies quiting the Event subsystem in SDL2.
SDL keeps track of number of init and shutdown calls for each subsystem.
Shuting down video or joystick more or equal to number of times they're inited will lead to event shutdown.

Toggling in and out of fullscreen or running in_restart twice causes SDL event subsystem to shutdown, making input not work.

If the console is closed, IN_GobbleMotionEvents gets stuck in a loop. SDL_PeepEvents returns -1 when there is an error, but we assume non-0 means read more events.

IN_ShutdownJoystick needs to check if joystick subsystem was inited before quitting it, otherwise we may cause SDL event subsystem to shutdown.





More information about the quake3-commits mailing list