public static unsafe void RegisterContext(GlfwInputContext ctx) { if (Contexts.Any(x => x._window == ctx._window)) { return; } Contexts.Add(ctx); // register callbacks var handle = (WindowHandle *)ctx._window.Handle; Util.Do(() => Util.Glfw.SetKeyCallback(handle, KeyCallback)); Util.Do(() => Util.Glfw.SetMouseButtonCallback(handle, MouseCallback)); Util.Do(() => Util.Glfw.SetScrollCallback(handle, ScrollCallback)); ctx._window.Update += ctx.WindowUpdate; }
public GlfwMouse(GlfwInputContext inputContext) { ScrollWheels = new GlfwWheelCollection(this); }
public static void UnregisterContext(GlfwInputContext ctx) { Contexts.Remove(ctx); ctx._window.Update -= ctx.WindowUpdate; }
public GlfwKeyboard(GlfwInputContext gic) { _gic = gic; }