Jump to content
  • Advertisement
Sign in to follow this  
Don_Wuh

Folowing mouse

This topic is 4814 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

im using dev cpp and im trying to do it in open gl plz help i dont know how to get the coordinates for the mouse i have a box and i want the box to follow the mouse cursor is there a simple line of code that i can use that will do it? or can some one point me in the direction of a page that will tell me how to do it ty for any help you can give me

Share this post


Link to post
Share on other sites
Advertisement
either A learn win32 programming and learn how to capture mouse clicks OR B use a library called GLUT(google it) it's a very simple way to set up and interface with window program, and on top of that it's cross platfrom. you simply supply glut with two funcitons one for following the mouse motion and one for handling click events. you call the functions

glutMotionFunc(mouseMotion);
glutMouseFunc(mouseButton);

with function pointers to your mouse motion and mouse button functions. ready the glut guide for more detail.

Tim

Share this post


Link to post
Share on other sites
Since you are using OpenGL, take a look at NeHe tutorials, among other things he has a tutorial that contains some explanations (source code included) on how to capture mouse input with Win32 API.
If you use GLUT then ZeusCMD tutorials will help you:
http://www.zeuscmd.com/tutorials/glut/03-MouseInput.php

Have a nice day

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!