Permalink
Browse files

Add resolution control to mouse wheel while holding right mouse button.

  • Loading branch information...
jimbo00000 committed Apr 10, 2015
1 parent 21f41fd commit 938174ef505a28293c1bcc338ac20f1480c08391
Showing with 22 additions and 8 deletions.
  1. +5 −3 README.md
  2. +17 −5 src/glfw_main.cpp
@@ -25,7 +25,7 @@ Gamepad and Hydra are supported, but optional. You can get by with only the HMD
#### Keyboard:
- **Space** - Recenter view
- **Enter** - Select shader/return to gallery
- **Enter** - Enter shader/return to gallery
- **Escape** - Quit
- **WASD** - Movement
- **QE13** - Movement(elevation/yaw)
@@ -44,9 +44,11 @@ Gamepad and Hydra are supported, but optional. You can get by with only the HMD
- **Left click & drag** - Yaw
- **Right click & drag** - Movement in horizontal plane
- **Middle click & drag** - Movement in vertical plane
- **Hold Right click & Left Click** - Enter shader/return to gallery
- **Hold Right click & Wheel** - Adjust render target size manually
#### Xbox Controller:
- **Start** - Enter shader
- **Start** - Enter shader/return to gallery
- **Left analog stick** - Movement
- **Right analog stick** - Yaw
- **A** - Move up
@@ -71,7 +73,7 @@ Gamepad and Hydra are supported, but optional. You can get by with only the HMD
- **Right Controller translation/rotation** - Select shader, pointer in pane
- **Right Stick** - Movement(press in for vertical plane)
- **Right Trigger** - Move quickly
- **Right Start Button** - Enter shader
- **Right Start Button** - Enter shader/return to gallery
- **Right Bumper** - Toggle Tweakbar pane
- **Right Button 1** - Click in pane
- **Right Button 2** - Reposition pane
@@ -700,11 +700,23 @@ void mouseWheel(GLFWwindow* pWindow, double x, double y)
const float delta = static_cast<float>(y);
const float incr = 0.05f;
float cscope = g_app.m_cinemaScopeFactor;
cscope += incr * delta;
cscope = std::max(0.0f, cscope);
cscope = std::min(0.95f, cscope);
g_app.m_cinemaScopeFactor = cscope;
if (which_button == GLFW_MOUSE_BUTTON_RIGHT)
{
float fbosc = g_app.GetFBOScale();
fbosc += incr * delta;
fbosc = std::max(.15f, fbosc);
fbosc = std::min(1.f, fbosc);
g_app.SetFBOScale(fbosc);
}
else
{
float cscope = g_app.m_cinemaScopeFactor;
cscope += incr * delta;
cscope = std::max(0.0f, cscope);
cscope = std::min(0.95f, cscope);
g_app.m_cinemaScopeFactor = cscope;
}
}
void resize(GLFWwindow* pWindow, int w, int h)

0 comments on commit 938174e

Please sign in to comment.