Add ma_device_get_user_data().

This commit is contained in:
David Reid
2026-01-05 09:41:20 +10:00
parent 0d94eb7da9
commit 116a06fac7
+14
View File
@@ -8802,6 +8802,11 @@ Retrieves a pointer to the context that owns the given device.
*/
MA_API ma_context* ma_device_get_context(ma_device* pDevice);
/*
Retrieves the user data pointer of the given device.
*/
MA_API void* ma_device_get_user_data(ma_device* pDevice);
/*
Helper function for retrieving the log object associated with the context that owns this device.
*/
@@ -45453,6 +45458,15 @@ MA_API ma_context* ma_device_get_context(ma_device* pDevice)
return pDevice->pContext;
}
MA_API void* ma_device_get_user_data(ma_device* pDevice)
{
if (pDevice == NULL) {
return NULL;
}
return pDevice->pUserData;
}
MA_API ma_log* ma_device_get_log(ma_device* pDevice)
{
return ma_context_get_log(ma_device_get_context(pDevice));