---------------------------------------------------------------------------------- |-- Module : Sound.OpenAL.ALC.Extensions-- Copyright : (c) Sven Panne 2003-2009-- License : BSD-style (see the file LICENSE)-- -- Maintainer : sven.panne@aedion.de-- Stability : stable-- Portability : portable---- This module corresponds to the extension handling parts of section 6.3-- (ALC Queries) of the OpenAL Specification and Reference (version 1.1).----------------------------------------------------------------------------------moduleSound.OpenAL.ALC.Extensions(alcExtensions,alcIsExtensionPresent,alcProcAddress,alcEnumValue,alcVersion)whereimportControl.Monad(liftM2)importData.StateVarimportForeign.Ptr(Ptr,FunPtr)importSound.OpenAL.ALC.BasicTypes(ALCchar,ALCenum,ALCint)importSound.OpenAL.ALC.Device(Device)importSound.OpenAL.ALC.QueryUtils(StringQuery(..),getString,IntQuery(..),getInteger,alcIsExtensionPresent)importSound.OpenAL.ALC.String(withALCString)importSound.OpenAL.Config(ALCdevice(..),nullDevice,marshalDevice)---------------------------------------------------------------------------------- | Contains a list of available context extensions.alcExtensions::Device->GettableStateVar[String]alcExtensionsdevice=makeGettableStateVar$fmapwords$getString(Justdevice)Extensions---------------------------------------------------------------------------------- | The application is expected to verify the applicability of an extension or-- core function entry point before requesting it by name, by use of-- 'alcIsExtensionPresent'. Extension entry points can be retrieved using-- 'alcProcAddress'. Entry points can be device specific, but are not context-- specific. Using 'Nothing' as the device does not guarantee that the entry-- point is returned, even if available for one of the available devices.alcProcAddress::MaybeDevice->String->GettableStateVar(FunPtra)alcProcAddressmaybeDevicefuncName=makeGettableStateVar.withALCStringfuncName.alcGetProcAddress.marshalDevice.maybenullDeviceid$maybeDeviceforeignimportCALLCONVunsafe"alcGetProcAddress"alcGetProcAddress::ALCdevice->PtrALCchar->IO(FunPtra)---------------------------------------------------------------------------------- | Enumeration\/token values are device independent, but tokens defined for-- extensions might not be present for a given device. Using 'Nothing' as the-- device is legal, but only the tokens defined by the AL core are-- guaranteed. Availability of extension tokens depends on the ALC extension.alcEnumValue::MaybeDevice->String->GettableStateVarALCenumalcEnumValuemaybeDeviceenumName=makeGettableStateVar.withALCStringenumName.alcGetEnumValue.marshalDevice.maybenullDeviceid$maybeDeviceforeignimportCALLCONVunsafe"alcGetEnumValue"alcGetEnumValue::ALCdevice->PtrALCchar->IOALCenum---------------------------------------------------------------------------------- | Contains the \"/major/./minor/\" specification revision for this implementation.alcVersion::GettableStateVarStringalcVersion=makeGettableStateVar$liftM2makeVersionString(getIntegerNothingMajorVersion)(getIntegerNothingMinorVersion)makeVersionString::ALCint->ALCint->StringmakeVersionStringmajorminor=showmajor++"."++showminor