aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-10-16 05:22:22 -0700
committerChris Robinson <[email protected]>2017-10-16 05:47:12 -0700
commit2f5b86dd381ac36d09951e05777ccb97237fa06e (patch)
treeed5fb888f66648df67adbbccde63de4135579743 /OpenAL32
parent5ec11a017c0799115e19895264917e8348a4c878 (diff)
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.
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/alState.c10
1 files changed, 10 insertions, 0 deletions
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); \