From 179f457cfc53f934d53983415ef029dd7e8b9303 Mon Sep 17 00:00:00 2001 From: DMP9 Date: Sun, 14 Jul 2019 20:13:36 +0100 Subject: [PATCH 01/46] Start of the GLFW Input implementation From ec588a7f249b224aa411e756de7d0b2410a79d9f Mon Sep 17 00:00:00 2001 From: DMP9 Date: Mon, 15 Jul 2019 21:50:59 +0100 Subject: [PATCH 02/46] A start I guess, it's messy and all over the place --- Silk.NET.sln | 30 +++++ documentation/proposals/Proposal - Input.md | 28 ++-- .../InputWindowExtensions.cs | 28 ---- .../Interfaces/IGamepad.cs | 6 +- .../Interfaces/IInputContext.cs | 24 +++- .../Interfaces/IJoystick.cs | 124 +++++++++--------- .../Interfaces/IKeyboard.cs | 2 +- .../Interfaces/IMouse.cs | 4 +- .../Collections/GlfwAxisCollection.cs | 90 +++++++++++++ .../Collections/GlfwGamepadCollection.cs | 84 ++++++++++++ .../Collections/GlfwJoystickCollection.cs | 98 ++++++++++++++ .../Collections/GlfwKeyboardCollection.cs | 70 ++++++++++ .../Collections/GlfwMouseCollection.cs | 70 ++++++++++ .../GlfwInputContext.cs | 61 +++++++++ .../GlfwInputPlatform.cs | 21 +++ .../Implementations/GlfwGamepad.cs | 32 +++++ .../Implementations/GlfwJoystick.cs | 41 ++++++ .../Implementations/GlfwKeyboard.cs | 40 ++++++ .../Implementations/GlfwMouse.cs | 29 ++++ .../Silk.NET.Input.Desktop/InputHandler.cs | 31 +++++ .../Silk.NET.Input.Desktop.csproj | 21 +++ src/Input/Silk.NET.Input.Desktop/Util.cs | 82 ++++++++++++ .../Silk.NET.Input/InputWindowExtensions.cs | 38 ++++++ .../Silk.NET.Input/Silk.NET.Input.csproj | 12 ++ src/Windowing/Silk.NET.GLFW/Glfw.cs | 2 +- .../Silk.NET.GLFW/Interfaces/IGlfw.cs | 2 +- 26 files changed, 952 insertions(+), 118 deletions(-) delete mode 100644 src/Input/Silk.NET.Input.Common/InputWindowExtensions.cs create mode 100644 src/Input/Silk.NET.Input.Desktop/Collections/GlfwAxisCollection.cs create mode 100644 src/Input/Silk.NET.Input.Desktop/Collections/GlfwGamepadCollection.cs create mode 100644 src/Input/Silk.NET.Input.Desktop/Collections/GlfwJoystickCollection.cs create mode 100644 src/Input/Silk.NET.Input.Desktop/Collections/GlfwKeyboardCollection.cs create mode 100644 src/Input/Silk.NET.Input.Desktop/Collections/GlfwMouseCollection.cs create mode 100644 src/Input/Silk.NET.Input.Desktop/GlfwInputContext.cs create mode 100644 src/Input/Silk.NET.Input.Desktop/GlfwInputPlatform.cs create mode 100644 src/Input/Silk.NET.Input.Desktop/Implementations/GlfwGamepad.cs create mode 100644 src/Input/Silk.NET.Input.Desktop/Implementations/GlfwJoystick.cs create mode 100644 src/Input/Silk.NET.Input.Desktop/Implementations/GlfwKeyboard.cs create mode 100644 src/Input/Silk.NET.Input.Desktop/Implementations/GlfwMouse.cs create mode 100644 src/Input/Silk.NET.Input.Desktop/InputHandler.cs create mode 100644 src/Input/Silk.NET.Input.Desktop/Silk.NET.Input.Desktop.csproj create mode 100644 src/Input/Silk.NET.Input.Desktop/Util.cs create mode 100644 src/Input/Silk.NET.Input/InputWindowExtensions.cs create mode 100644 src/Input/Silk.NET.Input/Silk.NET.Input.csproj diff --git a/Silk.NET.sln b/Silk.NET.sln index bb44d31f6d..9f5d188048 100644 --- a/Silk.NET.sln +++ b/Silk.NET.sln @@ -165,6 +165,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.OpenGLES.Extension EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{0651C5EF-50AA-4598-8D9C-8F210ADD8490}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Input.Desktop", "src\Input\Silk.NET.Input.Desktop\Silk.NET.Input.Desktop.csproj", "{3908DEF6-7403-49F5-B8EC-5B3B12C325D4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Input", "src\Input\Silk.NET.Input\Silk.NET.Input.csproj", "{020A8E88-B607-4281-BA0D-5ED03484A201}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1030,6 +1034,30 @@ Global {8D534FE1-6113-457A-97DD-FD42782580A5}.Release|x64.Build.0 = Release|Any CPU {8D534FE1-6113-457A-97DD-FD42782580A5}.Release|x86.ActiveCfg = Release|Any CPU {8D534FE1-6113-457A-97DD-FD42782580A5}.Release|x86.Build.0 = Release|Any CPU + {3908DEF6-7403-49F5-B8EC-5B3B12C325D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3908DEF6-7403-49F5-B8EC-5B3B12C325D4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3908DEF6-7403-49F5-B8EC-5B3B12C325D4}.Debug|x64.ActiveCfg = Debug|Any CPU + {3908DEF6-7403-49F5-B8EC-5B3B12C325D4}.Debug|x64.Build.0 = Debug|Any CPU + {3908DEF6-7403-49F5-B8EC-5B3B12C325D4}.Debug|x86.ActiveCfg = Debug|Any CPU + {3908DEF6-7403-49F5-B8EC-5B3B12C325D4}.Debug|x86.Build.0 = Debug|Any CPU + {3908DEF6-7403-49F5-B8EC-5B3B12C325D4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3908DEF6-7403-49F5-B8EC-5B3B12C325D4}.Release|Any CPU.Build.0 = Release|Any CPU + {3908DEF6-7403-49F5-B8EC-5B3B12C325D4}.Release|x64.ActiveCfg = Release|Any CPU + {3908DEF6-7403-49F5-B8EC-5B3B12C325D4}.Release|x64.Build.0 = Release|Any CPU + {3908DEF6-7403-49F5-B8EC-5B3B12C325D4}.Release|x86.ActiveCfg = Release|Any CPU + {3908DEF6-7403-49F5-B8EC-5B3B12C325D4}.Release|x86.Build.0 = Release|Any CPU + {020A8E88-B607-4281-BA0D-5ED03484A201}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {020A8E88-B607-4281-BA0D-5ED03484A201}.Debug|Any CPU.Build.0 = Debug|Any CPU + {020A8E88-B607-4281-BA0D-5ED03484A201}.Debug|x64.ActiveCfg = Debug|Any CPU + {020A8E88-B607-4281-BA0D-5ED03484A201}.Debug|x64.Build.0 = Debug|Any CPU + {020A8E88-B607-4281-BA0D-5ED03484A201}.Debug|x86.ActiveCfg = Debug|Any CPU + {020A8E88-B607-4281-BA0D-5ED03484A201}.Debug|x86.Build.0 = Debug|Any CPU + {020A8E88-B607-4281-BA0D-5ED03484A201}.Release|Any CPU.ActiveCfg = Release|Any CPU + {020A8E88-B607-4281-BA0D-5ED03484A201}.Release|Any CPU.Build.0 = Release|Any CPU + {020A8E88-B607-4281-BA0D-5ED03484A201}.Release|x64.ActiveCfg = Release|Any CPU + {020A8E88-B607-4281-BA0D-5ED03484A201}.Release|x64.Build.0 = Release|Any CPU + {020A8E88-B607-4281-BA0D-5ED03484A201}.Release|x86.ActiveCfg = Release|Any CPU + {020A8E88-B607-4281-BA0D-5ED03484A201}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {BFE429EB-4C2E-4BF3-A302-C9C5A2FDA6D7} = {23324041-2076-477C-A4BF-B385B8066C6C} @@ -1104,5 +1132,7 @@ Global {8D534FE1-6113-457A-97DD-FD42782580A5} = {CF69D5C3-4ACE-4458-BA5A-0E9A3B294CDC} {FD24E9FF-1097-4777-A418-F2D88C558665} = {0651C5EF-50AA-4598-8D9C-8F210ADD8490} {136C6154-D300-4B82-80D3-17B637841A2B} = {0651C5EF-50AA-4598-8D9C-8F210ADD8490} + {3908DEF6-7403-49F5-B8EC-5B3B12C325D4} = {FA9D1C95-5585-4DEC-B226-1447A486C376} + {020A8E88-B607-4281-BA0D-5ED03484A201} = {FA9D1C95-5585-4DEC-B226-1447A486C376} EndGlobalSection EndGlobal diff --git a/documentation/proposals/Proposal - Input.md b/documentation/proposals/Proposal - Input.md index 5cdb00bbe5..93cc39a948 100644 --- a/documentation/proposals/Proposal - Input.md +++ b/documentation/proposals/Proposal - Input.md @@ -27,9 +27,9 @@ Proposal API for Input via keyboards, mice, and controllers. ```cs public interface IJoystick : IInputDevice { - IReadOnlyCollection Axes { get; } - IReadOnlyCollection