| ␉␉␉}␊ |
| ␉␉␉catch(DllNotFoundException e)␊ |
| ␉␉␉{␊ |
| ␉␉␉␉System.Console.WriteLine("OpenAL not found! Need FNA.dll.config?");␊ |
| ␉␉␉␉Log("OpenAL not found! Need FNA.dll.config?");␊ |
| ␉␉␉␉throw e;␊ |
| ␉␉␉}␊ |
| ␉␉␉catch(Exception)␊ |
|
| ␉␉␉␉{␊ |
| ␉␉␉␉␉if (SDL.SDL_GL_SetSwapInterval(-1) != -1)␊ |
| ␉␉␉␉␉{␊ |
| ␉␉␉␉␉␉System.Console.WriteLine("Using EXT_swap_control_tear VSync!");␊ |
| ␉␉␉␉␉␉Log("Using EXT_swap_control_tear VSync!");␊ |
| ␉␉␉␉␉}␊ |
| ␉␉␉␉␉else␊ |
| ␉␉␉␉␉{␊ |
| ␉␉␉␉␉␉System.Console.WriteLine("EXT_swap_control_tear unsupported. Fall back to standard VSync.");␊ |
| ␉␉␉␉␉␉Log("EXT_swap_control_tear unsupported. Fall back to standard VSync.");␊ |
| ␉␉␉␉␉␉SDL.SDL_ClearError();␊ |
| ␉␉␉␉␉␉SDL.SDL_GL_SetSwapInterval(1);␊ |
| ␉␉␉␉␉}␊ |
|
| ␉␉␉}␊ |
| ␉␉␉else␊ |
| ␉␉␉{␊ |
| ␉␉␉␉throw new Exception("Unrecognized PresentInterval!");␊ |
| ␉␉␉␉throw new NotSupportedException("Unrecognized PresentInterval!");␊ |
| ␉␉␉}␊ |
| ␉␉}␊ |
| ␊ |
|
| ␉␉␉␉INTERNAL_haptics[which] = SDL.SDL_HapticOpenFromJoystick(thisJoystick);␊ |
| ␉␉␉␉if (INTERNAL_haptics[which] == IntPtr.Zero)␊ |
| ␉␉␉␉{␊ |
| ␉␉␉␉␉System.Console.WriteLine("HAPTIC OPEN ERROR: " + SDL.SDL_GetError());␊ |
| ␉␉␉␉␉Log("HAPTIC OPEN ERROR: " + SDL.SDL_GetError());␊ |
| ␉␉␉␉}␊ |
| ␉␉␉}␊ |
| ␉␉␉if (INTERNAL_haptics[which] != IntPtr.Zero)␊ |
|
| ␉␉␉}␊ |
| ␊ |
| ␉␉␉// Print controller information to stdout.␊ |
| ␉␉␉System.Console.WriteLine(␊ |
| ␉␉␉Log(␊ |
| ␉␉␉␉"Controller " + which.ToString() + ": " +␊ |
| ␉␉␉␉SDL.SDL_GameControllerName(INTERNAL_devices[which])␊ |
| ␉␉␉);␊ |
|
| ␉␉␉// A lot of errors can happen here, but honestly, they can be ignored...␊ |
| ␉␉␉SDL.SDL_ClearError();␊ |
| ␊ |
| ␉␉␉System.Console.WriteLine("Removed device, player: " + output.ToString());␊ |
| ␉␉␉Log("Removed device, player: " + output.ToString());␊ |
| ␉␉}␊ |
| ␊ |
| ␉␉// GetState can convert stick values to button values␊ |