Exemple #1
0
        public GlfwMouseState()
        {
            var buttonsLength = (int)(MouseButton.Last + 1);

            _mb = MemoryBlockPool.Get(sizeof(KeyEvent) * buttonsLength * 2);

            _buttons         = _mb.AllocPinnedMemory <KeyEvent>(buttonsLength);
            _previousButtons = _mb.AllocPinnedMemory <KeyEvent>(buttonsLength);
        }
Exemple #2
0
        internal GlfwKeyboardState()
        {
            var keyEventsLength = ((int)Key.LastKey + 1);
            var size            = sizeof(KeyEvent) * keyEventsLength * 2;

            _mb = MemoryBlockPool.Get(size);

            _keyEvents         = _mb.AllocPinnedMemory <KeyEvent>(keyEventsLength);
            _previousKeyEvents = _mb.AllocPinnedMemory <KeyEvent>(keyEventsLength);
        }