Context class
OpenAL context.
Contents
Public types
- class Configuration
- OpenAL context configuration.
- enum class HrtfStatus: ALenum { Disabled = ALC_HRTF_DISABLED_SOFT, Enabled = ALC_HRTF_ENABLED_SOFT, Denied = ALC_HRTF_DENIED_SOFT, Required = ALC_HRTF_REQUIRED_SOFT, Detected = ALC_HRTF_HEADPHONES_DETECTED_SOFT, UnsupportedFormat = ALC_HRTF_UNSUPPORTED_FORMAT_SOFT }
- HRTF status.
Public static functions
- 
              static auto deviceSpecifierStrings() -> std::vector<std:: string> 
- All device specifier strings.
- static auto hasCurrent() -> bool
- Whether there is any current context.
- static auto current() -> Context&
- Current context.
Constructors, destructors, conversion operators
- Context(const Configuration& configuration = Configuration()) explicit
- Constructor.
- ~Context()
- Destructor.
Public functions
- auto isHrtfEnabled() const -> bool
- Whether HRTFs (Head Related Transfer Functions) are enabled.
- auto hrtfStatus() const -> HrtfStatus
- HRTF status.
- 
              auto hrtfSpecifierString() const -> std::string 
- HRTF specifier.
- 
              auto hrtfSpecifier() const -> std::string deprecated 
- HRTF specifier.
- 
              auto deviceSpecifierString() const -> std::string 
- Device specifier string.
- 
              auto vendorString() const -> std::string 
- Vendor string.
- 
              auto rendererString() const -> std::string 
- Renderer string.
- 
              auto versionString() const -> std::string 
- Version string.
- 
              auto extensionStrings() const -> std::vector<std:: string> 
- Extension strings.
- 
              auto supportedExtensions() const -> const std::vector<Extension>& 
- Supported extensions.
- 
              template<class T>auto isExtensionSupported() const -> bool
- Whether given extension is supported.
- auto isExtensionSupported(const Extension& extension) const -> bool
- Whether given extension is supported.
Enum documentation
              enum class Magnum::
            HRTF status.
| Enumerators | |
|---|---|
| Disabled | HRTF is disabled | 
| Enabled | HRTF is enabled | 
| Denied | HRTF is disabled because it is not allowed on the device. This may be caused by invalid resource permissions, or an other user configuration that disallows HRTF. | 
| Required | HRTF is enabled because it must be used on the device. This may be caused by a device that can only use HRTF, or other user configuration that forces HRTF to be used. | 
| Detected | HRTF is enabled automatically because the device reported headphones. | 
| UnsupportedFormat | The device does not support HRTF with the current format. Typically this is caused by non-stereo output or an incompatible output frequency. | 
Function documentation
              static std::
            All device specifier strings.
              static bool Magnum::
            Whether there is any current context.
               Magnum::
            Constructor.
Creates OpenAL context with given configuration.
              bool Magnum::
            Whether HRTFs (Head Related Transfer Functions) are enabled.
HRFTs may not be enabled/disabled in a running context. Instead create a new Context with HRFTs enabled or disabled.
              HrtfStatus Magnum::
            HRTF status.
              std::
            HRTF specifier.
Name of the HRTF being used.
              std::
            HRTF specifier.
              std::
            Device specifier string.
              std::
            Vendor string.
              std::
            Renderer string.
              std::
            Version string.
              std::
            Extension strings.
The result is not cached, repeated queries will result in repeated OpenAL calls. Note that this function returns list of all extensions reported by the driver (even those not supported by Magnum), see supportedExtensions(), Extension::
              const std::
            Supported extensions.
The list contains only extensions from OpenAL versions newer than the current.
              
                template<class T>
              
              bool Magnum::
            Whether given extension is supported.
Extensions usable with this function are listed in Extensions namespace in header Extensions.h. Example usage:
if(Context::current().isExtensionSupported<Extensions::ALC::SOFTX::HRTF>()) { // amazing binaural audio } else { // probably left/right stereo only }
              bool Magnum::
            Whether given extension is supported.
Can be used e.g. for listing extensions available on current hardware, but for general usage prefer isExtensionSupported() const, as it does most operations in compile time.
              Debug& operator<<(Debug& debug,
              Context::
            Debug output operator.