Well only you have the source code in context, I can't tell when which function is called.
I think using a static here doesn't really do what you want.
If it's a class member, then that makes it the same for all instances of said class.
If it's a local function static, it just means it's only available in this translation unit.
Here's some pseudo code on how you could approach it:
loop as long as the window is open
process events (e.g. Closed event)
set the current and converted mouse position
take the delta from the previous mouse position
set the previous mouse position equal to the current mouse position
clear window
draw your things
display things to the window