O'Reilly logo
  • LI WEI thinks this is interesting:

A static variable (global with local scope) is used to remember the lastMouse position between the calls for the MouseMoved() function.

From

Cover of Learning C++ by Creating Games with UE4

Note

使用静态变量来全局记录上一次鼠标所在的位置。静态为全局,但只在局部被调用