Browse Source

Audio: deprecate Context::supportedExtensions().

Same as deddda418e did for the matching
function in GL::Context.
next
Vladimír Vondruš 2 months ago
parent
commit
2e4af30b38
  1. 13
      doc/changelog.dox
  2. 8
      src/Magnum/Audio/Context.cpp
  3. 11
      src/Magnum/Audio/Context.h

13
doc/changelog.dox

@ -1449,11 +1449,14 @@ See also:
particular, if `BUILD_DEPRECATED` is set but `MAGNUM_BUILD_DEPRECATED` not,
the unprefixed options are also recognized. See also
[mosra/corrade#139](https://github.com/mosra/corrade/issues/139).
- @cpp GL::Context::supportedExtensions() @ce is deprecated as it doesn't
provide anything that @ref GL::Context::extensionStrings(),
@ref GL::Extension::extensions() and @ref GL::Context::isExtensionSupported()
wouldn't provide already and only causes extra overhead during context
creation
- @cpp GL::Context::supportedExtensions() @ce /
@cpp Audio::Context::supportedExtensions() @ce is deprecated as it doesn't
provide anything that @ref GL::Context::extensionStrings() /
@ref Audio::Context::extensionStrings(), @ref GL::Extension::extensions() /
@ref Audio::Extension::extensions() and
@ref GL::Context::isExtensionSupported() /
@ref Audio::Context::isExtensionSupported() wouldn't provide already and
only causes extra overhead during context creation
- @ref GL::DebugOutput::setCallback() taking a @ref std::string in the
callback function pointer is deprecated in favor of a version taking a
@relativeref{Corrade,Containers::StringView}. See also

8
src/Magnum/Audio/Context.cpp

@ -290,7 +290,9 @@ bool Context::tryCreate(const Configuration& configuration) {
const Containers::Array<Containers::StringView> extensions = extensionStrings();
for(const Containers::StringView extension: extensions) {
if(const Extension* found = findExtension(extension)) {
#ifdef MAGNUM_BUILD_DEPRECATED
arrayAppend(_supportedExtensions, *found);
#endif
_extensionStatus.set(found->index(), true);
}
}
@ -317,7 +319,11 @@ bool Context::tryCreate(const Configuration& configuration) {
return true;
}
Context::Context(Context&& other) noexcept: _device{other._device}, _context{other._context}, _extensionStatus{Utility::move(other._extensionStatus)}, _supportedExtensions{Utility::move(other._supportedExtensions)} {
Context::Context(Context&& other) noexcept: _device{other._device}, _context{other._context}, _extensionStatus{Utility::move(other._extensionStatus)}
#ifdef MAGNUM_BUILD_DEPRECATED
, _supportedExtensions{Utility::move(other._supportedExtensions)}
#endif
{
other._device = nullptr;
other._context = nullptr;
if(currentContext == &other)

11
src/Magnum/Audio/Context.h

@ -418,16 +418,21 @@ class MAGNUM_AUDIO_EXPORT Context {
*/
Containers::Array<Containers::StringView> extensionStrings() const;
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief Supported extensions
*
* The list contains only extensions from OpenAL versions newer than
* the current.
* @see @ref isExtensionSupported(), @ref Extension::extensions()
* @m_deprecated_since_latest Deprecated as it doesn't provide anything
* that @ref extensionStrings(), @ref Extension::extensions() and
* @ref isExtensionSupported() wouldn't provide already and only
* causes extra overhead during context creation.
*/
Containers::ArrayView<const Extension> supportedExtensions() const {
CORRADE_DEPRECATED("use extensionStrings(), Extension::extensions() and isExtensionSupported() instead") Containers::ArrayView<const Extension> supportedExtensions() const {
return _supportedExtensions;
}
#endif
/**
* @brief Whether given extension is supported
@ -488,7 +493,9 @@ class MAGNUM_AUDIO_EXPORT Context {
Math::BitVector<Implementation::ExtensionCount> _extensionStatus;
Math::BitVector<Implementation::ExtensionCount> _extensionDisabledStatus;
#ifdef MAGNUM_BUILD_DEPRECATED
Containers::Array<Extension> _supportedExtensions;
#endif
Containers::Array<Extension> _disabledExtensions;
};

Loading…
Cancel
Save