# glfwGetMousePos

**URL:** https://discourse.glfw.org/t/glfwgetmousepos/281
**Category:** support
**Created:** [April 21, 2011, 9:53am UTC](https://discourse.glfw.org/t/glfwgetmousepos/281 "2011-04-21T09:53:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)
#### Post date: [April 21, 2011, 9:53am UTC](https://discourse.glfw.org/t/glfwgetmousepos/281/1 "2011-04-21T09:53:59Z")

</div>

**[cengkarim](https://sourceforge.net/u/cengkarim/)** wrote on [Thursday, April 21, 2011](https://sourceforge.net/p/glfw/discussion/247562/thread/7e0f65b2/#c6ac):

I found something strange, may be I’m doing something wrong. When my OpenGL  
application starts running, I query the mouse coordinates, they just 0, 0.  
After the first move of the mouse, the coordinates just jumps to  
windowWidth/2, windowHeight/2 (I guess). I this normal? The problem is I use  
the mouse to rotate the camera, and as expected, the camera just flips around  
on the first move of the mouse and I have to realign it again. Here is my  
initialization code:

```
void initializeApplication ( void )
 {
      ...
      glfwPollEvents ();
      glfwGetMousePos ( & mousePreviousX, & mousePreviousY );
      cout << mousePreviousX << "," << mousePreviousY << endl;
      ...
}
void draw ( void )
{
      ...
      glfwGetMousePos ( & mouseCurrentX, & mouseCurrentY );
      cout << mouseCurrentX << "," << mouseCurrentY << endl;
      ...
      glfwSwapBuffers ();
}

```

Here is the output:

```
...
0,0
0,0
0,0
0,0
0,0
0,0
322,115
326,121
329,123
330,123
...

```

Any clues?  
Thanks
