예제 #1
0
파일: Events.cs 프로젝트: noqisofon/SDL.net
        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);
        }
예제 #2
0
파일: Events.cs 프로젝트: noqisofon/SDL.net
        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);
            }
        }