public static bool Poll(int number_of_events) { SdlSystem.SDL_Event e; bool ret = false; for (int i = 0; i < number_of_events; ++i) { int retval = SdlSystem.SDL_PollEvent(out e); if (retval == (int)NativeFunctionReturnFlags.Error) { throw SdlException.Generate(); } if (retval == (int)NativeFunctionReturnFlags.None) { ret = true; break; } else { ProcessEvent(e); } } return(ret); }
public static bool Poll() { try { SdlSystem.SDL_Event e; int ret = SdlSystem.SDL_PollEvent(out e); if (ret == (int)NativeFunctionReturnFlags.Error) { throw SdlException.Generate(); } if (ret == (int)NativeFunctionReturnFlags.None) { return(false); } else { ProcessEvent(e); return(true); } } catch (AccessViolationException) { return(false); } }