diff --git a/doc/building.dox b/doc/building.dox index dbbfde068..832e86d69 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -487,8 +487,8 @@ your platform best: - `WITH_GLFWAPPLICATION` --- Build the @ref Platform::GlfwApplication "GlfwApplication" library. Depends on [GLFW](http://glfw.org). -- `WITH_GLUTAPPLICATION` --- Build the - @ref Platform::GlutApplication "GlutApplication" library. Depends on +- `WITH_GLUTAPPLICATION` @m_class{m-label m-danger} **deprecated** --- Build + the @ref Platform::GlutApplication "GlutApplication" library. Depends on [GLUT](http://freeglut.sourceforge.net/). Enables also building of the GL library. - `WITH_GLXAPPLICATION` --- Build the diff --git a/doc/changelog.dox b/doc/changelog.dox index 74ab2ecf6..47fe5f62c 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -265,6 +265,10 @@ See also: @subsection changelog-latest-deprecated Deprecated APIs +- @ref Platform::GlutApplication is based on an outdated toolkit and thus + scheduled for removal in a future release. Please consider switching to + @ref Platform::Sdl2Application or @ref Platform::GlfwApplication as soon as + possible. - `Math::Geometry`, `Math::Geometry::Distance` and `Math::Geometry::Intersection` namespaces are deprecated for being too deeply nested, use @ref Math::Distance and @ref Math::Intersection instead diff --git a/doc/cmake.dox b/doc/cmake.dox index a0fae38c3..aae8efd9b 100644 --- a/doc/cmake.dox +++ b/doc/cmake.dox @@ -111,7 +111,8 @@ the components. The optional components are: Platform namespace is split into more components: - `GlfwApplication` --- @ref Platform::GlfwApplication "GlfwApplication" -- `GlutApplication` --- @ref Platform::GlutApplication "GlutApplication" +- `GlutApplication` @m_class{m-label m-danger} **deprecated** --- + @ref Platform::GlutApplication "GlutApplication" - `GlxApplication` --- @ref Platform::GlxApplication "GlxApplication" - `Sdl2Application` --- @ref Platform::Sdl2Application "Sdl2Application" - `XEglApplication` --- @ref Platform::XEglApplication "XEglApplication" diff --git a/package/ci/travis.yml b/package/ci/travis.yml index 5f48fb127..3a39b5e09 100644 --- a/package/ci/travis.yml +++ b/package/ci/travis.yml @@ -185,9 +185,9 @@ cache: install: - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ ! "$TARGET" == "desktop-sanitizers" ] && [ ! "$TARGET" == "android" ] && [ ! "$TARGET" == "desktop-vulkan" ]; then export CXX=g++-4.7; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "desktop-sanitizers" ]; then export CXX=clang++-3.8; fi -- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "desktop" ]; then export WITH_GLUTAPPLICATION=ON; fi -- if [ "$WITH_GLUTAPPLICATION" != "ON" ] && [ ! "$TARGET" == "desktop-vulkan" ]; then export WITH_GLUTAPPLICATION=OFF; fi - if [ "$BUILD_DEPRECATED" != "OFF" ]; then export BUILD_DEPRECATED=ON; fi +- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "desktop" ] && [ "$BUILD_DEPRECATED" == "ON" ]; then export WITH_GLUTAPPLICATION=ON; fi +- if [ "$WITH_GLUTAPPLICATION" != "ON" ]; then export WITH_GLUTAPPLICATION=OFF; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ ! "$TARGET" == "desktop-vulkan" ]; then export PLATFORM_GL_API=GLX; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "android" ]; then wget -nc https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip && unzip -q android-*.zip; fi # Download CMake 2.8.12 to ensure we're still compatible with it (Travis has diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index 79a0a8e44..4e0dae6cd 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -154,6 +154,10 @@ endif() # GLUT application if(WITH_GLUTAPPLICATION) + if(NOT MAGNUM_BUILD_DEPRECATED) + message(FATAL_ERROR "GlutApplication is scheduled for removal and not available if BUILD_DEPRECATED is disabled. Please consider switching to Sdl2Application or GlfwApplication instead.") + endif() + find_package(GLUT) if(NOT GLUT_FOUND) message(FATAL_ERROR "GLUT library, required by GlutApplication, was not found. Set WITH_GLUTAPPLICATION to OFF to skip building it.") diff --git a/src/Magnum/Platform/GlutApplication.cpp b/src/Magnum/Platform/GlutApplication.cpp index 09fc18c35..abc3304ba 100644 --- a/src/Magnum/Platform/GlutApplication.cpp +++ b/src/Magnum/Platform/GlutApplication.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_GLUTAPPLICATION + #include "GlutApplication.h" #include @@ -33,7 +35,9 @@ namespace Magnum { namespace Platform { +CORRADE_IGNORE_DEPRECATED_PUSH GlutApplication* GlutApplication::_instance = nullptr; +CORRADE_IGNORE_DEPRECATED_POP GlutApplication::GlutApplication(const Arguments& arguments): GlutApplication{arguments, Configuration{}, GLConfiguration{}} {} @@ -181,7 +185,9 @@ GlutApplication::Configuration::Configuration(): {} GlutApplication::Configuration::~Configuration() = default; +CORRADE_IGNORE_DEPRECATED_PUSH template class BasicScreen; template class BasicScreenedApplication; +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Platform/GlutApplication.h b/src/Magnum/Platform/GlutApplication.h index 71b7b9188..6441a6c10 100644 --- a/src/Magnum/Platform/GlutApplication.h +++ b/src/Magnum/Platform/GlutApplication.h @@ -43,11 +43,24 @@ #include +#ifndef MAGNUM_BUILD_DEPRECATED +#error Scheduled for removal. Consider switching to Sdl2Application or GlfwApplication instead. +#endif + +/* I still have a test for this class and it shouldn't pollute the log there */ +#ifndef _MAGNUM_DO_NOT_WARN_DEPRECATED_GLUTAPPLICATION +CORRADE_DEPRECATED_FILE("Scheduled for removal. Consider switching to Sdl2Application or GlfwApplication instead.") +#endif + namespace Magnum { namespace Platform { /** @nosubgrouping @brief GLUT application +@deprecated This application is based on an outdated toolkit and scheduled for + removal in a future release. Please consider switching to either + @ref Sdl2Application or @ref GlfwApplication as soon as possible. + Application using the [GLUT](http://freeglut.sourceforge.net/) toolkit. Supports keyboard and mouse handling with support for changing cursor and mouse tracking and warping. @@ -108,7 +121,7 @@ If no other application header is included, this class is also aliased to @cpp Platform::Application @ce and the macro is aliased to @cpp MAGNUM_APPLICATION_MAIN() @ce to simplify porting. */ -class GlutApplication { +class CORRADE_DEPRECATED("Scheduled for removal. Consider switching to Sdl2Application or GlfwApplication instead.") GlutApplication { public: /** @brief Application arguments */ struct Arguments { @@ -789,6 +802,12 @@ class GlutApplication::MouseMoveEvent: public GlutApplication::InputEvent { @brief Entry point for GLUT-based applications @param className Class name +@deprecated This application is based on an outdated toolkit and scheduled for + removal in a future release. Please consider switching to either + @ref Magnum::Platform::Sdl2Application "Platform::Sdl2Application" or + @ref Magnum::Platform::GlfwApplication "Platform::GlfwApplication" as soon + as possible. + See @ref Magnum::Platform::GlutApplication "Platform::GlutApplication" for usage information. This macro abstracts out platform-specific entry point code and is equivalent to the following, see @ref portability-applications for more @@ -805,6 +824,7 @@ When no other application header is included this macro is also aliased to @cpp MAGNUM_APPLICATION_MAIN() @ce. */ #define MAGNUM_GLUTAPPLICATION_MAIN(className) \ + CORRADE_DEPRECATED_MACRO(MAGNUM_APPLICATION_MAIN(), "Scheduled for removal. Consider switching to Sdl2Application or GlfwApplication instead.") \ int main(int argc, char** argv) { \ className app({argc, argv}); \ return app.exec(); \ @@ -812,16 +832,28 @@ When no other application header is included this macro is also aliased to #ifndef DOXYGEN_GENERATING_OUTPUT #ifndef MAGNUM_APPLICATION_MAIN -typedef GlutApplication Application; -typedef BasicScreen Screen; -typedef BasicScreenedApplication ScreenedApplication; +CORRADE_IGNORE_DEPRECATED_PUSH +typedef CORRADE_DEPRECATED("Scheduled for removal. Consider switching to Sdl2Application or GlfwApplication instead.") GlutApplication Application; +typedef CORRADE_DEPRECATED("Scheduled for removal. Consider switching to Sdl2Application or GlfwApplication instead.")BasicScreen Screen; +typedef CORRADE_DEPRECATED("Scheduled for removal. Consider switching to Sdl2Application or GlfwApplication instead.") BasicScreenedApplication ScreenedApplication; +CORRADE_IGNORE_DEPRECATED_POP +#ifndef _MAGNUM_DO_NOT_WARN_DEPRECATED_GLUTAPPLICATION #define MAGNUM_APPLICATION_MAIN(className) MAGNUM_GLUTAPPLICATION_MAIN(className) #else +#define MAGNUM_APPLICATION_MAIN(className) \ + int main(int argc, char** argv) { \ + className app({argc, argv}); \ + return app.exec(); \ + } +#endif +#else #undef MAGNUM_APPLICATION_MAIN #endif #endif +CORRADE_IGNORE_DEPRECATED_PUSH CORRADE_ENUMSET_OPERATORS(GlutApplication::MouseMoveEvent::Buttons) +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Platform/Test/GlutApplicationTest.cpp b/src/Magnum/Platform/Test/GlutApplicationTest.cpp index 58ec733fd..35932b164 100644 --- a/src/Magnum/Platform/Test/GlutApplicationTest.cpp +++ b/src/Magnum/Platform/Test/GlutApplicationTest.cpp @@ -23,8 +23,11 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_GLUTAPPLICATION + #include "Magnum/Platform/GlutApplication.h" +CORRADE_IGNORE_DEPRECATED_PUSH namespace Magnum { namespace Platform { namespace Test { struct GlutApplicationTest: Platform::Application { @@ -35,3 +38,4 @@ struct GlutApplicationTest: Platform::Application { }}} MAGNUM_APPLICATION_MAIN(Magnum::Platform::Test::GlutApplicationTest) +CORRADE_IGNORE_DEPRECATED_POP