Skip to content

Commit 2f5b86d

Browse files
committed
Add an "un-exposed" method to get the library version
This reports the same ALSOFT version as alGetString(AL_VERSION), but doesn't require a current context (which requires a ALCdevice) to call. Do *NOT* use this version to determine feature support, use the standard interfaces. If you think you need to use this, you probably don't, and shouldn't.
1 parent 5ec11a0 commit 2f5b86d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎OpenAL32/alState.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ static const ALchar alSinc4Resampler[] = "3rd order Sinc";
5454
static const ALchar alBSinc12Resampler[] = "11th order Sinc";
5555
static const ALchar alBSinc24Resampler[] = "23rd order Sinc";
5656

57+
/* WARNING: Non-standard export! Not part of any extension, or exposed in the
58+
* alcFunctions list.
59+
*/
60+
AL_API const ALchar* AL_APIENTRY alsoft_get_version(void)
61+
{
62+
const char *spoof = getenv("ALSOFT_SPOOF_VERSION");
63+
if(spoof && spoof[0] != '\0') return spoof;
64+
return ALSOFT_VERSION;
65+
}
66+
5767
#define DO_UPDATEPROPS() do { \
5868
if(!ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire)) \
5969
UpdateContextProps(context); \

0 commit comments

Comments
 (0)