But have you actually printed out your mouse-coordinates in your targeting code, or examined them in a debugger? Before guessing that the problem lies with them, let’s check; if it does, then we proceed; if not, we look elsewhere rather than attempting to fix something that’s working as expected.
Nevertheless, your re-centring task could well be the source of the problem: if the re-centring code is executed before the code that handles your targeting, then you might indeed see little to no effect as a result of the mouse-cursor having been moved to the centre of the screen, and thus being either zero or near to zero. Why it might still respond somewhat when moving the mouse to the left I’m not sure, however.
But hold on–how was your targeting supposed to work in the first place, then? If you’re forcing the mouse cursor to the centre of the screen, then how can you move it to some point on the screen in order to direct the object that we’ve been discussing? o_0
Does the re-centring only happen under certain conditions?
On another point, you mention that you’ve set your mouse cursor to “relative mode”; do you mean that you’ve, at some point, done something along the lines of the following?
wp.setMouseMode(WindowProperties.MRelative)
(The above code is in Python; I imagine that the C++ version is similar, but with appropriate use of arrows and underscores, and fewer capital letters.)
If so, then I’m not sure that it’s a good idea: for one thing, I believe that “relative mode” doesn’t work under Windows, and for another, I’m really not sure of what would result from doing both that and manual re-centring…
All that said, am I correct in guessing that your FPS code works? If so, I see that you store the mouse -x and -y coordinates (in the variables “mouseX_” and “mouseY_”, respectively) before you recentre your mouse cursor; why not just make those available to your targeting code and use them instead of fetching the mouse-position again as you seem to currently be doing?