コード例 #1
0
        void MouseButtonChange(glfw3.Window window, glfw3.MouseButton button, glfw3.InputState state, glfw3.KeyMods mods)
        {
            var mousePosition     = GetMousePosition(window);
            var mousePositionNorm = Vector2.Create(mousePosition.X / Resolution.X, mousePosition.Y / Resolution.Y);

            MouseButtonChanged?.Invoke(this, new glfw3.MouseButtonEventArgs(mousePosition, mousePositionNorm, button, state, mods));
        }
コード例 #2
0
 void WindowChange(glfw3.Window window, int width, int height) => PrepareFramebuffer();
コード例 #3
0
 Vector2 GetMousePosition(glfw3.Window window)
 {
     glfw3.GetCursorPos(window, out var x, out var y);
     return(Vector2.Create((float)x, (float)y));
 }
コード例 #4
0
 void WindowClose(glfw3.Window window) => Closed?.Invoke(this, new EventArgs());