From a7fc952036668d6e6bdf7737cc13e92b4002259c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 12 Sep 2023 22:32:34 -0700 Subject: Add a alcGetProcAddress2 function This is essentially just a copy of alcGetProcAddress. It's purpose is to bypass Creative's router's alcGetProcAddress implementation, which returns its own functions even if given a device handle. When combined with it also wrapping the drivers' device and context handles, that prevents any extention function that needs a recognizable device or context handle from working, like the *Direct functions, as there's no way for the app to get a device or context handle the driver can know about). An alternate function to get function pointers allows a driver to return its own implementation for standard and extension functions, which an application can use to "bootstrap" audio to use a particular driver directly, enabling use of extensions that the router gets in the way of (and also avoid the overhead of the router, however small that may be). --- alc/inprogext.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'alc/inprogext.h') diff --git a/alc/inprogext.h b/alc/inprogext.h index fe2a1437..2fa425bb 100644 --- a/alc/inprogext.h +++ b/alc/inprogext.h @@ -65,6 +65,8 @@ AL_API void AL_APIENTRY alAuxiliaryEffectSlotStopvSOFT(ALsizei n, const ALuint * #ifndef AL_EXT_direct_context #define AL_EXT_direct_context +typedef ALCvoid* (ALC_APIENTRY *LPALCGETPROCADDRESS2)(ALCdevice *device, const ALCchar *funcname) AL_API_NOEXCEPT17; + typedef void (AL_APIENTRY *LPALENABLEDIRECT)(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT17; typedef void (AL_APIENTRY *LPALDISABLEDIRECT)(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT17; typedef ALboolean (AL_APIENTRY *LPALISENABLEDDIRECT)(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT17; @@ -224,6 +226,8 @@ typedef ALenum (AL_APIENTRY *LPEAXGETDIRECT)(ALCcontext *context, const struct _ typedef ALboolean (AL_APIENTRY *LPEAXSETBUFFERMODEDIRECT)(ALCcontext *context, ALsizei n, const ALuint *buffers, ALint value) AL_API_NOEXCEPT17; typedef ALenum (AL_APIENTRY *LPEAXGETBUFFERMODEDIRECT)(ALCcontext *context, ALuint buffer, ALint *pReserved) AL_API_NOEXCEPT17; #ifdef AL_ALEXT_PROTOTYPES +ALCvoid* AL_APIENTRY alcGetProcAddress2(ALCdevice *device, const ALchar *funcName) AL_API_NOEXCEPT; + void AL_APIENTRY alEnableDirect(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT; void AL_APIENTRY alDisableDirect(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT; ALboolean AL_APIENTRY alIsEnabledDirect(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT; -- cgit v1.2.3