Jay
Yes that works mmozeiko. Thanks. Simple solution. The only issue is that I am going to have to update this if I ever change the buffer size right?
More generally, you want to scale the mouse position like this:
| // buffer_dim is the size of the buffer you rasterize into.
// draw_dim is the size of the viewport you blit into.
vec2 ratio = buffer_dim / draw_dim;
mouse_position *= ratio;
|
(Note: the mul/div here are component-wise.)
Update draw_dim when you go from windowed to fullscreen (the MONITORINFO struct will give you the dimensions of the screen).
This assumes you're doing all the math in floating point, by the way.