- Home /
Question by
LittleCoyote · Sep 04, 2018 at 03:56 PM ·
inputsystemdllimport
DllImport safety
I've decided to grab mouse position from os ionstead of using Unity Input, to avoid mouse lag. What I'm using is:
[DllImport("user32.dll")]
public static extern bool GetCursorPos(out POINT lpPoint);
I'm aware, it will make my code platform - dependent, it's not a problem. But I wonder, is it safe to use? Is there any possibility this approach will be bad for stability or performance of my game?
Comment
Are you experiencing mouse delay? Do you have any metrics about this delay?
You're inviting a variety of issues doing this (not the least of which is the additional math required to convert that value to something sensible within your application).
Your answer