diff --git a/srcs/RT.cpp b/srcs/RT.cpp index f21935c..6bc548c 100644 --- a/srcs/RT.cpp +++ b/srcs/RT.cpp @@ -19,7 +19,7 @@ int main(int argc, char **argv) if (argc <= 1 || !scene.parseScene(argv[1])) return (1); - Window window(&scene, WIDTH, HEIGHT, "RT_GPU", 5); + Window window(&scene, WIDTH, HEIGHT, "RT_GPU", 0); Shader shader("shaders/vertex.vert", "shaders/frag.frag", "shaders/compute.glsl"); GLint max_gpu_size; diff --git a/srcs/class/Window.cpp b/srcs/class/Window.cpp index ea85dde..a1f22aa 100644 --- a/srcs/class/Window.cpp +++ b/srcs/class/Window.cpp @@ -99,7 +99,7 @@ void Window::mouseButtonCallback(GLFWwindow* window, int button, int action, int Window* win = static_cast(glfwGetWindowUserPointer(window)); (void) win; (void) button; (void) mods; - if (action == GLFW_RELEASE) + if (button == GLFW_MOUSE_BUTTON_RIGHT && action == GLFW_RELEASE) { win->_frameCount = 0; } @@ -120,8 +120,6 @@ void Window::keyCallback(GLFWwindow *window, int key, int scancode, int action, << dov.x << " " << dov.y << " " << "\t" << std::endl; } - if (action == GLFW_RELEASE) - win->_frameCount = 0; } void Window::display() @@ -136,6 +134,9 @@ void Window::display() _frameCount++; + if (_scene->getCamera()->getVelocity() > 0.0f) + _frameCount = 0; + glfwSwapBuffers(_window); } void Window::pollEvents()