Hi!
I would like to know the equivalent functions or way to do the following using GLUT instead of windows
Any ideas? Thanks!
code starts here:
POINT mousePos;
int mid_x = mWindowWidth >> 1;
int mid_y = mWindowHeight >> 1;
float angle_y = 0.0f;
float angle_z = 0.0f;
GetCursorPos(&mousePos); // Get the mouse cursor 2D x,y position
if( (mousePos.x == mid_x) && (mousePos.y == mid_y) ) return;
SetCursorPos(mid_x, mid_y); // Set the mouse cursor in the middle of the window
// Get the direction from the mouse, and bring the number down to a reasonable amount
angle_y = (float)( (mid_x - mousePos.x) ) / 1000;
angle_z = (float)( (mid_y - mousePos.y) ) / 1000;
endcode…