• Advertisement
Sign in to follow this  

DInput and SetCursorPos behaving weird

This topic is 4011 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

I have this kind of code in my game loop: DirectInput.Update Setcursorpos(screencenter) Setcursorpos is requried, because the cursor could get to the top-right corner of the screen and if you shoot, you exit. Not good. This looks like a good solution, but on some computers, the mouse doesnt seem to work. Sometimes it stops, laggs a bit, starts moving again and funny stuff like that. Could you tell me, what is the problem with my code? Can I mess around with setcursorpos? Or how can i make a window to cover the whole screen without any problems (like the title bar)?

Share this post


Link to post
Share on other sites
Advertisement
hey guy i do like this, but not sure it help or not


cx_screen = GetSystemMetrics(SM_CXSCREEN);
cy_screen = GetSystemMetrics(SM_CYSCREEN);

SetCursorPos(cx_screen/2, cy_screen/2);

Share this post


Link to post
Share on other sites
Yes, me too, but the problem is that the mouse occassionally stops working, if I use setcursorpos. It works smoothly without it, but I said why isnt that good.

Share this post


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

  • Advertisement