Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 public GlfwMouse(GlfwInputContext inputContext)
 {
     ScrollWheels = new GlfwWheelCollection(this);
 }
Ejemplo n.º 3
0
 public static void UnregisterContext(GlfwInputContext ctx)
 {
     Contexts.Remove(ctx);
     ctx._window.Update -= ctx.WindowUpdate;
 }
Ejemplo n.º 4
0
 public GlfwKeyboard(GlfwInputContext gic)
 {
     _gic = gic;
 }