Beispiel #1
0
        private void HandleSDLEvent(ref SDL_Event evnt)
        {
            if (evnt.type == SDL_EventType.SDL_JOYDEVICEADDED)
            {
                int deviceId = evnt.cbutton.which;

                // SDL2 loves to be inconsistent here by providing the device id instead of the instance id (like on removed event), as such we just grab it and send it inside our system.
                int instanceId = SDL_JoystickGetDeviceInstanceID(deviceId);

                if (instanceId == -1)
                {
                    return;
                }

                Logger.Debug?.Print(LogClass.Application, $"Added joystick instance id {instanceId}");

                OnJoyStickConnected?.Invoke(deviceId, instanceId);
            }
            else if (evnt.type == SDL_EventType.SDL_JOYDEVICEREMOVED)
            {
                Logger.Debug?.Print(LogClass.Application, $"Removed joystick instance id {evnt.cbutton.which}");

                OnJoystickDisconnected?.Invoke(evnt.cbutton.which);
            }
        }
Beispiel #2
0
        private void ProcessEvent(ref SDL_Event ev)
        {
            switch (ev.type)
            {
            case SDL_EventType.ControllerDeviceAdded:
            case SDL_EventType.ControllerDeviceRemoved:
            case SDL_EventType.ControllerDeviceRemapped:
            case SDL_EventType.ControllerButtonUp:
            case SDL_EventType.ControllerButtonDown:
            case SDL_EventType.ControllerAxisMotion:
                _inputGameController.CacheEvent(ref ev);
                break;

            //Currently Veldrid Snapshot is used for all events.
            //However here is an attempt to faster sample mouse position
            case SDL_EventType.MouseMotion:
                _inputMouseAndKeyboard.CacheEvent(ref ev);
                break;

            case SDL_EventType.Quit:
            case SDL_EventType.Terminating:
                _coreMessenger.QueueMessage(CoreMessage.Shutdown);
                break;

            case SDL_EventType.LowMemory:
                _applicationMessenger.QueueMessage(FrameworkMessage.LowMemoryReported);
                break;

            case SDL_EventType.RenderDeviceReset:
            case SDL_EventType.RenderTargetsReset:
                _coreMessenger.QueueMessage(CoreMessage.DeviceOrRenderTargetsReset);
                break;
            }
        }
Beispiel #3
0
        static public void UpdateFrameInput(SDL_Event Event, Boolean IsDown)
        {
            //aca se remappearian los controles si fueran remappeabels
            if (Event.key.keysym.sym == SDL_Keycode.SDLK_UP)
            {
                ArrowKeys[(int)ArrowKeysID.ARROW_UP].IsDown = IsDown;
            }

            if (Event.key.keysym.sym == SDL_Keycode.SDLK_RIGHT)
            {
                ArrowKeys[(int)ArrowKeysID.ARROW_RIGHT].IsDown = IsDown;
            }

            if (Event.key.keysym.sym == SDL_Keycode.SDLK_DOWN)
            {
                ArrowKeys[(int)ArrowKeysID.ARROW_DOWN].IsDown = IsDown;
            }

            if (Event.key.keysym.sym == SDL_Keycode.SDLK_LEFT)
            {
                ArrowKeys[(int)ArrowKeysID.ARROW_LEFT].IsDown = IsDown;
            }

            if (Event.key.keysym.sym == SDL_Keycode.SDLK_SPACE)
            {
                ActionKeys[(int)ActionKeysID.JUMP].IsDown = IsDown;
            }
        }
Beispiel #4
0
        /// <summary>
        /// Ends an active touch input.
        /// </summary>
        private void EndTouch(ref SDL_Event evt)
        {
            for (int i = 0; i < touches.Count; i++)
            {
                var touch = touches[i];
                if (touch.FingerID == evt.tfinger.fingerId)
                {
                    if (timestamp - touch.Timestamp <= TimeSpan.FromMilliseconds(TapDelay).Ticks)
                    {
                        var window = BoundWindow;
                        if (window != null)
                        {
                            var tapDistanceDips = TapMaximumDistance;
                            var tapDistancePixs = window.Display.DipsToPixels(tapDistanceDips);
                            if (tapDistancePixs >= touch.Distance)
                            {
                                EndTap(touch.TouchID, touch.FingerID, touch.OriginX, touch.OriginY);
                            }
                        }
                    }

                    OnTouchUp(touch.TouchID, touch.FingerID);

                    touches.RemoveAt(i);

                    break;
                }
            }
        }
Beispiel #5
0
        private void HandleWindowEvent(SDL_Event evnt)
        {
            if (evnt.type == SDL_EventType.SDL_WINDOWEVENT)
            {
                switch (evnt.window.windowEvent)
                {
                case SDL_WindowEventID.SDL_WINDOWEVENT_SIZE_CHANGED:
                    Width  = evnt.window.data1;
                    Height = evnt.window.data2;
                    Renderer?.Window.SetSize(Width, Height);
                    MouseDriver.SetClientSize(Width, Height);
                    break;

                case SDL_WindowEventID.SDL_WINDOWEVENT_CLOSE:
                    Exit();
                    break;

                default:
                    break;
                }
            }
            else
            {
                MouseDriver.Update(evnt);
            }
        }
Beispiel #6
0
        private void ProcessEvent(ref SDL_Event evt)
        {
            switch (evt.type)
            {
            case SDL_EventType.ControllerAxisMotion:
                SDL_ControllerAxisEvent axisEvent = Unsafe
                                                    .As <SDL_Event, SDL_ControllerAxisEvent>(ref evt);
                if (axisEvent.which == _instanceId)
                {
                    _axisValues[(int)axisEvent.axis] = axisEvent.value < 0
                            ? -((float)axisEvent.value / short.MinValue)
                            : (float)axisEvent.value / short.MaxValue;
                }
                break;

            case SDL_EventType.ControllerButtonDown:
            case SDL_EventType.ControllerButtonUp:
                SDL_ControllerButtonEvent buttonEvent = Unsafe
                                                        .As <SDL_Event, SDL_ControllerButtonEvent>(ref evt);
                if (buttonEvent.which == _instanceId)
                {
                    int  index = (int)buttonEvent.button;
                    bool down  = buttonEvent.state == 1;
                    _newButtons[index]  = !_buttonState[index] && down;
                    _buttonState[index] = down;
                }
                break;
            }
        }
Beispiel #7
0
        internal void MouseWheel(SDL_Event e)
        {
            MouseEvent mouseEvent = new MouseEvent();

            mouseEvent.SetCount(e.wheel.y);
            mouseWheel?.Invoke(gameObject, new object[] { mouseEvent });
        }
Beispiel #8
0
        private void HandleSDLEvent(ref SDL_Event evnt)
        {
            if (evnt.type == SDL_EventType.SDL_JOYDEVICEADDED)
            {
                int deviceId = evnt.cbutton.which;

                // SDL2 loves to be inconsistent here by providing the device id instead of the instance id (like on removed event), as such we just grab it and send it inside our system.
                int instanceId = SDL_JoystickGetDeviceInstanceID(deviceId);

                if (instanceId == -1)
                {
                    return;
                }

                Logger.Debug?.Print(LogClass.Application, $"Added joystick instance id {instanceId}");

                OnJoyStickConnected?.Invoke(deviceId, instanceId);
            }
            else if (evnt.type == SDL_EventType.SDL_JOYDEVICEREMOVED)
            {
                Logger.Debug?.Print(LogClass.Application, $"Removed joystick instance id {evnt.cbutton.which}");

                OnJoystickDisconnected?.Invoke(evnt.cbutton.which);
            }
            else if (evnt.type == SDL_EventType.SDL_WINDOWEVENT || evnt.type == SDL_EventType.SDL_MOUSEBUTTONDOWN || evnt.type == SDL_EventType.SDL_MOUSEBUTTONUP)
            {
                if (_registeredWindowHandlers.TryGetValue(evnt.window.windowID, out Action <SDL_Event> handler))
                {
                    handler(evnt);
                }
            }
        }
Beispiel #9
0
        internal void MouseButtonDown(SDL_Event e)
        {
            lastPressedButton = e.button.button;

            mouseState.ButtonPressed(e.button.button);
            mousePressed?.Invoke(gameObject, null);
        }
Beispiel #10
0
 internal void KeyDown(SDL_Event e)
 {
     pressedKeys.Add(latestKey);
     latestKey = SDL_GetKeyName(e.key.keysym.sym);
     keyPressed?.Invoke(gameObject, null);
     keyTyped?.Invoke(gameObject, null);
 }
Beispiel #11
0
        private void ProcessEvent(SDL_Event ev)
        {
            switch (ev.type)
            {
                case SDL_EventType.SDL_WINDOWEVENT:
                    if (ev.window.windowEvent == SDL_WindowEventID.SDL_WINDOWEVENT_RESIZED)
                        UxContext.OnWindowResize(width: ev.window.data1, height: ev.window.data2);
                    return;

                case SDL_EventType.SDL_QUIT:
                    CloseWindowKeyPressed = true;
                    return;

                case SDL_EventType.SDL_KEYDOWN:
                    OnKeyEvent(ev.key, true);
                    return;

                case SDL_EventType.SDL_KEYUP:
                    OnKeyEvent(ev.key, false);
                    return;

                case SDL_EventType.SDL_TEXTINPUT:
                    OnTextInput(GetText(ev.text));
                    return;

                case SDL_EventType.SDL_RENDER_TARGETS_RESET:
                    GameRenderer.RecreateBufferTextures();
                    return;
            }
        }
Beispiel #12
0
        public static void ProcessKeyEvent(SDL_Event ev)
        {
            switch (ev.type)
            {
            case SDL_EventType.SDL_KEYDOWN:
                var key_code = (int)ev.key.keysym.sym;
                AddKey(key_code);
                if (OnKeyDown != null)
                {
                    var key = TranslatePlatformKey(key_code);
                    if (_last_key_down != key && key != Key.None)
                    {
                        _last_key_down = key;
                        OnKeyDown(key);
                    }
                }

                break;

            case SDL_EventType.SDL_KEYUP:
                var key_code_up = (int)ev.key.keysym.sym;
                RemoveKey(key_code_up);
                _last_key_down = Key.None;
                if (OnKeyUp != null)
                {
                    var key = TranslatePlatformKey(key_code_up);
                    if (key == Key.None)
                    {
                        return;
                    }
                    OnKeyUp(key);
                }
                break;
            }
        }
Beispiel #13
0
        public static void ProcessMouseEvent(SDL_Event ev)
        {
            switch (ev.type)
            {
            case SDL_EventType.SDL_MOUSEBUTTONDOWN:
                SetMouseButtonState(ev.button.button, true);
                if (OnMouseDown != null)
                {
                    var button = TranslatePlatformMouseButton(ev.button.button);
                    OnMouseDown.Invoke(button);
                }
                break;

            case SDL_EventType.SDL_MOUSEBUTTONUP:
                SetMouseButtonState(ev.button.button, false);
                if (OnMouseUp != null)
                {
                    var button = TranslatePlatformMouseButton(ev.button.button);
                    OnMouseUp.Invoke(button);
                }
                break;

            case SDL_EventType.SDL_MOUSEMOTION:
                OnMouseMove?.Invoke();
                break;
            }
        }
Beispiel #14
0
        private static void ProcessWindowEvent(SDL_Event evt)
        {
            // Window Focus
            if (evt.window.windowEvent == SDL_WindowEventID.SDL_WINDOWEVENT_FOCUS_GAINED)
            {
                Engine.Active = true;

                if (!OSXUseSpaces)
                {
                    SDL_SetWindowFullscreen(
                        _window,
                        Engine.Fullscreen ?
                        (uint)SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP :
                        0
                        );
                }

                // Disable the screensaver when we're back.
                SDL_DisableScreenSaver();
            }
            else if (evt.window.windowEvent == SDL_WindowEventID.SDL_WINDOWEVENT_FOCUS_LOST)
            {
                Engine.Active = false;

                if (!OSXUseSpaces)
                {
                    SDL_SetWindowFullscreen(_window, 0);
                }

                SDL_EnableScreenSaver();
            }

            // Window Resize
            else if (evt.window.windowEvent == SDL_WindowEventID.SDL_WINDOWEVENT_SIZE_CHANGED)
            {
                var w = evt.window.data1;
                var h = evt.window.data2;
                display_w = w;
                display_h = h;

                Engine.OnDisplayResize();
            }

            else if (evt.window.windowEvent == SDL_WindowEventID.SDL_WINDOWEVENT_EXPOSED)
            {
                Engine.RunningGame.Tick();
            }

            else if (evt.window.windowEvent == SDL_WindowEventID.SDL_WINDOWEVENT_ENTER)
            {
                SDL_DisableScreenSaver();
                OnMouseEnter?.Invoke();
            }
            else if (evt.window.windowEvent == SDL_WindowEventID.SDL_WINDOWEVENT_LEAVE)
            {
                SDL_EnableScreenSaver();
                OnMouseLeave?.Invoke();
            }
        }
Beispiel #15
0
        internal SourceWindowEvent(object source, SDL_Event sdlEvent)
        {
            EventInfo = sdlEvent;
            Source    = source;
            Type      = (EventType)EventInfo.type;

            ProcessSourceEvent();
        }
Beispiel #16
0
        private void ProcessAnEvent(ref SDL_Event ev)
        {
            int id;

            switch (ev.type)
            {
            case SDL_EventType.ControllerDeviceAdded:
                UpdateGamepadRegister();
                _applicationMessenger.QueueMessage(FrameworkMessage.GamepadAdded);
                break;

            case SDL_EventType.ControllerDeviceRemoved:
                UpdateGamepadRegister();
                _applicationMessenger.QueueMessage(FrameworkMessage.GamepadRemoved);
                break;

            case SDL_EventType.ControllerDeviceRemapped:
                //Unsure if am required to process this event. For future investigation
                break;

            case SDL_EventType.ControllerButtonUp:
            case SDL_EventType.ControllerButtonDown:
                SDL_ControllerButtonEvent buttonEvent = Unsafe.As <SDL_Event, SDL_ControllerButtonEvent>(ref ev);

                id = buttonEvent.which;

                if (_controllers.ContainsKey(id))
                {
                    var controller = _controllers[id];

                    var button = ToGamepadButton(buttonEvent.button);

                    var pressed = buttonEvent.state == 1;     //SDL_PRESSED and SDL_RELEASED don't appear to exist

                    controller.ProcessButtonEvent(button, pressed);
                }
                break;

            case SDL_EventType.ControllerAxisMotion:
                SDL_ControllerAxisEvent axisEvent = Unsafe.As <SDL_Event, SDL_ControllerAxisEvent>(ref ev);

                id = axisEvent.which;

                if (_controllers.ContainsKey(id))
                {
                    var controller = _controllers[id];

                    var axis = ToGamepadAxis(axisEvent.axis);

                    var value = NormalizeAxis(axisEvent.value);

                    controller.ProcessAxisEvent(axis, value);
                }
                break;
            }
        }
Beispiel #17
0
 internal void MouseButtonUp(SDL_Event e)
 {
     mouseState.ButtonReleased(e.button.button);
     if (!AnyButtonDown())
     {
         lastPressedButton = 0;
     }
     mouseReleased?.Invoke(gameObject, null);
     mouseClicked?.Invoke(gameObject, null);
 }
Beispiel #18
0
        static private InputStruct CheckKeyDown(SDL_Event userEvent)
        {
            InputStruct input = new InputStruct {
                inputEvent = UNDEFINED_INPUT, x = 0, y = 0
            };

            SDL_GetMouseState(out input.x, out input.y);
            switch (userEvent.key.keysym.sym)
            {
            case SDLK_ESCAPE:
                input.inputEvent = PRESS_ESCAPE;
                break;

            case SDLK_DOWN:
                input.inputEvent = PRESS_DOWN;
                break;

            case SDLK_UP:
                input.inputEvent = PRESS_UP;
                break;

            case SDLK_w:
                input.inputEvent = PRESS_W;
                break;

            case SDLK_s:
                input.inputEvent = PRESS_S;
                break;

            case SDLK_a:
                input.inputEvent = PRESS_A;
                break;

            case SDLK_d:
                input.inputEvent = PRESS_D;
                break;

            case SDLK_p:
                input.inputEvent = PRESS_P;
                break;

            case SDLK_o:
                input.inputEvent = PRESS_O;
                break;

            case SDLK_RETURN:
                input.inputEvent = PRESS_ENTER;
                break;

            case SDLK_SPACE:
                input.inputEvent = PRESS_SPACE;
                break;
            }
            return(input);
        }
Beispiel #19
0
        /// <summary>
        /// Begins a new touch input.
        /// </summary>
        private void BeginTouch(ref SDL_Event evt)
        {
            var touchID    = nextTouchID++;
            var touchIndex = touches.Count == 0 ? 0 : touches[touches.Count - 1].TouchIndex + 1;
            var touchInfo  = new TouchInfo(timestamp, touchID, touchIndex, evt.tfinger.fingerId,
                                           evt.tfinger.x, evt.tfinger.y, evt.tfinger.x, evt.tfinger.y, evt.tfinger.pressure, false);

            touches.Add(touchInfo);

            OnTouchDown(touchID, touchInfo.FingerID, touchInfo.CurrentX, touchInfo.CurrentY, touchInfo.Pressure);
        }
Beispiel #20
0
 private static void ProcessGamePadEvent(SDL_Event evt)
 {
     if (evt.type == SDL_EventType.SDL_CONTROLLERDEVICEADDED)
     {
         AddGamePadInstance(evt.cdevice.which);
     }
     else if (evt.type == SDL_EventType.SDL_CONTROLLERDEVICEREMOVED)
     {
         RemoveGamePadInstance(evt.cdevice.which);
     }
 }
Beispiel #21
0
        private static void ProcessMouseEvent(SDL_Event evt)
        {
            if (evt.type == SDL_EventType.SDL_MOUSEBUTTONDOWN)
            {
                Mouse.ProcessClicked(evt.button.button - 1);
            }

            else if (evt.type == SDL_EventType.SDL_MOUSEWHEEL)
            {
                Mouse.ProcessMouseWheel(evt.wheel.y * 120);
            }
        }
        private void ProcessEvent(SDL_Event sDL_Event)
        {
            switch (sDL_Event.type)
            {
            case SDL2.SDL.SDL_EventType.SDL_KEYDOWN:

                break;

            case SDL2.SDL.SDL_EventType.SDL_KEYUP:


                break;
            }
        }
Beispiel #23
0
            private void HandleEvent(SDL_Event sdlEvent)
            {
                switch (sdlEvent.SDL_EventType)
                {
                case SDL_EventType.SDL_WINDOWEVENT:
                    HandleEventWindow(CastToStruct <SDL_WindowEvent>(sdlEvent));
                    break;

                case SDL_EventType.SDL_KEYDOWN:
                case SDL_EventType.SDL_KEYUP:
                    HandleEventKeyboard(CastToStruct <SDL_KeyboardEvent>(sdlEvent));
                    break;
                }
            }
Beispiel #24
0
        private static void ProcessTextInputEvent(SDL_Event evt)
        {
            if (evt.type == SDL_EventType.SDL_TEXTINPUT && !text_input_suppress)
            {
                unsafe
                {
                    int bytes = MeasureStringLength(evt.text.text);
                    if (bytes > 0)
                    {
                        char *chars_buffer = stackalloc char[bytes];
                        int   chars        = Encoding.UTF8.GetChars(
                            evt.text.text,
                            bytes,
                            chars_buffer,
                            bytes
                            );

                        for (int i = 0; i < chars; i += 1)
                        {
                            TextInput.ProcessTextInput(chars_buffer[i]);
                        }
                    }
                }
            }

            else if (evt.type == SDL_EventType.SDL_TEXTEDITING)
            {
                unsafe
                {
                    int bytes = MeasureStringLength(evt.edit.text);
                    if (bytes > 0)
                    {
                        char *charsBuffer = stackalloc char[bytes];
                        int   chars       = Encoding.UTF8.GetChars(
                            evt.edit.text,
                            bytes,
                            charsBuffer,
                            bytes
                            );
                        string text = new string(charsBuffer, 0, chars);
                        TextInput.ProcessTextEditing(text, evt.edit.start, evt.edit.length);
                    }
                    else
                    {
                        TextInput.ProcessTextEditing(null, 0, 0);
                    }
                }
            }
        }
Beispiel #25
0
        bool IInputDriver.WriteEvent(int type, int data)
        {
            SDL_Event ev = default(SDL_Event);

            ev.type       = SDL_EventType.SDL_USEREVENT;
            ev.user.data1 = new IntPtr(type);
            ev.user.data2 = new IntPtr(data);

            if (SDL_PushEvent(ref ev) == 0)
            {
                return(true);
            }

            return(false);
        }
Beispiel #26
0
 private void ProcessAnEvent(ref SDL_Event ev)
 {
     switch (ev.type)
     {
     case SDL_EventType.MouseMotion:
         if (!_hasAnInitialMouseMovementEventRegistered)
         {
             _hasAnInitialMouseMovementEventRegistered = true;
         }
         _gotMouseMotionEventThisUpdate = true;
         SDL_MouseMotionEvent mouseEvent = Unsafe.As <SDL_Event, SDL_MouseMotionEvent>(ref ev);
         _mouseLastPosition = new Vector2(mouseEvent.x, mouseEvent.y);
         _mouseLastVelocity = new Vector2(mouseEvent.xrel, mouseEvent.yrel);
         break;
     }
 }
Beispiel #27
0
        public static void PreLookForGamepads()
        {
            var evt = new SDL_Event[1];

            SDL_PumpEvents();
            while (SDL_PeepEvents(
                       evt,
                       1,
                       SDL_eventaction.SDL_GETEVENT,
                       SDL_EventType.SDL_CONTROLLERDEVICEADDED,
                       SDL_EventType.SDL_CONTROLLERDEVICEADDED
                       ) == 1)
            {
                AddGamePadInstance(evt[0].cdevice.which);
            }
        }
Beispiel #28
0
        private static void ProcessKeyEvent(SDL_Event evt)
        {
            if (evt.type == SDL_EventType.SDL_KEYDOWN)
            {
                Keys key = ConvertKey(ref evt.key.keysym);

                OnKeyDown?.Invoke(key);

                if (!Keyboard.Keys.Contains(key))
                {
                    Keyboard.Keys.Add(key);

                    if (text_input_bindings.TryGetValue(key, out int text_index))
                    {
                        text_input_control_down[text_index]   = true;
                        text_input_control_repeat[text_index] = Environment.TickCount + 400;
                        TextInput.ProcessTextInput(text_input_chars[text_index]);
                    }
                    else if (Keyboard.Keys.Contains(Keys.LeftControl) && key == Keys.V)
                    {
                        text_input_control_down[6]   = true;
                        text_input_control_repeat[6] = Environment.TickCount + 400;
                        TextInput.ProcessTextInput(text_input_chars[6]);
                        text_input_suppress = true;
                    }
                }
            }
            else if (evt.type == SDL_EventType.SDL_KEYUP)
            {
                Keys key = ConvertKey(ref evt.key.keysym);

                OnKeyUp?.Invoke(key);

                if (Keyboard.Keys.Remove(key))
                {
                    if (text_input_bindings.TryGetValue(key, out int value))
                    {
                        text_input_control_down[value] = false;
                    }
                    else if ((!Keyboard.Keys.Contains(Keys.LeftControl) && text_input_control_down[3]) || key == Keys.V)
                    {
                        text_input_control_down[6] = false;
                        text_input_suppress        = false;
                    }
                }
            }
        }
Beispiel #29
0
        private static void WaitForWindowToBeClose()
        {
            var quit        = false;
            var raisedEvent = new SDL_Event();

            while (!quit)
            {
                SDL_WaitEvent(ref raisedEvent);

                switch ((SDL_EventType)raisedEvent.type)
                {
                case SDL_EventType.SDL_QUIT:
                    quit = true;
                    break;
                }
            }
        }
Beispiel #30
0
        public void Spin()
        {
            if (!this.Initialized)
            {
                return;
            }

            SDL_Event e = new SDL_Event();
            uint      frameStart, frameTime;

            while (!Nes.IsStartingShutdown)
            {
                frameStart = SDL_GetTicks();

                while (SDL_PollEvent(out e) > 0)
                {
                    switch (e.type)
                    {
                    case SDL_EventType.SDL_QUIT:
                        Nes.Quit();
                        return;

                    case SDL_EventType.SDL_KEYDOWN:
                        Nes.Debugger.Log(NesDebugger.TAG_GUI, "Got key {0}", e.key);
                        break;
                    }
                }

                if (hasNewFrame)
                {
                    // This isn't working right now
                    // UpdateTexture();
                    hasNewFrame = false;
                }

                Render();

                frameTime = SDL_GetTicks() - frameStart;
                if (frameTime < NesConsts.FRAME_DELAY_MS)
                {
                    // SDL_Delay(NesConsts.FRAME_DELAY_MS - frameTime);
                    System.Threading.Thread.Sleep((int)(NesConsts.FRAME_DELAY_MS - frameTime));
                    Nes.Debugger.ConsoleView.Update();
                }
            }
        }
Beispiel #31
0
 public static extern int SDL_PollEvent(ref SDL_Event event_);
Beispiel #32
0
		public extern static int SDL_PushEvent(out SDL_Event _event);
Beispiel #33
0
 public static extern int SDL_PeepEvents(/* SDL_Event * */SDL_Event[] events, int numevents, SDL_eventaction action, Uint32 mask);
 static extern int SDL_WaitEvent(SDL_Event* evt);
 static extern int SDL_PollEvent(SDL_Event* evt);
Beispiel #36
0
		public static extern int SDL_PushEvent(ref SDL_Event _event);
Beispiel #37
0
		public static extern int SDL_WaitEventTimeout(out SDL_Event _event, int timeout);
Beispiel #38
0
Datei: Sdl.cs Projekt: vhotur/tao
 public static extern int SDL_PollEvent(out SDL_Event sdlEvent);
Beispiel #39
0
Datei: Sdl.cs Projekt: vhotur/tao
 public static extern int SDL_PushEvent(out SDL_Event evt);
Beispiel #40
0
Datei: Sdl.cs Projekt: vhotur/tao
 public static extern int SDL_WaitEvent(out SDL_Event evt);
Beispiel #41
0
 public static extern int SDL_PushEvent(/* SDL_Event * */ref SDL_Event event_);
Beispiel #42
0
		public extern static int SDL_WaitEvent(out SDL_Event _event);
Beispiel #43
0
 public static extern int SDL_WaitEvent(/* SDL_Event * */ref SDL_Event event_);
Beispiel #44
0
		public extern static int SDL_PeepEvents(out SDL_Event[] events,
                                                 int numevents,
                                                 SDL_eventaction action,
                                                 uint mask);