Silk.NET icon indicating copy to clipboard operation
Silk.NET copied to clipboard

glfw Garbage mouse position

Open StefanPoelloth opened this issue 1 year ago • 4 comments

Summary

The "Tutorial 2.2 - Camera" Example produces very large mouse position values. After a view seconds the mouse position is {<129309770. 134478720>} and rising. Calculating the mouse offset (from the previous move event) gives different values depending on the mouse position on the screen, -738, -378 if the mouse is at the top left and 64768, 65120 at bottom right.

Using the glfw 3.4 release seems to result in the OFFSET being equal to the position of the cursor relative to the center of the window. But that means the IMouse.Position property does accumulate the offset resulting in large positive or negative numbers.

Steps to reproduce

  • Platform: Desktop Windows 10 22H2
  1. Connect to another windows machine with Remote Desktop
  2. Run the Camera Example on the remote machine
  3. Try to move the camera using the mouse
  4. Put a breakpoint in the OnMouseMove function and inspect the mouse position

Comments

I have tested it with the main branch using the sample but the same problem occurs in my project using the silk.net 2.20.0 nuget.

This might be related; https://github.com/glfw/glfw/issues/1276

StefanPoelloth avatar Mar 04 '24 11:03 StefanPoelloth

Thanks for the link, looks like we need a native lib update.

Perksey avatar Mar 20 '24 19:03 Perksey

This should be fixed with #1993.

alexrp avatar Apr 08 '24 17:04 alexrp

I would like to test and confirm this but i wasn't able to compile silk using the instructions. Are there any nightly builds available?

StefanPoelloth avatar Apr 09 '24 07:04 StefanPoelloth

#1993 has been merged, so it would be good if we could test if this was fixed.

I would like to test and confirm this but i wasn't able to compile silk using the instructions.

Can you elaborate? Silk should be buildable on Windows, Linux, and macOS now, especially after #2017.

alexrp avatar Apr 13 '24 11:04 alexrp

Seems to be fixed with Silk.Net 2.21.0

StefanPoelloth avatar Jul 10 '24 16:07 StefanPoelloth

Ah great news! It appears we forgot to close this issue. Glad this is working now.

Perksey avatar Jul 10 '24 16:07 Perksey