Exemple #1
0
        protected virtual void onKeyDown(Key key, int scanCode, Modifier modifiers)
        {
            switch (key)
            {
            case Key.F4:
                if (modifiers == Modifier.Alt)
                {
                    Glfw3.SetWindowShouldClose(currentWindow.hWin, 1);
                }
                break;

            case Key.Escape:
                Glfw3.SetWindowShouldClose(currentWindow.hWin, 1);
                break;

            case Key.Up:
                camera.Move(0, 0, 1);
                break;

            case Key.Down:
                camera.Move(0, 0, -1);
                break;

            case Key.Left:
                camera.Move(1, 0, 0);
                break;

            case Key.Right:
                camera.Move(-1, 0, 0);
                break;

            case Key.PageUp:
                camera.Move(0, 1, 0);
                break;

            case Key.PageDown:
                camera.Move(0, -1, 0);
                break;

            case Key.F3:
                if (camera.Type == Camera.CamType.FirstPerson)
                {
                    camera.Type = Camera.CamType.LookAt;
                }
                else
                {
                    camera.Type = Camera.CamType.FirstPerson;
                }
                break;
            }
            updateViewRequested = true;
        }
Exemple #2
0
 /// <summary>
 /// Ask GLFW to close the native window.
 /// </summary>
 public void Close()
 {
     Glfw3.SetWindowShouldClose(hWin, 1);
 }