From 3a16fed279b69dbb74ca26f11279cbf258643ff2 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 28 Jun 2017 23:18:39 -0700 Subject: Handle the ALC version for some extension capabilities Also fix some improper parenthesis. --- router/router.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'router/router.c') diff --git a/router/router.c b/router/router.c index a8a5ebbf..0625c1fe 100644 --- a/router/router.c +++ b/router/router.c @@ -18,7 +18,7 @@ static int DriverListSizeMax = 0; static void LoadDriverList(void); -BOOL APIENTRY DllMain(HINSTANCE module, DWORD reason, void *reserved) +BOOL APIENTRY DllMain(HINSTANCE UNUSED(module), DWORD reason, void* UNUSED(reserved)) { int i; @@ -187,8 +187,16 @@ static void AddModule(HMODULE module, const WCHAR *name) LOAD_PROC(alDistanceModel); if(!err) { + ALCint alc_ver[2]; wcsncpy(DriverList[DriverListSize].Name, name, 32); - DriverList[DriverListSize++].Module = module; + DriverList[DriverListSize].Module = module; + DriverList[DriverListSize].alcGetIntegerv(NULL, ALC_MAJOR_VERSION, 1, &alc_ver[0]); + DriverList[DriverListSize].alcGetIntegerv(NULL, ALC_MINOR_VERSION, 1, &alc_ver[1]); + if(DriverList[DriverListSize].alcGetError(NULL) == ALC_NO_ERROR) + DriverList[DriverListSize].ALCVer = MAKE_ALC_VER(alc_ver[0], alc_ver[1]); + else + DriverList[DriverListSize].ALCVer = MAKE_ALC_VER(1, 0); + DriverListSize++; } } -- cgit v1.2.3