title: How to rotate camera in openGL using GLFW?
body: <p>I'm creating an OpenGL application in c++ using GLFW. Based on <a href="https://learnopengl.com/code_viewer_gh.php?code=src/1.getting_started/7.3.camera_mouse_zoom/camera_mouse_zoom.cpp" rel="nofollow noreferrer">this</a> tutorial i managed to create FPS like camera(WASD movement + pitch-yaw with mouse movement).</p>
  
  <p>For camera mouse movement i'm using</p>
  
  <pre><code>glfwSetCursorPosCallback(window, mouse_callback);
  </code></pre>
  
  <pre><code>void mouse_callback(GLFWwindow* window, double xpos, double ypos)
  {
      if (firstMouse)
      {
          lastX = xpos;
          lastY = ypos;
          firstMouse = false;
      }
  
      float xoffset = xpos - lastX;
      float yoffset = lastY - ypos; 
      lastX = xpos;
      lastY = ypos;
  
      float sensitivity = 0.1f;
      xoffset *= sensitivity;
      yoffset *= sensitivity;
  
      yaw += xoffset;
      pitch += yoffset;
  
      if (pitch &gt; 89.0f)
          pitch = 89.0f;
      if (pitch &lt; -89.0f)
          pitch = -89.0f;
  
      glm::vec3 front;
      front.x = cos(glm::radians(yaw)) * cos(glm::radians(pitch));
      front.y = sin(glm::radians(pitch));
      front.z = sin(glm::radians(yaw)) * cos(glm::radians(pitch));
      cameraFront = glm::normalize(front);
  }
  </code></pre>
  
  <p>This is working fine, but problem is that my application window is not full screen, so if i want to rotate my mouse cursor gets out of window and then it's hard to control camera. </p>
  
  <p>Is it possible to do the same thing as glfwSetCursorPosCallback, but only if left click is pressed? I want the camera do the same thing as its doing now, but only if i pressed left click.</p>