I have multiple input devices and I want to create a cursor for each one. I'm given x and y coordinates, and I want to draw it on the screen.
How do I calculate the x,y when using glTranslatef?
I have multiple input devices and I want to create a cursor for each one. I'm given x and y coordinates, and I want to draw it on the screen.
How do I calculate the x,y when using glTranslatef?
I'm pretty sure, unless im suffering from a major mind failure, it goes as follows:
float fX = ((float)(x * 2) / (float)screenWidth) - 1.0f)
float fY = ((float)(-y * 2) / (float)screenHeight) - 1.0f)