Mouse location parameters of Opentk 3.0 GameWindow.Mouse

There is GameWindow Opentk 2.0 Mouse properties, can be accessed through Mouse Mouse location attribute. To 3.0, the property is gone.

The study, GameWindow.Mouse.Position with MouseMove event GameWindow in Position exactly the same. But this can only be used in derived classes GameWindow's not easy.

If you want to achieve similar functionality with 2.0, you can get the mouse by the Mouse class absolute position is then converted by GameWindow.PointToClient function. So basically you can achieve similar functionality with 2.0. But still slightly different.

GameWindows.Mouse.Position value range does not exceed the window size, the minimum value is 0 and a maximum width and height of the window.

If by truncating, you can basically close with 2.0, but still in some places can not be exactly the same.

Window under windows mode with a title bar. If you move the mouse to the title bar, GameWindow.Mouse.Position no longer respond to the argument value is moved to the border.

The latter, even if the title bar to move the range, the position of the mouse will still change, simply can not fully simulate unless a very inefficient method. This difference might be tolerable. Because most of the game is full screen.

Guess you like

Origin www.cnblogs.com/mooniscrazy/p/11235501.html