Browse Source

Platform: removed GlutApplication.

pull/331/head
Daniel 7 years ago committed by Vladimír Vondruš
parent
commit
035f644769
  1. 3
      CMakeLists.txt
  2. 4
      doc/building.dox
  3. 9
      doc/changelog-old.dox
  4. 6
      doc/changelog.dox
  5. 2
      doc/cmake.dox
  6. 2
      doc/credits.dox
  7. 29
      modules/FindMagnum.cmake
  8. 3
      package/archlinux/PKGBUILD
  9. 3
      package/archlinux/PKGBUILD-clang
  10. 3
      package/archlinux/PKGBUILD-clang-addressanitizer
  11. 3
      package/archlinux/PKGBUILD-clang-analyzer
  12. 3
      package/archlinux/PKGBUILD-clang-libc++
  13. 3
      package/archlinux/PKGBUILD-coverage
  14. 3
      package/archlinux/PKGBUILD-gcc48
  15. 4
      package/archlinux/PKGBUILD-mingw-w64
  16. 4
      package/archlinux/PKGBUILD-release
  17. 1
      package/ci/travis-desktop.sh
  18. 3
      package/ci/travis.yml
  19. 43
      src/Magnum/Platform/CMakeLists.txt
  20. 187
      src/Magnum/Platform/GlutApplication.cpp
  21. 826
      src/Magnum/Platform/GlutApplication.h
  22. 2
      src/Magnum/Platform/Screen.h
  23. 2
      src/Magnum/Platform/ScreenedApplication.h
  24. 6
      src/Magnum/Platform/Test/CMakeLists.txt
  25. 41
      src/Magnum/Platform/Test/GlutApplicationTest.cpp

3
CMakeLists.txt

@ -103,7 +103,7 @@ option(WITH_SHADERS "Build Shaders library" ON)
cmake_dependent_option(WITH_TEXT "Build Text library" ON "NOT WITH_FONTCONVERTER;NOT WITH_MAGNUMFONT;NOT WITH_MAGNUMFONTCONVERTER" ON) cmake_dependent_option(WITH_TEXT "Build Text library" ON "NOT WITH_FONTCONVERTER;NOT WITH_MAGNUMFONT;NOT WITH_MAGNUMFONTCONVERTER" ON)
cmake_dependent_option(WITH_TEXTURETOOLS "Build TextureTools library" ON "NOT WITH_TEXT;NOT WITH_DISTANCEFIELDCONVERTER" ON) cmake_dependent_option(WITH_TEXTURETOOLS "Build TextureTools library" ON "NOT WITH_TEXT;NOT WITH_DISTANCEFIELDCONVERTER" ON)
cmake_dependent_option(WITH_TRADE "Build Trade library" ON "NOT WITH_MESHTOOLS;NOT WITH_PRIMITIVES;NOT WITH_IMAGECONVERTER;NOT WITH_ANYIMAGEIMPORTER;NOT WITH_ANYIMAGECONVERTER;NOT WITH_ANYSCENEIMPORTER;NOT WITH_OBJIMPORTER;NOT WITH_TGAIMAGECONVERTER;NOT WITH_TGAIMPORTER" ON) cmake_dependent_option(WITH_TRADE "Build Trade library" ON "NOT WITH_MESHTOOLS;NOT WITH_PRIMITIVES;NOT WITH_IMAGECONVERTER;NOT WITH_ANYIMAGEIMPORTER;NOT WITH_ANYIMAGECONVERTER;NOT WITH_ANYSCENEIMPORTER;NOT WITH_OBJIMPORTER;NOT WITH_TGAIMAGECONVERTER;NOT WITH_TGAIMPORTER" ON)
cmake_dependent_option(WITH_GL "Build GL library" ON "NOT WITH_SHADERS;NOT WITH_GL_INFO;NOT WITH_ANDROIDAPPLICATION;NOT WITH_WINDOWLESSIOSAPPLICATION;NOT WITH_CGLCONTEXT;NOT WITH_GLXAPPLICATION;NOT WITH_GLXCONTEXT;NOT WITH_XEGLAPPLICATION;NOT WITH_WINDOWLESSWGLAPPLICATION;NOT WITH_WGLCONTEXT;NOT WITH_WINDOWLESSWINDOWSEGLAPPLICATION;NOT WITH_GLUTAPPLICATION;NOT WITH_DISTANCEFIELDCONVERTER" ON) cmake_dependent_option(WITH_GL "Build GL library" ON "NOT WITH_SHADERS;NOT WITH_GL_INFO;NOT WITH_ANDROIDAPPLICATION;NOT WITH_WINDOWLESSIOSAPPLICATION;NOT WITH_CGLCONTEXT;NOT WITH_GLXAPPLICATION;NOT WITH_GLXCONTEXT;NOT WITH_XEGLAPPLICATION;NOT WITH_WINDOWLESSWGLAPPLICATION;NOT WITH_WGLCONTEXT;NOT WITH_WINDOWLESSWINDOWSEGLAPPLICATION;NOT WITH_DISTANCEFIELDCONVERTER" ON)
option(WITH_PRIMITIVES "Builf Primitives library" ON) option(WITH_PRIMITIVES "Builf Primitives library" ON)
option(WITH_VK "Build Vk library" OFF) option(WITH_VK "Build Vk library" OFF)
@ -153,7 +153,6 @@ endif()
# Platform-independent (almost) application libraries # Platform-independent (almost) application libraries
if(NOT CORRADE_TARGET_ANDROID) if(NOT CORRADE_TARGET_ANDROID)
option(WITH_GLFWAPPLICATION "Build GlfwApplication library" OFF) option(WITH_GLFWAPPLICATION "Build GlfwApplication library" OFF)
cmake_dependent_option(WITH_GLUTAPPLICATION "Build GlutApplication library" OFF "NOT TARGET_GLES" OFF)
option(WITH_SDL2APPLICATION "Build Sdl2Application library" OFF) option(WITH_SDL2APPLICATION "Build Sdl2Application library" OFF)
endif() endif()

4
doc/building.dox

@ -544,10 +544,6 @@ going to build any of the @ref example-index "examples", you'll need it.
- `WITH_GLFWAPPLICATION` --- Build the - `WITH_GLFWAPPLICATION` --- Build the
@ref Platform::GlfwApplication "GlfwApplication" library. Depends on @ref Platform::GlfwApplication "GlfwApplication" library. Depends on
[GLFW](http://glfw.org). [GLFW](http://glfw.org).
- `WITH_GLUTAPPLICATION` @m_class{m-label m-danger} **deprecated** --- Build
the @ref Platform::GlutApplication "GlutApplication" library. Depends on
[GLUT](http://freeglut.sourceforge.net/). Requires `TARGET_GL` to be
enabled.
- `WITH_GLXAPPLICATION` --- Build the - `WITH_GLXAPPLICATION` --- Build the
@ref Platform::GlxApplication "GlxApplication" library. Depends on **X11**. @ref Platform::GlxApplication "GlxApplication" library. Depends on **X11**.
Requires `TARGET_GL` to be enabled. Requires `TARGET_GL` to be enabled.

9
doc/changelog-old.dox

@ -307,8 +307,7 @@ for a high-level overview.
buffer buffer
- `Shapes::Shape::collision()` function as complement to - `Shapes::Shape::collision()` function as complement to
`Shapes::Shape::collides()` `Shapes::Shape::collides()`
- @ref Platform::GlutApplication::KeyEvent finally has more complete key - `Platform::GlutApplication::KeyEvent` finally has more complete key support
support
- @ref Math::Range::data() function, useful when querying range values from - @ref Math::Range::data() function, useful when querying range values from
GL GL
- Support for specifying context flags using - Support for specifying context flags using
@ -333,8 +332,8 @@ for a high-level overview.
[mosra/magnum#20](https://github.com/mosra/magnum/issues/20), [mosra/magnum#20](https://github.com/mosra/magnum/issues/20),
[mosra/magnum#45](https://github.com/mosra/magnum/issues/18)) [mosra/magnum#45](https://github.com/mosra/magnum/issues/18))
- @ref Platform::Sdl2Application is now used everywhere (documentation, - @ref Platform::Sdl2Application is now used everywhere (documentation,
tutorials, examples) by default, replacing @ref Platform::GlutApplication. tutorials, examples) by default, replacing `Platform::GlutApplication`. The
The GLUT application is still available, though. See GLUT application is still available, though. See
[mosra/magnum#39](https://github.com/mosra/magnum/issues/39). [mosra/magnum#39](https://github.com/mosra/magnum/issues/39).
- The need for compiler compatibility mode is now automatically detected by - The need for compiler compatibility mode is now automatically detected by
CMake to avoid strange compilation errors later CMake to avoid strange compilation errors later
@ -500,7 +499,7 @@ No dependency changes in this release.
- Ability to request context version in all windowed - Ability to request context version in all windowed
@ref Platform::Sdl2Application "Platform::*Application" classes @ref Platform::Sdl2Application "Platform::*Application" classes
- Mouse wheel support in @cpp Platform::NaClApplication::MouseEvent @ce - Mouse wheel support in @cpp Platform::NaClApplication::MouseEvent @ce
- No-op @ref Platform::GlutApplication::keyReleaseEvent() and - No-op `Platform::GlutApplication::keyReleaseEvent()` and
@cpp Platform::NaClApplication::Configuration::setTitle() @ce functions to @cpp Platform::NaClApplication::Configuration::setTitle() @ce functions to
preserve source compatibility with other application classes. preserve source compatibility with other application classes.
- @ref SceneGraph::Drawable::drawables() function as a non-ambiguous - @ref SceneGraph::Drawable::drawables() function as a non-ambiguous

6
doc/changelog.dox

@ -267,7 +267,9 @@ See also:
- Removed all aliases to @ref GL library functionality in the root namespace - Removed all aliases to @ref GL library functionality in the root namespace
(and root include path) which were deprecated in 2018.04 (and root include path) which were deprecated in 2018.04
- Removed the `Shapes` library together with `DebugTools::ShapeRenderer`, - Removed the `Shapes` library together with `DebugTools::ShapeRenderer`,
which was is a failed design experiment deprecated since 2018.10 which was a failed design experiment deprecated since version 2018.10
- Removed the `Platform::GlutApplication` as it was based on an outdated
toolkit and deprecated since version 2018.10
- In order to be compatible with both Emscripten 1.38.27 and the versions - In order to be compatible with both Emscripten 1.38.27 and the versions
before, all Emscripten markup is now expected to have the HTML @cb{.html} <canvas> @ce element identified by @cb{.css} #canvas @ce. You need to: before, all Emscripten markup is now expected to have the HTML @cb{.html} <canvas> @ce element identified by @cb{.css} #canvas @ce. You need to:
- update your HTML markup to use - update your HTML markup to use
@ -961,7 +963,7 @@ Released 2018-10-23, tagged as
have look at [Bullet](https://bulletphysics.org), which has Magnum have look at [Bullet](https://bulletphysics.org), which has Magnum
integration in @ref BulletIntegration, or at [Box2D](https://box2d.org/), integration in @ref BulletIntegration, or at [Box2D](https://box2d.org/),
which has a @ref examples-box2d "Magnum example" as well. which has a @ref examples-box2d "Magnum example" as well.
- @ref Platform::GlutApplication is based on an outdated toolkit and thus - `Platform::GlutApplication` is based on an outdated toolkit and thus
scheduled for removal in a future release. Please consider switching to scheduled for removal in a future release. Please consider switching to
@ref Platform::Sdl2Application or @ref Platform::GlfwApplication as soon as @ref Platform::Sdl2Application or @ref Platform::GlfwApplication as soon as
possible. possible.

2
doc/cmake.dox

@ -123,8 +123,6 @@ the components. The optional components are:
Platform namespace is split into more components: Platform namespace is split into more components:
- `GlfwApplication` --- @ref Platform::GlfwApplication "GlfwApplication" - `GlfwApplication` --- @ref Platform::GlfwApplication "GlfwApplication"
- `GlutApplication` @m_class{m-label m-danger} **deprecated** ---
@ref Platform::GlutApplication "GlutApplication"
- `GlxApplication` --- @ref Platform::GlxApplication "GlxApplication" - `GlxApplication` --- @ref Platform::GlxApplication "GlxApplication"
- `Sdl2Application` --- @ref Platform::Sdl2Application "Sdl2Application" - `Sdl2Application` --- @ref Platform::Sdl2Application "Sdl2Application"
- `XEglApplication` --- @ref Platform::XEglApplication "XEglApplication" - `XEglApplication` --- @ref Platform::XEglApplication "XEglApplication"

2
doc/credits.dox

@ -99,6 +99,8 @@ Are the below lists missing your name or something's wrong?
- **[\@biosek](https://github.com/biosek)** --- documentation fixes - **[\@biosek](https://github.com/biosek)** --- documentation fixes
- **Borislav Stanimirov** ([\@iboB](https://github.com/iboB)) --- strict - **Borislav Stanimirov** ([\@iboB](https://github.com/iboB)) --- strict
weak ordering for @ref Math types weak ordering for @ref Math types
- **Daniel Bloor** ([\@Bluer01](https://github.com/Bluer01)) --- setting old
code on fire
- **Denis Igorevich Lobanov** ([\@denislobanov](https://github.com/denislobanov)) - **Denis Igorevich Lobanov** ([\@denislobanov](https://github.com/denislobanov))
--- math fixes --- math fixes
- **[\@dlardi](https://github.com/dlardi)** --- WGL-related bugfixes - **[\@dlardi](https://github.com/dlardi)** --- WGL-related bugfixes

29
modules/FindMagnum.cmake

@ -68,7 +68,6 @@
# Trade - Trade library # Trade - Trade library
# Vk - Vk library # Vk - Vk library
# GlfwApplication - GLFW application # GlfwApplication - GLFW application
# GlutApplication - GLUT application
# GlxApplication - GLX application # GlxApplication - GLX application
# Sdl2Application - SDL2 application # Sdl2Application - SDL2 application
# XEglApplication - X/EGL application # XEglApplication - X/EGL application
@ -331,9 +330,10 @@ endif()
set(_MAGNUM_LIBRARY_COMPONENT_LIST set(_MAGNUM_LIBRARY_COMPONENT_LIST
Audio DebugTools GL MeshTools Primitives SceneGraph Shaders Text Audio DebugTools GL MeshTools Primitives SceneGraph Shaders Text
TextureTools Trade Vk TextureTools Trade Vk
AndroidApplication GlfwApplication GlutApplication GlxApplication AndroidApplication GlfwApplication GlxApplication Sdl2Application
Sdl2Application XEglApplication WindowlessCglApplication XEglApplication WindowlessCglApplication WindowlessEglApplication
WindowlessEglApplication WindowlessGlxApplication WindowlessIosApplication WindowlessWglApplication WindowlessWindowsEglApplication WindowlessGlxApplication WindowlessIosApplication WindowlessWglApplication
WindowlessWindowsEglApplication
CglContext EglContext GlxContext WglContext CglContext EglContext GlxContext WglContext
OpenGLTester) OpenGLTester)
set(_MAGNUM_PLUGIN_COMPONENT_LIST set(_MAGNUM_PLUGIN_COMPONENT_LIST
@ -408,7 +408,6 @@ if(MAGNUM_TARGET_GL)
list(APPEND _MAGNUM_GlfwApplication_DEPENDENCIES GL) list(APPEND _MAGNUM_GlfwApplication_DEPENDENCIES GL)
endif() endif()
set(_MAGNUM_GlutApplication_DEPENDENCIES GL)
set(_MAGNUM_GlxApplication_DEPENDENCIES GL) set(_MAGNUM_GlxApplication_DEPENDENCIES GL)
set(_MAGNUM_Sdl2Application_DEPENDENCIES ) set(_MAGNUM_Sdl2Application_DEPENDENCIES )
@ -635,26 +634,6 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
endif() endif()
endif() endif()
# GLUT application dependencies
elseif(_component STREQUAL GlutApplication)
find_package(GLUT)
set_property(TARGET Magnum::${_component} APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${GLUT_INCLUDE_DIR})
set_property(TARGET Magnum::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES ${GLUT_glut_LIBRARY})
# With GLVND (since CMake 3.11) we need to explicitly link to
# GLX because libOpenGL doesn't provide it. Also can't use
# OpenGL_OpenGL_FOUND, because that one is set also if GLVND is
# *not* found. WTF. I don't think GLUT works with EGL, so not
# handling that.
set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL)
if(OPENGL_opengl_LIBRARY)
set_property(TARGET Magnum::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES OpenGL::GLX)
endif()
# SDL2 application dependencies # SDL2 application dependencies
elseif(_component STREQUAL Sdl2Application) elseif(_component STREQUAL Sdl2Application)
find_package(SDL2) find_package(SDL2)

3
package/archlinux/PKGBUILD

@ -6,7 +6,7 @@ pkgdesc="C++11/C++14 graphics middleware for games and data visualization"
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url="https://magnum.graphics" url="https://magnum.graphics"
license=('MIT') license=('MIT')
depends=('corrade' 'openal' 'freeglut' 'sdl2' 'glfw' 'vulkan-icd-loader') depends=('corrade' 'openal' 'sdl2' 'glfw' 'vulkan-icd-loader')
makedepends=('cmake' 'ninja') makedepends=('cmake' 'ninja')
options=('!strip') options=('!strip')
provides=('magnum-git') provides=('magnum-git')
@ -27,7 +27,6 @@ build() {
-DWITH_AUDIO=ON \ -DWITH_AUDIO=ON \
-DWITH_VK=ON \ -DWITH_VK=ON \
-DWITH_GLFWAPPLICATION=ON \ -DWITH_GLFWAPPLICATION=ON \
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \
-DWITH_XEGLAPPLICATION=ON \ -DWITH_XEGLAPPLICATION=ON \

3
package/archlinux/PKGBUILD-clang

@ -6,7 +6,7 @@ pkgdesc="C++11/C++14 graphics middleware for games and data visualization (built
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url="https://magnum.graphics" url="https://magnum.graphics"
license=('MIT') license=('MIT')
depends=('corrade' 'openal' 'freeglut' 'sdl2' 'glfw' 'vulkan-icd-loader') depends=('corrade' 'openal' 'sdl2' 'glfw' 'vulkan-icd-loader')
makedepends=('cmake' 'clang' 'ninja') makedepends=('cmake' 'clang' 'ninja')
options=('!strip') options=('!strip')
provides=('magnum-git') provides=('magnum-git')
@ -30,7 +30,6 @@ build() {
-DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_AUDIO=ON \ -DWITH_AUDIO=ON \
-DWITH_VK=ON \ -DWITH_VK=ON \
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLFWAPPLICATION=ON \ -DWITH_GLFWAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \

3
package/archlinux/PKGBUILD-clang-addressanitizer

@ -6,7 +6,7 @@ pkgdesc="C++11/C++14 graphics middleware for games and data visualization (built
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url="https://magnum.graphics" url="https://magnum.graphics"
license=('MIT') license=('MIT')
depends=('corrade' 'openal' 'freeglut' 'sdl2' 'glfw' 'vulkan-icd-loader') depends=('corrade' 'openal' 'sdl2' 'glfw' 'vulkan-icd-loader')
makedepends=('cmake' 'clang' 'ninja') makedepends=('cmake' 'clang' 'ninja')
options=('!strip') options=('!strip')
provides=('magnum-git') provides=('magnum-git')
@ -31,7 +31,6 @@ build() {
-DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_AUDIO=ON \ -DWITH_AUDIO=ON \
-DWITH_VK=ON \ -DWITH_VK=ON \
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLFWAPPLICATION=ON \ -DWITH_GLFWAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \

3
package/archlinux/PKGBUILD-clang-analyzer

@ -6,7 +6,7 @@ pkgdesc="C++11/C++14 graphics middleware for games and data visualization (clang
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url="https://magnum.graphics" url="https://magnum.graphics"
license=('MIT') license=('MIT')
depends=('corrade' 'openal' 'freeglut' 'sdl2' 'glfw' 'vulkan-icd-loader') depends=('corrade' 'openal' 'sdl2' 'glfw' 'vulkan-icd-loader')
makedepends=('cmake' 'clang-analyzer' 'ninja') makedepends=('cmake' 'clang-analyzer' 'ninja')
options=('!strip') options=('!strip')
provides=('magnum-git') provides=('magnum-git')
@ -22,7 +22,6 @@ build() {
-DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_AUDIO=ON \ -DWITH_AUDIO=ON \
-DWITH_VK=ON \ -DWITH_VK=ON \
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLFWAPPLICATION=ON \ -DWITH_GLFWAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \

3
package/archlinux/PKGBUILD-clang-libc++

@ -6,7 +6,7 @@ pkgdesc="C++11/C++14 graphics middleware for games and data visualization (built
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url="https://magnum.graphics" url="https://magnum.graphics"
license=('MIT') license=('MIT')
depends=('corrade=dev.clang.libc++' 'openal' 'freeglut' 'sdl2' 'glfw' 'vulkan-icd-loader' 'libc++') depends=('corrade=dev.clang.libc++' 'openal' 'sdl2' 'glfw' 'vulkan-icd-loader' 'libc++')
makedepends=('cmake' 'clang' 'ninja') makedepends=('cmake' 'clang' 'ninja')
options=('!strip') options=('!strip')
provides=('magnum-git') provides=('magnum-git')
@ -33,7 +33,6 @@ build() {
-DWITH_AUDIO=ON \ -DWITH_AUDIO=ON \
-DWITH_VK=ON \ -DWITH_VK=ON \
-DWITH_GLFWAPPLICATION=ON \ -DWITH_GLFWAPPLICATION=ON \
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \
-DWITH_XEGLAPPLICATION=ON \ -DWITH_XEGLAPPLICATION=ON \

3
package/archlinux/PKGBUILD-coverage

@ -6,7 +6,7 @@ pkgdesc="C++11/C++14 graphics middleware for games and data visualization (cover
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url="https://magnum.graphics" url="https://magnum.graphics"
license=('MIT') license=('MIT')
depends=('corrade' 'openal' 'freeglut' 'sdl2' 'glfw' 'vulkan-icd-loader' 'gcc6') depends=('corrade' 'openal' 'sdl2' 'glfw' 'vulkan-icd-loader' 'gcc6')
makedepends=('cmake' 'ninja' 'lcov') makedepends=('cmake' 'ninja' 'lcov')
options=('!strip') options=('!strip')
provides=('magnum-git') provides=('magnum-git')
@ -29,7 +29,6 @@ build() {
-DWITH_AUDIO=ON \ -DWITH_AUDIO=ON \
-DWITH_VK=ON \ -DWITH_VK=ON \
-DWITH_GLFWAPPLICATION=ON \ -DWITH_GLFWAPPLICATION=ON \
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \
-DWITH_XEGLAPPLICATION=ON \ -DWITH_XEGLAPPLICATION=ON \

3
package/archlinux/PKGBUILD-gcc48

@ -6,7 +6,7 @@ pkgdesc="C++11/C++14 graphics middleware for games and data visualization (built
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url="https://magnum.graphics" url="https://magnum.graphics"
license=('MIT') license=('MIT')
depends=('corrade' 'openal' 'freeglut' 'sdl2' 'glfw') depends=('corrade' 'openal' 'sdl2' 'glfw')
makedepends=('cmake' 'ninja' 'gcc48') makedepends=('cmake' 'ninja' 'gcc48')
options=('!strip') options=('!strip')
provides=('magnum-git') provides=('magnum-git')
@ -34,7 +34,6 @@ build() {
-DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_AUDIO=ON \ -DWITH_AUDIO=ON \
-DWITH_GLFWAPPLICATION=ON \ -DWITH_GLFWAPPLICATION=ON \
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \
-DWITH_XEGLAPPLICATION=ON \ -DWITH_XEGLAPPLICATION=ON \

4
package/archlinux/PKGBUILD-mingw-w64

@ -6,7 +6,7 @@ pkgdesc="C++11/C++14 graphics middleware for games and data visualization (mingw
arch=('any') arch=('any')
url="https://magnum.graphics" url="https://magnum.graphics"
license=('MIT') license=('MIT')
depends=('mingw-w64-crt' 'mingw-w64-corrade' 'mingw-w64-freeglut' 'mingw-w64-sdl2' 'mingw-w64-openal') depends=('mingw-w64-crt' 'mingw-w64-corrade' 'mingw-w64-sdl2' 'mingw-w64-openal')
makedepends=('mingw-w64-gcc' 'cmake' 'ninja' 'corrade') makedepends=('mingw-w64-gcc' 'cmake' 'ninja' 'corrade')
options=('!buildflags' '!strip') options=('!buildflags' '!strip')
@ -21,7 +21,6 @@ build() {
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/i686-w64-mingw32 \ -DCMAKE_INSTALL_PREFIX=/usr/i686-w64-mingw32 \
-DWITH_AUDIO=ON \ -DWITH_AUDIO=ON \
-DWITH_GLUTAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \
-DWITH_WINDOWLESSWGLAPPLICATION=ON \ -DWITH_WINDOWLESSWGLAPPLICATION=ON \
-DWITH_WGLCONTEXT=ON \ -DWITH_WGLCONTEXT=ON \
@ -54,7 +53,6 @@ build() {
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32 \ -DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32 \
-DWITH_AUDIO=ON \ -DWITH_AUDIO=ON \
-DWITH_GLUTAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \
-DWITH_WINDOWLESSWGLAPPLICATION=ON \ -DWITH_WINDOWLESSWGLAPPLICATION=ON \
-DWITH_WGLCONTEXT=ON \ -DWITH_WGLCONTEXT=ON \

4
package/archlinux/PKGBUILD-release

@ -6,7 +6,7 @@ pkgdesc="C++11/C++14 graphics middleware for games and data visualization (debug
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url="https://magnum.graphics" url="https://magnum.graphics"
license=('MIT') license=('MIT')
depends=('corrade' 'openal' 'freeglut' 'sdl2' 'glfw' 'vulkan-icd-loader') depends=('corrade' 'openal' 'sdl2' 'glfw' 'vulkan-icd-loader')
makedepends=('cmake' 'ninja') makedepends=('cmake' 'ninja')
options=('!strip') options=('!strip')
provides=('magnum-git') provides=('magnum-git')
@ -23,7 +23,6 @@ build() {
-DWITH_AUDIO=ON \ -DWITH_AUDIO=ON \
-DWITH_VK=ON \ -DWITH_VK=ON \
-DWITH_GLFWAPPLICATION=ON \ -DWITH_GLFWAPPLICATION=ON \
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \
-DWITH_XEGLAPPLICATION=ON \ -DWITH_XEGLAPPLICATION=ON \
@ -58,7 +57,6 @@ build() {
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_AUDIO=ON \ -DWITH_AUDIO=ON \
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \
-DWITH_XEGLAPPLICATION=ON \ -DWITH_XEGLAPPLICATION=ON \

1
package/ci/travis-desktop.sh

@ -25,7 +25,6 @@ cmake .. \
-DWITH_AUDIO=ON \ -DWITH_AUDIO=ON \
-DWITH_VK=OFF \ -DWITH_VK=OFF \
-DWITH_GLFWAPPLICATION=ON \ -DWITH_GLFWAPPLICATION=ON \
-DWITH_GLUTAPPLICATION=$WITH_GLUTAPPLICATION \
-DWITH_SDL2APPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \
-DWITH_WINDOWLESS${PLATFORM_GL_API}APPLICATION=ON \ -DWITH_WINDOWLESS${PLATFORM_GL_API}APPLICATION=ON \
-DWITH_${PLATFORM_GL_API}CONTEXT=ON \ -DWITH_${PLATFORM_GL_API}CONTEXT=ON \

3
package/ci/travis.yml

@ -7,7 +7,6 @@ addons:
- lcov - lcov
- libsdl2-dev - libsdl2-dev
- libglfw3-dev - libglfw3-dev
- freeglut3-dev
- libopenal-dev - libopenal-dev
matrix: matrix:
@ -181,8 +180,6 @@ install:
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ ! "$TARGET" == "desktop-sanitizers" ] && [ ! "$TARGET" == "android" ] && [ ! "$TARGET" == "desktop-vulkan" ]; then export CXX=g++-4.8; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ ! "$TARGET" == "desktop-sanitizers" ] && [ ! "$TARGET" == "android" ] && [ ! "$TARGET" == "desktop-vulkan" ]; then export CXX=g++-4.8; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "desktop-sanitizers" ]; then export CXX=clang++-3.8; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "desktop-sanitizers" ]; then export CXX=clang++-3.8; fi
- if [ "$BUILD_DEPRECATED" != "OFF" ]; then export BUILD_DEPRECATED=ON; 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" ] || [ "$TARGET" == "desktop-sanitizers" ] ); then export PLATFORM_GL_API=GLX; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && ( [ "$TARGET" == "desktop" ] || [ "$TARGET" == "desktop-sanitizers" ] ); then export PLATFORM_GL_API=GLX; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "desktop-gles" ]; then export PLATFORM_GL_API=EGL; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "desktop-gles" ]; then export PLATFORM_GL_API=EGL; 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 - 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

43
src/Magnum/Platform/CMakeLists.txt

@ -92,7 +92,7 @@ set(MagnumPlatform_FILES )
install(FILES ${MagnumPlatform_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(FILES ${MagnumPlatform_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform)
# Decide about platform-specific context for cross-platform toolkits # Decide about platform-specific context for cross-platform toolkits
if((WITH_GLFWAPPLICATION OR WITH_GLUTAPPLICATION OR WITH_SDL2APPLICATION) AND TARGET_GL) if((WITH_GLFWAPPLICATION OR WITH_SDL2APPLICATION) AND TARGET_GL)
if(CORRADE_TARGET_APPLE AND NOT MAGNUM_TARGET_GLES) if(CORRADE_TARGET_APPLE AND NOT MAGNUM_TARGET_GLES)
set(NEED_CGLCONTEXT 1) set(NEED_CGLCONTEXT 1)
set(MagnumSomeContext_OBJECTS $<TARGET_OBJECTS:MagnumCglContextObjects>) set(MagnumSomeContext_OBJECTS $<TARGET_OBJECTS:MagnumCglContextObjects>)
@ -220,47 +220,6 @@ if(WITH_GLFWAPPLICATION)
add_library(Magnum::GlfwApplication ALIAS MagnumGlfwApplication) add_library(Magnum::GlfwApplication ALIAS MagnumGlfwApplication)
endif() 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.")
endif()
set(MagnumGlutApplication_SRCS
GlutApplication.cpp
${MagnumSomeContext_OBJECTS})
set(MagnumGlutApplication_HEADERS GlutApplication.h)
add_library(MagnumGlutApplication STATIC
${MagnumGlutApplication_SRCS}
${MagnumGlutApplication_HEADERS})
set_target_properties(MagnumGlutApplication PROPERTIES
DEBUG_POSTFIX "-d"
FOLDER "Magnum/Platform")
# Assuming that PIC is not needed because the Application lib is always
# linked to the executable and not to any intermediate shared lib
target_include_directories(MagnumGlutApplication PUBLIC ${GLUT_INCLUDE_DIR})
target_link_libraries(MagnumGlutApplication PUBLIC
MagnumGL
${GLUT_glut_LIBRARY}
# need to link to GLX explicitly if using GLVND (CMake 3.11+)
${MagnumSomeContext_LIBRARY})
install(FILES ${MagnumGlutApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform)
install(TARGETS MagnumGlutApplication
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}
ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})
# Magnum GlutApplication target alias for superprojects
add_library(Magnum::GlutApplication ALIAS MagnumGlutApplication)
endif()
# SDL2 application # SDL2 application
if(WITH_SDL2APPLICATION) if(WITH_SDL2APPLICATION)
find_package(SDL2) find_package(SDL2)

187
src/Magnum/Platform/GlutApplication.cpp

@ -1,187 +0,0 @@
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
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.
*/
#define _MAGNUM_DO_NOT_WARN_DEPRECATED_GLUTAPPLICATION
#include "GlutApplication.h"
#include <tuple>
#include "Magnum/GL/Version.h"
#include "Magnum/Platform/GLContext.h"
#include "Magnum/Platform/ScreenedApplication.hpp"
namespace Magnum { namespace Platform {
CORRADE_IGNORE_DEPRECATED_PUSH
GlutApplication* GlutApplication::_instance = nullptr;
GlutApplication::GlutApplication(const Arguments& arguments): GlutApplication{arguments, Configuration{}, GLConfiguration{}} {}
GlutApplication::GlutApplication(const Arguments& arguments, const Configuration& configuration): GlutApplication{arguments, configuration, GLConfiguration{}} {}
GlutApplication::GlutApplication(const Arguments& arguments, const Configuration& configuration, const GLConfiguration& glConfiguration): GlutApplication{arguments, NoCreate} {
create(configuration, glConfiguration);
}
GlutApplication::GlutApplication(const Arguments& arguments, NoCreateT): _context{new GLContext{NoCreate, arguments.argc, arguments.argv}} {
/* Save global instance */
_instance = this;
/* Init GLUT */
glutInit(&arguments.argc, arguments.argv);
glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_CONTINUE_EXECUTION);
}
void GlutApplication::create() {
create(Configuration{}, GLConfiguration{});
}
void GlutApplication::create(const Configuration& configuration) {
create(configuration, GLConfiguration{});
}
void GlutApplication::create(const Configuration& configuration, const GLConfiguration& glConfiguration) {
if(!tryCreate(configuration, glConfiguration)) std::exit(1);
}
bool GlutApplication::tryCreate(const Configuration& configuration) {
return tryCreate(configuration, GLConfiguration{});
}
bool GlutApplication::tryCreate(const Configuration& configuration, const GLConfiguration& glConfiguration) {
CORRADE_ASSERT(_context->version() == GL::Version::None, "Platform::GlutApplication::tryCreate(): context already created", false);
unsigned int flags = GLUT_DOUBLE|GLUT_RGBA|GLUT_DEPTH|GLUT_STENCIL;
/* Multisampling */
if(glConfiguration.sampleCount()) flags |= GLUT_MULTISAMPLE;
glutInitDisplayMode(flags);
glutInitWindowSize(configuration.size().x(), configuration.size().y());
/* Set context version, if requested */
if(glConfiguration.version() != GL::Version::None) {
Int major, minor;
std::tie(major, minor) = version(glConfiguration.version());
glutInitContextVersion(major, minor);
#ifndef MAGNUM_TARGET_GLES
if(glConfiguration.version() >= GL::Version::GL310)
glutInitContextProfile(GLUT_CORE_PROFILE);
#endif
}
/* Set context flags */
glutInitContextFlags(int(glConfiguration.flags()));
if(!glutCreateWindow(configuration.title().data())) {
Error() << "Platform::GlutApplication::tryCreate(): cannot create context";
return false;
}
glutReshapeFunc(staticViewportEvent);
glutKeyboardFunc(staticKeyPressEvent);
glutKeyboardUpFunc(staticKeyReleaseEvent);
glutSpecialFunc(staticSpecialKeyPressEvent);
glutSpecialUpFunc(staticSpecialKeyReleaseEvent);
glutMouseFunc(staticMouseEvent);
glutMotionFunc(staticMouseMoveEvent);
glutDisplayFunc(staticDrawEvent);
/* Return true if the initialization succeeds */
return _context->tryCreate();
}
GlutApplication::~GlutApplication() = default;
void GlutApplication::staticViewportEvent(int x, int y) {
ViewportEvent e{{x, y}};
_instance->viewportEvent(e);
}
void GlutApplication::staticKeyPressEvent(unsigned char key, int x, int y) {
KeyEvent e(static_cast<KeyEvent::Key>(key), {x, y});
_instance->keyPressEvent(e);
}
void GlutApplication::staticKeyReleaseEvent(unsigned char key, int x, int y) {
KeyEvent e(static_cast<KeyEvent::Key>(key), {x, y});
_instance->keyReleaseEvent(e);
}
void GlutApplication::staticSpecialKeyPressEvent(int key, int x, int y){
KeyEvent e(static_cast<KeyEvent::Key>(key << 16), {x, y});
_instance->keyPressEvent(e);
}
void GlutApplication::staticSpecialKeyReleaseEvent(int key, int x, int y){
KeyEvent e(static_cast<KeyEvent::Key>(key << 16), {x, y});
_instance->keyReleaseEvent(e);
}
void GlutApplication::staticMouseEvent(int button, int state, int x, int y) {
MouseEvent e(static_cast<MouseEvent::Button>(button), {x, y});
if(state == GLUT_DOWN)
_instance->mousePressEvent(e);
else
_instance->mouseReleaseEvent(e);
}
void GlutApplication::staticMouseMoveEvent(int x, int y) {
MouseMoveEvent e({x, y}, MouseMoveEvent::Button::Left);
_instance->mouseMoveEvent(e);
}
void GlutApplication::viewportEvent(ViewportEvent& event) {
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_IGNORE_DEPRECATED_PUSH
viewportEvent(event.windowSize());
CORRADE_IGNORE_DEPRECATED_POP
#else
static_cast<void>(event);
#endif
}
#ifdef MAGNUM_BUILD_DEPRECATED
void GlutApplication::viewportEvent(const Vector2i&) {}
#endif
void GlutApplication::keyPressEvent(KeyEvent&) {}
void GlutApplication::keyReleaseEvent(KeyEvent&) {}
void GlutApplication::mousePressEvent(MouseEvent&) {}
void GlutApplication::mouseReleaseEvent(MouseEvent&) {}
void GlutApplication::mouseMoveEvent(MouseMoveEvent&) {}
GlutApplication::GLConfiguration::GLConfiguration(): _sampleCount(0), _version(GL::Version::None) {}
GlutApplication::GLConfiguration::~GLConfiguration() = default;
GlutApplication::Configuration::Configuration():
_title("Magnum GLUT Application"), _size(800, 600) {}
GlutApplication::Configuration::~Configuration() = default;
template class BasicScreen<GlutApplication>;
template class BasicScreenedApplication<GlutApplication>;
CORRADE_IGNORE_DEPRECATED_POP
}}

826
src/Magnum/Platform/GlutApplication.h

@ -1,826 +0,0 @@
#ifndef Magnum_Platform_GlutApplication_h
#define Magnum_Platform_GlutApplication_h
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
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
@brief Class @ref Magnum::Platform::GlutApplication, macro @ref MAGNUM_GLUTAPPLICATION_MAIN()
@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 or @ref Magnum::Platform::GlfwApplication
as soon as possible.
*/
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#include <string>
#include <Corrade/Containers/Pointer.h>
#include "Magnum/Magnum.h"
#include "Magnum/Tags.h"
#include "Magnum/GL/GL.h"
#include "Magnum/Math/Vector2.h"
#include "Magnum/Platform/Platform.h"
/* We must include our own GL headers first to avoid conflicts */
#include "Magnum/GL/OpenGL.h"
#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 {
CORRADE_IGNORE_DEPRECATED_PUSH
/** @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.
This application library is available only on desktop OpenGL (Linux, Windows,
macOS). It depends on the [GLUT](http://freeglut.sourceforge.net/) library and
is built if `WITH_GLUTAPPLICATION` is enabled when building Magnum.
@m_class{m-block m-success}
@thirdparty This plugin makes use of the [freeGLUT](http://freeglut.sourceforge.net/)
library, licensed under @m_class{m-label m-success} **MIT**
([license text](https://github.com/dcnieho/FreeGLUT/blob/git_master/freeglut/freeglut/COPYING),
[choosealicense.com](https://choosealicense.com/licenses/mit/)).
It requires attribution for public use.
@section Platform-GlutApplication-usage General usage
In order to use this library from CMake, you need to request the
`GlutApplication` component of the `Magnum` package and link to the
`Magnum::GlutApplication` target:
@code{.cmake}
find_package(Magnum REQUIRED GlutApplication)
# ...
target_link_libraries(your-app Magnum::GlutApplication)
@endcode
If no other application is requested, you can also use the generic
`Magnum::Application` alias to simplify porting. Again, see @ref building and
@ref cmake for more information.
In C++ code you need to implement at least @ref drawEvent() to be able to draw
on the screen. The subclass can be then used directly in @cpp main() @ce
--- see convenience macro @ref MAGNUM_GLUTAPPLICATION_MAIN(). See @ref platform
for more information.
@code{.cpp}
class MyApplication: public Platform::GlutApplication {
// implement required methods...
};
MAGNUM_GLUTAPPLICATION_MAIN(MyApplication)
@endcode
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.
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/
class CORRADE_DEPRECATED("scheduled for removal, consider switching to Sdl2Application or GlfwApplication instead") GlutApplication {
public:
/** @brief Application arguments */
struct Arguments {
/** @brief Constructor */
/*implicit*/ constexpr Arguments(int& argc, char** argv) noexcept: argc{argc}, argv{argv} {}
int& argc; /**< @brief Argument count */
char** argv; /**< @brief Argument values */
};
class Configuration;
class GLConfiguration;
class ViewportEvent;
class InputEvent;
class KeyEvent;
class MouseEvent;
class MouseMoveEvent;
/**
* @brief Construct with given configuration for OpenGL context
* @param arguments Application arguments
* @param configuration Application configuration
* @param glConfiguration OpenGL context configuration
*
* Creates application with default or user-specified configuration.
* See @ref Configuration for more information. The program exits if
* the context cannot be created, see @ref tryCreate() for an
* alternative.
*/
explicit GlutApplication(const Arguments& arguments, const Configuration& configuration, const GLConfiguration& glConfiguration);
/**
* @brief Construct with given configuration
*
* Equivalent to calling @ref GlutApplication(const Arguments&, const Configuration&, const GLConfiguration&)
* with default-constructed @ref GLConfiguration.
*/
explicit GlutApplication(const Arguments& arguments, const Configuration& configuration);
/**
* @brief Construct with default configuration
*
* Equivalent to calling @ref GlutApplication(const Arguments&, const Configuration&)
* with default-constructed @ref Configuration.
*/
explicit GlutApplication(const Arguments& arguments);
/**
* @brief Construct without creating a window
* @param arguments Application arguments
*
* Unlike above, the window is not created and must be created later
* with @ref create() or @ref tryCreate().
*/
explicit GlutApplication(const Arguments& arguments, NoCreateT);
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief @copybrief GlutApplication(const Arguments&, NoCreateT)
* @deprecated Use @ref GlutApplication(const Arguments&, NoCreateT) instead.
*/
CORRADE_DEPRECATED("use GlutApplication(const Arguments&, NoCreateT) instead") explicit GlutApplication(const Arguments& arguments, std::nullptr_t): GlutApplication{arguments, NoCreate} {}
#endif
/** @brief Copying is not allowed */
GlutApplication(const GlutApplication&) = delete;
/** @brief Moving is not allowed */
GlutApplication(GlutApplication&&) = delete;
/** @brief Copying is not allowed */
GlutApplication& operator=(const GlutApplication&) = delete;
/** @brief Moving is not allowed */
GlutApplication& operator=(GlutApplication&&) = delete;
/**
* @brief Execute main loop
* @return Value for returning from @cpp main() @ce
*
* See @ref MAGNUM_GLUTAPPLICATION_MAIN() for usage information.
*/
int exec() {
glutMainLoop();
return 0;
}
protected:
/* Nobody will need to have (and delete) GlutApplication*, thus this is
faster than public pure virtual destructor */
~GlutApplication();
/**
* @brief Create a window with given configuration for OpenGL context
* @param configuration Application configuration
* @param glConfiguration OpenGL context configuration
*
* Must be called only if the context wasn't created by the constructor
* itself, i.e. when passing @ref NoCreate to it. Error message is
* printed and the program exits if the context cannot be created, see
* @ref tryCreate() for an alternative.
*/
void create(const Configuration& configuration, const GLConfiguration& glConfiguration);
/**
* @brief Create a window with given configuration and OpenGL context
*
* Equivalent to calling @ref create(const Configuration&, const GLConfiguration&)
* with default-constructed @ref GLConfiguration.
*/
void create(const Configuration& configuration);
/**
* @brief Create a window with default configuration and OpenGL context
*
* Equivalent to calling @ref create(const Configuration&) with
* default-constructed @ref Configuration.
*/
void create();
/**
* @brief Try to create context with given configuration for OpenGL context
*
* Unlike @ref create(const Configuration&, const GLConfiguration&)
* returns @cpp false @ce if the context cannot be created,
* @cpp true @ce otherwise.
*/
bool tryCreate(const Configuration& configuration, const GLConfiguration& glConfiguration);
/**
* @brief Try to create context with given configuration and OpenGL context
*
* Unlike @ref create(const Configuration&) returns @cpp false @ce if
* the context cannot be created, @cpp true @ce otherwise.
*/
bool tryCreate(const Configuration& configuration);
/** @{ @name Screen handling */
public:
/**
* @brief Swap buffers
*
* Paints currently rendered framebuffer on screen.
*/
void swapBuffers() { glutSwapBuffers(); }
/** @copydoc Sdl2Application::redraw() */
void redraw() { glutPostRedisplay(); }
private:
/**
* @brief Viewport event
*
* Called when window size changes. The default implementation does
* nothing. If you want to respond to size changes, you should pass the
* new size to @ref GL::DefaultFramebuffer::setViewport() (if using
* OpenGL) and possibly elsewhere (to
* @ref SceneGraph::Camera::setViewport(), other framebuffers...).
*
* Note that this function might not get called at all if the window
* size doesn't change. You should configure the initial state of your
* cameras, framebuffers etc. in application constructor rather than
* relying on this function to be called.
*/
virtual void viewportEvent(ViewportEvent& event);
#ifdef MAGNUM_BUILD_DEPRECATED
/** @brief @copybrief viewportEvent(ViewportEvent&)
* @deprecated Use @ref viewportEvent(ViewportEvent&) instead.
* To preserve backwards compatibility, this function is called
* from @ref viewportEvent(ViewportEvent&) with
* @ref ViewportEvent::windowSize() passed to @p size. Overriding
* the new function will cause this function to not be called
* anymore.
*/
virtual CORRADE_DEPRECATED("use viewportEvent(ViewportEvent&) instead") void viewportEvent(const Vector2i& size);
#endif
/** @copydoc Sdl2Application::drawEvent() */
virtual void drawEvent() = 0;
/*@}*/
/** @{ @name Keyboard handling */
/** @copydoc Sdl2Application::keyPressEvent() */
virtual void keyPressEvent(KeyEvent& event);
/** @copydoc Sdl2Application::keyReleaseEvent() */
virtual void keyReleaseEvent(KeyEvent& event);
/*@}*/
/** @{ @name Mouse handling */
public:
/**
* @brief Mouse cursor
*
* @see @ref setMouseCursor()
*/
enum class MouseCursor: int {
Default = GLUT_CURSOR_INHERIT, /**< Default cursor provided by parent window */
None = GLUT_CURSOR_NONE /**< No cursor */
};
/**
* @brief Enable or disable mouse tracking
*
* When mouse tracking is enabled, @ref mouseMoveEvent() is called even
* when no button is pressed. Mouse tracking is disabled by default.
*/
void setMouseTracking(bool enabled) {
glutPassiveMotionFunc(enabled ? staticMouseMoveEvent : nullptr);
}
/** @brief Set mouse cursor */
void setMouseCursor(MouseCursor cursor) {
glutSetCursor(static_cast<int>(cursor));
}
/** @brief Warp mouse cursor to given coordinates */
void warpMouseCursor(const Vector2i& position) {
glutWarpPointer(position.x(), position.y());
}
private:
/** @copydoc Sdl2Application::mousePressEvent() */
virtual void mousePressEvent(MouseEvent& event);
/** @copydoc Sdl2Application::mouseReleaseEvent() */
virtual void mouseReleaseEvent(MouseEvent& event);
/**
* @brief Mouse move event
*
* Called when any mouse button is pressed and mouse is moved. Default
* implementation does nothing.
* @see @ref setMouseTracking()
*/
virtual void mouseMoveEvent(MouseMoveEvent& event);
/*@}*/
private:
static void staticViewportEvent(int x, int y);
static void staticKeyPressEvent(unsigned char key, int x, int y);
static void staticKeyReleaseEvent(unsigned char key, int x, int y);
static void staticSpecialKeyPressEvent(int key, int x, int y);
static void staticSpecialKeyReleaseEvent(int key, int x, int y);
static void staticMouseEvent(int button, int state, int x, int y);
static void staticMouseMoveEvent(int x, int y);
static void staticDrawEvent() {
_instance->drawEvent();
}
static GlutApplication* _instance;
Containers::Pointer<Platform::GLContext> _context;
};
/**
@brief OpenGL context configuration
Double-buffered RGBA window with depth and stencil buffers.
@see @ref GlutApplication(), @ref Configuration, @ref create(),
@ref tryCreate()
*/
class GlutApplication::GLConfiguration {
public:
/**
* @brief Context flag
*
* @see @ref Flags, @ref setFlags()
*/
enum class Flag: int {
Debug = GLUT_DEBUG /**< Create debug context */
};
/**
* @brief Context flags
*
* @see @ref setFlags()
*/
#ifndef DOXYGEN_GENERATING_OUTPUT
typedef Containers::EnumSet<Flag, GLUT_DEBUG> Flags;
#else
typedef Containers::EnumSet<Flag> Flags;
#endif
/*implicit*/ GLConfiguration();
~GLConfiguration();
/** @brief Context flags */
Flags flags() const { return _flags; }
/**
* @brief Set context flags
* @return Reference to self (for method chaining)
*
* Default is no flag.
*/
GLConfiguration& setFlags(Flags flags) {
_flags = flags;
return *this;
}
/** @brief Context version */
GL::Version version() const { return _version; }
/**
* @brief Set context version
*
* If requesting version greater or equal to OpenGL 3.1, core profile
* is used. The created context will then have any version which is
* backwards-compatible with requested one. Default is
* @ref GL::Version::None, i.e. any provided version is used.
*/
GLConfiguration& setVersion(GL::Version version) {
_version = version;
return *this;
}
/** @brief Sample count */
Int sampleCount() const { return _sampleCount; }
/**
* @brief Set sample count
* @return Reference to self (for method chaining)
*
* Default is @cpp 0 @ce, thus no multisampling. The actual sample
* count is ignored, GLUT either enables it or disables. See also
* @ref GL::Renderer::Feature::Multisampling.
*/
GLConfiguration& setSampleCount(Int count) {
_sampleCount = count;
return *this;
}
private:
std::string _title;
Vector2i _size;
Int _sampleCount;
GL::Version _version;
Flags _flags;
};
CORRADE_ENUMSET_OPERATORS(GlutApplication::GLConfiguration::Flags)
/**
@brief Configuration
@see @ref GlutApplication(), @ref GLConfiguration, @ref create(),
@ref tryCreate()
*/
class GlutApplication::Configuration {
public:
#ifdef MAGNUM_BUILD_DEPRECATED
/** @brief @copybrief GLConfiguration::Flag
* @deprecated Use @ref GLConfiguration::Flag instead.
*/
typedef GLConfiguration::Flag Flag;
/** @brief @copybrief GLConfiguration::Flags
* @deprecated Use @ref GLConfiguration::Flags instead.
*/
typedef GLConfiguration::Flags Flags;
#endif
/*implicit*/ Configuration();
~Configuration();
/** @brief Window title */
std::string title() const { return _title; }
/**
* @brief Set window title
* @return Reference to self (for method chaining)
*
* Default is @cpp "Magnum GLUT Application" @ce.
*/
Configuration& setTitle(std::string title) {
_title = std::move(title);
return *this;
}
/** @brief Window size */
Vector2i size() const { return _size; }
/**
* @brief Set window size
* @return Reference to self (for method chaining)
*
* Default is @cpp {800, 600} @ce.
*/
Configuration& setSize(const Vector2i& size) {
_size = size;
return *this;
}
private:
std::string _title;
Vector2i _size;
};
/**
@brief Viewport event
@see @ref viewportEvent()
*/
class GlutApplication::ViewportEvent {
public:
/** @brief Window size */
Vector2i windowSize() const { return _windowSize; }
private:
friend GlutApplication;
explicit ViewportEvent(const Vector2i& windowSize): _windowSize{windowSize} {}
Vector2i _windowSize;
};
/**
@brief Base for input events
@see @ref KeyEvent, @ref MouseEvent, @ref MouseMoveEvent, @ref keyPressEvent(),
@ref mousePressEvent(), @ref mouseReleaseEvent(), @ref mouseMoveEvent()
*/
class GlutApplication::InputEvent {
public:
/** @brief Copying is not allowed */
InputEvent(const InputEvent&) = delete;
/** @brief Moving is not allowed */
InputEvent(InputEvent&&) = delete;
/** @brief Copying is not allowed */
InputEvent& operator=(const InputEvent&) = delete;
/** @brief Moving is not allowed */
InputEvent& operator=(InputEvent&&) = delete;
/** @copydoc Sdl2Application::InputEvent::setAccepted() */
void setAccepted(bool accepted = true) { _accepted = accepted; }
/** @copydoc Sdl2Application::InputEvent::isAccepted() */
bool isAccepted() const { return _accepted; }
protected:
explicit InputEvent(): _accepted(false) {}
~InputEvent() = default;
private:
bool _accepted;
};
/**
@brief Key event
@see @ref keyPressEvent()
*/
class GlutApplication::KeyEvent: public GlutApplication::InputEvent {
friend GlutApplication;
public:
/**
* @brief Key
*
* @see @ref key()
*/
enum class Key: UnsignedInt {
Esc = '\x1b', /**< Escape */
Up = GLUT_KEY_UP << 16, /**< Up arrow */
Down = GLUT_KEY_DOWN << 16, /**< Down arrow */
Left = GLUT_KEY_LEFT << 16, /**< Left arrow */
Right = GLUT_KEY_RIGHT << 16, /**< Right arrow */
F1 = GLUT_KEY_F1 << 16, /**< F1 */
F2 = GLUT_KEY_F2 << 16, /**< F2 */
F3 = GLUT_KEY_F3 << 16, /**< F3 */
F4 = GLUT_KEY_F4 << 16, /**< F4 */
F5 = GLUT_KEY_F5 << 16, /**< F5 */
F6 = GLUT_KEY_F6 << 16, /**< F6 */
F7 = GLUT_KEY_F7 << 16, /**< F7 */
F8 = GLUT_KEY_F8 << 16, /**< F8 */
F9 = GLUT_KEY_F9 << 16, /**< F9 */
F10 = GLUT_KEY_F10 << 16, /**< F10 */
F11 = GLUT_KEY_F11 << 16, /**< F11 */
F12 = GLUT_KEY_F12 << 16, /**< F12 */
Home = GLUT_KEY_HOME << 16, /**< Home */
End = GLUT_KEY_END << 16, /**< End */
PageUp = GLUT_KEY_PAGE_UP << 16, /**< Page up */
PageDown = GLUT_KEY_PAGE_DOWN << 16, /**< Page down */
Space = ' ', /**< Space */
Comma = ',', /**< Comma */
Period = '.', /**< Period */
Minus = '-', /**< Minus */
Plus = '+', /**< Plus */
Slash = '/', /**< Slash */
Percent = '%', /**< Percent */
Equal = '=', /**< Equal */
Zero = '0', /**< Zero */
One = '1', /**< One */
Two = '2', /**< Two */
Three = '3', /**< Three */
Four = '4', /**< Four */
Five = '5', /**< Five */
Six = '6', /**< Six */
Seven = '7', /**< Seven */
Eight = '8', /**< Eight */
Nine = '9', /**< Nine */
A = 'a', /**< Letter A */
B = 'b', /**< Letter B */
C = 'c', /**< Letter C */
D = 'd', /**< Letter D */
E = 'e', /**< Letter E */
F = 'f', /**< Letter F */
G = 'g', /**< Letter G */
H = 'h', /**< Letter H */
I = 'i', /**< Letter I */
J = 'j', /**< Letter J */
K = 'k', /**< Letter K */
L = 'l', /**< Letter L */
M = 'm', /**< Letter M */
N = 'n', /**< Letter N */
O = 'o', /**< Letter O */
P = 'p', /**< Letter P */
Q = 'q', /**< Letter Q */
R = 'r', /**< Letter R */
S = 's', /**< Letter S */
T = 't', /**< Letter T */
U = 'u', /**< Letter U */
V = 'v', /**< Letter V */
W = 'w', /**< Letter W */
X = 'x', /**< Letter X */
Y = 'y', /**< Letter Y */
Z = 'z' /**< Letter Z */
};
/** @brief Key */
Key key() const { return _key; }
/** @brief Position */
Vector2i position() const { return _position; }
private:
explicit KeyEvent(Key key, const Vector2i& position): _key(key), _position(position) {}
const Key _key;
const Vector2i _position;
};
/**
@brief Mouse event
@see @ref MouseMoveEvent, @ref mousePressEvent(), @ref mouseReleaseEvent()
*/
class GlutApplication::MouseEvent: public GlutApplication::InputEvent {
friend GlutApplication;
public:
/**
* @brief Mouse button
*
* @see @ref button()
*/
enum class Button: int {
Left = GLUT_LEFT_BUTTON, /**< Left button */
Middle = GLUT_MIDDLE_BUTTON, /**< Middle button */
Right = GLUT_RIGHT_BUTTON, /**< Right button */
WheelUp = 3, /**< Wheel up */
WheelDown = 4 /**< Wheel down */
};
/** @brief Button */
Button button() const { return _button; }
/** @brief Position */
Vector2i position() const { return _position; }
private:
explicit MouseEvent(Button button, const Vector2i& position): _button(button), _position(position) {}
const Button _button;
const Vector2i _position;
};
/**
@brief Mouse move event
@see @ref MouseEvent, @ref mouseMoveEvent()
*/
class GlutApplication::MouseMoveEvent: public GlutApplication::InputEvent {
friend GlutApplication;
public:
/**
* @brief Mouse button
*
* @see @ref Buttons, @ref buttons()
*/
enum class Button: UnsignedByte {
/**
* Any button. Note that GLUT doesn't differentiate between mouse
* buttons when firing the event.
*/
Left = 1
};
/**
* @brief Set of mouse buttons
*
* @see @ref buttons()
*/
typedef Containers::EnumSet<Button> Buttons;
/** @brief Position */
Vector2i position() const { return _position; }
/** @brief Mouse buttons */
Buttons buttons() const { return _buttons; }
private:
explicit MouseMoveEvent(const Vector2i& position, Buttons buttons): _position(position), _buttons(buttons) {}
const Vector2i _position;
const Buttons _buttons;
};
/** @hideinitializer
@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
information.
@code{.cpp}
int main(int argc, char** argv) {
className app({argc, argv});
return app.exec();
}
@endcode
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(); \
}
#ifndef DOXYGEN_GENERATING_OUTPUT
#ifndef MAGNUM_APPLICATION_MAIN
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;
#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_ENUMSET_OPERATORS(GlutApplication::MouseMoveEvent::Buttons)
CORRADE_IGNORE_DEPRECATED_POP
}}
#else
#error this header is available only in the OpenGL build
#endif
#endif

2
src/Magnum/Platform/Screen.h

@ -60,7 +60,7 @@ The following specialization are explicitly compiled into each particular
@ref ScreenedApplication.hpp implementation file to avoid linker errors. See @ref ScreenedApplication.hpp implementation file to avoid linker errors. See
@ref compilation-speedup-hpp for more information. @ref compilation-speedup-hpp for more information.
- @ref GlutApplication "BasicScreen<GlutApplication>" - @ref GlfwApplication "BasicScreen<GlfwApplication>"
- @ref GlxApplication "BasicScreen<GlxApplication>" - @ref GlxApplication "BasicScreen<GlxApplication>"
- @ref Sdl2Application "BasicScreen<Sdl2Application>" - @ref Sdl2Application "BasicScreen<Sdl2Application>"
- @ref XEglApplication "BasicScreen<XEglApplication>" - @ref XEglApplication "BasicScreen<XEglApplication>"

2
src/Magnum/Platform/ScreenedApplication.h

@ -91,7 +91,7 @@ The following specialization are explicitly compiled into each particular
@ref ScreenedApplication.hpp implementation file to avoid linker errors. See @ref ScreenedApplication.hpp implementation file to avoid linker errors. See
@ref compilation-speedup-hpp for more information. @ref compilation-speedup-hpp for more information.
- @ref GlutApplication "BasicScreenedApplication<GlutApplication>" - @ref GlfwApplication "BasicScreenedApplication<GlfwApplication>"
- @ref GlxApplication "BasicScreenedApplication<GlxApplication>" - @ref GlxApplication "BasicScreenedApplication<GlxApplication>"
- @ref Sdl2Application "BasicScreenedApplication<Sdl2Application>" - @ref Sdl2Application "BasicScreenedApplication<Sdl2Application>"
- @ref XEglApplication "BasicScreenedApplication<XEglApplication>" - @ref XEglApplication "BasicScreenedApplication<XEglApplication>"

6
src/Magnum/Platform/Test/CMakeLists.txt

@ -39,12 +39,6 @@ if(WITH_GLFWAPPLICATION)
set_target_properties(PlatformGlfwApplicationTest PROPERTIES FOLDER "Magnum/Platform/Test") set_target_properties(PlatformGlfwApplicationTest PROPERTIES FOLDER "Magnum/Platform/Test")
endif() endif()
if(WITH_GLUTAPPLICATION)
add_executable(PlatformGlutApplicationTest GlutApplicationTest.cpp)
target_link_libraries(PlatformGlutApplicationTest PRIVATE MagnumGlutApplication)
set_target_properties(PlatformGlutApplicationTest PROPERTIES FOLDER "Magnum/Platform/Test")
endif()
if(WITH_GLXAPPLICATION) if(WITH_GLXAPPLICATION)
add_executable(PlatformGlxApplicationTest GlxApplicationTest.cpp) add_executable(PlatformGlxApplicationTest GlxApplicationTest.cpp)
target_link_libraries(PlatformGlxApplicationTest PRIVATE MagnumGlxApplication) target_link_libraries(PlatformGlxApplicationTest PRIVATE MagnumGlxApplication)

41
src/Magnum/Platform/Test/GlutApplicationTest.cpp

@ -1,41 +0,0 @@
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
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.
*/
#define _MAGNUM_DO_NOT_WARN_DEPRECATED_GLUTAPPLICATION
#include "Magnum/Platform/GlutApplication.h"
CORRADE_IGNORE_DEPRECATED_PUSH
namespace Magnum { namespace Platform { namespace Test { namespace {
struct GlutApplicationTest: Platform::Application {
explicit GlutApplicationTest(const Arguments& arguments): Platform::Application{arguments} {}
void drawEvent() override {}
};
}}}}
MAGNUM_APPLICATION_MAIN(Magnum::Platform::Test::GlutApplicationTest)
CORRADE_IGNORE_DEPRECATED_POP
Loading…
Cancel
Save