[gameinput, directxtk, directxtk12] Update for GameInput v2 (#46370)

This commit is contained in:
Chuck Walbourn 2025-07-10 19:24:34 -07:00 committed by GitHub
parent 96fd599859
commit efcfaaf60d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 35 additions and 174 deletions

View File

@ -1,55 +0,0 @@
diff --git a/Src/Keyboard.cpp b/Src/Keyboard.cpp
index 95d6ce0..e183877 100644
--- a/Src/Keyboard.cpp
+++ b/Src/Keyboard.cpp
@@ -191,15 +191,18 @@ private:
_In_ IGameInputDevice *,
_In_ uint64_t,
_In_ GameInputDeviceStatus currentStatus,
- _In_ GameInputDeviceStatus) noexcept
+ _In_ GameInputDeviceStatus previousStatus) noexcept
{
auto impl = reinterpret_cast<Keyboard::Impl*>(context);
- if (currentStatus & GameInputDeviceConnected)
+ const bool wasConnected = (previousStatus & GameInputDeviceConnected) != 0;
+ const bool isConnected = (currentStatus & GameInputDeviceConnected) != 0;
+
+ if (isConnected && !wasConnected)
{
++impl->mConnected;
}
- else if (impl->mConnected > 0)
+ else if (!isConnected && wasConnected && impl->mConnected > 0)
{
--impl->mConnected;
}
diff --git a/Src/Mouse.cpp b/Src/Mouse.cpp
index c38625f..315a3ce 100644
--- a/Src/Mouse.cpp
+++ b/Src/Mouse.cpp
@@ -320,15 +320,18 @@ private:
_In_ IGameInputDevice *,
_In_ uint64_t,
_In_ GameInputDeviceStatus currentStatus,
- _In_ GameInputDeviceStatus) noexcept
+ _In_ GameInputDeviceStatus previousStatus) noexcept
{
auto impl = reinterpret_cast<Mouse::Impl*>(context);
- if (currentStatus & GameInputDeviceConnected)
+ const bool wasConnected = (previousStatus & GameInputDeviceConnected) != 0;
+ const bool isConnected = (currentStatus & GameInputDeviceConnected) != 0;
+
+ if (isConnected && !wasConnected)
{
++impl->mConnected;
}
- else if (impl->mConnected > 0)
+ else if (!isConnected && wasConnected && impl->mConnected > 0)
{
--impl->mConnected;
}
--
2.49.0.vfs.0.0

View File

@ -1,18 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1eb47e1..e23817e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -196,10 +196,6 @@ if(MINGW)
set(BUILD_XAUDIO_WIN8 OFF)
endif()
-if(${DIRECTX_ARCH} MATCHES "^arm")
- set(BUILD_XAUDIO_REDIST OFF)
-endif()
-
if(WINDOWS_STORE
OR BUILD_XAUDIO_WIN10 OR BUILD_XAUDIO_WIN8
OR BUILD_XAUDIO_REDIST)
--
2.49.0.windows.1

View File

@ -1,4 +1,4 @@
set(DIRECTXTK_TAG mar2025)
set(DIRECTXTK_TAG jul2025)
if(VCPKG_TARGET_IS_MINGW)
message(NOTICE "Building ${PORT} for MinGW requires the HLSL Compiler fxc.exe also be in the PATH. See https://aka.ms/windowssdk.")
@ -8,11 +8,8 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/DirectXTK
REF ${DIRECTXTK_TAG}
SHA512 b19291021a338291cde5cee4f9d001309f1503448895d2ec2199901c5993ca5efd719283bc6bdc3d0ee262ae13907ae55995d7df404200c5b860e9e1643d2b0a
SHA512 b91bed656306e9fdcba5a0de20c32c53f3783a51fe9283c4ee04362941e4e039787ca050c7a7effb35a30a274b4b3235738cb73acdc0e31aba714ad87bc7dbfe
HEAD_REF main
PATCHES
XAudio2Redist-ARM64.patch
GameInput-Connect.patch
)
vcpkg_check_features(
@ -41,7 +38,7 @@ if("tools" IN_LIST FEATURES)
MAKESPRITEFONT_EXE
URLS "https://github.com/Microsoft/DirectXTK/releases/download/${DIRECTXTK_TAG}/MakeSpriteFont.exe"
FILENAME "makespritefont-${DIRECTXTK_TAG}.exe"
SHA512 efc5b2e4aac1d0792d365df220249fd85b55287200e89528233845ee49157f1e09181ade829b8afbd3ced8e425a730f4ac6c3ce15535d8bc19d8d2bb768c8004
SHA512 ff52a77e6d9d86db58044ebf7b4fd4eeeffb210eefeb78b2147050c704c7968e80278e8d3d89bbde2d604ad6fd5b815d37a74cf6bbf6dc7458f7a49b78f3cf20
)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/directxtk/")
@ -56,7 +53,7 @@ if("tools" IN_LIST FEATURES)
XWBTOOL_EXE
URLS "https://github.com/Microsoft/DirectXTK/releases/download/${DIRECTXTK_TAG}/XWBTool.exe"
FILENAME "xwbtool-${DIRECTXTK_TAG}.exe"
SHA512 8e719b2acad1ec1f2f9985626f5a6d606135360394fa4e9c8864e12efb70b1bbc80b4aa0a655b38a379020389a3fe7608ba265bf4c8430b7fa46b54c3b07019b
SHA512 c2213127cef40a2d233f512c5f04a6f8ce62c3112b3b202f901ef18b36549f7974d8b102930a6f9b5023c2ed2423b5e1755914bfe9a00a1aa9080d83f8a05017
)
file(INSTALL "${XWBTOOL_EXE}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/directxtk/")
@ -69,7 +66,7 @@ if("tools" IN_LIST FEATURES)
XWBTOOL_EXE
URLS "https://github.com/Microsoft/DirectXTK/releases/download/${DIRECTXTK_TAG}/XWBTool_arm64.exe"
FILENAME "xwbtool-${DIRECTXTK_TAG}-arm64.exe"
SHA512 1d3ec35eac3034ceca79f8b2200945a698eb2a635cf7e0d8e7369afc5326636fceab777e3352aa1a9ccbdd556a549df2e17228daf44e24aa4dca809cceba7eac
SHA512 8387b1aa0d1dd7e9385d71ba04e5c96e3dcb8a786c17ecb09bd5effc8434c9f6ec3c9b9cee98537729626776092b8f205b91c291acdb4806d16e895c02a10ca3
)
file(INSTALL "${XWBTOOL_EXE}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/directxtk/")

View File

@ -1,7 +1,6 @@
{
"name": "directxtk",
"version-date": "2025-03-20",
"port-version": 2,
"version-date": "2025-07-10",
"description": "A collection of helper classes for writing DirectX 11.x code in C++.",
"homepage": "https://github.com/Microsoft/DirectXTK",
"documentation": "https://github.com/microsoft/DirectXTK/wiki",
@ -40,7 +39,7 @@
"description": "Build with XAudio 2.9 support for Windows 10/11"
},
"xaudio2redist": {
"description": "Build with XAudio2Redist support for Windows 7 SP1 or later",
"description": "Build with XAudio2Redist support for Windows 8.1 or later",
"dependencies": [
"xaudio2redist"
]

View File

@ -1,55 +0,0 @@
diff --git a/Src/Keyboard.cpp b/Src/Keyboard.cpp
index 95d6ce0..e183877 100644
--- a/Src/Keyboard.cpp
+++ b/Src/Keyboard.cpp
@@ -191,15 +191,18 @@ private:
_In_ IGameInputDevice *,
_In_ uint64_t,
_In_ GameInputDeviceStatus currentStatus,
- _In_ GameInputDeviceStatus) noexcept
+ _In_ GameInputDeviceStatus previousStatus) noexcept
{
auto impl = reinterpret_cast<Keyboard::Impl*>(context);
- if (currentStatus & GameInputDeviceConnected)
+ const bool wasConnected = (previousStatus & GameInputDeviceConnected) != 0;
+ const bool isConnected = (currentStatus & GameInputDeviceConnected) != 0;
+
+ if (isConnected && !wasConnected)
{
++impl->mConnected;
}
- else if (impl->mConnected > 0)
+ else if (!isConnected && wasConnected && impl->mConnected > 0)
{
--impl->mConnected;
}
diff --git a/Src/Mouse.cpp b/Src/Mouse.cpp
index c38625f..315a3ce 100644
--- a/Src/Mouse.cpp
+++ b/Src/Mouse.cpp
@@ -320,15 +320,18 @@ private:
_In_ IGameInputDevice *,
_In_ uint64_t,
_In_ GameInputDeviceStatus currentStatus,
- _In_ GameInputDeviceStatus) noexcept
+ _In_ GameInputDeviceStatus previousStatus) noexcept
{
auto impl = reinterpret_cast<Mouse::Impl*>(context);
- if (currentStatus & GameInputDeviceConnected)
+ const bool wasConnected = (previousStatus & GameInputDeviceConnected) != 0;
+ const bool isConnected = (currentStatus & GameInputDeviceConnected) != 0;
+
+ if (isConnected && !wasConnected)
{
++impl->mConnected;
}
- else if (impl->mConnected > 0)
+ else if (!isConnected && wasConnected && impl->mConnected > 0)
{
--impl->mConnected;
}
--
2.49.0.vfs.0.0

View File

@ -1,18 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e5cead7..d49f8c2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -213,10 +213,6 @@ if(MINGW)
set(BUILD_XAUDIO_WIN10 OFF)
endif()
-if(${DIRECTX_ARCH} MATCHES "^arm")
- set(BUILD_XAUDIO_REDIST OFF)
-endif()
-
if(WINDOWS_STORE
OR BUILD_XAUDIO_WIN10 OR BUILD_XAUDIO_WIN8
OR BUILD_XAUDIO_REDIST)
--
2.49.0.windows.1

View File

@ -1,14 +1,11 @@
set(DIRECTXTK_TAG mar2025)
set(DIRECTXTK_TAG jul2025)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/DirectXTK12
REF ${DIRECTXTK_TAG}
SHA512 d6071bd9493f69357dd5a0c2020a9e78154619dc443e6bdd2e1498ceff0650655c67798968a15377a8904d00e06220ae86fe94d01f7f8afb202bee3d4361a163
SHA512 cedd2215ecdd4a721fd84b0d7a5decdb893a27391338fd31e4de2b767b3ff96610941e52697f4210360f6a3ba45ea290ee8d827e05eb5de957e6564c3922b6b9
HEAD_REF main
PATCHES
XAudio2Redist-ARM64.patch
GameInput-Connect.patch
)
vcpkg_check_features(
@ -42,7 +39,7 @@ if("tools" IN_LIST FEATURES)
MAKESPRITEFONT_EXE
URLS "https://github.com/Microsoft/DirectXTK12/releases/download/${DIRECTXTK_TAG}/MakeSpriteFont.exe"
FILENAME "makespritefont-${DIRECTXTK_TAG}.exe"
SHA512 efc5b2e4aac1d0792d365df220249fd85b55287200e89528233845ee49157f1e09181ade829b8afbd3ced8e425a730f4ac6c3ce15535d8bc19d8d2bb768c8004
SHA512 ff52a77e6d9d86db58044ebf7b4fd4eeeffb210eefeb78b2147050c704c7968e80278e8d3d89bbde2d604ad6fd5b815d37a74cf6bbf6dc7458f7a49b78f3cf20
)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/directxtk12/")
@ -57,7 +54,7 @@ if("tools" IN_LIST FEATURES)
XWBTOOL_EXE
URLS "https://github.com/Microsoft/DirectXTK12/releases/download/${DIRECTXTK_TAG}/XWBTool.exe"
FILENAME "xwbtool-${DIRECTXTK_TAG}.exe"
SHA512 8e719b2acad1ec1f2f9985626f5a6d606135360394fa4e9c8864e12efb70b1bbc80b4aa0a655b38a379020389a3fe7608ba265bf4c8430b7fa46b54c3b07019b
SHA512 c2213127cef40a2d233f512c5f04a6f8ce62c3112b3b202f901ef18b36549f7974d8b102930a6f9b5023c2ed2423b5e1755914bfe9a00a1aa9080d83f8a05017
)
file(INSTALL "${XWBTOOL_EXE}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/directxtk12/")
@ -70,7 +67,7 @@ if("tools" IN_LIST FEATURES)
XWBTOOL_EXE
URLS "https://github.com/Microsoft/DirectXTK12/releases/download/${DIRECTXTK_TAG}/XWBTool_arm64.exe"
FILENAME "xwbtool-${DIRECTXTK_TAG}-arm64.exe"
SHA512 1d3ec35eac3034ceca79f8b2200945a698eb2a635cf7e0d8e7369afc5326636fceab777e3352aa1a9ccbdd556a549df2e17228daf44e24aa4dca809cceba7eac
SHA512 8387b1aa0d1dd7e9385d71ba04e5c96e3dcb8a786c17ecb09bd5effc8434c9f6ec3c9b9cee98537729626776092b8f205b91c291acdb4806d16e895c02a10ca3
)
file(INSTALL "${XWBTOOL_EXE}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/directxtk12/")

View File

@ -1,7 +1,6 @@
{
"name": "directxtk12",
"version-date": "2025-03-20",
"port-version": 2,
"version-date": "2025-07-10",
"description": "A collection of helper classes for writing DirectX 12 code in C++.",
"homepage": "https://github.com/Microsoft/DirectXTK12",
"documentation": "https://github.com/microsoft/DirectXTK12/wiki",

View File

@ -43,7 +43,7 @@ else()
vcpkg_download_distfile(ARCHIVE
URLS "https://www.nuget.org/api/v2/package/Microsoft.GameInput/${VERSION}"
FILENAME "gameinput.${VERSION}.zip"
SHA512 0ef143d59c3bda2396d86554ac6eb336bb08822e6d6ee3ecb930c00c2222467e1e8c1257b7a999e21340be9a8bb71e53eaa12a7b9f786ca6419418f0c0e271aa
SHA512 80baba86f3f89aca72b4d4fdaf0091f3b24a3a671476a0973dce23ba5b8e11d625c9647b1aceed8b2eb6ecb95ff4fb7c1845e38683cf2e757bdea7210f946955
)
vcpkg_extract_source_archive(

View File

@ -1,6 +1,6 @@
{
"name": "gameinput",
"version": "1.2.26100.4782",
"version": "2.0.26100.5312",
"description": "GameInput",
"homepage": "https://aka.ms/gameinput",
"license": null,

View File

@ -2405,12 +2405,12 @@
"port-version": 0
},
"directxtk": {
"baseline": "2025-03-20",
"port-version": 2
"baseline": "2025-07-10",
"port-version": 0
},
"directxtk12": {
"baseline": "2025-03-20",
"port-version": 2
"baseline": "2025-07-10",
"port-version": 0
},
"dirent": {
"baseline": "1.25",
@ -3109,7 +3109,7 @@
"port-version": 0
},
"gameinput": {
"baseline": "1.2.26100.4782",
"baseline": "2.0.26100.5312",
"port-version": 0
},
"gamenetworkingsockets": {

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f6f3c7e59b0a374238c65805c3f2ce12d9e7d052",
"version-date": "2025-07-10",
"port-version": 0
},
{
"git-tree": "9433dd837f01431fc89ea4da0ca260660fe19a3f",
"version-date": "2025-03-20",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "5b13bd42679ac39dddc6e6bbda274f35d1aca531",
"version-date": "2025-07-10",
"port-version": 0
},
{
"git-tree": "34d7461ae678651989254f2c7aaf1e93ad1ac7a5",
"version-date": "2025-03-20",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "79e96edfb7080c333ea382f2b813d2ccf4469bc8",
"version": "2.0.26100.5312",
"port-version": 0
},
{
"git-tree": "c84f9f50fb3afc88061a42570737436b2781d4ed",
"version": "1.2.26100.4782",