diff --git a/doc/changelog.dox b/doc/changelog.dox index 533035fc4..075bc5c92 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -176,6 +176,8 @@ See also: @ref MAGNUM_ASSERT_GL_VERSION_SUPPORTED(), @ref MAGNUM_ASSERT_GL_EXTENSION_SUPPORTED() and @ref MAGNUM_VERIFY_NO_GL_ERROR() instead +- The `Platform::Context` class is deprecated, use @ref Platform::GLContext + instead - The @ref PixelFormat and @ref CompressedPixelFormat enum now contains generic API-independent values. The GL-specific formats are present there, but marked as deprecated. Use either the generic values or diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index 7b3ab1038..b65b520e8 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -31,6 +31,10 @@ set(MagnumPlatform_HEADERS ScreenedApplication.h ScreenedApplication.hpp) +if(BUILD_DEPRECATED AND TARGET_GL) + list(APPEND MagnumPlatform_HEADERS Context.h) +endif() + # Files to display in project view of IDEs only (filled in below) set(MagnumPlatform_FILES ) diff --git a/src/Magnum/Platform/Context.h b/src/Magnum/Platform/Context.h new file mode 100644 index 000000000..463588b60 --- /dev/null +++ b/src/Magnum/Platform/Context.h @@ -0,0 +1,41 @@ +#ifndef Magnum_Platform_Context_h +#define Magnum_Platform_Context_h +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +/** @file + * @deprecated Use @ref Magnum/Platform/GLContext.h instead. + */ + +#include "Magnum/configure.h" + +#ifdef MAGNUM_BUILD_DEPRECATED +#include "Magnum/Platform/GLContext.h" +CORRADE_DEPRECATED_FILE("use Magnum/Platform/GLContext.h instead") +#else +#error use Magnum/Platform/GLContext.h instead +#endif + +#endif diff --git a/src/Magnum/Platform/GLContext.h b/src/Magnum/Platform/GLContext.h index 764620388..af37c23ee 100644 --- a/src/Magnum/Platform/GLContext.h +++ b/src/Magnum/Platform/GLContext.h @@ -138,6 +138,13 @@ class GLContext: public GL::Context { bool tryCreate() { return GL::Context::tryCreate(); } }; +#ifdef MAGNUM_BUILD_DEPRECATED +/** @brief @copybrief GL::Extension + * @deprecated Use @ref GL::Extension instead. + */ +typedef CORRADE_DEPRECATED("use Platform::GLContext instead") GLContext Context; +#endif + }} #else #error this header is available only in the OpenGL build diff --git a/src/Magnum/Platform/Platform.h b/src/Magnum/Platform/Platform.h index 4aa7705e0..4446af705 100644 --- a/src/Magnum/Platform/Platform.h +++ b/src/Magnum/Platform/Platform.h @@ -29,6 +29,12 @@ * @brief Forward declarations for the @ref Magnum::Platform namespace */ +#include "Magnum/configure.h" + +#if defined(MAGNUM_BUILD_DEPRECATED) && defined(MAGNUM_TARGET_GL) +#include +#endif + namespace Magnum { namespace Platform { #ifndef DOXYGEN_GENERATING_OUTPUT @@ -37,6 +43,10 @@ template class BasicScreenedApplication; #ifdef MAGNUM_TARGET_GL class GLContext; + +#if defined(MAGNUM_BUILD_DEPRECATED) && defined(MAGNUM_TARGET_GL) +typedef CORRADE_DEPRECATED("use Platform::GLContext instead") GLContext Context; +#endif #endif #endif