API CHANGE: Remove the pContext parameter from device enum callback.

This is part of some future work to decouple `ma_context` and
`ma_device` from backends. If you need access to the context for some
reason, you can pass it in via the user data.
This commit is contained in:
David Reid
2025-07-04 16:24:22 +10:00
parent 017eae73ac
commit 636fe28d86
2 changed files with 50 additions and 45 deletions
+12 -3
View File
@@ -165,7 +165,7 @@ static ma_result ma_context_enumerate_devices__sdl(void* pUserData, ma_context*
deviceInfo.isDefault = MA_TRUE;
}
cbResult = callback(pContext, ma_device_type_playback, &deviceInfo, pCallbackUserData);
cbResult = callback(ma_device_type_playback, &deviceInfo, pCallbackUserData);
if (cbResult == MA_FALSE) {
isTerminated = MA_TRUE;
break;
@@ -187,7 +187,7 @@ static ma_result ma_context_enumerate_devices__sdl(void* pUserData, ma_context*
deviceInfo.isDefault = MA_TRUE;
}
cbResult = callback(pContext, ma_device_type_capture, &deviceInfo, pCallbackUserData);
cbResult = callback(ma_device_type_capture, &deviceInfo, pCallbackUserData);
if (cbResult == MA_FALSE) {
isTerminated = MA_TRUE;
break;
@@ -616,7 +616,16 @@ static ma_device_backend_vtable ma_gDeviceBackendVTable_SDL =
NULL, /* onDeviceWrite */
NULL, /* onDeviceDataLoop */
NULL, /* onDeviceDataLoopWakeup */
NULL /* onDeviceGetInfo */
NULL, /* onDeviceGetInfo */
/* Temp. */
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};
const ma_device_backend_vtable* MA_DEVICE_BACKEND_VTABLE_SDL = &ma_gDeviceBackendVTable_SDL;