Skip to content
Snippets Groups Projects
Commit df8a0038 authored by Alexander Gauggel's avatar Alexander Gauggel
Browse files

[#106] Hack/Fixed event synchronization issue, which caused subtle mouse...

[#106] Hack/Fixed event synchronization issue, which caused subtle mouse stutter, which was visible due to motion blur. Added comment with info, should be fixed properly later. Have fun Tobi =)
parent 90d7d405
No related branches found
No related tags found
1 merge request!89Resolve "Indirect Dispatch"
Pipeline #26708 failed
......@@ -103,7 +103,7 @@ void App::run() {
float objectVerticalSpeed = 0.005;
float motionBlurMinVelocity = 0.001;
int cameraShutterSpeedInverse = 48;
int cameraShutterSpeedInverse = 30;
glm::mat4 mvpPrevious = glm::mat4(1.f);
glm::mat4 viewProjectionPrevious = m_cameraManager.getActiveCamera().getMVP();
......
......@@ -80,12 +80,17 @@ namespace vkcv {
window->e_key.unlock();
window->e_char.unlock();
window->e_gamepad.unlock();
}
}
glfwPollEvents();
// fixes subtle mouse stutter, which is made visible by motion blur
// FIXME: proper solution
// probably caused by main thread locking events before glfw callbacks are executed
std::this_thread::sleep_for(std::chrono::milliseconds(1));
glfwPollEvents();
for (int gamepadIndex = GLFW_JOYSTICK_1; gamepadIndex <= GLFW_JOYSTICK_LAST; gamepadIndex++) {
if (glfwJoystickPresent(gamepadIndex)) {
for (int gamepadIndex = GLFW_JOYSTICK_1; gamepadIndex <= GLFW_JOYSTICK_LAST; gamepadIndex++) {
if (glfwJoystickPresent(gamepadIndex)) {
onGamepadEvent(gamepadIndex);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment