diff --git a/miniaudio.h b/miniaudio.h index 9bed5dee..df7681da 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -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));