예제 #1
0
파일: Events.cs 프로젝트: noqisofon/SDL.net
        /// <summary>
        /// Processes the event.
        /// </summary>
        /// <param name='e'>
        /// E.
        /// </param>
        private static void ProcessEvent(SdlSystem.SDL_Event e)
        {
            switch ((EventTypes)e.type)
            {
            case EventTypes.ActiveEvent:
                OnActiveEvent(ActiveEventArgs.CreateEventArgs(e));
                break;

            case EventTypes.KeyDown:
                OnKeyboardDown(KeyboardEventArgs.CreateEventArgs(e));
                break;

            case EventTypes.KeyUp:
                OnKeyboardUp(KeyboardEventArgs.CreateEventArgs(e));
                break;

            case EventTypes.MouseMotion:
                OnMouseMotion(MouseMotionEventArgs.CreateEventArgs(e));
                break;

            case EventTypes.MouseButtonDown:
                OnMouseButtonDown(MouseButtonEventArgs.CreateEventArgs(e));
                break;

            case EventTypes.MouseButtonUp:
                OnMouseButtonUp(MouseButtonEventArgs.CreateEventArgs(e));
                break;

            case EventTypes.JoystickAxisMotion:
                OnJoystickAxisMotion(JoystickAxisEventArgs.CreateEventArgs(e));
                break;

            case EventTypes.JoystickBallMotion:
                OnJoystickBallMotion(JoystickBallEventArgs.CreateEventArgs(e));
                break;

            case EventTypes.JoystickHatMotion:
                OnJoystickHatMotion(JoystickHatEventArgs.CreateEventArgs(e));
                break;

            case EventTypes.JoystickButtonDown:
                OnJoystickButtonDown(JoystickButtonEventArgs.CreateEventArgs(e));
                break;

            case EventTypes.JoystickButtonUp:
                OnJoystickButtonUp(JoystickButtonEventArgs.CreateEventArgs(e));
                break;

            case EventTypes.VideoResize:
                OnVideoResize(VideoResizeEventArgs.CreateEventArgs(e));
                break;

            case EventTypes.VideoExpose:
                OnVideoExpose(VideoExposeEventArgs.CreateEventArgs(e));
                break;

            case EventTypes.Quit:
                OnQuit(QuitEventArgs.CreateEventArgs(e));
                break;

            case EventTypes.WindowManagerEvent:
                OnWindowManagerEvent(WindowManagerEventArgs.CreateEventArgs(e));
                break;

            case EventTypes.UserEvent:
                OnUserEvent(UserEventArgs.CreateEventArgs(e));
                break;
            }
        }
예제 #2
0
파일: Events.cs 프로젝트: noqisofon/SDL.net
		/// <summary>
		/// Raises the active event event.
		/// </summary>
		/// <param name='ergs'>
		/// Ergs.
		/// </param>
        private static void OnActiveEvent(ActiveEventArgs ergs) {
            if ( Active != null )
                Active( new Events(), ergs );
        }