From 2f5b86dd381ac36d09951e05777ccb97237fa06e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 16 Oct 2017 05:22:22 -0700 Subject: 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. --- OpenAL32/alState.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'OpenAL32') diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c index a5565f87..623e1d6b 100644 --- a/OpenAL32/alState.c +++ b/OpenAL32/alState.c @@ -54,6 +54,16 @@ static const ALchar alSinc4Resampler[] = "3rd order Sinc"; static const ALchar alBSinc12Resampler[] = "11th order Sinc"; static const ALchar alBSinc24Resampler[] = "23rd order Sinc"; +/* WARNING: Non-standard export! Not part of any extension, or exposed in the + * alcFunctions list. + */ +AL_API const ALchar* AL_APIENTRY alsoft_get_version(void) +{ + const char *spoof = getenv("ALSOFT_SPOOF_VERSION"); + if(spoof && spoof[0] != '\0') return spoof; + return ALSOFT_VERSION; +} + #define DO_UPDATEPROPS() do { \ if(!ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire)) \ UpdateContextProps(context); \ -- cgit v1.2.3