View Full Version : Mouse and PassiveMotionFunc
04-18-2005, 03:18 PM
I'm making a little video games in openGL using GLUT.
it's a kind of FPS.
my probleme is :
I use a passiveMotionFunc to move the sight like in ordinary games. But when the cursor is a the extrimity of the screen I can't move any more.
SO is there a solution to initilize the position of mouse, in order to be able to move as I wish.
Thank you .
PS : sorry for my english, I'm french.....
but I hope you will understand my problem.
Generally, for glut, this forum is best:
toolkits forum (http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=forum;f=10)
I don't think there are any solution to this common (?) problem. Depending on the OS you use you have several ways to perform what you want, mainly by redefining the cursor position.
Unfortunately, I don't know for the Win32 api. But you can use SDL.
oups... sorry, but I just read that in the linux forum, there's the glutWarpPointer() function that will warp the pointer to the wanted position.
Can't say more.
04-18-2005, 03:49 PM
Yes, thank you,
I seen it before, but I can't use it, i dont know why, but it make the moving of the really difficult ;)
Whatever, thank you for it
04-18-2005, 04:04 PM
Oh great Thank you I succeed, using what you said .
A big thank tou to you.
if it's interrest you, the code is :
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
if ( x < 10
No problems, you're welcome.
But the code you gave is somewhat cut, isn't it ? Anyway, I don't need it as I've made the warp directly over X11, and I don't use glut anymore, since a long time already.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.