SendInput for a 3D view?

Hello, this topic is about SendInput and C++. I am new to programming, and help is very appreciated.

When I use SendInput to make the mouse move, it normally does it correctly. However, when I use it on a 3D view with a cross-hair in the middle of the screen (something like doom or call of duty), it turns my player around completely or looks at a seemingly random spot.

To make things simple, let's say I want to move my cross-hair to look at 10 pixels offset from the top and right of the screen.

Here is how I used SendInput:
1
2
3
4
5
6
7
8
9
10
11
12
*x=10;
*y=10;
INPUT input = {};
input.type = INPUT_MOUSE;
input.mi.mouseData=0;
printf("(%i,%i) ",(*x), (*y));
input.mi.dx = (*x);
input.mi.dy = (*y);
input.mi.dwFlags = MOUSEEVENTF_MOVE; //ABSOLUTE seems to just make it unpredicatable
input.mi.time = 0;
input.mi.dwExtraInfo = 0;
SendInput(1,&input,sizeof(input));


I understand that a 3D camera is different than a 2D surface, but I thought the code would translate. Any advice?
Topic archived. No new replies allowed.