Soren Johnson
Soren Johnson

Reputation: 2611

How do I get the cursor location in OpenGL?

Is there a simple way to get the x,y cursor location at any point with OpenGL without using glutPassiveMotionFunc() to track it? Thanks...

Upvotes: 0

Views: 1373

Answers (1)

tibur
tibur

Reputation: 11636

No. OpenGL is not meant to give you such information. If you are using Windows, you can use GetCursorPos.

But I would suggest you to track it since it makes it cross platform. You will also need to use glutMotionFunc to track mouse position when a mouse button is pushed.

Upvotes: 2

Related Questions