Browse Source

Split the OpenGL layer out, pt 15: compatibility for Platform::Context.

pull/233/head
Vladimír Vondruš 8 years ago
parent
commit
9e58eaca61
  1. 2
      doc/changelog.dox
  2. 4
      src/Magnum/Platform/CMakeLists.txt
  3. 41
      src/Magnum/Platform/Context.h
  4. 7
      src/Magnum/Platform/GLContext.h
  5. 10
      src/Magnum/Platform/Platform.h

2
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

4
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 )

41
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š <mosra@centrum.cz>
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

7
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

10
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 <Corrade/Utility/Macros.h>
#endif
namespace Magnum { namespace Platform {
#ifndef DOXYGEN_GENERATING_OUTPUT
@ -37,6 +43,10 @@ template<class> 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

Loading…
Cancel
Save