dwmkerr / sharpgl

Use OpenGL in .NET applications. SharpGL wraps all modern OpenGL features and offers a powerful scene graph to aid development.
MIT License
770 stars 300 forks source link

How to properly handle Mouse movement and other Inputs? #203

Closed burdoto closed 3 years ago

burdoto commented 3 years ago

I'm left here wondering on how to properly obtain Input properties, such as Mouse position and key states.

I've tried using the MouseMove handler from both the Window and the OpenGLControl itself, but the resulting handler is only called about once every second, which is inapplicable for any kind of game I would try to make. Since the System.Windows.Input.Mouse class only works from WPFs own Thread, I can also not simply pull the mouse position from that one. I'm out of ideas right now, so how do you do it?