Browse Source

Platform: deprecate GlutApplication.

Yay, finally.
pull/272/head
Vladimír Vondruš 8 years ago
parent
commit
d70f75a179
  1. 4
      doc/building.dox
  2. 4
      doc/changelog.dox
  3. 3
      doc/cmake.dox
  4. 4
      package/ci/travis.yml
  5. 4
      src/Magnum/Platform/CMakeLists.txt
  6. 6
      src/Magnum/Platform/GlutApplication.cpp
  7. 40
      src/Magnum/Platform/GlutApplication.h
  8. 4
      src/Magnum/Platform/Test/GlutApplicationTest.cpp

4
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

4
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

3
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"

4
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

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

6
src/Magnum/Platform/GlutApplication.cpp

@ -23,6 +23,8 @@
DEALINGS IN THE SOFTWARE.
*/
#define _MAGNUM_DO_NOT_WARN_DEPRECATED_GLUTAPPLICATION
#include "GlutApplication.h"
#include <tuple>
@ -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<GlutApplication>;
template class BasicScreenedApplication<GlutApplication>;
CORRADE_IGNORE_DEPRECATED_POP
}}

40
src/Magnum/Platform/GlutApplication.h

@ -43,11 +43,24 @@
#include <GL/freeglut.h>
#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<GlutApplication> Screen;
typedef BasicScreenedApplication<GlutApplication> 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<GlutApplication> Screen;
typedef CORRADE_DEPRECATED("Scheduled for removal. Consider switching to Sdl2Application or GlfwApplication instead.") BasicScreenedApplication<GlutApplication> 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
}}

4
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

Loading…
Cancel
Save