From afd4ca73e706ef75c35a7023e3f9f81b1f45e519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 10 Dec 2015 11:13:26 +0100 Subject: [PATCH 001/258] CMake: enable MACOSX_RPATH by default. --- CMakeLists.txt | 5 +++++ package/ci/travis.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09f32734f..8f125a949 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,11 @@ cmake_minimum_required(VERSION 2.8.9) project(Magnum) +# CMake policies: enable MACOSX_RPATH by default +if(POLICY CMP0042) + cmake_policy(SET CMP0042 NEW) +endif() + # Find Corrade first so we can check on the target set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/modules/") find_package(Corrade REQUIRED) diff --git a/package/ci/travis.yml b/package/ci/travis.yml index 9e83485cb..46534f32f 100644 --- a/package/ci/travis.yml +++ b/package/ci/travis.yml @@ -44,7 +44,7 @@ install: - cd corrade - mkdir build - cd build -- cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/deps -DCMAKE_INSTALL_RPATH=$HOME/deps/lib -DCMAKE_MACOSX_RPATH=ON -DCMAKE_BUILD_TYPE=Release +- cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/deps -DCMAKE_INSTALL_RPATH=$HOME/deps/lib -DCMAKE_BUILD_TYPE=Release - cmake --build . - cmake --build . --target install - cd .. From fb8755b0c4f886e836f90a5935f968a64b806f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 10 Dec 2015 11:13:53 +0100 Subject: [PATCH 002/258] package/debian: don't enable the EglContext, it needs further dependencies. --- package/debian/rules | 1 - 1 file changed, 1 deletion(-) diff --git a/package/debian/rules b/package/debian/rules index 53e29e11f..2c7d6233b 100755 --- a/package/debian/rules +++ b/package/debian/rules @@ -9,7 +9,6 @@ override_dh_auto_configure: -DWITH_GLXAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ -DWITH_WINDOWLESSGLXAPPLICATION=ON \ - -DWITH_EGLCONTEXT=ON \ -DWITH_GLXCONTEXT=ON \ -DWITH_MAGNUMFONT=ON \ -DWITH_MAGNUMFONTCONVERTER=ON \ From a4f858ad9c819a14e72ddc6675486f47a278203d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 15 Dec 2015 18:17:49 +0100 Subject: [PATCH 003/258] Avoid "incomplete texture" GL errors in cube map test on Mesa. --- src/Magnum/Test/CubeMapTextureGLTest.cpp | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/Magnum/Test/CubeMapTextureGLTest.cpp b/src/Magnum/Test/CubeMapTextureGLTest.cpp index 7b66a7f8e..0827c80c8 100644 --- a/src/Magnum/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureGLTest.cpp @@ -717,6 +717,16 @@ void CubeMapTextureGLTest::subImage() { CubeMapTexture texture; texture.setImage(CubeMapTexture::Coordinate::PositiveX, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); + texture.setImage(CubeMapTexture::Coordinate::NegativeX, 0, TextureFormat::RGBA8, + ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); + texture.setImage(CubeMapTexture::Coordinate::PositiveY, 0, TextureFormat::RGBA8, + ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); + texture.setImage(CubeMapTexture::Coordinate::NegativeY, 0, TextureFormat::RGBA8, + ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); + texture.setImage(CubeMapTexture::Coordinate::PositiveZ, 0, TextureFormat::RGBA8, + ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); + texture.setImage(CubeMapTexture::Coordinate::NegativeZ, 0, TextureFormat::RGBA8, + ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); texture.setSubImage(CubeMapTexture::Coordinate::PositiveX, 0, Vector2i(1), ImageView2D{ _dataStorage, PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(2), unsafeSuffix(Data, _dataOffset)}); @@ -747,6 +757,16 @@ void CubeMapTextureGLTest::compressedSubImage() { CubeMapTexture texture; texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveX, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); + texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeX, 0, + CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); + texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveY, 0, + CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); + texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeY, 0, + CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); + texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveZ, 0, + CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); + texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeZ, 0, + CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); texture.setCompressedSubImage(CubeMapTexture::Coordinate::PositiveX, 0, Vector2i{4}, CompressedImageView2D{ #ifndef MAGNUM_TARGET_GLES _compressedDataStorage, @@ -772,6 +792,16 @@ void CubeMapTextureGLTest::subImageBuffer() { CubeMapTexture texture; texture.setImage(CubeMapTexture::Coordinate::PositiveX, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); + texture.setImage(CubeMapTexture::Coordinate::NegativeX, 0, TextureFormat::RGBA8, + ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); + texture.setImage(CubeMapTexture::Coordinate::PositiveY, 0, TextureFormat::RGBA8, + ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); + texture.setImage(CubeMapTexture::Coordinate::NegativeY, 0, TextureFormat::RGBA8, + ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); + texture.setImage(CubeMapTexture::Coordinate::PositiveZ, 0, TextureFormat::RGBA8, + ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); + texture.setImage(CubeMapTexture::Coordinate::NegativeZ, 0, TextureFormat::RGBA8, + ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); texture.setSubImage(CubeMapTexture::Coordinate::PositiveX, 0, Vector2i(1), BufferImage2D{ _dataStorage, PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(2), unsafeSuffix(Data, _dataOffset), BufferUsage::StaticDraw}); @@ -801,6 +831,16 @@ void CubeMapTextureGLTest::compressedSubImageBuffer() { CubeMapTexture texture; texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveX, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); + texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeX, 0, + CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); + texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveY, 0, + CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); + texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeY, 0, + CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); + texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveZ, 0, + CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); + texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeZ, 0, + CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); texture.setCompressedSubImage(CubeMapTexture::Coordinate::PositiveX, 0, Vector2i{4}, CompressedBufferImage2D{ #ifndef MAGNUM_TARGET_GLES _compressedDataStorage, From 3bbb67c3f9887369d28e153c6c2909b2d5ec3e05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 6 Dec 2015 16:32:47 +0100 Subject: [PATCH 004/258] Platform: leave Sdl2Application window positioning on the system. --- src/Magnum/Platform/Sdl2Application.cpp | 4 ++-- src/Magnum/Platform/Sdl2Application.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 1e7412964..98c9fcc9e 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -165,7 +165,7 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { /* Create window */ if(!(_window = SDL_CreateWindow(configuration.title().data(), - SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, + SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, configuration.size().x(), configuration.size().y(), SDL_WINDOW_OPENGL|windowFlags))) { @@ -211,7 +211,7 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, int(configuration.flags())); if(!(_window = SDL_CreateWindow(configuration.title().data(), - SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, + SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, configuration.size().x(), configuration.size().y(), SDL_WINDOW_OPENGL|windowFlags))) { diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index ffa7e9094..23965f6ca 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -534,8 +534,8 @@ CORRADE_ENUMSET_OPERATORS(Sdl2Application::Flags) /** @brief Configuration -The created window is always centered with double-buffered OpenGL context and -24bit depth buffer. +The created window is always with double-buffered OpenGL context and 24bit +depth buffer. @see @ref Sdl2Application(), @ref createContext(), @ref tryCreateContext() */ class Sdl2Application::Configuration { From 5bad5e8a9a9df16cd9fda08feb87b6033e6537aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 6 Dec 2015 16:34:11 +0100 Subject: [PATCH 005/258] Platform: Sdl2Application header cleanup. --- src/Magnum/Platform/Sdl2Application.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index 23965f6ca..a4dd01d3c 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -529,8 +529,6 @@ class Sdl2Application { Flags _flags; }; -CORRADE_ENUMSET_OPERATORS(Sdl2Application::Flags) - /** @brief Configuration @@ -754,11 +752,6 @@ class Sdl2Application::Configuration { #endif }; -#ifndef CORRADE_TARGET_EMSCRIPTEN -CORRADE_ENUMSET_OPERATORS(Sdl2Application::Configuration::Flags) -#endif -CORRADE_ENUMSET_OPERATORS(Sdl2Application::Configuration::WindowFlags) - /** @brief Base for input events @@ -1080,6 +1073,11 @@ typedef BasicScreenedApplication ScreenedApplication; #endif #endif +CORRADE_ENUMSET_OPERATORS(Sdl2Application::Flags) +#ifndef CORRADE_TARGET_EMSCRIPTEN +CORRADE_ENUMSET_OPERATORS(Sdl2Application::Configuration::Flags) +#endif +CORRADE_ENUMSET_OPERATORS(Sdl2Application::Configuration::WindowFlags) CORRADE_ENUMSET_OPERATORS(Sdl2Application::InputEvent::Modifiers) CORRADE_ENUMSET_OPERATORS(Sdl2Application::MouseMoveEvent::Buttons) From 16576552d24055804529c6f7a6b04518b781e0b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Dec 2015 11:33:57 +0100 Subject: [PATCH 006/258] Initialize GL object label size to 0 to prevent uninit mem access. On AMD drivers the debug output has to be explicitly enabled on context creation, otherwise all debug functions are no-op, thus causing the functions to read uninitialized memory. --- src/Magnum/AbstractObject.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magnum/AbstractObject.cpp b/src/Magnum/AbstractObject.cpp index a50bc0345..a9ff8c2f9 100644 --- a/src/Magnum/AbstractObject.cpp +++ b/src/Magnum/AbstractObject.cpp @@ -161,7 +161,7 @@ std::string AbstractObject::getLabelImplementationNoOp(GLenum, GLuint) { return std::string AbstractObject::getLabelImplementationKhr(const GLenum identifier, const GLuint name) { /* Get label size (w/o null terminator). Specifying 0 as size is not allowed, thus we pass the maximum instead. */ - GLsizei size; + GLsizei size = 0; #ifndef MAGNUM_TARGET_GLES glGetObjectLabel(identifier, name, maxLabelLength(), &size, nullptr); #elif !defined(CORRADE_TARGET_NACL) @@ -189,7 +189,7 @@ std::string AbstractObject::getLabelImplementationKhr(const GLenum identifier, c } std::string AbstractObject::getLabelImplementationExt(const GLenum identifier, const GLuint name) { - GLsizei size; + GLsizei size = 0; /* Get label size (w/o null terminator) */ #ifndef CORRADE_TARGET_NACL From c36573934fbce62d7737dbe8fb13f69851f835bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Dec 2015 11:52:22 +0100 Subject: [PATCH 007/258] Platform: ability to request debug context in windowless applications. Binary AMD drivers require the user to explicitly request the debug context on context initialization, otherwise all debug functions are no-op. This allows us to use debug functionality in command-line utils and, mainly, GL functionality tests. The Windows versions are coded without testing, so I hope I did not break something :) --- .../Platform/WindowlessGlxApplication.cpp | 13 ++++-- .../Platform/WindowlessGlxApplication.h | 38 ++++++++++++++++++ .../Platform/WindowlessWglApplication.cpp | 10 ++++- .../Platform/WindowlessWglApplication.h | 40 +++++++++++++++++++ .../WindowlessWindowsEglApplication.cpp | 6 +-- .../WindowlessWindowsEglApplication.h | 39 ++++++++++++++++++ 6 files changed, 137 insertions(+), 9 deletions(-) diff --git a/src/Magnum/Platform/WindowlessGlxApplication.cpp b/src/Magnum/Platform/WindowlessGlxApplication.cpp index ec2b64dc8..b821ed1a4 100644 --- a/src/Magnum/Platform/WindowlessGlxApplication.cpp +++ b/src/Magnum/Platform/WindowlessGlxApplication.cpp @@ -53,7 +53,7 @@ void WindowlessGlxApplication::createContext(const Configuration& configuration) if(!tryCreateContext(configuration)) std::exit(1); } -bool WindowlessGlxApplication::tryCreateContext(const Configuration&) { +bool WindowlessGlxApplication::tryCreateContext(const Configuration& configuration) { CORRADE_ASSERT(_context->version() == Version::None, "Platform::WindowlessGlxApplication::tryCreateContext(): context already created", false); _display = XOpenDisplay(nullptr); @@ -82,7 +82,7 @@ bool WindowlessGlxApplication::tryCreateContext(const Configuration&) { }; _pbuffer = glXCreatePbuffer(_display, configs[0], pbufferAttributes); - constexpr static const GLint contextAttributes[] = { + const GLint contextAttributes[] = { #ifdef MAGNUM_TARGET_GLES #ifdef MAGNUM_TARGET_GLES3 GLX_CONTEXT_MAJOR_VERSION_ARB, 3, @@ -99,7 +99,7 @@ bool WindowlessGlxApplication::tryCreateContext(const Configuration&) { GLX_CONTEXT_MAJOR_VERSION_ARB, 3, GLX_CONTEXT_MINOR_VERSION_ARB, 1, GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB, - GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB, + GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB|GLint(configuration.flags()), #endif 0 }; @@ -138,7 +138,12 @@ bool WindowlessGlxApplication::tryCreateContext(const Configuration&) { glXDestroyContext(_display, _glContext); } - _glContext = glXCreateContextAttribsARB(_display, configs[0], nullptr, True, nullptr); + const GLint fallbackContextAttributes[] = { + GLX_CONTEXT_FLAGS_ARB, GLint(configuration.flags()), + 0 + }; + + _glContext = glXCreateContextAttribsARB(_display, configs[0], nullptr, True, fallbackContextAttributes); } #endif diff --git a/src/Magnum/Platform/WindowlessGlxApplication.h b/src/Magnum/Platform/WindowlessGlxApplication.h index b052e95e3..d803bda5b 100644 --- a/src/Magnum/Platform/WindowlessGlxApplication.h +++ b/src/Magnum/Platform/WindowlessGlxApplication.h @@ -30,6 +30,7 @@ */ #include +#include #include "Magnum/OpenGL.h" #include @@ -176,7 +177,44 @@ class WindowlessGlxApplication { */ class WindowlessGlxApplication::Configuration { public: + /** + * @brief Context flag + * + * @see @ref Flags, @ref setFlags(), @ref Context::Flag + */ + enum class Flag: int { + Debug = GLX_CONTEXT_DEBUG_BIT_ARB /**< Create debug context */ + }; + + /** + * @brief Context flags + * + * @see @ref setFlags(), @ref Context::Flags + */ + #ifndef DOXYGEN_GENERATING_OUTPUT + typedef Containers::EnumSet Flags; + #else + typedef Containers::EnumSet Flags; + #endif + constexpr /*implicit*/ Configuration() {} + + /** @brief Context flags */ + Flags flags() const { return _flags; } + + /** + * @brief Set context flags + * @return Reference to self (for method chaining) + * + * Default is no flag. See also @ref Context::flags(). + */ + Configuration& setFlags(Flags flags) { + _flags = flags; + return *this; + } + + private: + Flags _flags; }; /** @hideinitializer diff --git a/src/Magnum/Platform/WindowlessWglApplication.cpp b/src/Magnum/Platform/WindowlessWglApplication.cpp index ef6c97798..6466607df 100644 --- a/src/Magnum/Platform/WindowlessWglApplication.cpp +++ b/src/Magnum/Platform/WindowlessWglApplication.cpp @@ -75,7 +75,7 @@ void WindowlessWglApplication::createContext(const Configuration& configuration) if(!tryCreateContext(configuration)) std::exit(1); } -bool WindowlessWglApplication::tryCreateContext(const Configuration&) { +bool WindowlessWglApplication::tryCreateContext(const Configuration& configuration) { CORRADE_ASSERT(_context->version() == Version::None, "Platform::WindowlessWglApplication::tryCreateContext(): context already created", false); /* Get device context */ @@ -104,8 +104,14 @@ bool WindowlessWglApplication::tryCreateContext(const Configuration&) { const int pixelFormat = ChoosePixelFormat(_deviceContext, &pfd); SetPixelFormat(_deviceContext, pixelFormat, &pfd); + const int attributes = { + WGL_CONTEXT_FLAGS_ARB, int(configuration.flags()), + 0 + }; + /* Create context and make it current */ - _renderingContext = wglCreateContext(_deviceContext); + const PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = reinterpret_cast( wglGetProcAddress(reinterpret_cast("glXCreateContextAttribsARB"))); + _renderingContext = wglCreateContextAttribsARB(_deviceContext, 0, attributes); if(!_renderingContext) { Error() << "Platform::WindowlessWglApplication::tryCreateContext(): cannot create context:" << GetLastError(); return false; diff --git a/src/Magnum/Platform/WindowlessWglApplication.h b/src/Magnum/Platform/WindowlessWglApplication.h index dcb3cff0e..b439f1caf 100644 --- a/src/Magnum/Platform/WindowlessWglApplication.h +++ b/src/Magnum/Platform/WindowlessWglApplication.h @@ -35,6 +35,7 @@ #define VC_EXTRALEAN #endif #include +#include #include "Magnum/Magnum.h" #include "Magnum/OpenGL.h" @@ -177,7 +178,46 @@ class WindowlessWglApplication { */ class WindowlessWglApplication::Configuration { public: + /** + * @brief Context flag + * + * @see @ref Flags, @ref setFlags(), @ref Context::Flag + */ + enum class Flag: int { + Debug = WGL_CONTEXT_DEBUG_BIT_ARB /**< Create debug context */ + }; + + /** + * @brief Context flags + * + * @see @ref setFlags(), @ref Context::Flags + */ + #ifndef DOXYGEN_GENERATING_OUTPUT + typedef Containers::EnumSet Flags; + #else + typedef Containers::EnumSet Flags; + #endif + #endif + constexpr /*implicit*/ Configuration() {} + ~Configuration(); + + /** @brief Context flags */ + Flags flags() const { return _flags; } + + /** + * @brief Set context flags + * @return Reference to self (for method chaining) + * + * Default is no flag. See also @ref Context::flags(). + */ + Configuration& setFlags(Flags flags) { + _flags = flags; + return *this; + } + + private: + Flags _flags; }; /** @hideinitializer diff --git a/src/Magnum/Platform/WindowlessWindowsEglApplication.cpp b/src/Magnum/Platform/WindowlessWindowsEglApplication.cpp index 0ab95c191..666fdaeb7 100644 --- a/src/Magnum/Platform/WindowlessWindowsEglApplication.cpp +++ b/src/Magnum/Platform/WindowlessWindowsEglApplication.cpp @@ -77,7 +77,7 @@ void WindowlessWindowsEglApplication::createContext(const Configuration& configu if(!tryCreateContext(configuration)) std::exit(1); } -bool WindowlessWindowsEglApplication::tryCreateContext(const Configuration&) { +bool WindowlessWindowsEglApplication::tryCreateContext(const Configuration& configuration) { CORRADE_ASSERT(_context->version() == Version::None, "Platform::WindowlessWindowsEglApplication::tryCreateContext(): context already created", false); /* Initialize */ @@ -127,7 +127,7 @@ bool WindowlessWindowsEglApplication::tryCreateContext(const Configuration&) { return false; } - static const EGLint attributes[] = { + const EGLint attributes[] = { #ifdef MAGNUM_TARGET_GLES EGL_CONTEXT_CLIENT_VERSION, #ifdef MAGNUM_TARGET_GLES3 @@ -138,7 +138,7 @@ bool WindowlessWindowsEglApplication::tryCreateContext(const Configuration&) { #error unsupported OpenGL ES version #endif #endif - + EGL_CONTEXT_FLAGS_KHR, EGLint(configuration.flags()), EGL_NONE }; diff --git a/src/Magnum/Platform/WindowlessWindowsEglApplication.h b/src/Magnum/Platform/WindowlessWindowsEglApplication.h index fb759b6a2..a5e3cd854 100644 --- a/src/Magnum/Platform/WindowlessWindowsEglApplication.h +++ b/src/Magnum/Platform/WindowlessWindowsEglApplication.h @@ -36,6 +36,8 @@ #endif #include #include +#include +#include #include "Magnum/Magnum.h" #include "Magnum/OpenGL.h" @@ -180,7 +182,44 @@ class WindowlessWindowsEglApplication { */ class WindowlessWindowsEglApplication::Configuration { public: + /** + * @brief Context flag + * + * @see @ref Flags, @ref setFlags(), @ref Context::Flag + */ + enum class Flag: int { + Debug = EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR /**< Create debug context */ + }; + + /** + * @brief Context flags + * + * @see @ref setFlags(), @ref Context::Flags + */ + #ifndef DOXYGEN_GENERATING_OUTPUT + typedef Containers::EnumSet Flags; + #else + typedef Containers::EnumSet Flags; + #endif + constexpr /*implicit*/ Configuration() {} + + /** @brief Context flags */ + Flags flags() const { return _flags; } + + /** + * @brief Set context flags + * @return Reference to self (for method chaining) + * + * Default is no flag. See also @ref Context::flags(). + */ + Configuration& setFlags(Flags flags) { + _flags = flags; + return *this; + } + + private: + Flags _flags; }; /** @hideinitializer From 4d67544fdaf902802791a2f6b6e96300af906195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Dec 2015 11:56:27 +0100 Subject: [PATCH 008/258] Try to explicitly enable debug output in GL tests. --- src/Magnum/Test/AbstractOpenGLTester.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Test/AbstractOpenGLTester.h b/src/Magnum/Test/AbstractOpenGLTester.h index 460306383..25d255280 100644 --- a/src/Magnum/Test/AbstractOpenGLTester.h +++ b/src/Magnum/Test/AbstractOpenGLTester.h @@ -57,12 +57,25 @@ class AbstractOpenGLTester: public TestSuite::Tester { private: struct WindowlessApplication: Platform::WindowlessApplication { - explicit WindowlessApplication(const Arguments& arguments): Platform::WindowlessApplication{arguments} {} + explicit WindowlessApplication(const Arguments& arguments): Platform::WindowlessApplication{arguments, nullptr} {} int exec() override final { return 0; } + + using Platform::WindowlessApplication::tryCreateContext; + using Platform::WindowlessApplication::createContext; + } _windowlessApplication; }; AbstractOpenGLTester::AbstractOpenGLTester(): _windowlessApplication{*_windowlessApplicationArguments} { + /* Try to create debug context, fallback to normal one if not possible. No + such thing on OSX. */ + #ifndef CORRADE_TARGET_APPLE + if(!_windowlessApplication.tryCreateContext(Platform::WindowlessApplication::Configuration{}.setFlags(Platform::WindowlessApplication::Configuration::Flag::Debug))) + _windowlessApplication.createContext(); + #else + _windowlessApplication.createContext(); + #endif + if(Context::current()->isExtensionSupported()) { Renderer::enable(Renderer::Feature::DebugOutput); Renderer::enable(Renderer::Feature::DebugOutputSynchronous); From cf89f5306d9828787403cf5e60c93ae20bf4d7e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Dec 2015 11:57:22 +0100 Subject: [PATCH 009/258] Platform: avoid using C-style casts. --- src/Magnum/Platform/WindowlessGlxApplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/Platform/WindowlessGlxApplication.cpp b/src/Magnum/Platform/WindowlessGlxApplication.cpp index b821ed1a4..2f34dee5b 100644 --- a/src/Magnum/Platform/WindowlessGlxApplication.cpp +++ b/src/Magnum/Platform/WindowlessGlxApplication.cpp @@ -104,7 +104,7 @@ bool WindowlessGlxApplication::tryCreateContext(const Configuration& configurati 0 }; - const PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC) glXGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB"); + const PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = reinterpret_cast(glXGetProcAddress(reinterpret_cast("glXCreateContextAttribsARB"))); _glContext = glXCreateContextAttribsARB(_display, configs[0], nullptr, True, contextAttributes); #ifndef MAGNUM_TARGET_GLES From ea65ff39fb7e1de0065b94693653e5ff263e0e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Dec 2015 11:57:59 +0100 Subject: [PATCH 010/258] Print an error if the user tries to disable unknown workaround. --- src/Magnum/Implementation/driverSpecific.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Implementation/driverSpecific.cpp b/src/Magnum/Implementation/driverSpecific.cpp index 3eadcbdf7..b95d15a3e 100644 --- a/src/Magnum/Implementation/driverSpecific.cpp +++ b/src/Magnum/Implementation/driverSpecific.cpp @@ -132,7 +132,10 @@ auto Context::detectedDriver() -> DetectedDrivers { void Context::disableDriverWorkaround(const std::string& workaround) { /* Ignore unknown workarounds */ - if(std::find(KnownWorkarounds.begin(), KnownWorkarounds.end(), workaround) == KnownWorkarounds.end()) return; + if(std::find(KnownWorkarounds.begin(), KnownWorkarounds.end(), workaround) == KnownWorkarounds.end()) { + Warning() << "Unknown workaround" << workaround; + return; + } _driverWorkarounds.emplace_back(workaround, true); } From 8dd4dfcf2b1daf6d7f27868e6831c4dbc23ff89e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Dec 2015 14:01:04 +0100 Subject: [PATCH 011/258] More vendor-specific XFAIL cases in Mesh GL test. --- src/Magnum/Test/MeshGLTest.cpp | 36 ++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/src/Magnum/Test/MeshGLTest.cpp b/src/Magnum/Test/MeshGLTest.cpp index 784b85124..b7e05e4b0 100644 --- a/src/Magnum/Test/MeshGLTest.cpp +++ b/src/Magnum/Test/MeshGLTest.cpp @@ -753,7 +753,10 @@ void MeshGLTest::addVertexBufferMatrixNxNd() { const Matrix3x3d data[] = { {}, Matrix3x3d::fromDiagonal({0.0, -0.9, 1.0}), - Matrix3x3d::fromDiagonal(Math::normalize(Math::Vector3(315, 65201, 2576))) + Matrix3x3d::fromVector(Math::normalize>(Math::Vector<9, UnsignedShort>{ + UnsignedShort(315), UnsignedShort( 10), UnsignedShort( 20), + UnsignedShort( 40), UnsignedShort(65201), UnsignedShort( 50), + UnsignedShort( 70), UnsignedShort( 80), UnsignedShort(2576)})) }; Buffer buffer; buffer.setData(data, BufferUsage::StaticDraw); @@ -773,9 +776,16 @@ void MeshGLTest::addVertexBufferMatrixNxNd() { { CORRADE_EXPECT_FAIL("Somehow only first two values are extracted"); CORRADE_COMPARE(value, Math::Vector3(315, 65201, 2576)); + } { + /* This is wrong, but check if it's still the right wrong */ + CORRADE_EXPECT_FAIL_IF(!!(Context::current()->detectedDriver() & Context::DetectedDriver::AMD), + "AMD cards take value[2][2] instead of value[1][1]."); + CORRADE_COMPARE(value, Math::Vector3(315, 65201, 0)); } - /* This is wrong, but check if it's still the right wrong */ - CORRADE_COMPARE(value, Math::Vector3(315, 65201, 0)); + + /* Also check that AMD is consistently wrong */ + if(Context::current()->detectedDriver() & Context::DetectedDriver::AMD) + CORRADE_COMPARE(value, Math::Vector3(315, 80, 0)); } #endif @@ -816,7 +826,10 @@ void MeshGLTest::addVertexBufferMatrixMxNd() { const Matrix3x4d data[] = { {}, Matrix3x4d::fromDiagonal({0.0f, -0.9f, 1.0f}), - Matrix3x4d::fromDiagonal(Math::normalize(Math::Vector3(315, 65201, 2576))) + Matrix3x4d::fromVector(Math::normalize>(Math::Vector<12, UnsignedShort>{ + UnsignedShort(315), UnsignedShort( 10), UnsignedShort( 20), UnsignedShort(30), + UnsignedShort( 40), UnsignedShort(65201), UnsignedShort( 50), UnsignedShort(60), + UnsignedShort( 70), UnsignedShort( 80), UnsignedShort(2576), UnsignedShort(90)})) }; Buffer buffer; buffer.setData(data, BufferUsage::StaticDraw); @@ -829,16 +842,23 @@ void MeshGLTest::addVertexBufferMatrixMxNd() { const auto value = Checker(DoubleShader("dmat3x4", "vec4", "vec4(value[0][0], value[1][1], value[2][2], 0.0)"), - RenderbufferFormat::RGBA16, mesh).get>(PixelFormat::RGB, PixelType::UnsignedShort); + RenderbufferFormat::RGBA16, mesh).get>(PixelFormat::RGBA, PixelType::UnsignedShort); MAGNUM_VERIFY_NO_ERROR(); { - CORRADE_EXPECT_FAIL("Somehow only first two values are extracted"); + CORRADE_EXPECT_FAIL("Somehow only first two values are extracted."); CORRADE_COMPARE(value, Math::Vector3(315, 65201, 2576)); + } { + /* This is wrong, but check if it's still the right wrong */ + CORRADE_EXPECT_FAIL_IF(!!(Context::current()->detectedDriver() & Context::DetectedDriver::AMD), + "AMD cards take value[2][2] instead of value[1][1]."); + CORRADE_COMPARE(value, Math::Vector3(315, 65201, 0)); } - /* This is wrong, but check if it's still the right wrong */ - CORRADE_COMPARE(value, Math::Vector3(315, 65201, 0)); + + /* Also check that AMD is consistently wrong */ + if(Context::current()->detectedDriver() & Context::DetectedDriver::AMD) + CORRADE_COMPARE(value, Math::Vector3(315, 80, 0)); } #endif From 503a6b2dc50986262a2a6b04e7fc033c4075198f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Dec 2015 14:01:36 +0100 Subject: [PATCH 012/258] Fix AMD complaints about misaligned data in Mesh GL test. --- src/Magnum/Test/MeshGLTest.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Magnum/Test/MeshGLTest.cpp b/src/Magnum/Test/MeshGLTest.cpp index b7e05e4b0..e5240881c 100644 --- a/src/Magnum/Test/MeshGLTest.cpp +++ b/src/Magnum/Test/MeshGLTest.cpp @@ -871,13 +871,13 @@ void MeshGLTest::addVertexBufferUnsignedIntWithUnsignedShort() { typedef Attribute<0, UnsignedInt> Attribute; - constexpr UnsignedShort data[] = { 0, 49563, 16583 }; + constexpr UnsignedShort data[] = { 0, 49563, 2128, 3821, 16583 }; Buffer buffer; buffer.setData(data, BufferUsage::StaticDraw); Mesh mesh; mesh.setBaseVertex(1) - .addVertexBuffer(buffer, 2, Attribute(Attribute::DataType::UnsignedShort)); + .addVertexBuffer(buffer, 2, 2, Attribute(Attribute::DataType::UnsignedShort)); MAGNUM_VERIFY_NO_ERROR(); @@ -896,13 +896,13 @@ void MeshGLTest::addVertexBufferUnsignedIntWithShort() { typedef Attribute<0, UnsignedInt> Attribute; - constexpr Short data[] = { 0, 24563, 16583 }; + constexpr Short data[] = { 0, 24563, 2128, 3821, 16583 }; Buffer buffer; buffer.setData(data, BufferUsage::StaticDraw); Mesh mesh; mesh.setBaseVertex(1) - .addVertexBuffer(buffer, 2, Attribute(Attribute::DataType::Short)); + .addVertexBuffer(buffer, 2, 2, Attribute(Attribute::DataType::Short)); MAGNUM_VERIFY_NO_ERROR(); @@ -921,13 +921,13 @@ void MeshGLTest::addVertexBufferIntWithUnsignedShort() { typedef Attribute<0, Int> Attribute; - constexpr UnsignedShort data[] = { 0, 49563, 16583 }; + constexpr UnsignedShort data[] = { 0, 49563, 2128, 3821, 16583 }; Buffer buffer; buffer.setData(data, BufferUsage::StaticDraw); Mesh mesh; mesh.setBaseVertex(1) - .addVertexBuffer(buffer, 2, Attribute(Attribute::DataType::UnsignedShort)); + .addVertexBuffer(buffer, 2, 2, Attribute(Attribute::DataType::UnsignedShort)); MAGNUM_VERIFY_NO_ERROR(); @@ -946,13 +946,13 @@ void MeshGLTest::addVertexBufferIntWithShort() { typedef Attribute<0, Int> Attribute; - constexpr Short data[] = { 0, 24563, -16583 }; + constexpr Short data[] = { 0, 24563, 2128, 3821, -16583 }; Buffer buffer; buffer.setData(data, BufferUsage::StaticDraw); Mesh mesh; mesh.setBaseVertex(1) - .addVertexBuffer(buffer, 2, Attribute(Attribute::DataType::Short)); + .addVertexBuffer(buffer, 2, 2, Attribute(Attribute::DataType::Short)); MAGNUM_VERIFY_NO_ERROR(); @@ -1098,13 +1098,13 @@ void MeshGLTest::addVertexBufferLessVectorComponents() { void MeshGLTest::addVertexBufferNormalized() { typedef Attribute<0, Vector3> Attribute; - constexpr Color3ub data[] = { {}, {0, 128, 64}, {32, 156, 228} }; + constexpr Color4ub data[] = { {}, {0, 128, 64}, {32, 156, 228} }; Buffer buffer; buffer.setData(data, BufferUsage::StaticDraw); Mesh mesh; mesh.setBaseVertex(1) - .addVertexBuffer(buffer, 3, Attribute(Attribute::DataType::UnsignedByte, Attribute::DataOption::Normalized)); + .addVertexBuffer(buffer, 4, Attribute(Attribute::DataType::UnsignedByte, Attribute::DataOption::Normalized), 1); MAGNUM_VERIFY_NO_ERROR(); From 9e4a86cc7c3b6d802a7e1ae8e6a2108b40d28448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Dec 2015 16:50:18 +0100 Subject: [PATCH 013/258] Ability to disable OpenGL extensions from command-line. Added `--magnum-disable-extensions` option next to the already existing `--magnum-disable-workarounds`. Specified extensions are not used automatically and also report as disabled and unsupported when asked using Context::isExtensionSupported() and Context::isExtensionDisabled(). --- src/Magnum/Context.cpp | 28 ++++++++++++++++++++++++++++ src/Magnum/Context.h | 4 +++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index 88460ddac..66e27f928 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/Context.cpp @@ -408,11 +408,16 @@ Context::Context(NoCreateT, Int argc, char** argv, void functionLoader()): _func Utility::Arguments args{"magnum"}; args.addOption("disable-workarounds").setHelpKey("disable-workarounds", "LIST") .setHelp("disable-workarounds", "driver workarounds to disable\n (see src/Magnum/Implementation/driverSpecific.cpp for detailed info)") + .addOption("disable-extensions").setHelpKey("disable-extensions", "LIST").setHelp("disable-extensions", "OpenGL extensions to disable") .parse(argc, argv); /* Disable driver workarounds */ for(auto&& workaround: Utility::String::splitWithoutEmptyParts(args.value("disable-workarounds"))) disableDriverWorkaround(workaround); + + /* Disable extensions */ + for(auto&& extension: Utility::String::splitWithoutEmptyParts(args.value("disable-extensions"))) + _disabledExtensions.push_back(extension); } Context::Context(Context&& other): _version{std::move(other._version)}, @@ -623,6 +628,29 @@ bool Context::tryCreate() { more info) */ Debug() << "Renderer:" << rendererString() << "by" << vendorString(); Debug() << "OpenGL version:" << versionString(); + + /* Disable extensions as requested by the user */ + if(!_disabledExtensions.empty()) { + Debug() << "Disabling extensions:"; + + /* Put remaining extensions into the hashmap for faster lookup */ + std::unordered_map allExtensions{std::move(futureExtensions)}; + for(std::size_t i = 0; i != future; ++i) + for(const Extension& extension: Extension::extensions(versions[i])) + allExtensions.emplace(extension._string, extension); + + /* Disable extensions that are known and supported and print a message + for each */ + for(auto&& extension: _disabledExtensions) { + auto found = allExtensions.find(extension); + /** @todo Error message here? I should not clutter the output at this point */ + if(found == allExtensions.end()) continue; + + _extensionRequiredVersion[found->second._index] = Version::None; + Debug() << " " << extension; + } + } + _state = new Implementation::State(*this); /* Print a list of used workarounds */ diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index 4a3e5368e..ec948646d 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -100,7 +100,7 @@ class. The options are as following: ``` Usage: - [--magnum-help] [--magnum-disable-workarounds LIST] ... + [--magnum-help] [--magnum-disable-workarounds LIST] [--magnum-disable-extensions LIST] ... Arguments: ... main application arguments @@ -108,6 +108,7 @@ Arguments: --magnum-help display this help message and exit --magnum-disable-workarounds LIST driver workarounds to disable (see src/Magnum/Implementation/driverSpecific.cpp for detailed info) + --magnum-disable-extensions LIST OpenGL extensions to disable ``` */ class MAGNUM_EXPORT Context { @@ -508,6 +509,7 @@ class MAGNUM_EXPORT Context { /* True means known and disabled, false means known */ std::vector> _driverWorkarounds; + std::vector _disabledExtensions; }; #ifndef MAGNUM_TARGET_WEBGL From eb871ccce2b902a6a66d1c2f879b3e384daf7288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Dec 2015 16:53:22 +0100 Subject: [PATCH 014/258] Don't display "Using driver workarounds" when there aren't any. --- src/Magnum/Context.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index 66e27f928..5ff3ff755 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/Context.cpp @@ -654,9 +654,11 @@ bool Context::tryCreate() { _state = new Implementation::State(*this); /* Print a list of used workarounds */ - Debug() << "Using driver workarounds:"; - for(const auto& workaround: _driverWorkarounds) - if(!workaround.second) Debug() << " " << workaround.first; + if(!_driverWorkarounds.empty()) { + Debug() << "Using driver workarounds:"; + for(const auto& workaround: _driverWorkarounds) + if(!workaround.second) Debug() << " " << workaround.first; + } /* Initialize functionality based on current OpenGL version and extensions */ /** @todo Get rid of these */ From d648d291009b0679b7d5fbff2f67408d179d4460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Dec 2015 17:17:01 +0100 Subject: [PATCH 015/258] Platform: superfluous endif. --- src/Magnum/Platform/WindowlessWglApplication.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Magnum/Platform/WindowlessWglApplication.h b/src/Magnum/Platform/WindowlessWglApplication.h index b439f1caf..544879ed6 100644 --- a/src/Magnum/Platform/WindowlessWglApplication.h +++ b/src/Magnum/Platform/WindowlessWglApplication.h @@ -197,7 +197,6 @@ class WindowlessWglApplication::Configuration { #else typedef Containers::EnumSet Flags; #endif - #endif constexpr /*implicit*/ Configuration() {} ~Configuration(); From 5a7460f570b818d643c05a04edbbba255779e797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Dec 2015 17:18:10 +0100 Subject: [PATCH 016/258] Platform: added `--short` option to magnum-info. Also updated the documentation. --- src/Magnum/Platform/magnum-info.cpp | 92 +++++++++++++++-------------- 1 file changed, 48 insertions(+), 44 deletions(-) diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index 13fd977a5..04063e78e 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -79,53 +79,53 @@ namespace Magnum { @section magnum-info-usage Usage - magnum-info [-h|--help] [--all-extensions] [--limits] + magnum-info [--magnum-...] [-h|--help] [-s|--short] [--all-extensions] [--limits] Arguments: - -- ` -h`, `--help` -- display this help message and exit -- `--all-extensions` -- show extensions also for fully supported versions +- `-h`, `--help` -- display this help message and exit +- `-s`, `--short` -- display just essential info and exit +- `--all-extensions` -- display extensions also for fully supported versions - `--limits` -- display also limits and implementation-defined values +- `--magnum-...` -- engine-specific options (see @ref Context for details) @section magnum-info-example Example output - +---------------------------------------------------------+ - | Information about Magnum engine and OpenGL capabilities | - +---------------------------------------------------------+ - - Used application: Platform::WindowlessGlxApplication - Compilation flags: - CORRADE_BUILD_DEPRECATED - MAGNUM_BUILD_DEPRECATED - - Vendor: NVIDIA Corporation - Renderer: GeForce GT 740M/PCIe/SSE2 - OpenGL version: OpenGL 4.4 (4.4.0 NVIDIA 337.25) - Context flags: - Supported GLSL versions: - 440 core - 430 core - 420 core - 410 core - 400 core - 330 core - 310 es - 300 es - 100 - - Vendor extension support: - GL_AMD_vertex_shader_layer - - GL_AMD_shader_trinary_minmax - - GL_ARB_robustness SUPPORTED - GL_ATI_texture_mirror_once SUPPORTED - GL_EXT_texture_filter_anisotropic SUPPORTED - GL_EXT_texture_mirror_clamp SUPPORTED - GL_EXT_direct_state_access SUPPORTED - GL_EXT_texture_sRGB_decode SUPPORTED - GL_EXT_shader_integer_mix SUPPORTED - GL_EXT_debug_label - - GL_EXT_debug_marker - - GL_GREMEDY_string_marker - +``` + +---------------------------------------------------------+ + | Information about Magnum engine and OpenGL capabilities | + +---------------------------------------------------------+ + +Used application: Platform::WindowlessGlxApplication +Compilation flags: + CORRADE_BUILD_DEPRECATED + CORRADE_TARGET_UNIX + MAGNUM_BUILD_DEPRECATED + +Renderer: AMD Radeon R7 M260 Series by ATI Technologies Inc. +OpenGL version: 4.5.13399 Compatibility Profile Context 15.201.1151 +Using optional features: + GL_ARB_ES2_compatibility + GL_ARB_direct_state_access + GL_ARB_get_texture_sub_image + GL_ARB_invalidate_subdata + ... +Using driver workarounds: + amd-nv-no-forward-compatible-core-context + no-layout-qualifiers-on-old-glsl +Context flags: +Supported GLSL versions: + 430 core + 430 compatibility + 420 core + ... + +Vendor extension support: + GL_AMD_vertex_shader_layer SUPPORTED + GL_AMD_shader_trinary_minmax SUPPORTED + GL_ARB_robustness - + GL_ARB_robustness_isolation - + ... +``` */ @@ -138,11 +138,13 @@ class MagnumInfo: public Platform::WindowlessApplication { MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplication(arguments, nullptr) { Utility::Arguments args; - args.addBooleanOption("all-extensions") - .setHelp("all-extensions", "show extensions also for fully supported versions") + args.addBooleanOption('s', "short") + .setHelp("short", "display just essential info and exit") + .addBooleanOption("all-extensions") + .setHelp("all-extensions", "display extensions also for fully supported versions") .addBooleanOption("limits") - .addSkippedPrefix("magnum", "engine-specific options") .setHelp("limits", "display also limits and implementation-defined values") + .addSkippedPrefix("magnum", "engine-specific options") .setHelp("Displays information about Magnum engine and OpenGL capabilities."); /** @@ -249,6 +251,8 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat for(const auto& version: shadingLanguageVersions) Debug() << " " << version; + if(args.isSet("short")) return; + Debug() << ""; /* Get first future (not supported) version */ From 9a73b32397b762a0f923d31d3e4f74d460f4f3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Dec 2015 17:18:43 +0100 Subject: [PATCH 017/258] Better formatting for the Context command-line arguments. --- src/Magnum/Context.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index ec948646d..3522be233 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -96,20 +96,18 @@ information. The context is configurable through command-line options, that are passed either from the `Platform::*Application` classes or from the @ref Platform::Context -class. The options are as following: +class. Usage: -``` -Usage: - [--magnum-help] [--magnum-disable-workarounds LIST] [--magnum-disable-extensions LIST] ... + [--magnum-help] [--magnum-disable-workarounds LIST] [--magnum-disable-extensions LIST] ... Arguments: - ... main application arguments - (see -h or --help for details) - --magnum-help display this help message and exit - --magnum-disable-workarounds LIST driver workarounds to disable - (see src/Magnum/Implementation/driverSpecific.cpp for detailed info) - --magnum-disable-extensions LIST OpenGL extensions to disable -``` + +- `...` -- main application arguments (see `-h` or `--help` for details) +- `--magnum-help` -- display this help message and exit +- `--magnum-disable-workarounds LIST` -- driver workarounds to disable (see + `src/Magnum/Implementation/driverSpecific.cpp` for detailed info) +- `--magnum-disable-extensions LIST` -- OpenGL extensions to disable + */ class MAGNUM_EXPORT Context { friend Platform::Context; From 6e8c16c9600fd23c5e5f89f55f609da3a94a116c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Dec 2015 22:07:59 +0100 Subject: [PATCH 018/258] MSVC 2015 Update 1: fixed nearly all constexpr bugs. --- src/Magnum/Array.h | 6 +--- src/Magnum/ImageView.h | 19 ++---------- src/Magnum/Math/BoolVector.h | 7 +---- src/Magnum/Math/Complex.h | 7 +---- src/Magnum/Math/DualComplex.h | 7 +---- src/Magnum/Math/DualQuaternion.h | 7 +---- src/Magnum/Math/Matrix.h | 9 +----- src/Magnum/Math/Matrix3.h | 20 ++----------- src/Magnum/Math/Matrix4.h | 22 ++------------ src/Magnum/Math/Quaternion.h | 7 +---- src/Magnum/Math/Range.h | 7 +---- src/Magnum/Math/RectangularMatrix.h | 26 ++--------------- src/Magnum/Math/Test/BoolVectorTest.cpp | 12 ++------ src/Magnum/Math/Test/ComplexTest.cpp | 11 ++----- src/Magnum/Math/Test/DualComplexTest.cpp | 11 ++----- src/Magnum/Math/Test/DualQuaternionTest.cpp | 11 ++----- src/Magnum/Math/Test/MatrixTest.cpp | 29 ++++--------------- src/Magnum/Math/Test/QuaternionTest.cpp | 11 ++----- src/Magnum/Math/Test/RangeTest.cpp | 29 +++++-------------- .../Math/Test/RectangularMatrixTest.cpp | 29 ++++--------------- src/Magnum/Math/Test/Vector2Test.cpp | 5 +--- src/Magnum/Math/Test/Vector3Test.cpp | 5 +--- src/Magnum/Math/Test/Vector4Test.cpp | 5 +--- src/Magnum/Math/Test/VectorTest.cpp | 23 ++++----------- src/Magnum/Math/Vector.h | 28 ++---------------- src/Magnum/Math/Vector2.h | 18 ++---------- src/Magnum/Math/Vector3.h | 18 ++---------- src/Magnum/Math/Vector4.h | 18 ++---------- src/Magnum/Test/ArrayTest.cpp | 6 +--- 29 files changed, 70 insertions(+), 343 deletions(-) diff --git a/src/Magnum/Array.h b/src/Magnum/Array.h index 0532958fc..0644bebef 100644 --- a/src/Magnum/Array.h +++ b/src/Magnum/Array.h @@ -77,11 +77,7 @@ template class Array { constexpr /*implicit*/ Array(T value); #else template::value && dimensions != 1, T>::type> - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - /*implicit*/ Array(U value): Array(typename Math::Implementation::GenerateSequence::Type(), value) {} + constexpr /*implicit*/ Array(U value): Array(typename Math::Implementation::GenerateSequence::Type(), value) {} #endif /** @brief Equality */ diff --git a/src/Magnum/ImageView.h b/src/Magnum/ImageView.h index 6290e6a44..8eebe93d6 100644 --- a/src/Magnum/ImageView.h +++ b/src/Magnum/ImageView.h @@ -108,11 +108,7 @@ template class ImageView { /** @overload * Similar to the above, but uses default @ref PixelStorage parameters. */ - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - explicit ImageView(PixelFormat format, PixelType type, const VectorTypeFor& size) noexcept: ImageView{{}, format, type, size} {} + constexpr explicit ImageView(PixelFormat format, PixelType type, const VectorTypeFor& size) noexcept: ImageView{{}, format, type, size} {} /** @brief Storage of pixel data */ PixelStorage storage() const { return _storage; } @@ -241,11 +237,7 @@ template class CompressedImageView { * Similar the above, but uses default @ref CompressedPixelStorage * parameters (or the hardcoded ones in OpenGL ES and WebGL). */ - #if !defined(CORRADE_MSVC2015_COMPATIBILITY) || defined(MAGNUM_TARGET_GLES) - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - explicit CompressedImageView(CompressedPixelFormat format, const VectorTypeFor& size, Containers::ArrayView data) noexcept; + constexpr explicit CompressedImageView(CompressedPixelFormat format, const VectorTypeFor& size, Containers::ArrayView data) noexcept; #ifndef MAGNUM_TARGET_GLES /** @@ -364,12 +356,7 @@ template constexpr CompressedImageView::Comp _format{format}, _size{size} {} #ifndef MAGNUM_TARGET_GLES -template -#ifndef CORRADE_MSVC2015_COMPATIBILITY -/* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ -constexpr -#endif -CompressedImageView::CompressedImageView(const CompressedPixelFormat format, const VectorTypeFor& size, const Containers::ArrayView data) noexcept: CompressedImageView{{}, format, size, data} {} +template constexpr CompressedImageView::CompressedImageView(const CompressedPixelFormat format, const VectorTypeFor& size, const Containers::ArrayView data) noexcept: CompressedImageView{{}, format, size, data} {} template constexpr CompressedImageView::CompressedImageView(const CompressedPixelFormat format, const VectorTypeFor& size) noexcept: CompressedImageView{{}, format, size} {} #endif diff --git a/src/Magnum/Math/BoolVector.h b/src/Magnum/Math/BoolVector.h index 8641abad1..5b509a72c 100644 --- a/src/Magnum/Math/BoolVector.h +++ b/src/Magnum/Math/BoolVector.h @@ -93,12 +93,7 @@ template class BoolVector { #ifdef DOXYGEN_GENERATING_OUTPUT inline explicit BoolVector(T value); #else - template::value && size != 1, bool>::type> - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - explicit BoolVector(T value): BoolVector(typename Implementation::GenerateSequence::Type(), value ? FullSegmentMask : 0) {} + template::value && size != 1, bool>::type> constexpr explicit BoolVector(T value): BoolVector(typename Implementation::GenerateSequence::Type(), value ? FullSegmentMask : 0) {} #endif /** @brief Copy constructor */ diff --git a/src/Magnum/Math/Complex.h b/src/Magnum/Math/Complex.h index 0100b4682..b8ac7987a 100644 --- a/src/Magnum/Math/Complex.h +++ b/src/Magnum/Math/Complex.h @@ -178,12 +178,7 @@ template class Complex { template constexpr explicit Complex(const Complex& other): _real{T(other._real)}, _imaginary{T(other._imaginary)} {} /** @brief Construct complex number from external representation */ - template::from(std::declval()))> - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - explicit Complex(const U& other): Complex{Implementation::ComplexConverter::from(other)} {} + template::from(std::declval()))> constexpr explicit Complex(const U& other): Complex{Implementation::ComplexConverter::from(other)} {} /** @brief Convert complex number to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { diff --git a/src/Magnum/Math/DualComplex.h b/src/Magnum/Math/DualComplex.h index 07c888e7b..415f28b63 100644 --- a/src/Magnum/Math/DualComplex.h +++ b/src/Magnum/Math/DualComplex.h @@ -163,12 +163,7 @@ template class DualComplex: public Dual> { {} /** @brief Construct dual complex number from external representation */ - template::from(std::declval()))> - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - explicit DualComplex(const U& other): DualComplex{Implementation::DualComplexConverter::from(other)} {} + template::from(std::declval()))> constexpr explicit DualComplex(const U& other): DualComplex{Implementation::DualComplexConverter::from(other)} {} /** @brief Copy constructor */ constexpr DualComplex(const Dual>& other): Dual>(other) {} diff --git a/src/Magnum/Math/DualQuaternion.h b/src/Magnum/Math/DualQuaternion.h index 6d998eb41..b20944114 100644 --- a/src/Magnum/Math/DualQuaternion.h +++ b/src/Magnum/Math/DualQuaternion.h @@ -234,12 +234,7 @@ template class DualQuaternion: public Dual> { template constexpr explicit DualQuaternion(const DualQuaternion& other): Dual>(other) {} /** @brief Construct dual quaternion from external representation */ - template::from(std::declval()))> - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - explicit DualQuaternion(const U& other): DualQuaternion{Implementation::DualQuaternionConverter::from(other)} {} + template::from(std::declval()))> constexpr explicit DualQuaternion(const U& other): DualQuaternion{Implementation::DualQuaternionConverter::from(other)} {} /** @brief Copy constructor */ constexpr DualQuaternion(const Dual>& other): Dual>(other) {} diff --git a/src/Magnum/Math/Matrix.h b/src/Magnum/Math/Matrix.h index 7013f9096..0394dc684 100644 --- a/src/Magnum/Math/Matrix.h +++ b/src/Magnum/Math/Matrix.h @@ -132,14 +132,7 @@ template class Matrix: public RectangularMatrix constexpr explicit Matrix(const RectangularMatrix& other): - #ifndef CORRADE_MSVC2015_COMPATIBILITY - RectangularMatrix(other) - #else - /* Avoid using non-constexpr version */ - RectangularMatrix(typename Implementation::GenerateSequence::Type(), other) - #endif - {} + template constexpr explicit Matrix(const RectangularMatrix& other): RectangularMatrix(other) {} /** @brief Construct matrix from external representation */ template::from(std::declval()))> constexpr explicit Matrix(const U& other): RectangularMatrix(Implementation::RectangularMatrixConverter::from(other)) {} diff --git a/src/Magnum/Math/Matrix3.h b/src/Magnum/Math/Matrix3.h index f4702db42..81fcc91b8 100644 --- a/src/Magnum/Math/Matrix3.h +++ b/src/Magnum/Math/Matrix3.h @@ -162,15 +162,8 @@ template class Matrix3: public Matrix3x3 { constexpr /*implicit*/ Matrix3(IdentityInitT = IdentityInit, T value = T{1}) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - #ifndef CORRADE_MSVC2015_COMPATIBILITY - : Matrix3x3{IdentityInit, value} - #else - /* Avoid using non-constexpr version, also MSVC 2015 can't handle - {} here */ - : Matrix3x3(Vector<3, T>{value, T(0), T(0)}, - Vector<3, T>{T(0), value, T(0)}, - Vector<3, T>{T(0), T(0), value}) - #endif + /* MSVC 2015 can't handle {} here */ + : Matrix3x3(IdentityInit, value) #endif {} @@ -178,15 +171,8 @@ template class Matrix3: public Matrix3x3 { constexpr explicit Matrix3(ZeroInitT) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - #ifndef CORRADE_MSVC2015_COMPATIBILITY + /* MSVC 2015 can't handle {} here */ : Matrix3x3(ZeroInit) - #else - /* Avoid using non-constexpr version, also MSVC 2015 can't handle - {} here */ - : Matrix3x3(Vector<3, T>{T(0), T(0), T(0)}, - Vector<3, T>{T(0), T(0), T(0)}, - Vector<3, T>{T(0), T(0), T(0)}) - #endif #endif {} diff --git a/src/Magnum/Math/Matrix4.h b/src/Magnum/Math/Matrix4.h index 1a209460a..f06289805 100644 --- a/src/Magnum/Math/Matrix4.h +++ b/src/Magnum/Math/Matrix4.h @@ -258,16 +258,8 @@ template class Matrix4: public Matrix4x4 { constexpr /*implicit*/ Matrix4(IdentityInitT = IdentityInit, T value = T{1}) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - #ifndef CORRADE_MSVC2015_COMPATIBILITY - : Matrix4x4{IdentityInit, value} - #else - /* Avoid using non-constexpr version, also MSVC 2015 can't handle - {} here */ - : Matrix4x4(Vector<4, T>{value, T(0), T(0), T(0)}, - Vector<4, T>{T(0), value, T(0), T(0)}, - Vector<4, T>{T(0), T(0), value, T(0)}, - Vector<4, T>{T(0), T(0), T(0), value}) - #endif + /* MSVC 2015 can't handle {} here */ + : Matrix4x4(IdentityInit, value) #endif {} @@ -275,16 +267,8 @@ template class Matrix4: public Matrix4x4 { constexpr explicit Matrix4(ZeroInitT) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - #ifndef CORRADE_MSVC2015_COMPATIBILITY + /* MSVC 2015 can't handle {} here */ : Matrix4x4(ZeroInit) - #else - /* Avoid using non-constexpr version, also MSVC 2015 can't handle - {} here */ - : Matrix4x4(Vector<4, T>{T(0), T(0), T(0), T(0)}, - Vector<4, T>{T(0), T(0), T(0), T(0)}, - Vector<4, T>{T(0), T(0), T(0), T(0)}, - Vector<4, T>{T(0), T(0), T(0), T(0)}) - #endif #endif {} diff --git a/src/Magnum/Math/Quaternion.h b/src/Magnum/Math/Quaternion.h index f0c0f31c0..5a1d62a09 100644 --- a/src/Magnum/Math/Quaternion.h +++ b/src/Magnum/Math/Quaternion.h @@ -241,12 +241,7 @@ template class Quaternion { template constexpr explicit Quaternion(const Quaternion& other): _vector{other._vector}, _scalar{T(other._scalar)} {} /** @brief Construct quaternion from external representation */ - template::from(std::declval()))> - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - explicit Quaternion(const U& other): Quaternion{Implementation::QuaternionConverter::from(other)} {} + template::from(std::declval()))> constexpr explicit Quaternion(const U& other): Quaternion{Implementation::QuaternionConverter::from(other)} {} /** @brief Convert quaternion to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { diff --git a/src/Magnum/Math/Range.h b/src/Magnum/Math/Range.h index e8f33a4b1..ba66e46e8 100644 --- a/src/Magnum/Math/Range.h +++ b/src/Magnum/Math/Range.h @@ -99,12 +99,7 @@ template class Range { template constexpr explicit Range(const Range& other): _min(other._min), _max(other._max) {} /** @brief Construct range from external representation */ - template::from(std::declval()))> - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - explicit Range(const U& other): Range{Implementation::RangeConverter::from(other)} {} + template::from(std::declval()))> constexpr explicit Range(const U& other): Range{Implementation::RangeConverter::from(other)} {} /** @brief Convert range to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { diff --git a/src/Magnum/Math/RectangularMatrix.h b/src/Magnum/Math/RectangularMatrix.h index 22d2b6bc8..3638e06d5 100644 --- a/src/Magnum/Math/RectangularMatrix.h +++ b/src/Magnum/Math/RectangularMatrix.h @@ -57,11 +57,6 @@ template class RectangularMatrix { template friend class RectangularMatrix; - #ifdef CORRADE_MSVC2015_COMPATIBILITY - /* Delegating constexpr constructor workarounds */ - friend class Matrix; - #endif - public: typedef T Type; /**< @brief Underlying data type */ @@ -113,12 +108,7 @@ template class RectangularMatrix { } /** @brief Construct zero-filled matrix */ - /** @todo Remove MSVC workaround when fixed */ - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - /*implicit*/ RectangularMatrix(ZeroInitT = ZeroInit) + constexpr /*implicit*/ RectangularMatrix(ZeroInitT = ZeroInit) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT /* MSVC 2015 can't handle {} here */ @@ -157,20 +147,10 @@ template class RectangularMatrix { * // integral == {1, 2, -15, 7} * @endcode */ - template - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - explicit RectangularMatrix(const RectangularMatrix& other): RectangularMatrix(typename Implementation::GenerateSequence::Type(), other) {} + template constexpr explicit RectangularMatrix(const RectangularMatrix& other): RectangularMatrix(typename Implementation::GenerateSequence::Type(), other) {} /** @brief Construct matrix from external representation */ - template::from(std::declval()))> - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - explicit RectangularMatrix(const U& other): RectangularMatrix(Implementation::RectangularMatrixConverter::from(other)) {} + template::from(std::declval()))> constexpr explicit RectangularMatrix(const U& other): RectangularMatrix(Implementation::RectangularMatrixConverter::from(other)) {} /** @brief Copy constructor */ constexpr RectangularMatrix(const RectangularMatrix&) = default; diff --git a/src/Magnum/Math/Test/BoolVectorTest.cpp b/src/Magnum/Math/Test/BoolVectorTest.cpp index 8ea552829..1995756fb 100644 --- a/src/Magnum/Math/Test/BoolVectorTest.cpp +++ b/src/Magnum/Math/Test/BoolVectorTest.cpp @@ -99,18 +99,10 @@ void BoolVectorTest::constructNoInit() { } void BoolVectorTest::constructOneValue() { - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - BoolVector19 a(false); + constexpr BoolVector19 a(false); CORRADE_COMPARE(a, BoolVector19(0x00, 0x00, 0x00)); - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - BoolVector19 b(true); + constexpr BoolVector19 b(true); CORRADE_COMPARE(b, BoolVector19(0xff, 0xff, 0x07)); CORRADE_VERIFY(!(std::is_convertible::value)); diff --git a/src/Magnum/Math/Test/ComplexTest.cpp b/src/Magnum/Math/Test/ComplexTest.cpp index c869fb391..7da891290 100644 --- a/src/Magnum/Math/Test/ComplexTest.cpp +++ b/src/Magnum/Math/Test/ComplexTest.cpp @@ -201,19 +201,14 @@ void ComplexTest::convert() { /* GCC 5.1 fills the result with zeros instead of properly calling delegated copy constructor if using constexpr. Reported here: - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66450 - MSVC 2015: Can't use delegating constructors with constexpr: - https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - #if (!defined(__GNUC__) || defined(__clang__)) && !defined(CORRADE_MSVC2015_COMPATIBILITY) + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66450 */ + #if !defined(__GNUC__) || defined(__clang__) constexpr #endif Complex c(a); CORRADE_COMPARE(c, b); - #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Why can't be conversion constexpr? */ - constexpr - #endif - Cmpl d(b); + constexpr Cmpl d(b); CORRADE_COMPARE(d.re, a.re); CORRADE_COMPARE(d.im, a.im); diff --git a/src/Magnum/Math/Test/DualComplexTest.cpp b/src/Magnum/Math/Test/DualComplexTest.cpp index 9e0a7096a..134f2bea3 100644 --- a/src/Magnum/Math/Test/DualComplexTest.cpp +++ b/src/Magnum/Math/Test/DualComplexTest.cpp @@ -198,19 +198,14 @@ void DualComplexTest::convert() { /* GCC 5.1 fills the result with zeros instead of properly calling delegated copy constructor if using constexpr. Reported here: - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66450 - MSVC 2015: Can't use delegating constructors with constexpr: - https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - #if (!defined(__GNUC__) || defined(__clang__)) && !defined(CORRADE_MSVC2015_COMPATIBILITY) + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66450 */ + #if !defined(__GNUC__) || defined(__clang__) constexpr #endif DualComplex c{a}; CORRADE_COMPARE(c, b); - #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Why can't be conversion constexpr? */ - constexpr - #endif - DualCmpl d(b); + constexpr DualCmpl d(b); CORRADE_COMPARE(d.re, a.re); CORRADE_COMPARE(d.im, a.im); CORRADE_COMPARE(d.x, a.x); diff --git a/src/Magnum/Math/Test/DualQuaternionTest.cpp b/src/Magnum/Math/Test/DualQuaternionTest.cpp index b84d8a3ab..c4f98c6b5 100644 --- a/src/Magnum/Math/Test/DualQuaternionTest.cpp +++ b/src/Magnum/Math/Test/DualQuaternionTest.cpp @@ -216,19 +216,14 @@ void DualQuaternionTest::convert() { /* GCC 5.1 fills the result with zeros instead of properly calling delegated copy constructor if using constexpr. Reported here: - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66450 - MSVC 2015: Can't use delegating constructors with constexpr: - https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - #if (!defined(__GNUC__) || defined(__clang__)) && !defined(CORRADE_MSVC2015_COMPATIBILITY) + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66450 */ + #if !defined(__GNUC__) || defined(__clang__) constexpr #endif DualQuaternion c{a}; CORRADE_COMPARE(c, b); - #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Why can't be conversion constexpr? */ - constexpr - #endif - DualQuat d(b); + constexpr DualQuat d(b); CORRADE_COMPARE(d.re.x, a.re.x); CORRADE_COMPARE(d.re.y, a.re.y); CORRADE_COMPARE(d.re.z, a.re.z); diff --git a/src/Magnum/Math/Test/MatrixTest.cpp b/src/Magnum/Math/Test/MatrixTest.cpp index 264938ec4..810307ecc 100644 --- a/src/Magnum/Math/Test/MatrixTest.cpp +++ b/src/Magnum/Math/Test/MatrixTest.cpp @@ -126,21 +126,9 @@ void MatrixTest::construct() { } void MatrixTest::constructIdentity() { - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - Matrix4x4 identity; - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - Matrix4x4 identity2{IdentityInit}; - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - Matrix4x4 identity3{IdentityInit, 4.0f}; + constexpr Matrix4x4 identity; + constexpr Matrix4x4 identity2{IdentityInit}; + constexpr Matrix4x4 identity3{IdentityInit, 4.0f}; Matrix4x4 identityExpected(Vector4(1.0f, 0.0f, 0.0f, 0.0f), Vector4(0.0f, 1.0f, 0.0f, 0.0f), @@ -158,11 +146,7 @@ void MatrixTest::constructIdentity() { } void MatrixTest::constructZero() { - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - Matrix4x4 a{ZeroInit}; + constexpr Matrix4x4 a{ZeroInit}; CORRADE_COMPARE(a, Matrix4x4(Vector4(0.0f, 0.0f, 0.0f, 0.0f), Vector4(0.0f, 0.0f, 0.0f, 0.0f), Vector4(0.0f, 0.0f, 0.0f, 0.0f), @@ -222,10 +206,7 @@ void MatrixTest::convert() { constexpr Matrix3x3 c(b); CORRADE_COMPARE(c, b); - #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Why can't be conversion constexpr? */ - constexpr - #endif - Mat3 d(b); + constexpr Mat3 d(b); for(std::size_t i = 0; i != 9; ++i) CORRADE_COMPARE(d.a[i], a.a[i]); diff --git a/src/Magnum/Math/Test/QuaternionTest.cpp b/src/Magnum/Math/Test/QuaternionTest.cpp index 5fcb6ad3b..b0f428ec3 100644 --- a/src/Magnum/Math/Test/QuaternionTest.cpp +++ b/src/Magnum/Math/Test/QuaternionTest.cpp @@ -202,19 +202,14 @@ void QuaternionTest::convert() { /* GCC 5.1 fills the result with zeros instead of properly calling delegated copy constructor if using constexpr. Reported here: - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66450 - MSVC 2015: Can't use delegating constructors with constexpr: - https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - #if (!defined(__GNUC__) || defined(__clang__)) && !defined(CORRADE_MSVC2015_COMPATIBILITY) + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66450 */ + #if !defined(__GNUC__) || defined(__clang__) constexpr #endif Quaternion c{a}; CORRADE_COMPARE(c, b); - #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Why can't be conversion constexpr? */ - constexpr - #endif - Quat d(b); + constexpr Quat d(b); CORRADE_COMPARE(d.x, a.x); CORRADE_COMPARE(d.y, a.y); CORRADE_COMPARE(d.z, a.z); diff --git a/src/Magnum/Math/Test/RangeTest.cpp b/src/Magnum/Math/Test/RangeTest.cpp index d882cef88..5fcd2c5b3 100644 --- a/src/Magnum/Math/Test/RangeTest.cpp +++ b/src/Magnum/Math/Test/RangeTest.cpp @@ -215,11 +215,7 @@ void RangeTest::constructConversion() { constexpr Range2D b({1.3f, 2.7f}, {-15.0f, 7.0f}); constexpr Range3D c({1.3f, 2.7f, -1.5f}, {-15.0f, 7.0f, 0.3f}); - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - Range1Di d(a); + constexpr Range1Di d(a); CORRADE_COMPARE(d, Range1Di(1, -15)); constexpr Range2Di e(b); @@ -260,14 +256,12 @@ void RangeTest::convert() { /* GCC 5.1 fills the result with zeros instead of properly calling delegated copy constructor if using constexpr. Reported here: - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66450 - MSVC 2015: Can't use delegating constructors with constexpr: - https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - #if (!defined(__GNUC__) || defined(__clang__)) && !defined(CORRADE_MSVC2015_COMPATIBILITY) + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66450 */ + #if !defined(__GNUC__) || defined(__clang__) constexpr #endif Range<2, Float> g{b}; - #if (!defined(__GNUC__) || defined(__clang__)) && !defined(CORRADE_MSVC2015_COMPATIBILITY) + #if !defined(__GNUC__) || defined(__clang__) constexpr #endif Range1D h{a}; @@ -284,26 +278,17 @@ void RangeTest::convert() { CORRADE_COMPARE(i, e); CORRADE_COMPARE(j, f); - #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Why can't be conversion constexpr? */ - constexpr - #endif - Dim k(d); + constexpr Dim k(d); CORRADE_COMPARE(k.offset, a.offset); CORRADE_COMPARE(k.size, a.size); - #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Why can't be conversion constexpr? */ - constexpr - #endif - Rect l(e); + constexpr Rect l(e); CORRADE_COMPARE(l.x, b.x); CORRADE_COMPARE(l.y, b.y); CORRADE_COMPARE(l.w, b.w); CORRADE_COMPARE(l.h, b.h); - #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Why can't be conversion constexpr? */ - constexpr - #endif - Box m(f); + constexpr Box m(f); CORRADE_COMPARE(m.x, c.x); CORRADE_COMPARE(m.y, c.y); CORRADE_COMPARE(m.z, c.z); diff --git a/src/Magnum/Math/Test/RectangularMatrixTest.cpp b/src/Magnum/Math/Test/RectangularMatrixTest.cpp index 1246cd18d..9a7f7e434 100644 --- a/src/Magnum/Math/Test/RectangularMatrixTest.cpp +++ b/src/Magnum/Math/Test/RectangularMatrixTest.cpp @@ -149,16 +149,8 @@ void RectangularMatrixTest::construct() { } void RectangularMatrixTest::constructDefault() { - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - Matrix4x3 a; - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - Matrix4x3 b{ZeroInit}; + constexpr Matrix4x3 a; + constexpr Matrix4x3 b{ZeroInit}; CORRADE_COMPARE(a, Matrix4x3(Vector3(0.0f, 0.0f, 0.0f), Vector3(0.0f, 0.0f, 0.0f), Vector3(0.0f, 0.0f, 0.0f), @@ -182,11 +174,7 @@ void RectangularMatrixTest::constructNoInit() { void RectangularMatrixTest::constructConversion() { constexpr Matrix2x2 a(Vector2( 1.3f, 2.7f), Vector2(-15.0f, 7.0f)); - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - Matrix2x2i b(a); + constexpr Matrix2x2i b(a); CORRADE_COMPARE(b, Matrix2x2i(Vector2i( 1, 2), Vector2i(-15, 7))); @@ -245,19 +233,14 @@ void RectangularMatrixTest::convert() { /* GCC 5.1 fills the result with zeros instead of properly calling delegated copy constructor if using constexpr. Reported here: - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66450 - MSVC 2015: Can't use delegating constructors with constexpr: - https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - #if (!defined(__GNUC__) || defined(__clang__)) && !defined(CORRADE_MSVC2015_COMPATIBILITY) + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66450 */ + #if !defined(__GNUC__) || defined(__clang__) constexpr #endif Matrix2x3 c{a}; CORRADE_COMPARE(c, b); - #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Why can't be conversion constexpr? */ - constexpr - #endif - Mat2x3 d(b); + constexpr Mat2x3 d(b); for(std::size_t i = 0; i != 5; ++i) CORRADE_COMPARE(d.a[i], a.a[i]); diff --git a/src/Magnum/Math/Test/Vector2Test.cpp b/src/Magnum/Math/Test/Vector2Test.cpp index a8cfdd448..eefcaa9bb 100644 --- a/src/Magnum/Math/Test/Vector2Test.cpp +++ b/src/Magnum/Math/Test/Vector2Test.cpp @@ -152,10 +152,7 @@ void Vector2Test::convert() { constexpr Vector2 c(a); CORRADE_COMPARE(c, b); - #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Why can't be conversion constexpr? */ - constexpr - #endif - Vec2 d(b); + constexpr Vec2 d(b); CORRADE_COMPARE(d.x, a.x); CORRADE_COMPARE(d.y, a.y); diff --git a/src/Magnum/Math/Test/Vector3Test.cpp b/src/Magnum/Math/Test/Vector3Test.cpp index af2719585..b22c6c0b7 100644 --- a/src/Magnum/Math/Test/Vector3Test.cpp +++ b/src/Magnum/Math/Test/Vector3Test.cpp @@ -156,10 +156,7 @@ void Vector3Test::convert() { constexpr Vector3 c(a); CORRADE_COMPARE(c, b); - #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Why can't be conversion constexpr? */ - constexpr - #endif - Vec3 d(b); + constexpr Vec3 d(b); CORRADE_COMPARE(d.x, a.x); CORRADE_COMPARE(d.y, a.y); CORRADE_COMPARE(d.z, a.z); diff --git a/src/Magnum/Math/Test/Vector4Test.cpp b/src/Magnum/Math/Test/Vector4Test.cpp index 1fb0d4b8d..2691bd915 100644 --- a/src/Magnum/Math/Test/Vector4Test.cpp +++ b/src/Magnum/Math/Test/Vector4Test.cpp @@ -171,10 +171,7 @@ void Vector4Test::convert() { constexpr Vector4 c(a); CORRADE_COMPARE(c, b); - #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Why can't be conversion constexpr? */ - constexpr - #endif - Vec4 d(b); + constexpr Vec4 d(b); CORRADE_COMPARE(d.x, a.x); CORRADE_COMPARE(d.y, a.y); CORRADE_COMPARE(d.z, a.z); diff --git a/src/Magnum/Math/Test/VectorTest.cpp b/src/Magnum/Math/Test/VectorTest.cpp index 78b43bf47..f49b54eb4 100644 --- a/src/Magnum/Math/Test/VectorTest.cpp +++ b/src/Magnum/Math/Test/VectorTest.cpp @@ -201,11 +201,7 @@ void VectorTest::constructNoInit() { } void VectorTest::constructOneValue() { - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - Vector4 a(7.25f); + constexpr Vector4 a(7.25f); CORRADE_COMPARE(a, Vector4(7.25f, 7.25f, 7.25f, 7.25f)); @@ -223,11 +219,7 @@ void VectorTest::constructOneComponent() { void VectorTest::constructConversion() { constexpr Vector4 a(1.3f, 2.7f, -15.0f, 7.0f); - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - Vector4i b(a); + constexpr Vector4i b(a); CORRADE_COMPARE(b, Vector4i(1, 2, -15, 7)); @@ -247,19 +239,14 @@ void VectorTest::convert() { /* GCC 5.1 fills the result with zeros instead of properly calling delegated copy constructor if using constexpr. Reported here: - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66450 - MSVC 2015: Can't use delegating constructors with constexpr: - https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - #if (!defined(__GNUC__) || defined(__clang__)) && !defined(CORRADE_MSVC2015_COMPATIBILITY) + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66450 */ + #if !defined(__GNUC__) || defined(__clang__) constexpr #endif Vector3 c{a}; CORRADE_COMPARE(c, b); - #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Why can't be conversion constexpr? */ - constexpr - #endif - Vec3 d(b); + constexpr Vec3 d(b); CORRADE_COMPARE(d.x, a.x); CORRADE_COMPARE(d.y, a.y); CORRADE_COMPARE(d.z, a.z); diff --git a/src/Magnum/Math/Vector.h b/src/Magnum/Math/Vector.h index e143f7efc..d0f1cdf29 100644 --- a/src/Magnum/Math/Vector.h +++ b/src/Magnum/Math/Vector.h @@ -98,13 +98,6 @@ template class Vector { template friend class Vector; - #ifdef CORRADE_MSVC2015_COMPATIBILITY - /* Delegating constexpr constructor workarounds */ - friend class Vector2; - friend class Vector3; - friend class Vector4; - #endif - public: typedef T Type; /**< @brief Underlying data type */ @@ -188,12 +181,7 @@ template class Vector { #ifdef DOXYGEN_GENERATING_OUTPUT constexpr explicit Vector(T value); #else - template::value && size != 1, T>::type> - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - explicit Vector(U value): Vector(typename Implementation::GenerateSequence::Type(), value) {} + template::value && size != 1, T>::type> constexpr explicit Vector(U value): Vector(typename Implementation::GenerateSequence::Type(), value) {} #endif /** @@ -207,20 +195,10 @@ template class Vector { * // integral == {1, 2, -15, 7} * @endcode */ - template - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - explicit Vector(const Vector& other): Vector(typename Implementation::GenerateSequence::Type(), other) {} + template constexpr explicit Vector(const Vector& other): Vector(typename Implementation::GenerateSequence::Type(), other) {} /** @brief Construct vector from external representation */ - template::from(std::declval()))> - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - explicit Vector(const U& other): Vector(Implementation::VectorConverter::from(other)) {} + template::from(std::declval()))> constexpr explicit Vector(const U& other): Vector(Implementation::VectorConverter::from(other)) {} /** @brief Copy constructor */ constexpr Vector(const Vector&) = default; diff --git a/src/Magnum/Math/Vector2.h b/src/Magnum/Math/Vector2.h index 5aca64b59..44196556a 100644 --- a/src/Magnum/Math/Vector2.h +++ b/src/Magnum/Math/Vector2.h @@ -130,14 +130,7 @@ template class Vector2: public Vector<2, T> { {} /** @copydoc Vector::Vector(T) */ - constexpr explicit Vector2(T value): - #ifndef CORRADE_MSVC2015_COMPATIBILITY - Vector<2, T>(value) - #else - /* Avoid using non-constexpr version */ - Vector<2, T>(value, value) - #endif - {} + constexpr explicit Vector2(T value): Vector<2, T>(value) {} /** * @brief Constructor @@ -149,14 +142,7 @@ template class Vector2: public Vector<2, T> { constexpr /*implicit*/ Vector2(T x, T y): Vector<2, T>(x, y) {} /** @copydoc Vector::Vector(const Vector&) */ - template constexpr explicit Vector2(const Vector<2, U>& other): - #ifndef CORRADE_MSVC2015_COMPATIBILITY - Vector<2, T>(other) - #else - /* Avoid using non-constexpr version */ - Vector<2, T>(typename Implementation::GenerateSequence<2>::Type(), other) - #endif - {} + template constexpr explicit Vector2(const Vector<2, U>& other): Vector<2, T>(other) {} /** @brief Construct vector from external representation */ template class Vector3: public Vector<3, T> { {} /** @copydoc Vector::Vector(T) */ - constexpr explicit Vector3(T value): - #ifndef CORRADE_MSVC2015_COMPATIBILITY - Vector<3, T>(value) - #else - /* Avoid using non-constexpr version */ - Vector<3, T>(value, value, value) - #endif - {} + constexpr explicit Vector3(T value): Vector<3, T>(value) {} /** * @brief Constructor @@ -180,14 +173,7 @@ template class Vector3: public Vector<3, T> { constexpr /*implicit*/ Vector3(const Vector2& xy, T z): Vector<3, T>(xy[0], xy[1], z) {} /** @copydoc Vector::Vector(const Vector&) */ - template constexpr explicit Vector3(const Vector<3, U>& other): - #ifndef CORRADE_MSVC2015_COMPATIBILITY - Vector<3, T>(other) - #else - /* Avoid using non-constexpr version */ - Vector<3, T>(typename Implementation::GenerateSequence<3>::Type(), other) - #endif - {} + template constexpr explicit Vector3(const Vector<3, U>& other): Vector<3, T>(other) {} /** @brief Construct vector from external representation */ template class Vector4: public Vector<4, T> { {} /** @copydoc Vector::Vector(T) */ - constexpr explicit Vector4(T value): - #ifndef CORRADE_MSVC2015_COMPATIBILITY - Vector<4, T>(value) - #else - /* Avoid using non-constexpr version */ - Vector<4, T>(value, value, value, value) - #endif - {} + constexpr explicit Vector4(T value): Vector<4, T>(value) {} /** * @brief Constructor @@ -106,14 +99,7 @@ template class Vector4: public Vector<4, T> { constexpr /*implicit*/ Vector4(const Vector3& xyz, T w): Vector<4, T>(xyz[0], xyz[1], xyz[2], w) {} /** @copydoc Vector::Vector(const Vector&) */ - template constexpr explicit Vector4(const Vector<4, U>& other): - #ifndef CORRADE_MSVC2015_COMPATIBILITY - Vector<4, T>(other) - #else - /* Avoid using non-constexpr version */ - Vector<4, T>(typename Implementation::GenerateSequence<4>::Type(), other) - #endif - {} + template constexpr explicit Vector4(const Vector<4, U>& other): Vector<4, T>(other) {} /** @brief Construct vector from external representation */ template::from(std::declval()))> constexpr explicit Vector4(const U& other): Vector<4, T>(Implementation::VectorConverter<4, T, U>::from(other)) {} diff --git a/src/Magnum/Test/ArrayTest.cpp b/src/Magnum/Test/ArrayTest.cpp index 7a5048235..70a88c4e8 100644 --- a/src/Magnum/Test/ArrayTest.cpp +++ b/src/Magnum/Test/ArrayTest.cpp @@ -51,11 +51,7 @@ void ArrayTest::construct() { constexpr Array<3, Int> a = {5, 6, 7}; CORRADE_COMPARE(a, (Array<3, Int>(5, 6, 7))); - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* Can't use delegating constructors with constexpr -- https://connect.microsoft.com/VisualStudio/feedback/details/1579279/c-constexpr-does-not-work-with-delegating-constructors */ - constexpr - #endif - Array<3, Int> a2 = 5; + constexpr Array<3, Int> a2 = 5; CORRADE_COMPARE(a2, (Array<3, Int>(5, 5, 5))); constexpr Array1D b = 5; From b777135116816daecd423f80be09487000e7a186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Dec 2015 22:42:43 +0100 Subject: [PATCH 019/258] MSVC 2015 Update 1: in-class constexpr initialization works now. --- src/Magnum/Implementation/FramebufferState.cpp | 4 ---- src/Magnum/Implementation/FramebufferState.h | 5 ----- src/Magnum/Math/Matrix.h | 4 ---- 3 files changed, 13 deletions(-) diff --git a/src/Magnum/Implementation/FramebufferState.cpp b/src/Magnum/Implementation/FramebufferState.cpp index 3a03b177c..6b6ef8755 100644 --- a/src/Magnum/Implementation/FramebufferState.cpp +++ b/src/Magnum/Implementation/FramebufferState.cpp @@ -33,11 +33,7 @@ namespace Magnum { namespace Implementation { -#ifndef CORRADE_MSVC2015_COMPATIBILITY constexpr const Range2Di FramebufferState::DisengagedViewport; -#else -const Range2Di FramebufferState::DisengagedViewport{{}, {-1, -1}}; -#endif FramebufferState::FramebufferState(Context& context, std::vector& extensions): readBinding{0}, drawBinding{0}, renderbufferBinding{0}, maxDrawBuffers{0}, maxColorAttachments{0}, maxRenderbufferSize{0}, #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) diff --git a/src/Magnum/Implementation/FramebufferState.h b/src/Magnum/Implementation/FramebufferState.h index 93df48c1f..55a04251e 100644 --- a/src/Magnum/Implementation/FramebufferState.h +++ b/src/Magnum/Implementation/FramebufferState.h @@ -40,12 +40,7 @@ namespace Magnum { namespace Implementation { struct FramebufferState { - #ifndef CORRADE_MSVC2015_COMPATIBILITY - /* MSVC complains that in-class initialization is not yet implemented */ constexpr static const Range2Di DisengagedViewport{{}, {-1, -1}}; - #else - static const Range2Di DisengagedViewport; - #endif explicit FramebufferState(Context& context, std::vector& extensions); diff --git a/src/Magnum/Math/Matrix.h b/src/Magnum/Math/Matrix.h index 0394dc684..630240aeb 100644 --- a/src/Magnum/Math/Matrix.h +++ b/src/Magnum/Math/Matrix.h @@ -54,9 +54,6 @@ template class Matrix: public RectangularMatrix class Matrix: public RectangularMatrix Date: Wed, 16 Dec 2015 22:20:36 +0100 Subject: [PATCH 020/258] Platform: actually properly implement WindowlessWglApplication. That was unprofessional from me, sorry, because it didn't even compile. When I got it to compile, it crashed right away, because I was querying GLX function instead of WGL function. But even after that it was still crashing BECAUSE APPARENTLY YOU HAVE TO CREATE CONTEXT TO BE ABLE TO CREATE CONTEXT, YO DAWG. Fuck all this GL shit. Gimme something sane already. Ugh. --- .../Platform/WindowlessWglApplication.cpp | 21 ++++++++++++++++--- .../Platform/WindowlessWglApplication.h | 6 +++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Platform/WindowlessWglApplication.cpp b/src/Magnum/Platform/WindowlessWglApplication.cpp index 6466607df..eb10cb980 100644 --- a/src/Magnum/Platform/WindowlessWglApplication.cpp +++ b/src/Magnum/Platform/WindowlessWglApplication.cpp @@ -104,14 +104,29 @@ bool WindowlessWglApplication::tryCreateContext(const Configuration& configurati const int pixelFormat = ChoosePixelFormat(_deviceContext, &pfd); SetPixelFormat(_deviceContext, pixelFormat, &pfd); - const int attributes = { + const int attributes[] = { WGL_CONTEXT_FLAGS_ARB, int(configuration.flags()), 0 }; - /* Create context and make it current */ - const PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = reinterpret_cast( wglGetProcAddress(reinterpret_cast("glXCreateContextAttribsARB"))); + /* Create temporary context so we are able to get the pointer to + wglCreateContextAttribsARB() */ + HGLRC temporaryContext = wglCreateContext(_deviceContext); + if(!wglMakeCurrent(_deviceContext, temporaryContext)) { + Error() << "Platform::WindowlessWglApplication::tryCreateContext(): cannot make temporary context current:" << GetLastError(); + return false; + } + + /* Get pointer to proper context creation function and create real context + with it */ + typedef HGLRC(WINAPI*PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC, HGLRC, const int*); + const PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = reinterpret_cast( wglGetProcAddress(reinterpret_cast("wglCreateContextAttribsARB"))); _renderingContext = wglCreateContextAttribsARB(_deviceContext, 0, attributes); + + /* Delete the temporary context */ + wglMakeCurrent(_deviceContext, nullptr); + wglDeleteContext(temporaryContext); + if(!_renderingContext) { Error() << "Platform::WindowlessWglApplication::tryCreateContext(): cannot create context:" << GetLastError(); return false; diff --git a/src/Magnum/Platform/WindowlessWglApplication.h b/src/Magnum/Platform/WindowlessWglApplication.h index 544879ed6..fbcd5a962 100644 --- a/src/Magnum/Platform/WindowlessWglApplication.h +++ b/src/Magnum/Platform/WindowlessWglApplication.h @@ -41,6 +41,11 @@ #include "Magnum/OpenGL.h" #include "Magnum/Platform/Platform.h" +/* Define stuff that we need because I can't be bothered with creating a new + header just for two defines */ +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 + namespace Magnum { namespace Platform { /** @@ -199,7 +204,6 @@ class WindowlessWglApplication::Configuration { #endif constexpr /*implicit*/ Configuration() {} - ~Configuration(); /** @brief Context flags */ Flags flags() const { return _flags; } From dd3db921b0600083ba011b82ae433c88940c06fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 17 Dec 2015 10:07:57 +0100 Subject: [PATCH 021/258] Don't compare random memory in PixelStorageGLTest. --- src/Magnum/Test/PixelStorageGLTest.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Magnum/Test/PixelStorageGLTest.cpp b/src/Magnum/Test/PixelStorageGLTest.cpp index 01c0e6291..7a1b33685 100644 --- a/src/Magnum/Test/PixelStorageGLTest.cpp +++ b/src/Magnum/Test/PixelStorageGLTest.cpp @@ -119,7 +119,10 @@ void PixelStorageGLTest::unpack2D() { MAGNUM_VERIFY_NO_ERROR(); - Image2D actual{PixelFormat::RGB, PixelType::UnsignedByte}; + /* Read into zero-initialized array to avoid comparing random memory in + padding bytes (confirmed on NVidia 355.11, AMD 15.300.1025.0) */ + Image2D actual{PixelFormat::RGB, PixelType::UnsignedByte, {}, + Containers::Array{Containers::ValueInit, sizeof(ActualData)}}; #ifndef MAGNUM_TARGET_GLES texture.image(0, actual); @@ -131,11 +134,6 @@ void PixelStorageGLTest::unpack2D() { MAGNUM_VERIFY_NO_ERROR(); - /* Clear padding in the last row (the driver might leave them untouched, - confirmed on NVidia 355.11) */ - CORRADE_VERIFY(actual.data().size() == Containers::ArrayView{ActualData}.size()); - *(actual.data().end() - 1) = *(actual.data().end() - 2) = 0; - CORRADE_COMPARE_AS(actual.data(), Containers::ArrayView{ActualData}, TestSuite::Compare::Container); } @@ -217,7 +215,12 @@ void PixelStorageGLTest::unpack3D() { /* Testing mainly image height here, which is not available as pack parameter in ES */ #ifndef MAGNUM_TARGET_GLES - Image3D actual = texture.image(0, {PixelFormat::RGB, PixelType::UnsignedByte}); + /* Read into zero-initialized array to avoid comparing random memory in + padding bytes (confirmed on AMD 15.300.1025.0) */ + Image3D actual{PixelFormat::RGB, PixelType::UnsignedByte, {}, + Containers::Array{Containers::ValueInit, sizeof(ActualData)}}; + + texture.image(0, actual); MAGNUM_VERIFY_NO_ERROR(); From 659759d2ef29bd4e7f736a479d893744964e297f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 17 Dec 2015 10:10:17 +0100 Subject: [PATCH 022/258] Revert "More vendor-specific XFAIL cases in Mesh GL test." This is behaving properly on AMD 15.300.1025.0. This reverts commit 8dd4dfcf2b1daf6d7f27868e6831c4dbc23ff89e. --- src/Magnum/Test/MeshGLTest.cpp | 36 ++++++++++------------------------ 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/src/Magnum/Test/MeshGLTest.cpp b/src/Magnum/Test/MeshGLTest.cpp index e5240881c..8c55275d9 100644 --- a/src/Magnum/Test/MeshGLTest.cpp +++ b/src/Magnum/Test/MeshGLTest.cpp @@ -753,10 +753,7 @@ void MeshGLTest::addVertexBufferMatrixNxNd() { const Matrix3x3d data[] = { {}, Matrix3x3d::fromDiagonal({0.0, -0.9, 1.0}), - Matrix3x3d::fromVector(Math::normalize>(Math::Vector<9, UnsignedShort>{ - UnsignedShort(315), UnsignedShort( 10), UnsignedShort( 20), - UnsignedShort( 40), UnsignedShort(65201), UnsignedShort( 50), - UnsignedShort( 70), UnsignedShort( 80), UnsignedShort(2576)})) + Matrix3x3d::fromDiagonal(Math::normalize(Math::Vector3(315, 65201, 2576))) }; Buffer buffer; buffer.setData(data, BufferUsage::StaticDraw); @@ -776,16 +773,11 @@ void MeshGLTest::addVertexBufferMatrixNxNd() { { CORRADE_EXPECT_FAIL("Somehow only first two values are extracted"); CORRADE_COMPARE(value, Math::Vector3(315, 65201, 2576)); - } { - /* This is wrong, but check if it's still the right wrong */ - CORRADE_EXPECT_FAIL_IF(!!(Context::current()->detectedDriver() & Context::DetectedDriver::AMD), - "AMD cards take value[2][2] instead of value[1][1]."); - CORRADE_COMPARE(value, Math::Vector3(315, 65201, 0)); } - /* Also check that AMD is consistently wrong */ - if(Context::current()->detectedDriver() & Context::DetectedDriver::AMD) - CORRADE_COMPARE(value, Math::Vector3(315, 80, 0)); + /* This is wrong, but check if it's still the right wrong. Fails on AMD + 15.201.1151 but seems to be fixed in 15.300.1025.0 */ + CORRADE_COMPARE(value, Math::Vector3(315, 65201, 0)); } #endif @@ -826,10 +818,7 @@ void MeshGLTest::addVertexBufferMatrixMxNd() { const Matrix3x4d data[] = { {}, Matrix3x4d::fromDiagonal({0.0f, -0.9f, 1.0f}), - Matrix3x4d::fromVector(Math::normalize>(Math::Vector<12, UnsignedShort>{ - UnsignedShort(315), UnsignedShort( 10), UnsignedShort( 20), UnsignedShort(30), - UnsignedShort( 40), UnsignedShort(65201), UnsignedShort( 50), UnsignedShort(60), - UnsignedShort( 70), UnsignedShort( 80), UnsignedShort(2576), UnsignedShort(90)})) + Matrix3x4d::fromDiagonal(Math::normalize(Math::Vector3(315, 65201, 2576))) }; Buffer buffer; buffer.setData(data, BufferUsage::StaticDraw); @@ -842,23 +831,18 @@ void MeshGLTest::addVertexBufferMatrixMxNd() { const auto value = Checker(DoubleShader("dmat3x4", "vec4", "vec4(value[0][0], value[1][1], value[2][2], 0.0)"), - RenderbufferFormat::RGBA16, mesh).get>(PixelFormat::RGBA, PixelType::UnsignedShort); + RenderbufferFormat::RGBA16, mesh).get>(PixelFormat::RGB, PixelType::UnsignedShort); MAGNUM_VERIFY_NO_ERROR(); { - CORRADE_EXPECT_FAIL("Somehow only first two values are extracted."); + CORRADE_EXPECT_FAIL("Somehow only first two values are extracted"); CORRADE_COMPARE(value, Math::Vector3(315, 65201, 2576)); - } { - /* This is wrong, but check if it's still the right wrong */ - CORRADE_EXPECT_FAIL_IF(!!(Context::current()->detectedDriver() & Context::DetectedDriver::AMD), - "AMD cards take value[2][2] instead of value[1][1]."); - CORRADE_COMPARE(value, Math::Vector3(315, 65201, 0)); } - /* Also check that AMD is consistently wrong */ - if(Context::current()->detectedDriver() & Context::DetectedDriver::AMD) - CORRADE_COMPARE(value, Math::Vector3(315, 80, 0)); + /* This is wrong, but check if it's still the right wrong. Fails on AMD + 15.201.1151 but seems to be fixed in 15.300.1025.0 */ + CORRADE_COMPARE(value, Math::Vector3(315, 65201, 0)); } #endif From 43d6c57415883e52ba2f014840e621901573155e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 28 Dec 2015 22:37:19 +0100 Subject: [PATCH 023/258] Avoid crash in CubeMapTexture GL test w/o ARB_compressed_pixel_storage. --- src/Magnum/Test/CubeMapTextureGLTest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Magnum/Test/CubeMapTextureGLTest.cpp b/src/Magnum/Test/CubeMapTextureGLTest.cpp index 0827c80c8..1e9fbb0e6 100644 --- a/src/Magnum/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureGLTest.cpp @@ -195,6 +195,7 @@ CubeMapTextureGLTest::CubeMapTextureGLTest() { _compressedDataStorage = {}; #endif _compressedDataOffset = 0; + _compressedFullDataOffset = 0; } } From 02e5c3c5e2ef598e7da70f1bcd378d539c391145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 31 Dec 2015 22:26:09 +0100 Subject: [PATCH 024/258] Fix EXT_DSA impl of CubeMapTexture::setCompressedSubImage(). --- src/Magnum/CubeMapTexture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/CubeMapTexture.cpp b/src/Magnum/CubeMapTexture.cpp index cc5a8c382..2e2c15666 100644 --- a/src/Magnum/CubeMapTexture.cpp +++ b/src/Magnum/CubeMapTexture.cpp @@ -403,7 +403,7 @@ void CubeMapTexture::subImageImplementationDSAEXT(const Coordinate coordinate, c void CubeMapTexture::compressedSubImageImplementationDSAEXT(const Coordinate coordinate, const GLint level, const Vector2i& offset, const Vector2i& size, const CompressedPixelFormat format, const GLvoid* const data, const GLsizei dataSize) { _flags |= ObjectFlag::Created; - glTextureSubImage2DEXT(_id, GLenum(coordinate), level, offset.x(), offset.y(), size.x(), size.y(), GLenum(format), dataSize, data); + glCompressedTextureSubImage2DEXT(_id, GLenum(coordinate), level, offset.x(), offset.y(), size.x(), size.y(), GLenum(format), dataSize, data); } #endif From fe4487a303a94369d65698f3815add1558f3c34b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 1 Jan 2016 21:34:00 +0100 Subject: [PATCH 025/258] Removed outdated comment. --- src/Magnum/BufferImage.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Magnum/BufferImage.h b/src/Magnum/BufferImage.h index 3db9a2a24..fbb11bc3a 100644 --- a/src/Magnum/BufferImage.h +++ b/src/Magnum/BufferImage.h @@ -247,7 +247,6 @@ template class CompressedBufferImage { * @param data Image data * @param usage Image buffer usage * - * The data are *not* deleted after filling the buffer. * @todo Make it more flexible (usable with * @extension{ARB,buffer_storage}, avoiding relocations...) * From f83bbc01ad0fe3d2cb435362af7de6baf590647d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 1 Jan 2016 21:51:23 +0100 Subject: [PATCH 026/258] Don't compare random memory in PixelStorage GL test. --- src/Magnum/Test/PixelStorageGLTest.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Magnum/Test/PixelStorageGLTest.cpp b/src/Magnum/Test/PixelStorageGLTest.cpp index 7a1b33685..fd2a1aff3 100644 --- a/src/Magnum/Test/PixelStorageGLTest.cpp +++ b/src/Magnum/Test/PixelStorageGLTest.cpp @@ -224,6 +224,11 @@ void PixelStorageGLTest::unpack3D() { MAGNUM_VERIFY_NO_ERROR(); + /* Clear padding in the last row (the driver might leave them untouched, + confirmed on NVidia 358.16) */ + CORRADE_VERIFY(actual.data().size() == Containers::ArrayView{ActualData}.size()); + *(actual.data().end() - 1) = *(actual.data().end() - 2) = 0; + CORRADE_COMPARE_AS(actual.data(), Containers::ArrayView{ActualData}, TestSuite::Compare::Container); #endif From 5647add6fe77fd229aa57cfefe7fb671c5e7725f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 1 Jan 2016 22:07:56 +0100 Subject: [PATCH 027/258] Merged two internal pixel storage calculating functions into one. I guess this might fix *some* issues. --- src/Magnum/PixelStorage.h | 36 ++++++++++++++-------------- src/Magnum/Test/PixelStorageTest.cpp | 16 ++++++------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/Magnum/PixelStorage.h b/src/Magnum/PixelStorage.h index 85cc49c8e..b43dd2a1d 100644 --- a/src/Magnum/PixelStorage.h +++ b/src/Magnum/PixelStorage.h @@ -414,25 +414,10 @@ namespace Implementation { } #endif - /* Use in compressed image upload functions */ #ifndef MAGNUM_TARGET_GLES - template std::size_t occupiedCompressedImageDataSize(const T& image, std::size_t dataSize) { - if(!image.storage().compressedBlockSize().product() || !image.storage().compressedBlockDataSize()) - return dataSize; - - return ((Vector3i::pad(image.size(), 1) + image.storage().compressedBlockSize() - Vector3i{1})/image.storage().compressedBlockSize()).product()*image.storage().compressedBlockDataSize(); - } - #else - template std::size_t occupiedCompressedImageDataSize(const T&, std::size_t dataSize) { - return dataSize; - } - #endif - - #ifndef MAGNUM_TARGET_GLES - /* Used in image query functions */ - template std::size_t compressedImageDataSizeFor(const T& image, const Math::Vector& size, std::size_t dataSize) { + template std::pair compressedImageDataOffsetSizeFor(const T& image, const Math::Vector& size, std::size_t dataSize) { if(!image.storage().compressedBlockSize().product() || !image.storage().compressedBlockDataSize()) - return dataSize; + return {0, dataSize}; std::size_t offset; Math::Vector3 blockCount; @@ -441,7 +426,22 @@ namespace Implementation { const auto realBlockCount = Math::Vector3{(Vector3i::pad(size, 1) + image.storage().compressedBlockSize() - Vector3i{1})/image.storage().compressedBlockSize()}; - return offset + (blockCount.product() - (blockCount.x() - realBlockCount.x()) - (blockCount.y() - realBlockCount.y())*blockCount.x())*blockDataSize; + return {offset, (blockCount.product() - (blockCount.x() - realBlockCount.x()) - (blockCount.y() - realBlockCount.y())*blockCount.x())*blockDataSize}; + } + + /* Used in image query functions */ + template std::size_t compressedImageDataSizeFor(const T& image, const Math::Vector& size, std::size_t dataSize) { + auto r = compressedImageDataOffsetSizeFor(image, size, dataSize); + return r.first + r.second; + } + + /* Use in compressed image upload functions */ + template std::size_t occupiedCompressedImageDataSize(const T& image, std::size_t dataSize) { + return compressedImageDataOffsetSizeFor(image, image.size(), dataSize).second; + } + #else + template std::size_t occupiedCompressedImageDataSize(const T&, std::size_t dataSize) { + return dataSize; } #endif diff --git a/src/Magnum/Test/PixelStorageTest.cpp b/src/Magnum/Test/PixelStorageTest.cpp index 23ef72650..120923b7d 100644 --- a/src/Magnum/Test/PixelStorageTest.cpp +++ b/src/Magnum/Test/PixelStorageTest.cpp @@ -50,7 +50,7 @@ struct PixelStorageTest: TestSuite::Tester { void dataPropertiesCompressedRowLength(); void dataPropertiesCompressedImageHeight(); - void dataSizeCompressed(); + void dataOffsetSizeCompressed(); #endif }; @@ -73,7 +73,7 @@ PixelStorageTest::PixelStorageTest() { &PixelStorageTest::dataPropertiesCompressedRowLength, &PixelStorageTest::dataPropertiesCompressedImageHeight, - &PixelStorageTest::dataSizeCompressed + &PixelStorageTest::dataOffsetSizeCompressed #endif }); } @@ -207,11 +207,11 @@ void PixelStorageTest::dataPropertiesCompressedImageHeight() { (std::tuple{(2 + 2 + 9)*16, {1, 3, 3}, 16})); } -void PixelStorageTest::dataSizeCompressed() { - /* Tf the storage doesn't contain any info about block sizes (the default, +void PixelStorageTest::dataOffsetSizeCompressed() { + /* Tf the storage doesn't contain any info about block sizes (the default), using the provided value */ - CORRADE_COMPARE(Implementation::compressedImageDataSizeFor(CompressedImage3D{}, - Vector2i{37, 35}, 1579), 1579); + CORRADE_COMPARE(Implementation::compressedImageDataOffsetSizeFor(CompressedImage3D{}, + Vector2i{37, 35}, 1579), (std::pair{0, 1579})); /* The same parameters as in PixelStorageGLTest 3D case */ const CompressedImage3D image{CompressedPixelStorage{} @@ -220,8 +220,8 @@ void PixelStorageTest::dataSizeCompressed() { .setRowLength(8) .setImageHeight(8) .setSkip({4, 4, 4})}; - CORRADE_COMPARE(Implementation::compressedImageDataSizeFor(image, Vector3i{4, 4, 1}, 1579), - 16*4*4 + 16*4); + CORRADE_COMPARE(Implementation::compressedImageDataOffsetSizeFor(image, Vector3i{4, 4, 1}, 1579), + (std::pair{16*4*4 + 16*2 + 16, 16})); } #endif From c32523e641a5b9fbb5245c43dff917e1d9d6aa64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 1 Jan 2016 22:46:10 +0100 Subject: [PATCH 028/258] Ensure that the cube map is complete for compressed image query tests. I'm experiencing weird inconsistencies when querying GL_TEXTURE_COMPRESSED_IMAGE_SIZE on cube map textures, it seems to depend on whether the texture is complete/immutable or not, this is a first part of an attempt to nail it down. --- src/Magnum/Test/CubeMapTextureGLTest.cpp | 26 ++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/Magnum/Test/CubeMapTextureGLTest.cpp b/src/Magnum/Test/CubeMapTextureGLTest.cpp index 1e9fbb0e6..0c4de0409 100644 --- a/src/Magnum/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureGLTest.cpp @@ -460,12 +460,19 @@ void CubeMapTextureGLTest::compressedImage() { CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif - CubeMapTexture texture; - texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveX, 0, CompressedImageView2D{ + const CompressedImageView2D view{ #ifndef MAGNUM_TARGET_GLES _compressedDataStorage, #endif - CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, unsafeSuffix(CompressedData, _compressedDataOffset)}); + CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, unsafeSuffix(CompressedData, _compressedDataOffset)}; + + CubeMapTexture texture; + texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveX, 0, view) + .setCompressedImage(CubeMapTexture::Coordinate::NegativeX, 0, view) + .setCompressedImage(CubeMapTexture::Coordinate::PositiveY, 0, view) + .setCompressedImage(CubeMapTexture::Coordinate::NegativeY, 0, view) + .setCompressedImage(CubeMapTexture::Coordinate::PositiveZ, 0, view) + .setCompressedImage(CubeMapTexture::Coordinate::NegativeZ, 0, view); MAGNUM_VERIFY_NO_ERROR(); @@ -512,12 +519,19 @@ void CubeMapTextureGLTest::compressedImageBuffer() { CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif - CubeMapTexture texture; - texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveX, 0, CompressedBufferImage2D{ + CompressedBufferImage2D buffer{ #ifndef MAGNUM_TARGET_GLES _compressedDataStorage, #endif - CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, unsafeSuffix(CompressedData, _compressedDataOffset), BufferUsage::StaticDraw}); + CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, unsafeSuffix(CompressedData, _compressedDataOffset), BufferUsage::StaticDraw}; + + CubeMapTexture texture; + texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveX, 0, buffer) + .setCompressedImage(CubeMapTexture::Coordinate::NegativeX, 0, buffer) + .setCompressedImage(CubeMapTexture::Coordinate::PositiveY, 0, buffer) + .setCompressedImage(CubeMapTexture::Coordinate::NegativeY, 0, buffer) + .setCompressedImage(CubeMapTexture::Coordinate::PositiveZ, 0, buffer) + .setCompressedImage(CubeMapTexture::Coordinate::NegativeZ, 0, buffer); MAGNUM_VERIFY_NO_ERROR(); From 27aea0ccd5c4272ccc0c1b9efb3747b32832fde4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 1 Jan 2016 23:27:34 +0100 Subject: [PATCH 029/258] Don't spread cubemap texture level parameter query workarounds elsewhere. Pre-DSA code paths need to specify for which face we are querying the level parameters, which meant that all other calls had to specify the (implicit) target too. I'm also preparing to put a cubemap-specific workaround in the level parameter query and that really shouldn't be present in the generic implementation for all texture types. The other place where a specific target is needed is in setImage() implementations, but these are rather big chunks of code and I don't feel like copying these verbatim to cubemap implementation just to isolate the workaround in one place. --- src/Magnum/AbstractTexture.cpp | 44 ++++++++--------- src/Magnum/AbstractTexture.h | 12 ++--- src/Magnum/CubeMapTexture.cpp | 57 ++++++++++++++++------ src/Magnum/CubeMapTexture.h | 12 +++-- src/Magnum/CubeMapTextureArray.h | 2 +- src/Magnum/Implementation/TextureState.cpp | 5 ++ src/Magnum/Implementation/TextureState.h | 5 +- src/Magnum/MultisampleTexture.h | 2 +- src/Magnum/RectangleTexture.h | 2 +- src/Magnum/Texture.h | 2 +- src/Magnum/TextureArray.h | 2 +- 11 files changed, 92 insertions(+), 53 deletions(-) diff --git a/src/Magnum/AbstractTexture.cpp b/src/Magnum/AbstractTexture.cpp index 3a1de6229..8f0bad58a 100644 --- a/src/Magnum/AbstractTexture.cpp +++ b/src/Magnum/AbstractTexture.cpp @@ -1094,19 +1094,19 @@ void AbstractTexture::setMaxAnisotropyImplementationExt(GLfloat anisotropy) { } #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -void AbstractTexture::getLevelParameterImplementationDefault(const GLenum target, const GLint level, const GLenum parameter, GLint* const values) { +void AbstractTexture::getLevelParameterImplementationDefault(const GLint level, const GLenum parameter, GLint* const values) { bindInternal(); - glGetTexLevelParameteriv(target, level, parameter, values); + glGetTexLevelParameteriv(_target, level, parameter, values); } #ifndef MAGNUM_TARGET_GLES -void AbstractTexture::getLevelParameterImplementationDSA(GLenum, const GLint level, const GLenum parameter, GLint* const values) { +void AbstractTexture::getLevelParameterImplementationDSA(const GLint level, const GLenum parameter, GLint* const values) { glGetTextureLevelParameteriv(_id, level, parameter, values); } -void AbstractTexture::getLevelParameterImplementationDSAEXT(const GLenum target, const GLint level, const GLenum parameter, GLint* const values) { +void AbstractTexture::getLevelParameterImplementationDSAEXT(const GLint level, const GLenum parameter, GLint* const values) { _flags |= ObjectFlag::Created; - glGetTextureLevelParameterivEXT(_id, target, level, parameter, values); + glGetTextureLevelParameterivEXT(_id, _target, level, parameter, values); } #endif #endif @@ -1493,7 +1493,7 @@ void AbstractTexture::invalidateSubImageImplementationARB(GLint level, const Vec #ifndef DOXYGEN_GENERATING_OUTPUT #ifndef MAGNUM_TARGET_GLES template void AbstractTexture::image(GLint level, Image& image) { - const Math::Vector size = DataHelper::imageSize(*this, _target, level); + const Math::Vector size = DataHelper::imageSize(*this, level); const std::size_t dataSize = Implementation::imageDataSizeFor(image, size); /* Reallocate only if needed */ @@ -1512,7 +1512,7 @@ template void MAGNUM_EXPORT AbstractTexture::image<2>(GLint, Image<2>&); template void MAGNUM_EXPORT AbstractTexture::image<3>(GLint, Image<3>&); template void AbstractTexture::image(GLint level, BufferImage& image, BufferUsage usage) { - const Math::Vector size = DataHelper::imageSize(*this, _target, level); + const Math::Vector size = DataHelper::imageSize(*this, level); const std::size_t dataSize = Implementation::imageDataSizeFor(image, size); /* Reallocate only if needed */ @@ -1531,12 +1531,12 @@ template void MAGNUM_EXPORT AbstractTexture::image<2>(GLint, BufferImage<2>&, Bu template void MAGNUM_EXPORT AbstractTexture::image<3>(GLint, BufferImage<3>&, BufferUsage); template void AbstractTexture::compressedImage(const GLint level, CompressedImage& image) { - const Math::Vector size = DataHelper::imageSize(*this, _target, level); + const Math::Vector size = DataHelper::imageSize(*this, level); GLint textureDataSize; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(_target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(_target, level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ Containers::Array data{image.release()}; @@ -1554,12 +1554,12 @@ template void MAGNUM_EXPORT AbstractTexture::compressedImage<2>(GLint, Compresse template void MAGNUM_EXPORT AbstractTexture::compressedImage<3>(GLint, CompressedImage<3>&); template void AbstractTexture::compressedImage(const GLint level, CompressedBufferImage& image, BufferUsage usage) { - const Math::Vector size = DataHelper::imageSize(*this, _target, level); + const Math::Vector size = DataHelper::imageSize(*this, level); GLint textureDataSize; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(_target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(_target, level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ if(image.dataSize() < dataSize) @@ -1626,30 +1626,30 @@ template void MAGNUM_EXPORT AbstractTexture::subImage<3>(GLint, const Range3Di&, #ifndef DOXYGEN_GENERATING_OUTPUT #ifndef MAGNUM_TARGET_GLES -Math::Vector<1, GLint> AbstractTexture::DataHelper<1>::imageSize(AbstractTexture& texture, GLenum, const GLint level) { +Math::Vector<1, GLint> AbstractTexture::DataHelper<1>::imageSize(AbstractTexture& texture, const GLint level) { Math::Vector<1, GLint> value; - (texture.*Context::current()->state().texture->getLevelParameterivImplementation)(texture._target, level, GL_TEXTURE_WIDTH, &value[0]); + (texture.*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_WIDTH, &value[0]); return value; } #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -Vector2i AbstractTexture::DataHelper<2>::imageSize(AbstractTexture& texture, const GLenum target, const GLint level) { +Vector2i AbstractTexture::DataHelper<2>::imageSize(AbstractTexture& texture, const GLint level) { const Implementation::TextureState& state = *Context::current()->state().texture; Vector2i value; - (texture.*state.getLevelParameterivImplementation)(target, level, GL_TEXTURE_WIDTH, &value[0]); - (texture.*state.getLevelParameterivImplementation)(target, level, GL_TEXTURE_HEIGHT, &value[1]); + (texture.*state.getLevelParameterivImplementation)(level, GL_TEXTURE_WIDTH, &value[0]); + (texture.*state.getLevelParameterivImplementation)(level, GL_TEXTURE_HEIGHT, &value[1]); return value; } -Vector3i AbstractTexture::DataHelper<3>::imageSize(AbstractTexture& texture, GLenum, const GLint level) { +Vector3i AbstractTexture::DataHelper<3>::imageSize(AbstractTexture& texture, const GLint level) { const Implementation::TextureState& state = *Context::current()->state().texture; Vector3i value; - (texture.*state.getLevelParameterivImplementation)(texture._target, level, GL_TEXTURE_WIDTH, &value[0]); - (texture.*state.getLevelParameterivImplementation)(texture._target, level, GL_TEXTURE_HEIGHT, &value[1]); - (texture.*state.getLevelParameterivImplementation)(texture._target, level, GL_TEXTURE_DEPTH, &value[2]); + (texture.*state.getLevelParameterivImplementation)(level, GL_TEXTURE_WIDTH, &value[0]); + (texture.*state.getLevelParameterivImplementation)(level, GL_TEXTURE_HEIGHT, &value[1]); + (texture.*state.getLevelParameterivImplementation)(level, GL_TEXTURE_DEPTH, &value[2]); return value; } #endif diff --git a/src/Magnum/AbstractTexture.h b/src/Magnum/AbstractTexture.h index 5784f1067..defd3bc1a 100644 --- a/src/Magnum/AbstractTexture.h +++ b/src/Magnum/AbstractTexture.h @@ -463,10 +463,10 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { void MAGNUM_LOCAL setMaxAnisotropyImplementationExt(GLfloat anisotropy); #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - void MAGNUM_LOCAL getLevelParameterImplementationDefault(GLenum target, GLint level, GLenum parameter, GLint* values); + void MAGNUM_LOCAL getLevelParameterImplementationDefault(GLint level, GLenum parameter, GLint* values); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL getLevelParameterImplementationDSA(GLenum, GLint level, GLenum parameter, GLint* values); - void MAGNUM_LOCAL getLevelParameterImplementationDSAEXT(GLenum target, GLint level, GLenum parameter, GLint* values); + void MAGNUM_LOCAL getLevelParameterImplementationDSA(GLint level, GLenum parameter, GLint* values); + void MAGNUM_LOCAL getLevelParameterImplementationDSAEXT(GLint level, GLenum parameter, GLint* values); #endif #endif @@ -584,7 +584,7 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { #ifndef DOXYGEN_GENERATING_OUTPUT #ifndef MAGNUM_TARGET_GLES template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<1> { - static Math::Vector<1, GLint> imageSize(AbstractTexture& texture, GLenum, GLint level); + static Math::Vector<1, GLint> imageSize(AbstractTexture& texture, GLint level); static void setWrapping(AbstractTexture& texture, const Array1D& wrapping); @@ -605,7 +605,7 @@ template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<1> { #endif template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<2> { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - static Vector2i imageSize(AbstractTexture& texture, GLenum target, GLint level); + static Vector2i imageSize(AbstractTexture& texture, GLint level); #endif static void setWrapping(AbstractTexture& texture, const Array2D& wrapping); @@ -647,7 +647,7 @@ template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<2> { template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<3> { #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #ifndef MAGNUM_TARGET_GLES2 - static Vector3i imageSize(AbstractTexture& texture, GLenum, GLint level); + static Vector3i imageSize(AbstractTexture& texture, GLint level); #endif static void setWrapping(AbstractTexture& texture, const Array3D& wrapping); diff --git a/src/Magnum/CubeMapTexture.cpp b/src/Magnum/CubeMapTexture.cpp index 2e2c15666..2e5e917c9 100644 --- a/src/Magnum/CubeMapTexture.cpp +++ b/src/Magnum/CubeMapTexture.cpp @@ -49,6 +49,17 @@ Vector2i CubeMapTexture::maxSize() { return Vector2i{Implementation::maxCubeMapTextureSideSize()}; } +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +Vector2i CubeMapTexture::imageSize(const Int level) { + const Implementation::TextureState& state = *Context::current()->state().texture; + + Vector2i value; + (this->*state.getCubeLevelParameterivImplementation)(level, GL_TEXTURE_WIDTH, &value[0]); + (this->*state.getCubeLevelParameterivImplementation)(level, GL_TEXTURE_HEIGHT, &value[1]); + return value; +} +#endif + #ifndef MAGNUM_TARGET_GLES void CubeMapTexture::image(const Int level, Image3D& image) { createIfNotAlready(); @@ -99,12 +110,10 @@ void CubeMapTexture::compressedImage(const Int level, CompressedImage3D& image) const Vector3i size{imageSize(level), 6}; GLint textureDataSize; - /* Similarly to imageSize(), use only parameters of +X in pre-DSA code path - and assume that all other slices are the same */ - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ Containers::Array data{image.release()}; @@ -127,12 +136,10 @@ void CubeMapTexture::compressedImage(const Int level, CompressedBufferImage3D& i const Vector3i size{imageSize(level), 6}; GLint textureDataSize; - /* Similarly to imageSize(), use only parameters of +X in pre-DSA code path - and assume that all other slices are the same */ - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ if(image.dataSize() < dataSize) @@ -193,12 +200,10 @@ BufferImage2D CubeMapTexture::image(const Coordinate coordinate, const Int level void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int level, CompressedImage2D& image) { const Vector2i size = imageSize(level); GLint textureDataSize; - /* Similarly to imageSize(), use only parameters of +X in pre-DSA code path - and assume that all other slices are the same */ - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ Containers::Array data{image.release()}; @@ -219,12 +224,10 @@ CompressedImage2D CubeMapTexture::compressedImage(const Coordinate coordinate, c void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int level, CompressedBufferImage2D& image, const BufferUsage usage) { const Vector2i size = imageSize(level); GLint textureDataSize; - /* Similarly to imageSize(), use only parameters of +X in pre-DSA code path - and assume that all other slices are the same */ - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ if(image.dataSize() < dataSize) @@ -337,6 +340,28 @@ CubeMapTexture& CubeMapTexture::setCompressedSubImage(const Coordinate coordinat } #endif +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +void CubeMapTexture::getLevelParameterImplementationDefault(const GLint level, const GLenum parameter, GLint* const values) { + bindInternal(); + /* Using only parameters of +X in pre-DSA code path and assuming that all + other faces are the same */ + glGetTexLevelParameteriv(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, parameter, values); +} + +#ifndef MAGNUM_TARGET_GLES +void CubeMapTexture::getLevelParameterImplementationDSA(const GLint level, const GLenum parameter, GLint* const values) { + glGetTextureLevelParameteriv(_id, level, parameter, values); +} + +void CubeMapTexture::getLevelParameterImplementationDSAEXT(const GLint level, const GLenum parameter, GLint* const values) { + _flags |= ObjectFlag::Created; + /* Using only parameters of +X in pre-DSA code path and assuming that all + other faces are the same */ + glGetTextureLevelParameterivEXT(_id, GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, parameter, values); +} +#endif +#endif + #ifndef MAGNUM_TARGET_GLES void CubeMapTexture::getImageImplementationDefault(const Coordinate coordinate, const GLint level, const Vector2i&, const PixelFormat format, const PixelType type, std::size_t, GLvoid* const data) { bindInternal(); diff --git a/src/Magnum/CubeMapTexture.h b/src/Magnum/CubeMapTexture.h index 11331a67e..9f0a4ffc8 100644 --- a/src/Magnum/CubeMapTexture.h +++ b/src/Magnum/CubeMapTexture.h @@ -421,9 +421,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @requires_gles Texture image size queries are not available in * WebGL. */ - Vector2i imageSize(Int level) { - return DataHelper<2>::imageSize(*this, GL_TEXTURE_CUBE_MAP_POSITIVE_X, level); - } + Vector2i imageSize(Int level); #ifdef MAGNUM_BUILD_DEPRECATED /** @@ -946,6 +944,14 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { private: explicit CubeMapTexture(GLuint id, ObjectFlags flags) noexcept: AbstractTexture{id, GL_TEXTURE_CUBE_MAP, flags} {} + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + void MAGNUM_LOCAL getLevelParameterImplementationDefault(GLint level, GLenum parameter, GLint* values); + #ifndef MAGNUM_TARGET_GLES + void MAGNUM_LOCAL getLevelParameterImplementationDSA(GLint level, GLenum parameter, GLint* values); + void MAGNUM_LOCAL getLevelParameterImplementationDSAEXT(GLint level, GLenum parameter, GLint* values); + #endif + #endif + #ifndef MAGNUM_TARGET_GLES void MAGNUM_LOCAL getImageImplementationDefault(Coordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); void MAGNUM_LOCAL getImageImplementationDSA(Coordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); diff --git a/src/Magnum/CubeMapTextureArray.h b/src/Magnum/CubeMapTextureArray.h index 880a31128..059c05add 100644 --- a/src/Magnum/CubeMapTextureArray.h +++ b/src/Magnum/CubeMapTextureArray.h @@ -368,7 +368,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture { * See @ref Texture::imageSize() for more information. */ Vector3i imageSize(Int level) { - return DataHelper<3>::imageSize(*this, _target, level); + return DataHelper<3>::imageSize(*this, level); } #ifndef MAGNUM_TARGET_GLES diff --git a/src/Magnum/Implementation/TextureState.cpp b/src/Magnum/Implementation/TextureState.cpp index 31f5f582f..0ece7be34 100644 --- a/src/Magnum/Implementation/TextureState.cpp +++ b/src/Magnum/Implementation/TextureState.cpp @@ -135,6 +135,7 @@ TextureState::TextureState(Context& context, std::vector& extension setBufferImplementation = &BufferTexture::setBufferImplementationDSA; setBufferRangeImplementation = &BufferTexture::setBufferRangeImplementationDSA; + getCubeLevelParameterivImplementation = &CubeMapTexture::getLevelParameterImplementationDSA; cubeSubImageImplementation = &CubeMapTexture::subImageImplementationDSA; cubeCompressedSubImageImplementation = &CubeMapTexture::compressedSubImageImplementationDSA; @@ -159,6 +160,7 @@ TextureState::TextureState(Context& context, std::vector& extension setBufferImplementation = &BufferTexture::setBufferImplementationDSAEXT; setBufferRangeImplementation = &BufferTexture::setBufferRangeImplementationDSAEXT; + getCubeLevelParameterivImplementation = &CubeMapTexture::getLevelParameterImplementationDSAEXT; cubeSubImageImplementation = &CubeMapTexture::subImageImplementationDSAEXT; cubeCompressedSubImageImplementation = &CubeMapTexture::compressedSubImageImplementationDSAEXT; @@ -195,6 +197,9 @@ TextureState::TextureState(Context& context, std::vector& extension setBufferRangeImplementation = &BufferTexture::setBufferRangeImplementationDefault; #endif + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + getCubeLevelParameterivImplementation = &CubeMapTexture::getLevelParameterImplementationDefault; + #endif cubeSubImageImplementation = &CubeMapTexture::subImageImplementationDefault; cubeCompressedSubImageImplementation = &CubeMapTexture::compressedSubImageImplementationDefault; } diff --git a/src/Magnum/Implementation/TextureState.h b/src/Magnum/Implementation/TextureState.h index 43035a9e2..81ab20a42 100644 --- a/src/Magnum/Implementation/TextureState.h +++ b/src/Magnum/Implementation/TextureState.h @@ -61,7 +61,7 @@ struct TextureState { #endif void(AbstractTexture::*setMaxAnisotropyImplementation)(GLfloat); #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - void(AbstractTexture::*getLevelParameterivImplementation)(GLenum, GLint, GLenum, GLint*); + void(AbstractTexture::*getLevelParameterivImplementation)(GLint, GLenum, GLint*); #endif void(AbstractTexture::*mipmapImplementation)(); #ifndef MAGNUM_TARGET_GLES @@ -97,6 +97,9 @@ struct TextureState { void(BufferTexture::*setBufferRangeImplementation)(BufferTextureFormat, Buffer&, GLintptr, GLsizeiptr); #endif + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + void(CubeMapTexture::*getCubeLevelParameterivImplementation)(GLint, GLenum, GLint*); + #endif #ifndef MAGNUM_TARGET_GLES void(CubeMapTexture::*getCubeImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, PixelFormat, PixelType, std::size_t, GLvoid*); void(CubeMapTexture::*getCompressedCubeImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, std::size_t, GLvoid*); diff --git a/src/Magnum/MultisampleTexture.h b/src/Magnum/MultisampleTexture.h index d806d4a0c..d9d42e3d8 100644 --- a/src/Magnum/MultisampleTexture.h +++ b/src/Magnum/MultisampleTexture.h @@ -210,7 +210,7 @@ template class MultisampleTexture: public AbstractTextur * OpenGL ES 3.0 and older. */ VectorTypeFor imageSize() { - return DataHelper::imageSize(*this, _target, 0); + return DataHelper::imageSize(*this, 0); } /** diff --git a/src/Magnum/RectangleTexture.h b/src/Magnum/RectangleTexture.h index dabe8f4c2..0962c9e7a 100644 --- a/src/Magnum/RectangleTexture.h +++ b/src/Magnum/RectangleTexture.h @@ -275,7 +275,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture { * * See @ref Texture::imageSize() for more information. */ - Vector2i imageSize() { return DataHelper<2>::imageSize(*this, _target, 0); } + Vector2i imageSize() { return DataHelper<2>::imageSize(*this, 0); } /** * @brief Read texture to image diff --git a/src/Magnum/Texture.h b/src/Magnum/Texture.h index 3d274b4be..8bfa7e9bc 100644 --- a/src/Magnum/Texture.h +++ b/src/Magnum/Texture.h @@ -625,7 +625,7 @@ template class Texture: public AbstractTexture { * WebGL. */ VectorTypeFor imageSize(Int level) { - return DataHelper::imageSize(*this, _target, level); + return DataHelper::imageSize(*this, level); } #endif diff --git a/src/Magnum/TextureArray.h b/src/Magnum/TextureArray.h index 00867ac36..e87cba8ec 100644 --- a/src/Magnum/TextureArray.h +++ b/src/Magnum/TextureArray.h @@ -388,7 +388,7 @@ template class TextureArray: public AbstractTexture { * WebGL. */ VectorTypeFor imageSize(Int level) { - return DataHelper::imageSize(*this, _target, level); + return DataHelper::imageSize(*this, level); } #endif From 7d0a5d904782091bbd2e4d001c15e731305f535f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 00:05:21 +0100 Subject: [PATCH 030/258] Make it possible to get predictable compressed cubemap image sizes. I expect the drivers to return size of *one* face when I'm querying that particular face using the pre-DSA or EXT_DSA API and size of *all* six faces when I'm querying whole texture using DSA API. One can dream, eh? It appears that, at least on my NVidia, the returned value does not depend on whether I'm querying all faces or a single one, but RATHER is based on whether the texture is immutable or not. How's that predictable at all?! Workaround in the next commit. --- src/Magnum/CubeMapTexture.cpp | 48 ++++++++++++++++++---- src/Magnum/CubeMapTexture.h | 8 ++++ src/Magnum/Implementation/TextureState.cpp | 3 ++ src/Magnum/Implementation/TextureState.h | 1 + 4 files changed, 52 insertions(+), 8 deletions(-) diff --git a/src/Magnum/CubeMapTexture.cpp b/src/Magnum/CubeMapTexture.cpp index 2e5e917c9..569a3dbd9 100644 --- a/src/Magnum/CubeMapTexture.cpp +++ b/src/Magnum/CubeMapTexture.cpp @@ -109,8 +109,7 @@ void CubeMapTexture::compressedImage(const Int level, CompressedImage3D& image) createIfNotAlready(); const Vector3i size{imageSize(level), 6}; - GLint textureDataSize; - (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + const GLint textureDataSize = (this->*Context::current()->state().texture->getCubeLevelCompressedImageSizeImplementation)(level); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); @@ -135,8 +134,7 @@ void CubeMapTexture::compressedImage(const Int level, CompressedBufferImage3D& i createIfNotAlready(); const Vector3i size{imageSize(level), 6}; - GLint textureDataSize; - (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + const GLint textureDataSize = (this->*Context::current()->state().texture->getCubeLevelCompressedImageSizeImplementation)(level); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); @@ -199,8 +197,9 @@ BufferImage2D CubeMapTexture::image(const Coordinate coordinate, const Int level void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int level, CompressedImage2D& image) { const Vector2i size = imageSize(level); - GLint textureDataSize; - (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + /* The function returns size of all six faces, divide the result to get size + of one face */ + const GLint textureDataSize = (this->*Context::current()->state().texture->getCubeLevelCompressedImageSizeImplementation)(level)/6; const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); @@ -223,8 +222,9 @@ CompressedImage2D CubeMapTexture::compressedImage(const Coordinate coordinate, c void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int level, CompressedBufferImage2D& image, const BufferUsage usage) { const Vector2i size = imageSize(level); - GLint textureDataSize; - (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + /* The function returns size of all six faces, divide the result to get size + of one face */ + const GLint textureDataSize = (this->*Context::current()->state().texture->getCubeLevelCompressedImageSizeImplementation)(level)/6; const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); @@ -362,6 +362,38 @@ void CubeMapTexture::getLevelParameterImplementationDSAEXT(const GLint level, co #endif #endif +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +GLint CubeMapTexture::getLevelCompressedImageSizeImplementationDefault(const GLint level) { + bindInternal(); + /* Using only parameters of +X in pre-DSA code path and assuming that all + other faces are the same */ + GLint value; + glGetTexLevelParameteriv(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &value); + + /* Size of all six faces */ + return value*6; +} + +#ifndef MAGNUM_TARGET_GLES +GLint CubeMapTexture::getLevelCompressedImageSizeImplementationDSA(const GLint level) { + GLint value; + glGetTextureLevelParameteriv(_id, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &value); + return value; +} + +GLint CubeMapTexture::getLevelCompressedImageSizeImplementationDSAEXT(const GLint level) { + _flags |= ObjectFlag::Created; + /* Using only parameters of +X in pre-DSA code path and assuming that all + other faces are the same */ + GLint value; + glGetTextureLevelParameterivEXT(_id, GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &value); + + /* Size of all six faces */ + return value*6; +} +#endif +#endif + #ifndef MAGNUM_TARGET_GLES void CubeMapTexture::getImageImplementationDefault(const Coordinate coordinate, const GLint level, const Vector2i&, const PixelFormat format, const PixelType type, std::size_t, GLvoid* const data) { bindInternal(); diff --git a/src/Magnum/CubeMapTexture.h b/src/Magnum/CubeMapTexture.h index 9f0a4ffc8..4e4b0c4d9 100644 --- a/src/Magnum/CubeMapTexture.h +++ b/src/Magnum/CubeMapTexture.h @@ -952,6 +952,14 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { #endif #endif + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + GLint MAGNUM_LOCAL getLevelCompressedImageSizeImplementationDefault(GLint level); + #ifndef MAGNUM_TARGET_GLES + GLint MAGNUM_LOCAL getLevelCompressedImageSizeImplementationDSA(GLint level); + GLint MAGNUM_LOCAL getLevelCompressedImageSizeImplementationDSAEXT(GLint level); + #endif + #endif + #ifndef MAGNUM_TARGET_GLES void MAGNUM_LOCAL getImageImplementationDefault(Coordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); void MAGNUM_LOCAL getImageImplementationDSA(Coordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); diff --git a/src/Magnum/Implementation/TextureState.cpp b/src/Magnum/Implementation/TextureState.cpp index 0ece7be34..ec127405e 100644 --- a/src/Magnum/Implementation/TextureState.cpp +++ b/src/Magnum/Implementation/TextureState.cpp @@ -136,6 +136,7 @@ TextureState::TextureState(Context& context, std::vector& extension setBufferRangeImplementation = &BufferTexture::setBufferRangeImplementationDSA; getCubeLevelParameterivImplementation = &CubeMapTexture::getLevelParameterImplementationDSA; + getCubeLevelCompressedImageSizeImplementation = &CubeMapTexture::getLevelCompressedImageSizeImplementationDSA; cubeSubImageImplementation = &CubeMapTexture::subImageImplementationDSA; cubeCompressedSubImageImplementation = &CubeMapTexture::compressedSubImageImplementationDSA; @@ -161,6 +162,7 @@ TextureState::TextureState(Context& context, std::vector& extension setBufferRangeImplementation = &BufferTexture::setBufferRangeImplementationDSAEXT; getCubeLevelParameterivImplementation = &CubeMapTexture::getLevelParameterImplementationDSAEXT; + getCubeLevelCompressedImageSizeImplementation = &CubeMapTexture::getLevelCompressedImageSizeImplementationDSAEXT; cubeSubImageImplementation = &CubeMapTexture::subImageImplementationDSAEXT; cubeCompressedSubImageImplementation = &CubeMapTexture::compressedSubImageImplementationDSAEXT; @@ -199,6 +201,7 @@ TextureState::TextureState(Context& context, std::vector& extension #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) getCubeLevelParameterivImplementation = &CubeMapTexture::getLevelParameterImplementationDefault; + getCubeLevelCompressedImageSizeImplementation = &CubeMapTexture::getLevelCompressedImageSizeImplementationDefault; #endif cubeSubImageImplementation = &CubeMapTexture::subImageImplementationDefault; cubeCompressedSubImageImplementation = &CubeMapTexture::compressedSubImageImplementationDefault; diff --git a/src/Magnum/Implementation/TextureState.h b/src/Magnum/Implementation/TextureState.h index 81ab20a42..85ceb0b7b 100644 --- a/src/Magnum/Implementation/TextureState.h +++ b/src/Magnum/Implementation/TextureState.h @@ -99,6 +99,7 @@ struct TextureState { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void(CubeMapTexture::*getCubeLevelParameterivImplementation)(GLint, GLenum, GLint*); + GLint(CubeMapTexture::*getCubeLevelCompressedImageSizeImplementation)(GLint); #endif #ifndef MAGNUM_TARGET_GLES void(CubeMapTexture::*getCubeImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, PixelFormat, PixelType, std::size_t, GLvoid*); From ea376e2fbccd422704d2b3607c9c94c09afa0c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 1 Jan 2016 23:06:45 +0100 Subject: [PATCH 031/258] Test that GL_TEXTURE_COMPRESSED_IMAGE_SIZE behaves consistently on cubemap. It returns different value based on whether the cube map is immutable (allocated using setStorage()) or a sequence of setImage() calls, well, at least on my NVidia. That should not happen, workaround incoming. --- src/Magnum/Test/CubeMapTextureGLTest.cpp | 49 ++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/src/Magnum/Test/CubeMapTextureGLTest.cpp b/src/Magnum/Test/CubeMapTextureGLTest.cpp index 0c4de0409..3e2d39541 100644 --- a/src/Magnum/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureGLTest.cpp @@ -74,6 +74,7 @@ struct CubeMapTextureGLTest: AbstractOpenGLTester { void imageBuffer(); void compressedImageBuffer(); #endif + void immutableCompressedImage(); #ifndef MAGNUM_TARGET_GLES void fullImageQuery(); void compressedFullImageQuery(); @@ -140,6 +141,7 @@ CubeMapTextureGLTest::CubeMapTextureGLTest() { &CubeMapTextureGLTest::imageBuffer, &CubeMapTextureGLTest::compressedImageBuffer, #endif + &CubeMapTextureGLTest::immutableCompressedImage, #ifndef MAGNUM_TARGET_GLES &CubeMapTextureGLTest::fullImageQuery, &CubeMapTextureGLTest::compressedFullImageQuery, @@ -549,6 +551,53 @@ void CubeMapTextureGLTest::compressedImageBuffer() { } #endif +void CubeMapTextureGLTest::immutableCompressedImage() { + #ifndef MAGNUM_TARGET_GLES + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::texture_storage::string() + std::string(" is not supported.")); + #elif defined(MAGNUM_TARGET_GLES2) + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_storage::string() + std::string(" is not supported.")); + #endif + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + + /* Testing that GL_TEXTURE_COMPRESSED_IMAGE_SIZE is consistent and returns + the same value regardless whether the texture is immutable or not. (Not + the case, at least on NVidia 358.16, compare with compressedImage() test + case that just calls setImage() six times instead of setStorage() and + gets value that's six times smaller. I couldn't find anything in the + specs so I suspect it's a bug). */ + + const CompressedImageView2D view{ + #ifndef MAGNUM_TARGET_GLES + _compressedDataStorage, + #endif + CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, unsafeSuffix(CompressedData, _compressedDataOffset)}; + + CubeMapTexture texture; + texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, Vector2i{4}) + .setCompressedSubImage(CubeMapTexture::Coordinate::PositiveX, 0, {}, view) + .setCompressedSubImage(CubeMapTexture::Coordinate::NegativeX, 0, {}, view) + .setCompressedSubImage(CubeMapTexture::Coordinate::PositiveY, 0, {}, view) + .setCompressedSubImage(CubeMapTexture::Coordinate::NegativeY, 0, {}, view) + .setCompressedSubImage(CubeMapTexture::Coordinate::PositiveZ, 0, {}, view) + .setCompressedSubImage(CubeMapTexture::Coordinate::NegativeZ, 0, {}, view); + + MAGNUM_VERIFY_NO_ERROR(); + + #ifndef MAGNUM_TARGET_GLES + CompressedImage2D image = texture.compressedImage(CubeMapTexture::Coordinate::NegativeY, 0, {}); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), Vector2i{4}); + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}), + Containers::ArrayView{CompressedData}, TestSuite::Compare::Container); + #endif +} + #ifndef MAGNUM_TARGET_GLES namespace { constexpr UnsignedByte FullData[] = { 0x00, 0x01, 0x02, 0x03, From 9715e0c4b830611bda7c74621f460bfdbb61857d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 00:32:14 +0100 Subject: [PATCH 032/258] Add NVidia to list of detected drivers. I hoped this commit will never need to happen. --- src/Magnum/Context.h | 7 ++++++- src/Magnum/Implementation/driverSpecific.cpp | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index 3522be233..a9b1347b2 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -209,6 +209,11 @@ class MAGNUM_EXPORT Context { IntelWindows = 1 << 1, #endif + #ifndef MAGNUM_TARGET_WEBGL + /** Binary NVidia drivers */ + NVidia = 1 << 2, + #endif + #ifdef MAGNUM_TARGET_GLES /** * OpenGL ES implementation by ANGLE (translated to D3D), used by @@ -216,7 +221,7 @@ class MAGNUM_EXPORT Context { * specification explicitly disallows exposing driver information * to the application, this check cannot be done reliably. */ - ProbablyAngle = 1 << 2 + ProbablyAngle = 1 << 3 #endif }; diff --git a/src/Magnum/Implementation/driverSpecific.cpp b/src/Magnum/Implementation/driverSpecific.cpp index b95d15a3e..8be35d1a2 100644 --- a/src/Magnum/Implementation/driverSpecific.cpp +++ b/src/Magnum/Implementation/driverSpecific.cpp @@ -113,6 +113,11 @@ auto Context::detectedDriver() -> DetectedDrivers { #endif #endif + #ifndef MAGNUM_TARGET_WEBGL + if(vendor.find("NVIDIA Corporation") != std::string::npos) + return *_detectedDrivers |= DetectedDriver::NVidia; + #endif + /** @todo there is also D3D9/D3D11 distinction on webglreport.com, is it useful? */ #ifdef MAGNUM_TARGET_GLES /* OpenGL ES implementation using ANGLE. Taken from these sources: From 6bb6c4c398b89ecd3257393a6295bae58d8b9395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 00:32:54 +0100 Subject: [PATCH 033/258] Add workaround for inconsistent cubemap compressed image size on NVidia. The affected test case now passes again. --- src/Magnum/CubeMapTexture.cpp | 28 +++++++++++++++++--- src/Magnum/CubeMapTexture.h | 7 ++--- src/Magnum/Implementation/TextureState.cpp | 20 +++++++++++--- src/Magnum/Implementation/TextureState.h | 2 +- src/Magnum/Implementation/driverSpecific.cpp | 6 +++++ 5 files changed, 53 insertions(+), 10 deletions(-) diff --git a/src/Magnum/CubeMapTexture.cpp b/src/Magnum/CubeMapTexture.cpp index 569a3dbd9..e1c7d48b8 100644 --- a/src/Magnum/CubeMapTexture.cpp +++ b/src/Magnum/CubeMapTexture.cpp @@ -362,7 +362,7 @@ void CubeMapTexture::getLevelParameterImplementationDSAEXT(const GLint level, co #endif #endif -#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +#ifndef MAGNUM_TARGET_GLES GLint CubeMapTexture::getLevelCompressedImageSizeImplementationDefault(const GLint level) { bindInternal(); /* Using only parameters of +X in pre-DSA code path and assuming that all @@ -374,13 +374,28 @@ GLint CubeMapTexture::getLevelCompressedImageSizeImplementationDefault(const GLi return value*6; } -#ifndef MAGNUM_TARGET_GLES +GLint CubeMapTexture::getLevelCompressedImageSizeImplementationDefaultImmutableWorkaround(const GLint level) { + const GLint value = getLevelCompressedImageSizeImplementationDefault(level); + + GLint immutable; + glGetTexParameteriv(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_IMMUTABLE_LEVELS, &immutable); + return immutable ? value/6 : value; +} + GLint CubeMapTexture::getLevelCompressedImageSizeImplementationDSA(const GLint level) { GLint value; glGetTextureLevelParameteriv(_id, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &value); return value; } +GLint CubeMapTexture::getLevelCompressedImageSizeImplementationDSANonImmutableWorkaround(const GLint level) { + const GLint value = getLevelCompressedImageSizeImplementationDSA(level); + + GLint immutable; + glGetTextureParameteriv(_id, GL_TEXTURE_IMMUTABLE_LEVELS, &immutable); + return immutable ? value : value*6; +} + GLint CubeMapTexture::getLevelCompressedImageSizeImplementationDSAEXT(const GLint level) { _flags |= ObjectFlag::Created; /* Using only parameters of +X in pre-DSA code path and assuming that all @@ -391,7 +406,14 @@ GLint CubeMapTexture::getLevelCompressedImageSizeImplementationDSAEXT(const GLin /* Size of all six faces */ return value*6; } -#endif + +GLint CubeMapTexture::getLevelCompressedImageSizeImplementationDSAEXTImmutableWorkaround(const GLint level) { + const GLint value = getLevelCompressedImageSizeImplementationDSAEXT(level); + + GLint immutable; + glGetTextureParameterivEXT(_id, GL_TEXTURE_CUBE_MAP, GL_TEXTURE_IMMUTABLE_LEVELS, &immutable); + return immutable ? value/6 : value; +} #endif #ifndef MAGNUM_TARGET_GLES diff --git a/src/Magnum/CubeMapTexture.h b/src/Magnum/CubeMapTexture.h index 4e4b0c4d9..f49d8966c 100644 --- a/src/Magnum/CubeMapTexture.h +++ b/src/Magnum/CubeMapTexture.h @@ -952,12 +952,13 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { #endif #endif - #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - GLint MAGNUM_LOCAL getLevelCompressedImageSizeImplementationDefault(GLint level); #ifndef MAGNUM_TARGET_GLES + GLint MAGNUM_LOCAL getLevelCompressedImageSizeImplementationDefault(GLint level); + GLint MAGNUM_LOCAL getLevelCompressedImageSizeImplementationDefaultImmutableWorkaround(GLint level); GLint MAGNUM_LOCAL getLevelCompressedImageSizeImplementationDSA(GLint level); + GLint MAGNUM_LOCAL getLevelCompressedImageSizeImplementationDSANonImmutableWorkaround(GLint level); GLint MAGNUM_LOCAL getLevelCompressedImageSizeImplementationDSAEXT(GLint level); - #endif + GLint MAGNUM_LOCAL getLevelCompressedImageSizeImplementationDSAEXTImmutableWorkaround(GLint level); #endif #ifndef MAGNUM_TARGET_GLES diff --git a/src/Magnum/Implementation/TextureState.cpp b/src/Magnum/Implementation/TextureState.cpp index ec127405e..0d0491a55 100644 --- a/src/Magnum/Implementation/TextureState.cpp +++ b/src/Magnum/Implementation/TextureState.cpp @@ -136,7 +136,6 @@ TextureState::TextureState(Context& context, std::vector& extension setBufferRangeImplementation = &BufferTexture::setBufferRangeImplementationDSA; getCubeLevelParameterivImplementation = &CubeMapTexture::getLevelParameterImplementationDSA; - getCubeLevelCompressedImageSizeImplementation = &CubeMapTexture::getLevelCompressedImageSizeImplementationDSA; cubeSubImageImplementation = &CubeMapTexture::subImageImplementationDSA; cubeCompressedSubImageImplementation = &CubeMapTexture::compressedSubImageImplementationDSA; @@ -162,7 +161,6 @@ TextureState::TextureState(Context& context, std::vector& extension setBufferRangeImplementation = &BufferTexture::setBufferRangeImplementationDSAEXT; getCubeLevelParameterivImplementation = &CubeMapTexture::getLevelParameterImplementationDSAEXT; - getCubeLevelCompressedImageSizeImplementation = &CubeMapTexture::getLevelCompressedImageSizeImplementationDSAEXT; cubeSubImageImplementation = &CubeMapTexture::subImageImplementationDSAEXT; cubeCompressedSubImageImplementation = &CubeMapTexture::compressedSubImageImplementationDSAEXT; @@ -201,7 +199,6 @@ TextureState::TextureState(Context& context, std::vector& extension #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) getCubeLevelParameterivImplementation = &CubeMapTexture::getLevelParameterImplementationDefault; - getCubeLevelCompressedImageSizeImplementation = &CubeMapTexture::getLevelCompressedImageSizeImplementationDefault; #endif cubeSubImageImplementation = &CubeMapTexture::subImageImplementationDefault; cubeCompressedSubImageImplementation = &CubeMapTexture::compressedSubImageImplementationDefault; @@ -222,6 +219,23 @@ TextureState::TextureState(Context& context, std::vector& extension } #ifndef MAGNUM_TARGET_GLES + /* Compressed cubemap image size query implementation (extensions added + above) */ + if((context.detectedDriver() & Context::DetectedDriver::NVidia) && + !context.isDriverWorkaroundDisabled("nv-cubemap-inconsistent-compressed-image-size")) { + if(context.isExtensionSupported()) + getCubeLevelCompressedImageSizeImplementation = &CubeMapTexture::getLevelCompressedImageSizeImplementationDSANonImmutableWorkaround; + else if(context.isExtensionSupported()) + getCubeLevelCompressedImageSizeImplementation = &CubeMapTexture::getLevelCompressedImageSizeImplementationDSAEXTImmutableWorkaround; + else getCubeLevelCompressedImageSizeImplementation = &CubeMapTexture::getLevelCompressedImageSizeImplementationDefaultImmutableWorkaround; + } else { + if(context.isExtensionSupported()) + getCubeLevelCompressedImageSizeImplementation = &CubeMapTexture::getLevelCompressedImageSizeImplementationDSA; + else if(context.isExtensionSupported()) + getCubeLevelCompressedImageSizeImplementation = &CubeMapTexture::getLevelCompressedImageSizeImplementationDSAEXT; + else getCubeLevelCompressedImageSizeImplementation = &CubeMapTexture::getLevelCompressedImageSizeImplementationDefault; + } + /* Image retrieval implementation */ if(context.isExtensionSupported()) { /* Extension name added above */ diff --git a/src/Magnum/Implementation/TextureState.h b/src/Magnum/Implementation/TextureState.h index 85ceb0b7b..d7ff7ed15 100644 --- a/src/Magnum/Implementation/TextureState.h +++ b/src/Magnum/Implementation/TextureState.h @@ -99,9 +99,9 @@ struct TextureState { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void(CubeMapTexture::*getCubeLevelParameterivImplementation)(GLint, GLenum, GLint*); - GLint(CubeMapTexture::*getCubeLevelCompressedImageSizeImplementation)(GLint); #endif #ifndef MAGNUM_TARGET_GLES + GLint(CubeMapTexture::*getCubeLevelCompressedImageSizeImplementation)(GLint); void(CubeMapTexture::*getCubeImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, PixelFormat, PixelType, std::size_t, GLvoid*); void(CubeMapTexture::*getCompressedCubeImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, std::size_t, GLvoid*); #endif diff --git a/src/Magnum/Implementation/driverSpecific.cpp b/src/Magnum/Implementation/driverSpecific.cpp index 8be35d1a2..2ee50b188 100644 --- a/src/Magnum/Implementation/driverSpecific.cpp +++ b/src/Magnum/Implementation/driverSpecific.cpp @@ -51,6 +51,12 @@ namespace { 1.30 on NVidia and 1.40 on Mac OS X. Everything is fine when using newer GLSL version. */ "no-layout-qualifiers-on-old-glsl", + + /* NVidia drivers (358.16) report different compressed image size for + cubemaps based on whether the texture is immutable or not and not + based on whether I'm querying all faces (ARB_DSA) or a single face + (non-DSA, EXT_DSA) */ + "nv-cubemap-inconsistent-compressed-image-size", #endif #ifdef CORRADE_TARGET_NACL From f746eaaf7dc7191724646344f878314a62a75e99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 01:11:06 +0100 Subject: [PATCH 034/258] Workaround broken full cube map compressed image query on NVidia. The query returns only data of the first cube map face and not the others, worked around that by querying each face separately. --- src/Magnum/CubeMapTexture.cpp | 29 ++++++++++++++------ src/Magnum/CubeMapTexture.h | 3 ++ src/Magnum/Implementation/TextureState.cpp | 9 ++++++ src/Magnum/Implementation/TextureState.h | 1 + src/Magnum/Implementation/driverSpecific.cpp | 4 +++ 5 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/Magnum/CubeMapTexture.cpp b/src/Magnum/CubeMapTexture.cpp index e1c7d48b8..f29e4ea51 100644 --- a/src/Magnum/CubeMapTexture.cpp +++ b/src/Magnum/CubeMapTexture.cpp @@ -110,18 +110,19 @@ void CubeMapTexture::compressedImage(const Int level, CompressedImage3D& image) const Vector3i size{imageSize(level), 6}; const GLint textureDataSize = (this->*Context::current()->state().texture->getCubeLevelCompressedImageSizeImplementation)(level); - const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); + std::size_t dataOffset, dataSize; + std::tie(dataOffset, dataSize) = Implementation::compressedImageDataOffsetSizeFor(image, size, textureDataSize); GLint format; (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ Containers::Array data{image.release()}; - if(data.size() < dataSize) - data = Containers::Array{dataSize}; + if(data.size() < dataOffset + dataSize) + data = Containers::Array{dataOffset + dataSize}; Buffer::unbindInternal(Buffer::TargetHint::PixelPack); image.storage().applyPack(); - glGetCompressedTextureImage(_id, level, data.size(), data); + (this->*Context::current()->state().texture->getFullCompressedCubeImageImplementation)(level, size.xy(), dataOffset, dataSize, data); image.setData(image.storage(), CompressedPixelFormat(format), size, std::move(data)); } @@ -135,19 +136,20 @@ void CubeMapTexture::compressedImage(const Int level, CompressedBufferImage3D& i const Vector3i size{imageSize(level), 6}; const GLint textureDataSize = (this->*Context::current()->state().texture->getCubeLevelCompressedImageSizeImplementation)(level); - const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); + std::size_t dataOffset, dataSize; + std::tie(dataOffset, dataSize) = Implementation::compressedImageDataOffsetSizeFor(image, size, textureDataSize); GLint format; (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ - if(image.dataSize() < dataSize) - image.setData(image.storage(), CompressedPixelFormat(format), size, {nullptr, dataSize}, usage); + if(image.dataSize() < dataOffset + dataSize) + image.setData(image.storage(), CompressedPixelFormat(format), size, {nullptr, dataOffset + dataSize}, usage); else image.setData(image.storage(), CompressedPixelFormat(format), size, nullptr, usage); image.buffer().bindInternal(Buffer::TargetHint::PixelPack); image.storage().applyPack(); - glGetCompressedTextureImage(_id, level, dataSize, nullptr); + (this->*Context::current()->state().texture->getFullCompressedCubeImageImplementation)(level, size.xy(), dataOffset, dataSize, nullptr); } CompressedBufferImage3D CubeMapTexture::compressedImage(const Int level, CompressedBufferImage3D&& image, const BufferUsage usage) { @@ -417,6 +419,17 @@ GLint CubeMapTexture::getLevelCompressedImageSizeImplementationDSAEXTImmutableWo #endif #ifndef MAGNUM_TARGET_GLES +void CubeMapTexture::getCompressedImageImplementationDSA(const GLint level, const Vector2i&, const std::size_t dataOffset, const std::size_t dataSize, GLvoid* const data) { + glGetCompressedTextureImage(_id, level, dataOffset + dataSize, data); +} + +void CubeMapTexture::getCompressedImageImplementationDSASingleSliceWorkaround(const GLint level, const Vector2i& size, const std::size_t dataOffset, const std::size_t dataSize, GLvoid* const data) { + /* On NVidia (358.16) calling glGetCompressedTextureImage() extracts only + the first face */ + for(Int face = 0; face != 6; ++face) + glGetCompressedTextureSubImage(_id, level, 0, 0, face, size.x(), size.y(), 1, dataOffset + dataSize/6, static_cast(data) + dataSize*face/6); +} + void CubeMapTexture::getImageImplementationDefault(const Coordinate coordinate, const GLint level, const Vector2i&, const PixelFormat format, const PixelType type, std::size_t, GLvoid* const data) { bindInternal(); glGetTexImage(GLenum(coordinate), level, GLenum(format), GLenum(type), data); diff --git a/src/Magnum/CubeMapTexture.h b/src/Magnum/CubeMapTexture.h index f49d8966c..98650ab4f 100644 --- a/src/Magnum/CubeMapTexture.h +++ b/src/Magnum/CubeMapTexture.h @@ -962,6 +962,9 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { #endif #ifndef MAGNUM_TARGET_GLES + void MAGNUM_LOCAL getCompressedImageImplementationDSA(GLint level, const Vector2i& size, std::size_t dataOffset, std::size_t dataSize, GLvoid* data); + void MAGNUM_LOCAL getCompressedImageImplementationDSASingleSliceWorkaround(GLint level, const Vector2i& size, std::size_t dataOffset, std::size_t dataSize, GLvoid* data); + void MAGNUM_LOCAL getImageImplementationDefault(Coordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); void MAGNUM_LOCAL getImageImplementationDSA(Coordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); void MAGNUM_LOCAL getImageImplementationDSAEXT(Coordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); diff --git a/src/Magnum/Implementation/TextureState.cpp b/src/Magnum/Implementation/TextureState.cpp index 0d0491a55..c3073daa3 100644 --- a/src/Magnum/Implementation/TextureState.cpp +++ b/src/Magnum/Implementation/TextureState.cpp @@ -277,6 +277,15 @@ TextureState::TextureState(Context& context, std::vector& extension getCubeImageImplementation = &CubeMapTexture::getImageImplementationDefault; getCompressedCubeImageImplementation = &CubeMapTexture::getCompressedImageImplementationDefault; } + + /* Full compressed cubemap image query implementation (extensions added + above) */ + if((context.detectedDriver() & Context::DetectedDriver::NVidia) && + context.isExtensionSupported() && + !context.isDriverWorkaroundDisabled("nv-cubemap-broken-full-compressed-image-query")) + getFullCompressedCubeImageImplementation = &CubeMapTexture::getCompressedImageImplementationDSASingleSliceWorkaround; + else + getFullCompressedCubeImageImplementation = &CubeMapTexture::getCompressedImageImplementationDSA; #endif /* Texture storage implementation for desktop and ES */ diff --git a/src/Magnum/Implementation/TextureState.h b/src/Magnum/Implementation/TextureState.h index d7ff7ed15..475c62b27 100644 --- a/src/Magnum/Implementation/TextureState.h +++ b/src/Magnum/Implementation/TextureState.h @@ -103,6 +103,7 @@ struct TextureState { #ifndef MAGNUM_TARGET_GLES GLint(CubeMapTexture::*getCubeLevelCompressedImageSizeImplementation)(GLint); void(CubeMapTexture::*getCubeImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, PixelFormat, PixelType, std::size_t, GLvoid*); + void(CubeMapTexture::*getFullCompressedCubeImageImplementation)(GLint, const Vector2i&, std::size_t, std::size_t, GLvoid*); void(CubeMapTexture::*getCompressedCubeImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, std::size_t, GLvoid*); #endif void(CubeMapTexture::*cubeSubImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, const Vector2i&, PixelFormat, PixelType, const GLvoid*); diff --git a/src/Magnum/Implementation/driverSpecific.cpp b/src/Magnum/Implementation/driverSpecific.cpp index 2ee50b188..a07246c4c 100644 --- a/src/Magnum/Implementation/driverSpecific.cpp +++ b/src/Magnum/Implementation/driverSpecific.cpp @@ -57,6 +57,10 @@ namespace { based on whether I'm querying all faces (ARB_DSA) or a single face (non-DSA, EXT_DSA) */ "nv-cubemap-inconsistent-compressed-image-size", + + /* NVidia drivers (358.16) return only the first slice of compressed + cube map image when querying all six slice using ARB_DSA API */ + "nv-cubemap-broken-full-compressed-image-query", #endif #ifdef CORRADE_TARGET_NACL From 60d6c967106e384eb9824de543d106dd33149523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 01:23:12 +0100 Subject: [PATCH 035/258] Platform: use context configuration flags also on ES builds. --- src/Magnum/Platform/WindowlessGlxApplication.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Magnum/Platform/WindowlessGlxApplication.cpp b/src/Magnum/Platform/WindowlessGlxApplication.cpp index 2f34dee5b..a17ec3168 100644 --- a/src/Magnum/Platform/WindowlessGlxApplication.cpp +++ b/src/Magnum/Platform/WindowlessGlxApplication.cpp @@ -93,6 +93,7 @@ bool WindowlessGlxApplication::tryCreateContext(const Configuration& configurati #endif GLX_CONTEXT_MINOR_VERSION_ARB, 0, GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_ES2_PROFILE_BIT_EXT, + GLX_CONTEXT_FLAGS_ARB, GLint(configuration.flags()), #else /* Similarly to what's done in Sdl2Application, try to request core context first */ From ed043957627522efaf60222d6916ef322b3ab04b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 01:48:35 +0100 Subject: [PATCH 036/258] Test compressed array/cube textures also w/o problematic pixel storage. To ensure that the implementation works at least in some cases. (It does.) --- src/Magnum/Test/CubeMapTextureArrayGLTest.cpp | 23 ++++++++++ src/Magnum/Test/CubeMapTextureGLTest.cpp | 34 ++++++++++++++ src/Magnum/Test/TextureArrayGLTest.cpp | 44 +++++++++++++++++++ 3 files changed, 101 insertions(+) diff --git a/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp b/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp index e6e14e5ea..6dc471bb4 100644 --- a/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp @@ -701,6 +701,29 @@ void CubeMapTextureArrayGLTest::compressedSubImage() { if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + #ifndef MAGNUM_TARGET_GLES + /* Compressed pixel storage for array textures is underspecified. If the + extension is supported, first test with default values to ensure we are + not that far off, then continue as usual */ + if(Context::current()->isExtensionSupported()) { + CubeMapTextureArray texture; + texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, + {12, 12, 6}, CompressedZero}); + texture.setCompressedSubImage(0, {4, 4, 1}, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, Vector3i{4}, CompressedSubData}); + + MAGNUM_VERIFY_NO_ERROR(); + + CompressedImage3D image = texture.compressedImage(0, {}); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), (Vector3i{12, 12, 6})); + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}), + Containers::ArrayView{CompressedSubDataComplete}, TestSuite::Compare::Container); + } + #endif + CubeMapTextureArray texture; texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 12, 6}, CompressedZero}); diff --git a/src/Magnum/Test/CubeMapTextureGLTest.cpp b/src/Magnum/Test/CubeMapTextureGLTest.cpp index 3e2d39541..06c22c6cd 100644 --- a/src/Magnum/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureGLTest.cpp @@ -818,6 +818,40 @@ void CubeMapTextureGLTest::compressedSubImage() { CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif + #ifndef MAGNUM_TARGET_GLES + /* Compressed pixel storage for array textures is underspecified. If the + extension is supported, first test with default values to ensure we are + not that far off, then continue as usual */ + if(Context::current()->isExtensionSupported()) { + CubeMapTexture texture; + texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveX, 0, + CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); + texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeX, 0, + CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); + texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveY, 0, + CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); + texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeY, 0, + CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); + texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveZ, 0, + CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); + texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeZ, 0, + CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); + texture.setCompressedSubImage(CubeMapTexture::Coordinate::PositiveX, 0, Vector2i{4}, CompressedImageView2D{ + CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, CompressedData}); + + MAGNUM_VERIFY_NO_ERROR(); + + CompressedImage2D image = texture.compressedImage(CubeMapTexture::Coordinate::PositiveX, 0, {}); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), Vector2i{12}); + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}), + Containers::ArrayView{CompressedSubDataComplete}, TestSuite::Compare::Container); + } + #endif + CubeMapTexture texture; texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveX, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); diff --git a/src/Magnum/Test/TextureArrayGLTest.cpp b/src/Magnum/Test/TextureArrayGLTest.cpp index 61d2976fb..5e32ca8a9 100644 --- a/src/Magnum/Test/TextureArrayGLTest.cpp +++ b/src/Magnum/Test/TextureArrayGLTest.cpp @@ -1090,6 +1090,28 @@ void TextureArrayGLTest::compressedSubImage2D() { CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif + #ifndef MAGNUM_TARGET_GLES + /* Compressed pixel storage for array textures is underspecified. If the + extension is supported, first test with default values to ensure we are + not that far off, then continue as usual */ + if(Context::current()->isExtensionSupported()) { + Texture2DArray texture; + texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, + Vector3i{12, 4, 4}, CompressedZero2D}); + texture.setCompressedSubImage(0, {4, 0, 1}, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 2}, CompressedData2D}); + + MAGNUM_VERIFY_NO_ERROR(); + + CompressedImage3D image = texture.compressedImage(0, {}); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), (Vector3i{12, 4, 4})); + CORRADE_COMPARE_AS( + Containers::ArrayView(image.data(), image.data().size()), Containers::ArrayView{CompressedSubData2DComplete}, TestSuite::Compare::Container); + } + #endif + Texture2DArray texture; texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, Vector3i{12, 4, 4}, CompressedZero2D}); @@ -1151,6 +1173,28 @@ void TextureArrayGLTest::compressedSubImage2DBuffer() { CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif + #ifndef MAGNUM_TARGET_GLES + /* Compressed pixel storage for array textures is underspecified. If the + extension is supported, first test with default values to ensure we are + not that far off, then continue as usual */ + if(Context::current()->isExtensionSupported()) { + Texture2DArray texture; + texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, + Vector3i{12, 4, 4}, CompressedZero2D}); + texture.setCompressedSubImage(0, {4, 0, 1}, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 2}, CompressedData2D}); + + MAGNUM_VERIFY_NO_ERROR(); + + CompressedBufferImage3D image = texture.compressedImage(0, {}, BufferUsage::StaticRead); + const auto imageData = image.buffer().data(); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), (Vector3i{12, 4, 4})); + CORRADE_COMPARE_AS(imageData, Containers::ArrayView{CompressedSubData2DComplete}, TestSuite::Compare::Container); + } + #endif + Texture2DArray texture; texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, Vector3i{12, 4, 4}, CompressedZero2D}); From 5f8c32f05d06fc90423a4635b97bf923d6ad5e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 01:49:57 +0100 Subject: [PATCH 037/258] Expect failure on NVidia with array/cubemap compressed pixel storages. I'm tired of these. Finally all pixel storage tests are working again. --- src/Magnum/Test/CubeMapTextureArrayGLTest.cpp | 12 +++++++++--- src/Magnum/Test/CubeMapTextureGLTest.cpp | 12 +++++++++--- src/Magnum/Test/TextureArrayGLTest.cpp | 18 +++++++++++++++--- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp b/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp index 6dc471bb4..e97073d02 100644 --- a/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp @@ -741,9 +741,15 @@ void CubeMapTextureArrayGLTest::compressedSubImage() { MAGNUM_VERIFY_NO_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{12, 12, 6})); - CORRADE_COMPARE_AS( - (Containers::ArrayView{image.data(), image.data().size()}), - Containers::ArrayView{CompressedSubDataComplete}, TestSuite::Compare::Container); + + { + CORRADE_EXPECT_FAIL_IF(Context::current()->isExtensionSupported() && (Context::current()->detectedDriver() & Context::DetectedDriver::NVidia), + "Non-default compressed pixel storage for cube map textures behaves weirdly on NVidia for client-memory images"); + + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}), + Containers::ArrayView{CompressedSubDataComplete}, TestSuite::Compare::Container); + } #endif } diff --git a/src/Magnum/Test/CubeMapTextureGLTest.cpp b/src/Magnum/Test/CubeMapTextureGLTest.cpp index 06c22c6cd..324f81a57 100644 --- a/src/Magnum/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureGLTest.cpp @@ -879,9 +879,15 @@ void CubeMapTextureGLTest::compressedSubImage() { MAGNUM_VERIFY_NO_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{12}); - CORRADE_COMPARE_AS( - (Containers::ArrayView{image.data(), image.data().size()}), - Containers::ArrayView{CompressedSubDataComplete}, TestSuite::Compare::Container); + + { + CORRADE_EXPECT_FAIL_IF(Context::current()->isExtensionSupported() && (Context::current()->detectedDriver() & Context::DetectedDriver::NVidia), + "Non-default compressed pixel storage for cube map textures behaves weirdly on NVidia for client-memory images"); + + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}), + Containers::ArrayView{CompressedSubDataComplete}, TestSuite::Compare::Container); + } #endif } diff --git a/src/Magnum/Test/TextureArrayGLTest.cpp b/src/Magnum/Test/TextureArrayGLTest.cpp index 5e32ca8a9..ad79e364f 100644 --- a/src/Magnum/Test/TextureArrayGLTest.cpp +++ b/src/Magnum/Test/TextureArrayGLTest.cpp @@ -1129,8 +1129,14 @@ void TextureArrayGLTest::compressedSubImage2D() { MAGNUM_VERIFY_NO_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{12, 4, 4})); - CORRADE_COMPARE_AS( - Containers::ArrayView(image.data(), image.data().size()), Containers::ArrayView{CompressedSubData2DComplete}, TestSuite::Compare::Container); + + { + CORRADE_EXPECT_FAIL_IF(Context::current()->isExtensionSupported() && (Context::current()->detectedDriver() & Context::DetectedDriver::NVidia), + "Non-default compressed pixel storage for array textures behaves weirdly on NVidia"); + + CORRADE_COMPARE_AS( + Containers::ArrayView(image.data(), image.data().size()), Containers::ArrayView{CompressedSubData2DComplete}, TestSuite::Compare::Container); + } #endif } @@ -1213,7 +1219,13 @@ void TextureArrayGLTest::compressedSubImage2DBuffer() { MAGNUM_VERIFY_NO_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{12, 4, 4})); - CORRADE_COMPARE_AS(imageData, Containers::ArrayView{CompressedSubData2DComplete}, TestSuite::Compare::Container); + + { + CORRADE_EXPECT_FAIL_IF(Context::current()->isExtensionSupported() && (Context::current()->detectedDriver() & Context::DetectedDriver::NVidia), + "Non-default compressed pixel storage for array textures behaves weirdly on NVidia"); + + CORRADE_COMPARE_AS(imageData, Containers::ArrayView{CompressedSubData2DComplete}, TestSuite::Compare::Container); + } #endif } From 1a685842c82a3ebb293e64ac5975047c3c8e805e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 02:04:07 +0100 Subject: [PATCH 038/258] Fix SampleQuery GL test on NVidia. For some reason binding a framebuffer resulted in populating the sample query. YAY ALL TESTS PASS AGAIN WOW --- src/Magnum/Test/SampleQueryGLTest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Test/SampleQueryGLTest.cpp b/src/Magnum/Test/SampleQueryGLTest.cpp index 55072128f..9f1b417ae 100644 --- a/src/Magnum/Test/SampleQueryGLTest.cpp +++ b/src/Magnum/Test/SampleQueryGLTest.cpp @@ -168,6 +168,8 @@ void SampleQueryGLTest::querySamplesPassed() { MAGNUM_VERIFY_NO_ERROR(); + framebuffer.bind(); + #ifndef MAGNUM_TARGET_GLES SampleQuery q{SampleQuery::Target::SamplesPassed}; #else @@ -175,7 +177,6 @@ void SampleQueryGLTest::querySamplesPassed() { #endif q.begin(); - framebuffer.bind(); mesh.draw(shader); q.end(); From 56cdc71a52826d1ff2c52bec79be505696b04659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 1 Aug 2015 22:58:42 +0200 Subject: [PATCH 039/258] Compressed image support, part 14: queries for compressed block sizes. --- doc/opengl-support.dox | 2 +- src/Magnum/AbstractTexture.cpp | 28 +++++++++++++++++++++++++++ src/Magnum/AbstractTexture.h | 11 +++++++++++ src/Magnum/CubeMapTexture.h | 28 +++++++++++++++++++++++++++ src/Magnum/CubeMapTextureArray.h | 28 +++++++++++++++++++++++++++ src/Magnum/RectangleTexture.h | 22 +++++++++++++++++++++ src/Magnum/Texture.h | 33 ++++++++++++++++++++++++++++++++ src/Magnum/TextureArray.h | 28 +++++++++++++++++++++++++++ 8 files changed, 179 insertions(+), 1 deletion(-) diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index 94480a052..2a39b4ed4 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -179,7 +179,7 @@ GLSL 4.30 | done @extension{ARB,explicit_uniform_location} | done @extension{ARB,fragment_layer_viewport} | done (shading language only) @extension{ARB,framebuffer_no_attachments} | | -@extension{ARB,internalformat_query2} | | +@extension{ARB,internalformat_query2} | only compressed texture block queries @extension{ARB,invalidate_subdata} | done @extension{ARB,multi_draw_indirect} | | @extension{ARB,program_interface_query} | | diff --git a/src/Magnum/AbstractTexture.cpp b/src/Magnum/AbstractTexture.cpp index 8f0bad58a..d4fc418a5 100644 --- a/src/Magnum/AbstractTexture.cpp +++ b/src/Magnum/AbstractTexture.cpp @@ -197,6 +197,14 @@ void AbstractTexture::bindImplementationMulti(const GLint firstTextureUnit, Cont } #endif +#ifndef MAGNUM_TARGET_GLES +Int AbstractTexture::compressedBlockDataSize(const GLenum target, const TextureFormat format) { + GLint value; + glGetInternalformativ(target, GLenum(format), GL_TEXTURE_COMPRESSED_BLOCK_SIZE, 1, &value); + return value; +} +#endif + AbstractTexture::AbstractTexture(GLenum target): _target{target}, _flags{ObjectFlag::DeleteOnDestruction} { (this->*Context::current()->state().texture->createImplementation)(); CORRADE_INTERNAL_ASSERT(_id != Implementation::State::DisengagedBinding); @@ -1625,6 +1633,26 @@ template void MAGNUM_EXPORT AbstractTexture::subImage<3>(GLint, const Range3Di&, #endif #ifndef DOXYGEN_GENERATING_OUTPUT +#ifndef MAGNUM_TARGET_GLES +Math::Vector<1, GLint> AbstractTexture::DataHelper<1>::compressedBlockSize(const GLenum target, const TextureFormat format) { + GLint value; + glGetInternalformativ(target, GLenum(format), GL_TEXTURE_COMPRESSED_BLOCK_WIDTH, 1, &value); + return value; +} + +Vector2i AbstractTexture::DataHelper<2>::compressedBlockSize(const GLenum target, const TextureFormat format) { + Vector2i value{Math::NoInit}; + glGetInternalformativ(target, GLenum(format), GL_TEXTURE_COMPRESSED_BLOCK_WIDTH, 1, &value.x()); + glGetInternalformativ(target, GLenum(format), GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT, 1, &value.y()); + return value; +} + +Vector3i AbstractTexture::DataHelper<3>::compressedBlockSize(const GLenum target, const TextureFormat format) { + /** @todo use real value when OpenGL has proper queries for 3D compression formats */ + return Vector3i{DataHelper<2>::compressedBlockSize(target, format), 1}; +} +#endif + #ifndef MAGNUM_TARGET_GLES Math::Vector<1, GLint> AbstractTexture::DataHelper<1>::imageSize(AbstractTexture& texture, const GLint level) { Math::Vector<1, GLint> value; diff --git a/src/Magnum/AbstractTexture.h b/src/Magnum/AbstractTexture.h index defd3bc1a..2921da856 100644 --- a/src/Magnum/AbstractTexture.h +++ b/src/Magnum/AbstractTexture.h @@ -338,6 +338,10 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { #endif template struct DataHelper {}; + #ifndef MAGNUM_TARGET_GLES + static Int compressedBlockDataSize(GLenum target, TextureFormat format); + #endif + explicit AbstractTexture(GLenum target); explicit AbstractTexture(NoCreateT, GLenum target) noexcept: _target{target}, _id{0}, _flags{ObjectFlag::DeleteOnDestruction} {} explicit AbstractTexture(GLuint id, GLenum target, ObjectFlags flags) noexcept: _target{target}, _id{id}, _flags{flags} {} @@ -584,6 +588,7 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { #ifndef DOXYGEN_GENERATING_OUTPUT #ifndef MAGNUM_TARGET_GLES template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<1> { + static Math::Vector<1, GLint> compressedBlockSize(GLenum target, TextureFormat format); static Math::Vector<1, GLint> imageSize(AbstractTexture& texture, GLint level); static void setWrapping(AbstractTexture& texture, const Array1D& wrapping); @@ -604,6 +609,9 @@ template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<1> { }; #endif template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<2> { + #ifndef MAGNUM_TARGET_GLES + static Vector2i compressedBlockSize(GLenum target, TextureFormat format); + #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) static Vector2i imageSize(AbstractTexture& texture, GLint level); #endif @@ -646,6 +654,9 @@ template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<2> { }; template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<3> { #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) + #ifndef MAGNUM_TARGET_GLES + static Vector3i compressedBlockSize(GLenum target, TextureFormat format); + #endif #ifndef MAGNUM_TARGET_GLES2 static Vector3i imageSize(AbstractTexture& texture, GLint level); #endif diff --git a/src/Magnum/CubeMapTexture.h b/src/Magnum/CubeMapTexture.h index 98650ab4f..dda1c8861 100644 --- a/src/Magnum/CubeMapTexture.h +++ b/src/Magnum/CubeMapTexture.h @@ -102,6 +102,34 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { */ static Vector2i maxSize(); + #ifndef MAGNUM_TARGET_GLES + /** + * @copybrief Texture::compressedBlockSize() + * + * See @ref Texture::compressedBlockSize() for more information. + * @requires_gl43 Extension @extension{ARB,internalformat_query2} + * @requires_gl Compressed texture queries are not available in OpenGL + * ES. + */ + static Vector2i compressedBlockSize(TextureFormat format) { + return DataHelper<2>::compressedBlockSize(GL_TEXTURE_CUBE_MAP, format); + } + + /** + * @copybrief Texture::compressedBlockDataSize() + * + * See @ref Texture::compressedBlockDataSize() for more information. + * @requires_gl43 Extension @extension{ARB,internalformat_query2} + * @requires_gl Compressed texture queries are not available in OpenGL + * ES. + * @see @ref compressedBlockSize(), @fn_gl{Getinternalformat} with + * @def_gl{TEXTURE_COMPRESSED_BLOCK_SIZE} + */ + static Int compressedBlockDataSize(TextureFormat format) { + return AbstractTexture::compressedBlockDataSize(GL_TEXTURE_CUBE_MAP, format); + } + #endif + /** * @brief Wrap existing OpenGL cube map texture object * @param id OpenGL cube map texture ID diff --git a/src/Magnum/CubeMapTextureArray.h b/src/Magnum/CubeMapTextureArray.h index 059c05add..fc9f8f9ce 100644 --- a/src/Magnum/CubeMapTextureArray.h +++ b/src/Magnum/CubeMapTextureArray.h @@ -98,6 +98,34 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture { */ static Vector3i maxSize(); + #ifndef MAGNUM_TARGET_GLES + /** + * @copybrief Texture::compressedBlockSize() + * + * See @ref Texture::compressedBlockSize() for more information. + * @requires_gl43 Extension @extension{ARB,internalformat_query2} + * @requires_gl Compressed texture queries are not available in OpenGL + * ES. + */ + static Vector2i compressedBlockSize(TextureFormat format) { + return DataHelper<2>::compressedBlockSize(GL_TEXTURE_CUBE_MAP_ARRAY, format); + } + + /** + * @copybrief Texture::compressedBlockDataSize() + * + * See @ref Texture::compressedBlockDataSize() for more information. + * @requires_gl43 Extension @extension{ARB,internalformat_query2} + * @requires_gl Compressed texture queries are not available in OpenGL + * ES. + * @see @ref compressedBlockSize(), @fn_gl{Getinternalformat} with + * @def_gl{TEXTURE_COMPRESSED_BLOCK_SIZE} + */ + static Int compressedBlockDataSize(TextureFormat format) { + return AbstractTexture::compressedBlockDataSize(GL_TEXTURE_CUBE_MAP_ARRAY, format); + } + #endif + /** * @brief Wrap existing OpenGL cube map array texture object * @param id OpenGL cube map array texture ID diff --git a/src/Magnum/RectangleTexture.h b/src/Magnum/RectangleTexture.h index 0962c9e7a..186af3f70 100644 --- a/src/Magnum/RectangleTexture.h +++ b/src/Magnum/RectangleTexture.h @@ -80,6 +80,28 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture { */ static Vector2i maxSize(); + /** + * @copybrief Texture::compressedBlockSize() + * + * See @ref Texture::compressedBlockSize() for more information. + * @requires_gl43 Extension @extension{ARB,internalformat_query2} + */ + static Vector2i compressedBlockSize(TextureFormat format) { + return DataHelper<2>::compressedBlockSize(GL_TEXTURE_RECTANGLE, format); + } + + /** + * @copybrief Texture::compressedBlockDataSize() + * + * See @ref Texture::compressedBlockDataSize() for more information. + * @requires_gl43 Extension @extension{ARB,internalformat_query2} + * @see @ref compressedBlockSize(), @fn_gl{Getinternalformat} with + * @def_gl{TEXTURE_COMPRESSED_BLOCK_SIZE} + */ + static Int compressedBlockDataSize(TextureFormat format) { + return AbstractTexture::compressedBlockDataSize(GL_TEXTURE_RECTANGLE, format); + } + /** * @brief Wrap existing OpenGL rectangle texture object * @param id OpenGL rectangle texture ID diff --git a/src/Magnum/Texture.h b/src/Magnum/Texture.h index 8bfa7e9bc..288b0189a 100644 --- a/src/Magnum/Texture.h +++ b/src/Magnum/Texture.h @@ -123,6 +123,39 @@ template class Texture: public AbstractTexture { return Implementation::maxTextureSize(); } + #ifndef MAGNUM_TARGET_GLES + /** + * @brief Compressed block size + * + * If @p format is compressed, returns compressed block size (in + * pixels). For uncompressed formats returns zero vector. + * @see @ref compressedBlockDataSize(), @fn_gl{Getinternalformat} with + * @def_gl{TEXTURE_COMPRESSED_BLOCK_WIDTH}, + * @def_gl{TEXTURE_COMPRESSED_BLOCK_HEIGHT} + * @requires_gl43 Extension @extension{ARB,internalformat_query2} + * @requires_gl Compressed texture queries are not available in OpenGL + * ES. + */ + static VectorTypeFor compressedBlockSize(TextureFormat format) { + return DataHelper::compressedBlockSize(Implementation::textureTarget(), format); + } + + /** + * @brief Compressed block data size + * + * If @p format is compressed, returns compressed block data size (in + * bytes). For uncompressed formats returns zero. + * @see @ref compressedBlockSize(), @fn_gl{Getinternalformat} with + * @def_gl{TEXTURE_COMPRESSED_BLOCK_SIZE} + * @requires_gl43 Extension @extension{ARB,internalformat_query2} + * @requires_gl Compressed texture queries are not available in OpenGL + * ES. + */ + static Int compressedBlockDataSize(TextureFormat format) { + return AbstractTexture::compressedBlockDataSize(Implementation::textureTarget(), format); + } + #endif + /** * @brief Wrap existing OpenGL texture object * @param id OpenGL texture ID diff --git a/src/Magnum/TextureArray.h b/src/Magnum/TextureArray.h index e87cba8ec..a61370ed4 100644 --- a/src/Magnum/TextureArray.h +++ b/src/Magnum/TextureArray.h @@ -111,6 +111,34 @@ template class TextureArray: public AbstractTexture { */ static VectorTypeFor maxSize(); + #ifndef MAGNUM_TARGET_GLES + /** + * @copybrief Texture::compressedBlockSize() + * + * See @ref Texture::compressedBlockSize() for more information. + * @requires_gl43 Extension @extension{ARB,internalformat_query2} + * @requires_gl Compressed texture queries are not available in OpenGL + * ES. + */ + static VectorTypeFor compressedBlockSize(TextureFormat format) { + return DataHelper::compressedBlockSize(Implementation::textureArrayTarget(), format); + } + + /** + * @copybrief Texture::compressedBlockDataSize() + * + * See @ref Texture::compressedBlockDataSize() for more information. + * @requires_gl43 Extension @extension{ARB,internalformat_query2} + * @requires_gl Compressed texture queries are not available in OpenGL + * ES. + * @see @ref compressedBlockSize(), @fn_gl{Getinternalformat} with + * @def_gl{TEXTURE_COMPRESSED_BLOCK_SIZE} + */ + static Int compressedBlockDataSize(TextureFormat format) { + return AbstractTexture::compressedBlockDataSize(Implementation::textureArrayTarget(), format); + } + #endif + /** * @brief Wrap existing OpenGL texture array object * @param id OpenGL texture array ID From 645edecbcdc76902e80634bcc54782544512cf0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 1 Aug 2015 19:45:53 +0200 Subject: [PATCH 040/258] Compressed image support, part 15: compressed subimage download. NVidia reports compressed block data size in bits instead of bytes, thus all the test currently fail. (Another) workaround incoming. --- doc/opengl-mapping.dox | 2 +- doc/opengl-support.dox | 2 +- src/Magnum/AbstractTexture.cpp | 58 +++++++ src/Magnum/AbstractTexture.h | 6 + src/Magnum/CubeMapTexture.cpp | 10 ++ src/Magnum/CubeMapTexture.h | 44 +++++ src/Magnum/CubeMapTextureArray.cpp | 10 ++ src/Magnum/CubeMapTextureArray.h | 44 +++++ src/Magnum/RectangleTexture.cpp | 10 ++ src/Magnum/RectangleTexture.h | 40 +++++ src/Magnum/Test/CubeMapTextureArrayGLTest.cpp | 72 ++++++++ src/Magnum/Test/CubeMapTextureGLTest.cpp | 78 +++++++++ src/Magnum/Test/RectangleTextureGLTest.cpp | 12 ++ src/Magnum/Test/TextureArrayGLTest.cpp | 84 ++++++++++ src/Magnum/Test/TextureGLTest.cpp | 156 ++++++++++++++++++ src/Magnum/Texture.cpp | 10 ++ src/Magnum/Texture.h | 55 ++++++ src/Magnum/TextureArray.cpp | 10 ++ src/Magnum/TextureArray.h | 44 +++++ 19 files changed, 745 insertions(+), 2 deletions(-) diff --git a/doc/opengl-mapping.dox b/doc/opengl-mapping.dox index b2bbb7566..68177a9c4 100644 --- a/doc/opengl-mapping.dox +++ b/doc/opengl-mapping.dox @@ -175,7 +175,7 @@ OpenGL function | Matching API @fn_gl2{GetBufferPointer,GetBufferPointerv}, \n `glGetNamedBufferPointer()`, \n @fn_gl_extension{GetNamedBufferPointer,EXT,direct_state_access} | not queryable, @ref Buffer::map() setter only @fn_gl{GetBufferSubData}, \n `glGetNamedBufferSubData()`, \n @fn_gl_extension{GetNamedBufferSubData,EXT,direct_state_access} | @ref Buffer::data(), \n @ref Buffer::subData() @fn_gl{GetCompressedTexImage}, \n `glGetnCompressedTexImage()`, \n @fn_gl_extension{GetnCompressedTexImage,ARB,robustness}, \n `glGetCompressedTextureImage()`, \n @fn_gl_extension{GetCompressedTextureImage,EXT,direct_state_access} | @ref Texture::compressedImage(), \n @ref TextureArray::compressedImage(), \n @ref CubeMapTexture::compressedImage(), \n @ref CubeMapTextureArray::compressedImage(), \n @ref RectangleTexture::compressedImage() -@fn_gl{GetCompressedTextureSubImage} | | +@fn_gl{GetCompressedTextureSubImage} | @ref Texture::compressedSubImage(), \n @ref TextureArray::compressedSubImage(), \n @ref CubeMapTexture::compressedImage(), \n @ref CubeMapTexture::compressedSubImage(), \n @ref CubeMapTextureArray::compressedSubImage(), \n @ref RectangleTexture::compressedSubImage() @fn_gl{GetDebugMessageLog} | | @fn_gl{GetError} | @ref Renderer::error() @fn_gl{GetFragDataIndex}, @fn_gl{GetFragDataLocation} | not queryable, @ref AbstractShaderProgram::bindFragmentDataLocation() and \n @ref AbstractShaderProgram::bindFragmentDataLocationIndexed() setters only diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index 2a39b4ed4..f8ac8924b 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -222,7 +222,7 @@ GLSL 4.50 | done @extension{ARB,cull_distance} | | @extension{ARB,derivative_control} | done (shading language only) @extension{ARB,direct_state_access} | done for implemented functionality (except VAOs) -@extension{ARB,get_texture_sub_image} | missing compressed texture queries +@extension{ARB,get_texture_sub_image} | done @extension{ARB,shader_texture_image_samples} | done (shading language only) @extension{ARB,texture_barrier} | | @extension{KHR,context_flush_control} | | diff --git a/src/Magnum/AbstractTexture.cpp b/src/Magnum/AbstractTexture.cpp index d4fc418a5..94012890d 100644 --- a/src/Magnum/AbstractTexture.cpp +++ b/src/Magnum/AbstractTexture.cpp @@ -1629,6 +1629,64 @@ template void AbstractTexture::subImage(const GLint leve template void MAGNUM_EXPORT AbstractTexture::subImage<1>(GLint, const Range1Di&, BufferImage<1>&, BufferUsage); template void MAGNUM_EXPORT AbstractTexture::subImage<2>(GLint, const Range2Di&, BufferImage<2>&, BufferUsage); template void MAGNUM_EXPORT AbstractTexture::subImage<3>(GLint, const Range3Di&, BufferImage<3>&, BufferUsage); + +template std::size_t AbstractTexture::compressedSubImageSize(TextureFormat format, const Math::Vector& size) { + /* Amount of blocks in given range (rounded up) multiplied by block + data size. The user is responsible for proper block-aligned size. */ + const Math::Vector blockSize = DataHelper::compressedBlockSize(_target, format); + return ((size + blockSize - Math::Vector{1})/blockSize).product()* + compressedBlockDataSize(_target, format); +} + +template void AbstractTexture::compressedSubImage(const GLint level, const RangeTypeFor& range, CompressedImage& image) { + createIfNotAlready(); + + const Math::Vector size = range.size(); + const Vector3i paddedOffset = Vector3i::pad(range.min()); + const Vector3i paddedSize = Vector3i::pad(size, 1); + GLint format; + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); + const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, compressedSubImageSize(TextureFormat(format), size)); + + /* Reallocate only if needed */ + Containers::Array data{image.release()}; + if(data.size() < dataSize) + data = Containers::Array{dataSize}; + + Buffer::unbindInternal(Buffer::TargetHint::PixelPack); + image.storage().applyPack(); + glGetCompressedTextureSubImage(_id, level, paddedOffset.x(), paddedOffset.y(), paddedOffset.z(), paddedSize.x(), paddedSize.y(), paddedSize.z(), data.size(), data); + image.setData(CompressedPixelFormat(format), size, std::move(data)); +} + +template void MAGNUM_EXPORT AbstractTexture::compressedSubImage<1>(GLint, const Range1Di&, CompressedImage<1>&); +template void MAGNUM_EXPORT AbstractTexture::compressedSubImage<2>(GLint, const Range2Di&, CompressedImage<2>&); +template void MAGNUM_EXPORT AbstractTexture::compressedSubImage<3>(GLint, const Range3Di&, CompressedImage<3>&); + +template void AbstractTexture::compressedSubImage(const GLint level, const RangeTypeFor& range, CompressedBufferImage& image, const BufferUsage usage) { + createIfNotAlready(); + + const Math::Vector size = range.size(); + const Vector3i paddedOffset = Vector3i::pad(range.min()); + const Vector3i paddedSize = Vector3i::pad(size, 1); + GLint format; + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); + const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, compressedSubImageSize(TextureFormat(format), size)); + + /* Reallocate only if needed */ + if(image.dataSize() < dataSize) + image.setData(image.storage(), CompressedPixelFormat(format), size, {nullptr, dataSize}, usage); + else + image.setData(image.storage(), CompressedPixelFormat(format), size, nullptr, usage); + + image.buffer().bindInternal(Buffer::TargetHint::PixelPack); + image.storage().applyPack(); + glGetCompressedTextureSubImage(_id, level, paddedOffset.x(), paddedOffset.y(), paddedOffset.z(), paddedSize.x(), paddedSize.y(), paddedSize.z(), dataSize, nullptr); +} + +template void MAGNUM_EXPORT AbstractTexture::compressedSubImage<1>(GLint, const Range1Di&, CompressedBufferImage<1>&, BufferUsage); +template void MAGNUM_EXPORT AbstractTexture::compressedSubImage<2>(GLint, const Range2Di&, CompressedBufferImage<2>&, BufferUsage); +template void MAGNUM_EXPORT AbstractTexture::compressedSubImage<3>(GLint, const Range3Di&, CompressedBufferImage<3>&, BufferUsage); #endif #endif diff --git a/src/Magnum/AbstractTexture.h b/src/Magnum/AbstractTexture.h index 2921da856..2b1657aa9 100644 --- a/src/Magnum/AbstractTexture.h +++ b/src/Magnum/AbstractTexture.h @@ -409,6 +409,8 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { template void compressedImage(GLint level, CompressedBufferImage& image, BufferUsage usage); template void subImage(GLint level, const RangeTypeFor& range, Image& image); template void subImage(GLint level, const RangeTypeFor& range, BufferImage& image, BufferUsage usage); + template void compressedSubImage(GLint level, const RangeTypeFor& range, CompressedImage& image); + template void compressedSubImage(GLint level, const RangeTypeFor& range, CompressedBufferImage& image, BufferUsage usage); #endif GLenum _target; @@ -431,6 +433,10 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { void MAGNUM_LOCAL createImplementationDSA(); #endif + #ifndef MAGNUM_TARGET_GLES + template std::size_t MAGNUM_LOCAL compressedSubImageSize(TextureFormat format, const Math::Vector& size); + #endif + void MAGNUM_LOCAL bindImplementationDefault(GLint textureUnit); #ifndef MAGNUM_TARGET_GLES void MAGNUM_LOCAL bindImplementationMulti(GLint textureUnit); diff --git a/src/Magnum/CubeMapTexture.cpp b/src/Magnum/CubeMapTexture.cpp index f29e4ea51..49d2ef01a 100644 --- a/src/Magnum/CubeMapTexture.cpp +++ b/src/Magnum/CubeMapTexture.cpp @@ -257,6 +257,16 @@ BufferImage3D CubeMapTexture::subImage(const Int level, const Range3Di& range, B return std::move(image); } +CompressedImage3D CubeMapTexture::compressedSubImage(const Int level, const Range3Di& range, CompressedImage3D&& image) { + compressedSubImage(level, range, image); + return std::move(image); +} + +CompressedBufferImage3D CubeMapTexture::compressedSubImage(const Int level, const Range3Di& range, CompressedBufferImage3D&& image, const BufferUsage usage) { + compressedSubImage(level, range, image, usage); + return std::move(image); +} + CubeMapTexture& CubeMapTexture::setSubImage(const Int level, const Vector3i& offset, const ImageView3D& image) { createIfNotAlready(); diff --git a/src/Magnum/CubeMapTexture.h b/src/Magnum/CubeMapTexture.h index dda1c8861..2ee70927a 100644 --- a/src/Magnum/CubeMapTexture.h +++ b/src/Magnum/CubeMapTexture.h @@ -721,6 +721,50 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @endcode */ BufferImage3D subImage(Int level, const Range3Di& range, BufferImage3D&& image, BufferUsage usage); + + /** + * @copybrief Texture::compressedSubImage(Int, const RangeTypeFor&, CompressedImage&) + * + * See @ref Texture::compressedSubImage(Int, const RangeTypeFor&, CompressedImage&) + * for more information. + * @requires_gl45 Extension @extension{ARB,get_texture_sub_image} + * @requires_gl Texture image queries are not available in OpenGL ES or + * WebGL. See @ref Framebuffer::read() for possible workaround. + */ + void compressedSubImage(Int level, const Range3Di& range, CompressedImage3D& image) { + AbstractTexture::compressedSubImage<3>(level, range, image); + } + + /** @overload + * + * Convenience alternative to the above, example usage: + * @code + * CompressedImage3D image = texture.compressedSubImage(0, range, {}); + * @endcode + */ + CompressedImage3D compressedSubImage(Int level, const Range3Di& range, CompressedImage3D&& image); + + /** + * @copybrief Texture::compressedSubImage(Int, const RangeTypeFor&, CompressedBufferImage&, BufferUsage) + * + * See @ref Texture::compressedSubImage(Int, const RangeTypeFor&, CompressedBufferImage&, BufferUsage) + * for more information. + * @requires_gl45 Extension @extension{ARB,get_texture_sub_image} + * @requires_gl Texture image queries are not available in OpenGL ES or + * WebGL. See @ref Framebuffer::read() for possible workaround. + */ + void compressedSubImage(Int level, const Range3Di& range, CompressedBufferImage3D& image, BufferUsage usage) { + AbstractTexture::compressedSubImage<3>(level, range, image, usage); + } + + /** @overload + * + * Convenience alternative to the above, example usage: + * @code + * CompressedBufferImage3D image = texture.compressedSubImage(0, range, {}, BufferUsage::StaticRead); + * @endcode + */ + CompressedBufferImage3D compressedSubImage(Int level, const Range3Di& range, CompressedBufferImage3D&& image, BufferUsage usage); #endif /** diff --git a/src/Magnum/CubeMapTextureArray.cpp b/src/Magnum/CubeMapTextureArray.cpp index a0a8535a0..009a6acf7 100644 --- a/src/Magnum/CubeMapTextureArray.cpp +++ b/src/Magnum/CubeMapTextureArray.cpp @@ -78,6 +78,16 @@ BufferImage3D CubeMapTextureArray::subImage(const Int level, const Range3Di& ran this->subImage(level, range, image, usage); return std::move(image); } + +CompressedImage3D CubeMapTextureArray::compressedSubImage(const Int level, const Range3Di& range, CompressedImage3D&& image) { + compressedSubImage(level, range, image); + return std::move(image); +} + +CompressedBufferImage3D CubeMapTextureArray::compressedSubImage(const Int level, const Range3Di& range, CompressedBufferImage3D&& image, const BufferUsage usage) { + compressedSubImage(level, range, image, usage); + return std::move(image); +} #endif } diff --git a/src/Magnum/CubeMapTextureArray.h b/src/Magnum/CubeMapTextureArray.h index fc9f8f9ce..a78abb21b 100644 --- a/src/Magnum/CubeMapTextureArray.h +++ b/src/Magnum/CubeMapTextureArray.h @@ -526,6 +526,50 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture { * @endcode */ BufferImage3D subImage(Int level, const Range3Di& range, BufferImage3D&& image, BufferUsage usage); + + /** + * @copybrief Texture::compressedSubImage(Int, const RangeTypeFor&, CompressedImage&) + * + * See @ref Texture::compressedSubImage(Int, const RangeTypeFor&, CompressedImage&) + * for more information. + * @requires_gl45 Extension @extension{ARB,get_texture_sub_image} + * @requires_gl Texture image queries are not available in OpenGL ES. + * See @ref Framebuffer::read() for possible workaround. + */ + void compressedSubImage(Int level, const Range3Di& range, CompressedImage3D& image) { + AbstractTexture::compressedSubImage<3>(level, range, image); + } + + /** @overload + * + * Convenience alternative to the above, example usage: + * @code + * CompressedImage3D image = texture.compressedSubImage(0, range, {}); + * @endcode + */ + CompressedImage3D compressedSubImage(Int level, const Range3Di& range, CompressedImage3D&& image); + + /** + * @copybrief Texture::compressedSubImage(Int, const RangeTypeFor&, CompressedBufferImage&, BufferUsage) + * + * See @ref Texture::compressedSubImage(Int, const RangeTypeFor&, CompressedBufferImage&, BufferUsage) + * for more information. + * @requires_gl45 Extension @extension{ARB,get_texture_sub_image} + * @requires_gl Texture image queries are not available in OpenGL ES. + * See @ref Framebuffer::read() for possible workaround. + */ + void compressedSubImage(Int level, const Range3Di& range, CompressedBufferImage3D& image, BufferUsage usage) { + AbstractTexture::compressedSubImage<3>(level, range, image, usage); + } + + /** @overload + * + * Convenience alternative to the above, example usage: + * @code + * CompressedBufferImage3D image = texture.compressedSubImage(0, range, {}, BufferUsage::StaticRead); + * @endcode + */ + CompressedBufferImage3D compressedSubImage(Int level, const Range3Di& range, CompressedBufferImage3D&& image, BufferUsage usage); #endif /** diff --git a/src/Magnum/RectangleTexture.cpp b/src/Magnum/RectangleTexture.cpp index 1a7b93a2b..ef516190f 100644 --- a/src/Magnum/RectangleTexture.cpp +++ b/src/Magnum/RectangleTexture.cpp @@ -78,5 +78,15 @@ BufferImage2D RectangleTexture::subImage(const Range2Di& range, BufferImage2D&& return std::move(image); } +CompressedImage2D RectangleTexture::compressedSubImage(const Range2Di& range, CompressedImage2D&& image) { + compressedSubImage(range, image); + return std::move(image); +} + +CompressedBufferImage2D RectangleTexture::compressedSubImage(const Range2Di& range, CompressedBufferImage2D&& image, const BufferUsage usage) { + compressedSubImage(range, image, usage); + return std::move(image); +} + } #endif diff --git a/src/Magnum/RectangleTexture.h b/src/Magnum/RectangleTexture.h index 186af3f70..11db9875e 100644 --- a/src/Magnum/RectangleTexture.h +++ b/src/Magnum/RectangleTexture.h @@ -414,6 +414,46 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture { */ BufferImage2D subImage(const Range2Di& range, BufferImage2D&& image, BufferUsage usage); + /** + * @copybrief Texture::compressedSubImage(Int, const RangeTypeFor&, CompressedImage&) + * + * See @ref Texture::compressedSubImage(Int, const RangeTypeFor&, CompressedImage&) + * for more information. + * @requires_gl45 Extension @extension{ARB,get_texture_sub_image} + */ + void compressedSubImage(const Range2Di& range, CompressedImage2D& image) { + AbstractTexture::compressedSubImage<2>(0, range, image); + } + + /** @overload + * + * Convenience alternative to the above, example usage: + * @code + * CompressedImage2D image = texture.compressedSubImage(range, {}); + * @endcode + */ + CompressedImage2D compressedSubImage(const Range2Di& range, CompressedImage2D&& image); + + /** + * @copybrief Texture::compressedSubImage(Int, const RangeTypeFor&, CompressedBufferImage&, BufferUsage) + * + * See @ref Texture::compressedSubImage(Int, const RangeTypeFor&, CompressedBufferImage&, BufferUsage) + * for more information. + * @requires_gl45 Extension @extension{ARB,get_texture_sub_image} + */ + void compressedSubImage(const Range2Di& range, CompressedBufferImage2D& image, BufferUsage usage) { + AbstractTexture::compressedSubImage<2>(0, range, image, usage); + } + + /** @overload + * + * Convenience alternative to the above, example usage: + * @code + * CompressedBufferImage2D image = texture.compressedSubImage(range, {}, BufferUsage::StaticRead); + * @endcode + */ + CompressedBufferImage2D compressedSubImage(const Range2Di& range, CompressedBufferImage2D&& image, BufferUsage usage); + /** * @copybrief Texture::setImage() * @return Reference to self (for method chaining) diff --git a/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp b/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp index e97073d02..984ee06ee 100644 --- a/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp @@ -66,7 +66,9 @@ struct CubeMapTextureArrayGLTest: AbstractOpenGLTester { void compressedSubImageBuffer(); #ifndef MAGNUM_TARGET_GLES void subImageQuery(); + void compressedSubImageQuery(); void subImageQueryBuffer(); + void compressedSubImageQueryBuffer(); #endif void generateMipmap(); @@ -109,7 +111,9 @@ CubeMapTextureArrayGLTest::CubeMapTextureArrayGLTest() { &CubeMapTextureArrayGLTest::compressedSubImageBuffer, #ifndef MAGNUM_TARGET_GLES &CubeMapTextureArrayGLTest::subImageQuery, + &CubeMapTextureArrayGLTest::compressedSubImageQuery, &CubeMapTextureArrayGLTest::subImageQueryBuffer, + &CubeMapTextureArrayGLTest::compressedSubImageQueryBuffer, #endif &CubeMapTextureArrayGLTest::generateMipmap, @@ -840,6 +844,41 @@ void CubeMapTextureArrayGLTest::subImageQuery() { Containers::ArrayView{SubData}, TestSuite::Compare::Container); } +void CubeMapTextureArrayGLTest::compressedSubImageQuery() { + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + + CubeMapTextureArray texture; + texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, {12, 12, 6}) + .setCompressedSubImage(0, {}, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 12, 6}, CompressedSubDataComplete}); + + MAGNUM_VERIFY_NO_ERROR(); + + /* Test also without compressed pixel storage to ensure that both size + computations work */ + if(Context::current()->isExtensionSupported()) { + CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 1}, Vector3i{4}), {}); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), Vector3i{4}); + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}), + Containers::ArrayView{CompressedSubData}, TestSuite::Compare::Container); + } + + CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 1}, Vector3i{4}), {_compressedSubDataStorage}); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), Vector3i{4}); + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}.suffix(_compressedSubDataOffset)), + Containers::ArrayView{CompressedSubData}, TestSuite::Compare::Container); +} + void CubeMapTextureArrayGLTest::subImageQueryBuffer() { if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); @@ -862,6 +901,39 @@ void CubeMapTextureArrayGLTest::subImageQueryBuffer() { CORRADE_COMPARE_AS(imageData.suffix(SubDataOffset), Containers::ArrayView{SubData}, TestSuite::Compare::Container); } + +void CubeMapTextureArrayGLTest::compressedSubImageQueryBuffer() { + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + + CubeMapTextureArray texture; + texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, {12, 12, 6}) + .setCompressedSubImage(0, {}, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 12, 6}, CompressedSubDataComplete}); + + MAGNUM_VERIFY_NO_ERROR(); + + /* Test also without compressed pixel storage to ensure that both size + computations work */ + if(Context::current()->isExtensionSupported()) { + CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 1}, Vector3i{4}), {}, BufferUsage::StaticRead); + const auto imageData = image.buffer().data(); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), Vector3i{4}); + CORRADE_COMPARE_AS(imageData, Containers::ArrayView{CompressedSubData}, TestSuite::Compare::Container); + } + + CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 1}, Vector3i{4}), {_compressedSubDataStorage}, BufferUsage::StaticRead); + const auto imageData = image.buffer().data(); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), Vector3i{4}); + CORRADE_COMPARE_AS(imageData.suffix(_compressedSubDataOffset), Containers::ArrayView{CompressedSubData}, TestSuite::Compare::Container); +} #endif void CubeMapTextureArrayGLTest::generateMipmap() { diff --git a/src/Magnum/Test/CubeMapTextureGLTest.cpp b/src/Magnum/Test/CubeMapTextureGLTest.cpp index 324f81a57..5e5534673 100644 --- a/src/Magnum/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureGLTest.cpp @@ -90,7 +90,9 @@ struct CubeMapTextureGLTest: AbstractOpenGLTester { #endif #ifndef MAGNUM_TARGET_GLES void subImageQuery(); + void compressedSubImageQuery(); void subImageQueryBuffer(); + void compressedSubImageQueryBuffer(); #endif void generateMipmap(); @@ -157,7 +159,9 @@ CubeMapTextureGLTest::CubeMapTextureGLTest() { #endif #ifndef MAGNUM_TARGET_GLES &CubeMapTextureGLTest::subImageQuery, + &CubeMapTextureGLTest::compressedSubImageQuery, &CubeMapTextureGLTest::subImageQueryBuffer, + &CubeMapTextureGLTest::compressedSubImageQueryBuffer, #endif &CubeMapTextureGLTest::generateMipmap, @@ -991,6 +995,44 @@ void CubeMapTextureGLTest::subImageQuery() { Containers::ArrayView{Data}, TestSuite::Compare::Container); } +void CubeMapTextureGLTest::compressedSubImageQuery() { + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + /* I'm too lazy to call setSubImage() six times */ + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + + CubeMapTexture texture; + texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, Vector2i{12}) + .setCompressedSubImage(0, {}, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 12, 1}, CompressedSubDataComplete}); + + MAGNUM_VERIFY_NO_ERROR(); + + /* Test also without compressed pixel storage to ensure that both size + computations work */ + if(Context::current()->isExtensionSupported()) { + CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 0}, {4, 4, 1}), {}); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 1})); + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}), + Containers::ArrayView{CompressedData}, TestSuite::Compare::Container); + } + + CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 0}, {4, 4, 1}), {_compressedDataStorage}); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 1})); + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}.suffix(_compressedDataOffset)), + Containers::ArrayView{CompressedData}, TestSuite::Compare::Container); +} + void CubeMapTextureGLTest::subImageQueryBuffer() { if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); @@ -1013,6 +1055,42 @@ void CubeMapTextureGLTest::subImageQueryBuffer() { CORRADE_COMPARE(image.size(), Vector3i(2, 2, 1)); CORRADE_COMPARE_AS(imageData.suffix(_dataOffset), Containers::ArrayView{Data}, TestSuite::Compare::Container); } + +void CubeMapTextureGLTest::compressedSubImageQueryBuffer() { + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + /* I'm too lazy to call setSubImage() six times */ + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + + CubeMapTexture texture; + texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, Vector2i{12}) + .setCompressedSubImage(0, {}, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 12, 1}, CompressedSubDataComplete}); + + MAGNUM_VERIFY_NO_ERROR(); + + /* Test also without compressed pixel storage to ensure that both size + computations work */ + if(Context::current()->isExtensionSupported()) { + CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 0}, {4, 4, 1}), {}, BufferUsage::StaticRead); + const auto imageData = image.buffer().data(); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 1})); + CORRADE_COMPARE_AS(imageData, Containers::ArrayView{CompressedData}, TestSuite::Compare::Container); + } + + CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 0}, {4, 4, 1}), {_compressedDataStorage}, BufferUsage::StaticRead); + const auto imageData = image.buffer().data(); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 1})); + CORRADE_COMPARE_AS(imageData.suffix(_compressedDataOffset), Containers::ArrayView{CompressedData}, TestSuite::Compare::Container); +} #endif void CubeMapTextureGLTest::generateMipmap() { diff --git a/src/Magnum/Test/RectangleTextureGLTest.cpp b/src/Magnum/Test/RectangleTextureGLTest.cpp index e6ea19b7a..091dee333 100644 --- a/src/Magnum/Test/RectangleTextureGLTest.cpp +++ b/src/Magnum/Test/RectangleTextureGLTest.cpp @@ -64,7 +64,9 @@ struct RectangleTextureGLTest: AbstractOpenGLTester { void subImageBuffer(); void compressedSubImageBuffer(); void subImageQuery(); + void compressedSubImageQuery(); void subImageQueryBuffer(); + void compressedSubImageQueryBuffer(); void invalidateImage(); void invalidateSubImage(); @@ -95,7 +97,9 @@ RectangleTextureGLTest::RectangleTextureGLTest() { &RectangleTextureGLTest::subImageBuffer, &RectangleTextureGLTest::compressedSubImageBuffer, &RectangleTextureGLTest::subImageQuery, + &RectangleTextureGLTest::compressedSubImageQuery, &RectangleTextureGLTest::subImageQueryBuffer, + &RectangleTextureGLTest::compressedSubImageQueryBuffer, &RectangleTextureGLTest::invalidateImage, &RectangleTextureGLTest::invalidateSubImage}); @@ -398,6 +402,10 @@ void RectangleTextureGLTest::subImageQuery() { Containers::ArrayView{Data}, TestSuite::Compare::Container); } +void RectangleTextureGLTest::compressedSubImageQuery() { + CORRADE_SKIP("No rectangle texture compression format exists."); +} + void RectangleTextureGLTest::subImageQueryBuffer() { if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); @@ -421,6 +429,10 @@ void RectangleTextureGLTest::subImageQueryBuffer() { Containers::ArrayView{Data}, TestSuite::Compare::Container); } +void RectangleTextureGLTest::compressedSubImageQueryBuffer() { + CORRADE_SKIP("No rectangle texture compression format exists."); +} + void RectangleTextureGLTest::invalidateImage() { if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); diff --git a/src/Magnum/Test/TextureArrayGLTest.cpp b/src/Magnum/Test/TextureArrayGLTest.cpp index ad79e364f..da8a88d93 100644 --- a/src/Magnum/Test/TextureArrayGLTest.cpp +++ b/src/Magnum/Test/TextureArrayGLTest.cpp @@ -117,7 +117,9 @@ struct TextureArrayGLTest: AbstractOpenGLTester { void subImage1DBuffer(); void compressedSubImage1DBuffer(); void subImage1DQuery(); + void compressedSubImage1DQuery(); void subImage1DQueryBuffer(); + void compressedSubImage1DQueryBuffer(); #endif void subImage2D(); void compressedSubImage2D(); @@ -125,7 +127,9 @@ struct TextureArrayGLTest: AbstractOpenGLTester { void compressedSubImage2DBuffer(); #ifndef MAGNUM_TARGET_GLES void subImage2DQuery(); + void compressedSubImage2DQuery(); void subImage2DQueryBuffer(); + void compressedSubImage2DQueryBuffer(); #endif #ifndef MAGNUM_TARGET_GLES @@ -225,7 +229,9 @@ TextureArrayGLTest::TextureArrayGLTest() { &TextureArrayGLTest::subImage1DBuffer, &TextureArrayGLTest::compressedSubImage1DBuffer, &TextureArrayGLTest::subImage1DQuery, + &TextureArrayGLTest::compressedSubImage1DQuery, &TextureArrayGLTest::subImage1DQueryBuffer, + &TextureArrayGLTest::compressedSubImage1DQueryBuffer, #endif &TextureArrayGLTest::subImage2D, &TextureArrayGLTest::compressedSubImage2D, @@ -233,7 +239,9 @@ TextureArrayGLTest::TextureArrayGLTest() { &TextureArrayGLTest::compressedSubImage2DBuffer, #ifndef MAGNUM_TARGET_GLES &TextureArrayGLTest::subImage2DQuery, + &TextureArrayGLTest::compressedSubImage2DQuery, &TextureArrayGLTest::subImage2DQueryBuffer, + &TextureArrayGLTest::compressedSubImage2DQueryBuffer, #endif #ifndef MAGNUM_TARGET_GLES @@ -967,6 +975,10 @@ void TextureArrayGLTest::subImage1DQuery() { (Containers::ArrayView{image.data(), image.data().size()}.suffix(DataOffset1D)), Containers::ArrayView{Data1D}, TestSuite::Compare::Container); } +void TextureArrayGLTest::compressedSubImage1DQuery() { + CORRADE_SKIP("No 1D texture compression format exists."); +} + void TextureArrayGLTest::subImage1DQueryBuffer() { if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); @@ -989,6 +1001,10 @@ void TextureArrayGLTest::subImage1DQueryBuffer() { CORRADE_COMPARE_AS(imageData.suffix(DataOffset1D), Containers::ArrayView{Data1D}, TestSuite::Compare::Container); } + +void TextureArrayGLTest::compressedSubImage1DQueryBuffer() { + CORRADE_SKIP("No 1D texture compression format exists."); +} #endif namespace { @@ -1252,6 +1268,44 @@ void TextureArrayGLTest::subImage2DQuery() { (Containers::ArrayView{image.data(), image.data().size()}.suffix(DataOffset2D)), Containers::ArrayView{Data2D}, TestSuite::Compare::Container); } +void TextureArrayGLTest::compressedSubImage2DQuery() { + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + + Texture2DArray texture; + texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, {12, 4, 4}) + .setCompressedSubImage(0, {}, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, + {12, 4, 4}, CompressedSubData2DComplete}); + + MAGNUM_VERIFY_NO_ERROR(); + + /* Test also without compressed pixel storage to ensure that both size + computations work */ + if(Context::current()->isExtensionSupported()) { + CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 1}, {4, 4, 2}), {}); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 2})); + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}), + Containers::ArrayView{CompressedData2D}, TestSuite::Compare::Container); + } + + CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 1}, {4, 4, 2}), {_compressedDataStorage2D}); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 2})); + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}.suffix(_compressedDataOffset2D)), + Containers::ArrayView{CompressedData2D}, TestSuite::Compare::Container); +} + void TextureArrayGLTest::subImage2DQueryBuffer() { if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); @@ -1275,6 +1329,36 @@ void TextureArrayGLTest::subImage2DQueryBuffer() { Containers::ArrayView{Data2D}, TestSuite::Compare::Container); } +void TextureArrayGLTest::compressedSubImage2DQueryBuffer() { + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + + Texture2DArray texture; + texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, {12, 4, 4}) + .setCompressedSubImage(0, {}, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, + {12, 4, 4}, CompressedSubData2DComplete}); + + MAGNUM_VERIFY_NO_ERROR(); + + CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 1}, {4, 4, 2}), { + #ifndef MAGNUM_TARGET_GLES + _compressedDataStorage2D + #endif + }, BufferUsage::StaticRead); + + MAGNUM_VERIFY_NO_ERROR(); + const auto imageData = image.buffer().data(); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 2})); + CORRADE_COMPARE_AS(imageData.suffix(_compressedDataOffset2D), Containers::ArrayView{CompressedData2D}, TestSuite::Compare::Container); +} + void TextureArrayGLTest::generateMipmap1D() { if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported.")); diff --git a/src/Magnum/Test/TextureGLTest.cpp b/src/Magnum/Test/TextureGLTest.cpp index a3918c200..3e33caa9a 100644 --- a/src/Magnum/Test/TextureGLTest.cpp +++ b/src/Magnum/Test/TextureGLTest.cpp @@ -139,7 +139,9 @@ struct TextureGLTest: AbstractOpenGLTester { void subImage1DBuffer(); void compressedSubImage1DBuffer(); void subImage1DQuery(); + void compressedSubImage1DQuery(); void subImage1DQueryBuffer(); + void compressedSubImage1DQueryBuffer(); #endif void subImage2D(); void compressedSubImage2D(); @@ -149,7 +151,9 @@ struct TextureGLTest: AbstractOpenGLTester { #endif #ifndef MAGNUM_TARGET_GLES void subImage2DQuery(); + void compressedSubImage2DQuery(); void subImage2DQueryBuffer(); + void compressedSubImage2DQueryBuffer(); #endif void subImage3D(); void compressedSubImage3D(); @@ -159,7 +163,9 @@ struct TextureGLTest: AbstractOpenGLTester { #endif #ifndef MAGNUM_TARGET_GLES void subImage3DQuery(); + void compressedSubImage3DQuery(); void subImage3DQueryBuffer(); + void compressedSubImage3DQueryBuffer(); #endif #ifndef MAGNUM_TARGET_GLES @@ -286,7 +292,9 @@ TextureGLTest::TextureGLTest() { &TextureGLTest::subImage1DBuffer, &TextureGLTest::compressedSubImage1DBuffer, &TextureGLTest::subImage1DQuery, + &TextureGLTest::compressedSubImage1DQuery, &TextureGLTest::subImage1DQueryBuffer, + &TextureGLTest::compressedSubImage1DQueryBuffer, #endif &TextureGLTest::subImage2D, &TextureGLTest::compressedSubImage2D, @@ -296,7 +304,9 @@ TextureGLTest::TextureGLTest() { #endif #ifndef MAGNUM_TARGET_GLES &TextureGLTest::subImage2DQuery, + &TextureGLTest::compressedSubImage2DQuery, &TextureGLTest::subImage2DQueryBuffer, + &TextureGLTest::compressedSubImage2DQueryBuffer, #endif &TextureGLTest::subImage3D, &TextureGLTest::compressedSubImage3D, @@ -306,7 +316,9 @@ TextureGLTest::TextureGLTest() { #endif #ifndef MAGNUM_TARGET_GLES &TextureGLTest::subImage3DQuery, + &TextureGLTest::compressedSubImage3DQuery, &TextureGLTest::subImage3DQueryBuffer, + &TextureGLTest::compressedSubImage3DQueryBuffer, #endif #ifndef MAGNUM_TARGET_GLES @@ -1316,6 +1328,10 @@ void TextureGLTest::subImage1DQuery() { (Containers::ArrayView{image.data(), image.data().size()}.suffix(DataOffset1D)), Containers::ArrayView{Data1D}, TestSuite::Compare::Container); } +void TextureGLTest::compressedSubImage1DQuery() { + CORRADE_SKIP("No 1D texture compression format exists."); +} + void TextureGLTest::subImage1DQueryBuffer() { if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); @@ -1336,6 +1352,10 @@ void TextureGLTest::subImage1DQueryBuffer() { CORRADE_COMPARE_AS(imageData.suffix(DataOffset1D), Containers::ArrayView{Data1D}, TestSuite::Compare::Container); } + +void TextureGLTest::compressedSubImage1DQueryBuffer() { + CORRADE_SKIP("No 1D texture compression format exists."); +} #endif namespace { @@ -1491,6 +1511,41 @@ void TextureGLTest::subImage2DQuery() { (Containers::ArrayView{image.data(), image.data().size()}.suffix(_dataOffset2D)), Containers::ArrayView{Data2D}, TestSuite::Compare::Container); } +void TextureGLTest::compressedSubImage2DQuery() { + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + + Texture2D texture; + texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, {12, 4}) + .setCompressedSubImage(0, {}, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 4}, CompressedSubData2DComplete}); + + MAGNUM_VERIFY_NO_ERROR(); + + /* Test also without compressed pixel storage to ensure that both size + computations work */ + if(Context::current()->isExtensionSupported()) { + CompressedImage2D image = texture.compressedSubImage(0, Range2Di::fromSize({4, 0}, Vector2i{4}), {}); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), Vector2i{4}); + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}), + Containers::ArrayView{CompressedData2D}, TestSuite::Compare::Container); + } + + CompressedImage2D image = texture.compressedSubImage(0, Range2Di::fromSize({4, 0}, Vector2i{4}), {_compressedDataStorage2D}); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), Vector2i{4}); + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}.suffix(_compressedDataOffset2D)), + Containers::ArrayView{CompressedData2D}, TestSuite::Compare::Container); +} + void TextureGLTest::subImage2DQueryBuffer() { if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); @@ -1511,6 +1566,39 @@ void TextureGLTest::subImage2DQueryBuffer() { CORRADE_COMPARE_AS(imageData.suffix(_dataOffset2D), Containers::ArrayView{Data2D}, TestSuite::Compare::Container); } + +void TextureGLTest::compressedSubImage2DQueryBuffer() { + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + + Texture2D texture; + texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, {12, 4}) + .setCompressedSubImage(0, {}, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 4}, CompressedSubData2DComplete}); + + MAGNUM_VERIFY_NO_ERROR(); + + /* Test also without compressed pixel storage to ensure that both size + computations work */ + if(Context::current()->isExtensionSupported()) { + CompressedBufferImage2D image = texture.compressedSubImage(0, Range2Di::fromSize({4, 0}, Vector2i{4}), {}, BufferUsage::StaticRead); + const auto imageData = image.buffer().data(); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), Vector2i{4}); + CORRADE_COMPARE_AS(imageData, Containers::ArrayView{CompressedData2D}, TestSuite::Compare::Container); + } + + CompressedBufferImage2D image = texture.compressedSubImage(0, Range2Di::fromSize({4, 0}, Vector2i{4}), {_compressedDataStorage2D}, BufferUsage::StaticRead); + const auto imageData = image.buffer().data(); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), Vector2i{4}); + CORRADE_COMPARE_AS(imageData.suffix(_compressedDataOffset2D), Containers::ArrayView{CompressedData2D}, TestSuite::Compare::Container); +} #endif namespace { @@ -1707,6 +1795,41 @@ void TextureGLTest::subImage3DQuery() { (Containers::ArrayView{image.data(), image.data().size()}.suffix(_dataOffset3D)), Containers::ArrayView{Data3D}, TestSuite::Compare::Container); } +void TextureGLTest::compressedSubImage3DQuery() { + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); + + Texture3D texture; + texture.setStorage(1, TextureFormat::CompressedRGBABptcUnorm, {12, 4, 4}) + .setCompressedSubImage(0, {}, CompressedImageView3D{CompressedPixelFormat::RGBABptcUnorm, {12, 4, 4}, CompressedSubData3DComplete}); + + MAGNUM_VERIFY_NO_ERROR(); + + /* Test also without compressed pixel storage to ensure that both size + computations work */ + if(Context::current()->isExtensionSupported()) { + CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 0}, Vector3i{4}), {}); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), (Vector3i{4})); + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}), + Containers::ArrayView{CompressedData3D}, TestSuite::Compare::Container); + } + + CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 0}, Vector3i{4}), {_compressedDataStorage3D}); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), (Vector3i{4})); + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}.suffix(_compressedDataOffset3D)), + Containers::ArrayView{CompressedData3D}, TestSuite::Compare::Container); +} + void TextureGLTest::subImage3DQueryBuffer() { if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); @@ -1728,6 +1851,39 @@ void TextureGLTest::subImage3DQueryBuffer() { Containers::ArrayView{Data3D}, TestSuite::Compare::Container); } +void TextureGLTest::compressedSubImage3DQueryBuffer() { + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); + + Texture3D texture; + texture.setStorage(1, TextureFormat::CompressedRGBABptcUnorm, {12, 4, 4}) + .setCompressedSubImage(0, {}, CompressedImageView3D{CompressedPixelFormat::RGBABptcUnorm, {12, 4, 4}, CompressedSubData3DComplete}); + + MAGNUM_VERIFY_NO_ERROR(); + + /* Test also without compressed pixel storage to ensure that both size + computations work */ + if(Context::current()->isExtensionSupported()) { + CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 0}, Vector3i{4}), {}, BufferUsage::StaticRead); + const auto imageData = image.buffer().data(); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), Vector3i{4}); + CORRADE_COMPARE_AS(imageData, Containers::ArrayView{CompressedData3D}, TestSuite::Compare::Container); + } + + CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 0}, Vector3i{4}), {_compressedDataStorage3D}, BufferUsage::StaticRead); + const auto imageData = image.buffer().data(); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE(image.size(), Vector3i{4}); + CORRADE_COMPARE_AS(imageData.suffix(_compressedDataOffset3D), Containers::ArrayView{CompressedData3D}, TestSuite::Compare::Container); +} + void TextureGLTest::generateMipmap1D() { if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported.")); diff --git a/src/Magnum/Texture.cpp b/src/Magnum/Texture.cpp index 018d8084b..db9553812 100644 --- a/src/Magnum/Texture.cpp +++ b/src/Magnum/Texture.cpp @@ -93,6 +93,16 @@ template BufferImage Texture::su return std::move(image); } +template CompressedImage Texture::compressedSubImage(const Int level, const RangeTypeFor& range, CompressedImage&& image) { + compressedSubImage(level, range, image); + return std::move(image); +} + +template CompressedBufferImage Texture::compressedSubImage(const Int level, const RangeTypeFor& range, CompressedBufferImage&& image, const BufferUsage usage) { + compressedSubImage(level, range, image, usage); + return std::move(image); +} + template class MAGNUM_EXPORT Texture<1>; template class MAGNUM_EXPORT Texture<2>; template class MAGNUM_EXPORT Texture<3>; diff --git a/src/Magnum/Texture.h b/src/Magnum/Texture.h index 288b0189a..c99773547 100644 --- a/src/Magnum/Texture.h +++ b/src/Magnum/Texture.h @@ -860,6 +860,61 @@ template class Texture: public AbstractTexture { * @endcode */ BufferImage subImage(Int level, const RangeTypeFor& range, BufferImage&& image, BufferUsage usage); + + /** + * @brief Read range of given compressed texture mip level to image + * @param level Mip level + * @param range Range to read + * @param image Image where to put the compressed data + * + * Compression format and data size are taken from the texture. + * @see @fn_gl2{GetTextureLevelParameter,GetTexLevelParameter}, + * @fn_gl_extension{GetTextureLevelParameter,EXT,direct_state_access}, + * eventually @fn_gl{GetTexLevelParameter} with + * @def_gl{TEXTURE_COMPRESSED_IMAGE_SIZE}, @def_gl{TEXTURE_INTERNAL_FORMAT}, + * then @fn_gl{GetCompressedTextureSubImage} + * @requires_gl45 Extension @extension{ARB,get_texture_sub_image} + * @requires_gl Texture image queries are not available in OpenGL ES or + * WebGL. See @ref Framebuffer::read() for possible workaround. + */ + void compressedSubImage(Int level, const RangeTypeFor& range, CompressedImage& image) { + AbstractTexture::compressedSubImage(level, range, image); + } + + /** @overload + * + * Convenience alternative to the above, example usage: + * @code + * CompressedImage2D image = texture.compressedSubImage(0, rect, {}); + * @endcode + */ + CompressedImage compressedSubImage(Int level, const RangeTypeFor& range, CompressedImage&& image); + + /** + * @brief Read range of given compressed texture mip level to buffer image + * @param level Mip level + * @param range Range to read + * @param image Buffer image where to put the compressed data + * @param usage Buffer usage + * + * See @ref compressedSubImage(Int, const RangeTypeFor&, CompressedBufferImage&, BufferUsage) + * for more information. + * @requires_gl45 Extension @extension{ARB,get_texture_sub_image} + * @requires_gl Texture image queries are not available in OpenGL ES or + * WebGL. See @ref Framebuffer::read() for possible workaround. + */ + void compressedSubImage(Int level, const RangeTypeFor& range, CompressedBufferImage& image, BufferUsage usage) { + AbstractTexture::compressedSubImage(level, range, image, usage); + } + + /** @overload + * + * Convenience alternative to the above, example usage: + * @code + * CompressedBufferImage2D image = texture.compressedSubImage(0, rect, {}, BufferUsage::StaticRead); + * @endcode + */ + CompressedBufferImage compressedSubImage(Int level, const RangeTypeFor& range, CompressedBufferImage&& image, BufferUsage usage); #endif /** diff --git a/src/Magnum/TextureArray.cpp b/src/Magnum/TextureArray.cpp index de611004f..e30f6cd6a 100644 --- a/src/Magnum/TextureArray.cpp +++ b/src/Magnum/TextureArray.cpp @@ -84,6 +84,16 @@ template BufferImage TextureArraysubImage(level, range, image, usage); return std::move(image); } + +template CompressedImage TextureArray::compressedSubImage(const Int level, const RangeTypeFor& range, CompressedImage&& image) { + compressedSubImage(level, range, image); + return std::move(image); +} + +template CompressedBufferImage TextureArray::compressedSubImage(const Int level, const RangeTypeFor& range, CompressedBufferImage&& image, const BufferUsage usage) { + compressedSubImage(level, range, image, usage); + return std::move(image); +} #endif #ifndef MAGNUM_TARGET_GLES diff --git a/src/Magnum/TextureArray.h b/src/Magnum/TextureArray.h index a61370ed4..d0f7498f2 100644 --- a/src/Magnum/TextureArray.h +++ b/src/Magnum/TextureArray.h @@ -551,6 +551,50 @@ template class TextureArray: public AbstractTexture { * @endcode */ BufferImage subImage(Int level, const RangeTypeFor& range, BufferImage&& image, BufferUsage usage); + + /** + * @copybrief Texture::compressedSubImage(Int, const RangeTypeFor&, CompressedImage&) + * + * See @ref Texture::compressedSubImage(Int, const RangeTypeFor&, CompressedImage&) + * for more information. + * @requires_gl45 Extension @extension{ARB,get_texture_sub_image} + * @requires_gl Texture image queries are not available in OpenGL ES or + * WebGL. See @ref Framebuffer::read() for possible workaround. + */ + void compressedSubImage(Int level, const RangeTypeFor& range, CompressedImage& image) { + AbstractTexture::compressedSubImage(level, range, image); + } + + /** @overload + * + * Convenience alternative to the above, example usage: + * @code + * CompressedImage3D image = texture.compressedSubImage(0, range, {}); + * @endcode + */ + CompressedImage compressedSubImage(Int level, const RangeTypeFor& range, CompressedImage&& image); + + /** + * @copybrief Texture::compressedSubImage(Int, const RangeTypeFor&, CompressedBufferImage&, BufferUsage) + * + * See @ref Texture::compressedSubImage(Int, const RangeTypeFor&, CompressedBufferImage&, BufferUsage) + * for more information. + * @requires_gl45 Extension @extension{ARB,get_texture_sub_image} + * @requires_gl Texture image queries are not available in OpenGL ES or + * WebGL. See @ref Framebuffer::read() for possible workaround. + */ + void compressedSubImage(Int level, const RangeTypeFor& range, CompressedBufferImage& image, BufferUsage usage) { + AbstractTexture::compressedSubImage(level, range, image, usage); + } + + /** @overload + * + * Convenience alternative to the above, example usage: + * @code + * CompressedBufferImage3D image = texture.compressedSubImage(0, range, {}, BufferUsage::StaticRead); + * @endcode + */ + CompressedBufferImage compressedSubImage(Int level, const RangeTypeFor& range, CompressedBufferImage&& image, BufferUsage usage); #endif /** From d5dae1a2114e61e8e1321c06513655ca00952cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 03:21:27 +0100 Subject: [PATCH 041/258] Added workaround for NVidia reporting compressed block size in bits. Instead of bytes as per specification of glGetInternalformativ(). --- src/Magnum/AbstractTexture.cpp | 9 +++++++++ src/Magnum/AbstractTexture.h | 5 +++++ src/Magnum/Implementation/TextureState.cpp | 9 +++++++++ src/Magnum/Implementation/TextureState.h | 1 + src/Magnum/Implementation/driverSpecific.cpp | 4 ++++ 5 files changed, 28 insertions(+) diff --git a/src/Magnum/AbstractTexture.cpp b/src/Magnum/AbstractTexture.cpp index 94012890d..d2603e1f6 100644 --- a/src/Magnum/AbstractTexture.cpp +++ b/src/Magnum/AbstractTexture.cpp @@ -199,10 +199,19 @@ void AbstractTexture::bindImplementationMulti(const GLint firstTextureUnit, Cont #ifndef MAGNUM_TARGET_GLES Int AbstractTexture::compressedBlockDataSize(const GLenum target, const TextureFormat format) { + return (Context::current()->state().texture->compressedBlockDataSizeImplementation)(target, format); +} + +Int AbstractTexture::compressedBlockDataSizeImplementationDefault(const GLenum target, const TextureFormat format) { GLint value; glGetInternalformativ(target, GLenum(format), GL_TEXTURE_COMPRESSED_BLOCK_SIZE, 1, &value); return value; } + +Int AbstractTexture::compressedBlockDataSizeImplementationBitsWorkaround(const GLenum target, const TextureFormat format) { + /* NVidia (358.16) reports the value in bits instead of bytes */ + return compressedBlockDataSizeImplementationDefault(target, format)/8; +} #endif AbstractTexture::AbstractTexture(GLenum target): _target{target}, _flags{ObjectFlag::DeleteOnDestruction} { diff --git a/src/Magnum/AbstractTexture.h b/src/Magnum/AbstractTexture.h index 2b1657aa9..eea1ea3d4 100644 --- a/src/Magnum/AbstractTexture.h +++ b/src/Magnum/AbstractTexture.h @@ -416,6 +416,11 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { GLenum _target; private: + #ifndef MAGNUM_TARGET_GLES + static Int MAGNUM_LOCAL compressedBlockDataSizeImplementationDefault(GLenum target, TextureFormat format); + static Int MAGNUM_LOCAL compressedBlockDataSizeImplementationBitsWorkaround(GLenum target, TextureFormat format); + #endif + static void MAGNUM_LOCAL unbindImplementationDefault(GLint textureUnit); #ifndef MAGNUM_TARGET_GLES static void MAGNUM_LOCAL unbindImplementationMulti(GLint textureUnit); diff --git a/src/Magnum/Implementation/TextureState.cpp b/src/Magnum/Implementation/TextureState.cpp index c3073daa3..98e4fd30d 100644 --- a/src/Magnum/Implementation/TextureState.cpp +++ b/src/Magnum/Implementation/TextureState.cpp @@ -374,6 +374,15 @@ TextureState::TextureState(Context& context, std::vector& extension setMaxAnisotropyImplementation = &AbstractTexture::setMaxAnisotropyImplementationExt; } else setMaxAnisotropyImplementation = &AbstractTexture::setMaxAnisotropyImplementationNoOp; + #ifndef MAGNUM_TARGET_GLES + /* NVidia workaround for compressed block data size implementation */ + if((context.detectedDriver() & Context::DetectedDriver::NVidia) && + !context.isDriverWorkaroundDisabled("nv-compressed-block-size-in-bits")) + compressedBlockDataSizeImplementation = &AbstractTexture::compressedBlockDataSizeImplementationBitsWorkaround; + else + compressedBlockDataSizeImplementation = &AbstractTexture::compressedBlockDataSizeImplementationDefault; + #endif + /* Resize bindings array to hold all possible texture units */ glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextureUnits); CORRADE_INTERNAL_ASSERT(maxTextureUnits > 0); diff --git a/src/Magnum/Implementation/TextureState.h b/src/Magnum/Implementation/TextureState.h index 475c62b27..f34a234b7 100644 --- a/src/Magnum/Implementation/TextureState.h +++ b/src/Magnum/Implementation/TextureState.h @@ -45,6 +45,7 @@ struct TextureState { void reset(); + Int(*compressedBlockDataSizeImplementation)(GLenum, TextureFormat); void(*unbindImplementation)(GLint); void(*bindMultiImplementation)(GLint, Containers::ArrayView); void(AbstractTexture::*createImplementation)(); diff --git a/src/Magnum/Implementation/driverSpecific.cpp b/src/Magnum/Implementation/driverSpecific.cpp index a07246c4c..1469a4647 100644 --- a/src/Magnum/Implementation/driverSpecific.cpp +++ b/src/Magnum/Implementation/driverSpecific.cpp @@ -52,6 +52,10 @@ namespace { newer GLSL version. */ "no-layout-qualifiers-on-old-glsl", + /* NVidia drivers (358.16) report compressed block size from internal + format query in bits instead of bytes */ + "nv-compressed-block-size-in-bits", + /* NVidia drivers (358.16) report different compressed image size for cubemaps based on whether the texture is immutable or not and not based on whether I'm querying all faces (ARB_DSA) or a single face From f1643c827e074905663e32df2a905a2306965a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 03:22:12 +0100 Subject: [PATCH 042/258] Expect more test failures on NV. I'm tired of that poorly specified compressed stuff shit. --- src/Magnum/Test/TextureGLTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Magnum/Test/TextureGLTest.cpp b/src/Magnum/Test/TextureGLTest.cpp index 3e33caa9a..efaaaeb00 100644 --- a/src/Magnum/Test/TextureGLTest.cpp +++ b/src/Magnum/Test/TextureGLTest.cpp @@ -1815,6 +1815,10 @@ void TextureGLTest::compressedSubImage3DQuery() { MAGNUM_VERIFY_NO_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4})); + + CORRADE_EXPECT_FAIL_IF(!!(Context::current()->detectedDriver() & Context::DetectedDriver::NVidia), + "Default compressed pixel storage behaves weirdly with BPTC compression on NVidia"); + CORRADE_COMPARE_AS( (Containers::ArrayView{image.data(), image.data().size()}), Containers::ArrayView{CompressedData3D}, TestSuite::Compare::Container); @@ -1872,6 +1876,10 @@ void TextureGLTest::compressedSubImage3DQueryBuffer() { MAGNUM_VERIFY_NO_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{4}); + + CORRADE_EXPECT_FAIL_IF(!!(Context::current()->detectedDriver() & Context::DetectedDriver::NVidia), + "Default compressed pixel storage behaves weirdly with BPTC compression on NVidia"); + CORRADE_COMPARE_AS(imageData, Containers::ArrayView{CompressedData3D}, TestSuite::Compare::Container); } From 3cfaab654a144400bebe7e65206024c9f49bb31d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 03:25:02 +0100 Subject: [PATCH 043/258] Platform: Doxygen workarounds. --- src/Magnum/Platform/WindowlessWglApplication.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Magnum/Platform/WindowlessWglApplication.h b/src/Magnum/Platform/WindowlessWglApplication.h index fbcd5a962..e52611421 100644 --- a/src/Magnum/Platform/WindowlessWglApplication.h +++ b/src/Magnum/Platform/WindowlessWglApplication.h @@ -41,10 +41,12 @@ #include "Magnum/OpenGL.h" #include "Magnum/Platform/Platform.h" +#ifndef DOXYGEN_GENERATING_OUTPUT /* Define stuff that we need because I can't be bothered with creating a new header just for two defines */ #define WGL_CONTEXT_FLAGS_ARB 0x2094 #define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 +#endif namespace Magnum { namespace Platform { From c054e5f1a2e5db30c730defc4698512a7e682667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 03:32:50 +0100 Subject: [PATCH 044/258] doc: updated and fixed OpenGL mapping table. --- doc/opengl-mapping.dox | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/opengl-mapping.dox b/doc/opengl-mapping.dox index 68177a9c4..1edffe2be 100644 --- a/doc/opengl-mapping.dox +++ b/doc/opengl-mapping.dox @@ -463,7 +463,7 @@ OpenGL function | Matching API @def_gl_extension{MAX_SPARSE_3D_TEXTURE_SIZE,ARB,sparse_texture} | | @def_gl_extension{MAX_SPARSE_ARRAY_TEXTURE_LAYERS,ARB,sparse_texture} | | @def_gl{MAX_TESS_GEN_LEVEL} | | -@def_gl{MAX_TESS_PATCH_COMPONENTS} +@def_gl{MAX_TESS_PATCH_COMPONENTS} | | @def_gl{MAX_TEXTURE_BUFFER_SIZE} | @ref BufferTexture::maxSize() @def_gl_extension{MAX_TEXTURE_MAX_ANISOTROPY,EXT,texture_filter_anisotropic} | @ref Sampler::maxMaxAnisotropy() @def_gl{MAX_TEXTURE_LOD_BIAS} | @ref AbstractTexture::maxLodBias() @@ -483,6 +483,7 @@ OpenGL function | Matching API @def_gl{MIN_FRAGMENT_INTERPOLATION_OFFSET}, \n @def_gl{MAX_FRAGMENT_INTERPOLATION_OFFSET} | | @def_gl{MIN_MAP_BUFFER_ALIGNMENT} | @ref Buffer::minMapAlignment() @def_gl{MIN_PROGRAM_TEXEL_OFFSET}, \n @def_gl{MAX_PROGRAM_TEXEL_OFFSET} | @ref AbstractShaderProgram::minTexelOffset(), \n @ref AbstractShaderProgram::maxTexelOffset() +@def_gl{MIN_PROGRAM_TEXTURE_GATHER_OFFSET}, \n @def_gl{MAX_PROGRAM_TEXTURE_GATHER_OFFSET} | | @def_gl{MIN_SAMPLE_SHADING_VALUE} | | @def_gl{NUM_EXTENSIONS} | @ref Context::supportedExtensions() @def_gl{NUM_PROGRAM_BINARY_FORMATS}, \n @def_gl{PROGRAM_BINARY_FORMATS} | | From ce67d652eafa70ba923ea1fa6b7b241401ceea95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 13:02:03 +0100 Subject: [PATCH 045/258] Adapted to Corrade::Utility::Arguments changes. --- src/Magnum/Text/fontconverter.cpp | 10 +++++----- src/Magnum/TextureTools/distancefieldconverter.cpp | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Magnum/Text/fontconverter.cpp b/src/Magnum/Text/fontconverter.cpp index 01d1e1870..4cb1a0eae 100644 --- a/src/Magnum/Text/fontconverter.cpp +++ b/src/Magnum/Text/fontconverter.cpp @@ -104,14 +104,14 @@ FontConverter::FontConverter(const Arguments& arguments): Platform::WindowlessAp .addArgument("output").setHelp("output", "output filename prefix") .addNamedArgument("font").setHelp("font", "font plugin") .addNamedArgument("converter").setHelp("converter", "font converter plugin") - .addOption("plugin-dir", MAGNUM_PLUGINS_DIR).setHelpKey("plugin-dir", "DIR").setHelp("plugin-dir", "base plugin dir") + .addOption("plugin-dir", MAGNUM_PLUGINS_DIR).setHelp("plugin-dir", "base plugin dir", "DIR") .addOption("characters", "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789?!:;,. ").setHelp("characters", "characters to include in the output") - .addOption("font-size", "128").setHelpKey("font-size", "N").setHelp("font-size", "input font size") - .addOption("atlas-size", "2048 2048").setHelpKey("atlas-size", "\"X Y\"").setHelp("atlas-size", "glyph atlas size") - .addOption("output-size", "256 256").setHelpKey("output-size", "\"X Y\"").setHelp("output-size", "output atlas size. If set to zero size, distance field computation will not be used.") - .addOption("radius", "24").setHelpKey("radius", "N").setHelp("radius", "distance field computation radius") + .addOption("font-size", "128").setHelp("font-size", "input font size", "N") + .addOption("atlas-size", "2048 2048").setHelp("atlas-size", "glyph atlas size", "\"X Y\"") + .addOption("output-size", "256 256").setHelp("output-size", "output atlas size. If set to zero size, distance field computation will not be used.", "\"X Y\"") + .addOption("radius", "24").setHelp("radius", "distance field computation radius", "N") .addSkippedPrefix("magnum", "engine-specific options") .setHelp("Converts font to raster one of given atlas size.") .parse(arguments.argc, arguments.argv); diff --git a/src/Magnum/TextureTools/distancefieldconverter.cpp b/src/Magnum/TextureTools/distancefieldconverter.cpp index 606c2eda1..681631e5b 100644 --- a/src/Magnum/TextureTools/distancefieldconverter.cpp +++ b/src/Magnum/TextureTools/distancefieldconverter.cpp @@ -105,9 +105,9 @@ DistanceFieldConverter::DistanceFieldConverter(const Arguments& arguments): Plat .addArgument("output").setHelp("output", "output image") .addOption("importer", "AnyImageImporter").setHelp("importer", "image importer plugin") .addOption("converter", "AnyImageConverter").setHelp("converter", "image converter plugin") - .addOption("plugin-dir", MAGNUM_PLUGINS_DIR).setHelpKey("plugin-dir", "DIR").setHelp("plugin-dir", "base plugin dir") - .addNamedArgument("output-size").setHelpKey("output-size", "\"X Y\"").setHelp("output-size", "size of output image") - .addNamedArgument("radius").setHelpKey("radius", "N").setHelp("radius", "distance field computation radius") + .addOption("plugin-dir", MAGNUM_PLUGINS_DIR).setHelp("plugin-dir", "base plugin dir", "DIR") + .addNamedArgument("output-size").setHelp("output-size", "size of output image", "\"X Y\"") + .addNamedArgument("radius").setHelp("radius", "distance field computation radius", "N") .addSkippedPrefix("magnum", "engine-specific options") .setHelp("Converts red channel of an image to distance field representation.") .parse(arguments.argc, arguments.argv); From 707d1d084d20c5c98814873e7b1dc24cc29623f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 13:10:05 +0100 Subject: [PATCH 046/258] Ability to disable workarounds and extensions from environment. Use MAGNUM_DISABLE_WORKAROUNDS and MAGNUM_DISABLE_EXTENSIONS environment variables. --- src/Magnum/Context.cpp | 8 +++++--- src/Magnum/Context.h | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index 5ff3ff755..eae3215c1 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/Context.cpp @@ -406,9 +406,11 @@ Context* Context::_current = nullptr; Context::Context(NoCreateT, Int argc, char** argv, void functionLoader()): _functionLoader{functionLoader}, _version{Version::None} { /* Parse arguments */ Utility::Arguments args{"magnum"}; - args.addOption("disable-workarounds").setHelpKey("disable-workarounds", "LIST") - .setHelp("disable-workarounds", "driver workarounds to disable\n (see src/Magnum/Implementation/driverSpecific.cpp for detailed info)") - .addOption("disable-extensions").setHelpKey("disable-extensions", "LIST").setHelp("disable-extensions", "OpenGL extensions to disable") + args.addOption("disable-workarounds") + .setHelp("disable-workarounds", "driver workarounds to disable\n (see src/Magnum/Implementation/driverSpecific.cpp for detailed info)", "LIST") + .addOption("disable-extensions").setHelp("disable-extensions", "OpenGL extensions to disable", "LIST") + .setFromEnvironment("disable-workarounds") + .setFromEnvironment("disable-extensions") .parse(argc, argv); /* Disable driver workarounds */ diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index a9b1347b2..e56440f59 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -106,7 +106,9 @@ Arguments: - `--magnum-help` -- display this help message and exit - `--magnum-disable-workarounds LIST` -- driver workarounds to disable (see `src/Magnum/Implementation/driverSpecific.cpp` for detailed info) + (environment: `MAGNUM_DISABLE_WORKAROUNDS`) - `--magnum-disable-extensions LIST` -- OpenGL extensions to disable + (environment: `MAGNUM_DISABLE_EXTENSIONS`) */ class MAGNUM_EXPORT Context { From fbeb2bf890fd476f3d87a58c8c6134f2862544e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 13:53:01 +0100 Subject: [PATCH 047/258] More strict XFAIL in CubeMapTexture GL test on NV. --- src/Magnum/Test/CubeMapTextureGLTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Test/CubeMapTextureGLTest.cpp b/src/Magnum/Test/CubeMapTextureGLTest.cpp index 5e5534673..a1600dd4a 100644 --- a/src/Magnum/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureGLTest.cpp @@ -885,8 +885,8 @@ void CubeMapTextureGLTest::compressedSubImage() { CORRADE_COMPARE(image.size(), Vector2i{12}); { - CORRADE_EXPECT_FAIL_IF(Context::current()->isExtensionSupported() && (Context::current()->detectedDriver() & Context::DetectedDriver::NVidia), - "Non-default compressed pixel storage for cube map textures behaves weirdly on NVidia for client-memory images"); + CORRADE_EXPECT_FAIL_IF(Context::current()->isExtensionSupported() && Context::current()->isExtensionSupported() && (Context::current()->detectedDriver() & Context::DetectedDriver::NVidia), + "Non-default compressed pixel storage for cube map textures behaves weirdly on NVidia for client-memory images when using ARB_direct_state_access"); CORRADE_COMPARE_AS( (Containers::ArrayView{image.data(), image.data().size()}), From d36f45ac98a95d383bd55c2b9669a3347ad1ebf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 16:32:23 +0100 Subject: [PATCH 048/258] Fixed compiler warnings when building with CORRADE_NO_ASSERT. --- src/Magnum/MeshTools/Interleave.h | 9 +++++---- src/Magnum/SceneGraph/Object.hpp | 2 ++ src/Magnum/Text/Renderer.cpp | 3 +-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Magnum/MeshTools/Interleave.h b/src/Magnum/MeshTools/Interleave.h index 67cbbb82c..ff03bb6d2 100644 --- a/src/Magnum/MeshTools/Interleave.h +++ b/src/Magnum/MeshTools/Interleave.h @@ -44,11 +44,12 @@ namespace Implementation { resolution (the functions would otherwise need to be de-inlined to break cyclic dependencies) */ struct AttributeCount { - template typename std::enable_if::value, std::size_t>::type operator()(const T& first, const U&... next) const { - CORRADE_ASSERT(sizeof...(next) == 0 || AttributeCount{}(next...) == first.size() || AttributeCount{}(next...) == ~std::size_t(0), "MeshTools::interleave(): attribute arrays don't have the same length, expected" << first.size() << "but got" << AttributeCount{}(next...), 0); - #if defined(CORRADE_NO_ASSERT) && !defined(CORRADE_GRACEFUL_ASSERT) - static_cast(sizeof...(next)); + template typename std::enable_if::value, std::size_t>::type operator()(const T& first, const U&... + #if !defined(CORRADE_NO_ASSERT) || defined(CORRADE_GRACEFUL_ASSERT) + next #endif + ) const { + CORRADE_ASSERT(sizeof...(next) == 0 || AttributeCount{}(next...) == first.size() || AttributeCount{}(next...) == ~std::size_t(0), "MeshTools::interleave(): attribute arrays don't have the same length, expected" << first.size() << "but got" << AttributeCount{}(next...), 0); return first.size(); } diff --git a/src/Magnum/SceneGraph/Object.hpp b/src/Magnum/SceneGraph/Object.hpp index 9d3bcffeb..74bea0352 100644 --- a/src/Magnum/SceneGraph/Object.hpp +++ b/src/Magnum/SceneGraph/Object.hpp @@ -212,8 +212,10 @@ template std::vector Ob } std::vector>> jointObjects(objects); + #if !defined(CORRADE_NO_ASSERT) || defined(CORRADE_GRACEFUL_ASSERT) /* Scene object */ const Scene* scene = this->scene(); + #endif /* Nearest common ancestor not yet implemented - assert this is done on scene */ CORRADE_ASSERT(scene == this, "SceneGraph::Object::transformationMatrices(): currently implemented only for Scene", {}); diff --git a/src/Magnum/Text/Renderer.cpp b/src/Magnum/Text/Renderer.cpp index 3d13faa72..cde237fc6 100644 --- a/src/Magnum/Text/Renderer.cpp +++ b/src/Magnum/Text/Renderer.cpp @@ -93,13 +93,12 @@ std::tuple, Range2D> renderVerticesInternal(AbstractFont& fo /* Layout the line */ const auto layouter = font.layout(cache, size, line); - const UnsignedInt vertexCount = layouter->glyphCount()*4; /* Verify that we don't reallocate anything. The only problem might arise when the layouter decides to compose one character from more than one glyph (i.e. accents). Will remove the assert when this issue arises. */ - CORRADE_INTERNAL_ASSERT(vertices.size()+vertexCount <= vertices.capacity()); + CORRADE_INTERNAL_ASSERT(vertices.size() + layouter->glyphCount()*4 <= vertices.capacity()); /* Bounds of rendered line */ Range2D lineRectangle; From d1714bfd1e12a992145d675de1c564e78139ff65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 18:38:05 +0100 Subject: [PATCH 049/258] Context::current() now returns reference instead of pointer. 103% of use cases use the returned value directly without checking, so we might as well do the check ourselves. Added new function hasCurrent() and added deprecated backward-compatibility conversion and -> operators. Wow, that creeped to a lot of places. Last dinosaur from the pointer age. --- src/Magnum/AbstractFramebuffer.cpp | 36 ++-- src/Magnum/AbstractObject.cpp | 4 +- src/Magnum/AbstractQuery.cpp | 10 +- src/Magnum/AbstractShaderProgram.cpp | 140 +++++++-------- src/Magnum/AbstractTexture.cpp | 170 +++++++++--------- src/Magnum/Audio/Context.h | 2 +- src/Magnum/Buffer.cpp | 74 ++++---- src/Magnum/BufferTexture.cpp | 16 +- src/Magnum/Context.cpp | 7 + src/Magnum/Context.h | 33 +++- src/Magnum/CubeMapTexture.cpp | 38 ++-- src/Magnum/CubeMapTextureArray.cpp | 4 +- src/Magnum/DebugOutput.cpp | 28 +-- src/Magnum/DefaultFramebuffer.cpp | 14 +- src/Magnum/Framebuffer.cpp | 66 +++---- src/Magnum/Implementation/driverSpecific.cpp | 4 +- src/Magnum/Implementation/maxTextureSize.cpp | 8 +- src/Magnum/Mesh.cpp | 36 ++-- src/Magnum/MeshTools/FullScreenTriangle.cpp | 2 +- src/Magnum/MeshView.cpp | 4 +- src/Magnum/MultisampleTexture.cpp | 8 +- src/Magnum/PixelStorage.cpp | 10 +- src/Magnum/Platform/magnum-info.cpp | 66 +++---- src/Magnum/RectangleTexture.cpp | 4 +- src/Magnum/Renderbuffer.cpp | 20 +-- src/Magnum/Renderer.cpp | 10 +- src/Magnum/Sampler.cpp | 4 +- src/Magnum/Shader.cpp | 142 +++++++-------- src/Magnum/Shaders/DistanceFieldVector.cpp | 12 +- src/Magnum/Shaders/Flat.cpp | 12 +- .../CreateCompatibilityShader.h | 6 +- src/Magnum/Shaders/MeshVisualizer.cpp | 16 +- src/Magnum/Shaders/Phong.cpp | 12 +- .../Shaders/Test/MeshVisualizerGLTest.cpp | 6 +- src/Magnum/Shaders/Vector.cpp | 12 +- src/Magnum/Shaders/VertexColor.cpp | 10 +- src/Magnum/Test/AbstractObjectGLTest.cpp | 2 +- src/Magnum/Test/AbstractOpenGLTester.h | 2 +- src/Magnum/Test/AbstractQueryGLTest.cpp | 12 +- .../Test/AbstractShaderProgramGLTest.cpp | 4 +- src/Magnum/Test/AbstractTextureGLTest.cpp | 4 +- src/Magnum/Test/BufferGLTest.cpp | 20 +-- src/Magnum/Test/BufferTextureGLTest.cpp | 22 +-- src/Magnum/Test/ContextGLTest.cpp | 36 ++-- src/Magnum/Test/CubeMapTextureArrayGLTest.cpp | 130 +++++++------- src/Magnum/Test/CubeMapTextureGLTest.cpp | 92 +++++----- src/Magnum/Test/DebugOutputGLTest.cpp | 28 +-- src/Magnum/Test/FramebufferGLTest.cpp | 154 ++++++++-------- src/Magnum/Test/MeshGLTest.cpp | 120 +++++++------ src/Magnum/Test/MultisampleTextureGLTest.cpp | 48 ++--- src/Magnum/Test/PixelStorageGLTest.cpp | 12 +- src/Magnum/Test/PrimitiveQueryGLTest.cpp | 6 +- src/Magnum/Test/RectangleTextureGLTest.cpp | 46 ++--- src/Magnum/Test/RenderbufferGLTest.cpp | 20 +-- src/Magnum/Test/SampleQueryGLTest.cpp | 6 +- src/Magnum/Test/ShaderGLTest.cpp | 4 +- src/Magnum/Test/TextureArrayGLTest.cpp | 162 ++++++++--------- src/Magnum/Test/TextureGLTest.cpp | 154 ++++++++-------- src/Magnum/Test/TimeQueryGLTest.cpp | 10 +- src/Magnum/Test/TransformFeedbackGLTest.cpp | 22 +-- src/Magnum/Text/DistanceFieldGlyphCache.cpp | 8 +- src/Magnum/Text/GlyphCache.cpp | 4 +- src/Magnum/Text/Renderer.cpp | 4 +- src/Magnum/Text/Test/RendererGLTest.cpp | 8 +- src/Magnum/Texture.cpp | 2 +- src/Magnum/TextureArray.cpp | 2 +- src/Magnum/TextureTools/DistanceField.cpp | 24 +-- src/Magnum/TransformFeedback.cpp | 34 ++-- src/MagnumPlugins/TgaImporter/TgaImporter.cpp | 2 +- 69 files changed, 1141 insertions(+), 1109 deletions(-) diff --git a/src/Magnum/AbstractFramebuffer.cpp b/src/Magnum/AbstractFramebuffer.cpp index 25ecc43d1..fa50b0122 100644 --- a/src/Magnum/AbstractFramebuffer.cpp +++ b/src/Magnum/AbstractFramebuffer.cpp @@ -38,7 +38,7 @@ namespace Magnum { Vector2i AbstractFramebuffer::maxViewportSize() { - Vector2i& value = Context::current()->state().framebuffer->maxViewportSize; + Vector2i& value = Context::current().state().framebuffer->maxViewportSize; /* Get the value, if not already cached */ if(value == Vector2i()) @@ -50,16 +50,16 @@ Vector2i AbstractFramebuffer::maxViewportSize() { Int AbstractFramebuffer::maxDrawBuffers() { #ifdef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) return 0; #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif #endif - GLint& value = Context::current()->state().framebuffer->maxDrawBuffers; + GLint& value = Context::current().state().framebuffer->maxDrawBuffers; /* Get the value, if not already cached */ if(value == 0) { @@ -75,10 +75,10 @@ Int AbstractFramebuffer::maxDrawBuffers() { #ifndef MAGNUM_TARGET_GLES Int AbstractFramebuffer::maxDualSourceDrawBuffers() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; - GLint& value = Context::current()->state().framebuffer->maxDualSourceDrawBuffers; + GLint& value = Context::current().state().framebuffer->maxDualSourceDrawBuffers; /* Get the value, if not already cached */ if(value == 0) @@ -106,7 +106,7 @@ void AbstractFramebuffer::bind() { void AbstractFramebuffer::bindInternal(FramebufferTarget target) { #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - (this->*Context::current()->state().framebuffer->bindImplementation)(target); + (this->*Context::current().state().framebuffer->bindImplementation)(target); #else bindImplementationDefault(target); #endif @@ -114,7 +114,7 @@ void AbstractFramebuffer::bindInternal(FramebufferTarget target) { #ifdef MAGNUM_TARGET_GLES2 void AbstractFramebuffer::bindImplementationSingle(FramebufferTarget) { - Implementation::FramebufferState& state = *Context::current()->state().framebuffer; + Implementation::FramebufferState& state = *Context::current().state().framebuffer; CORRADE_INTERNAL_ASSERT(state.readBinding == state.drawBinding); if(state.readBinding == _id) return; @@ -130,7 +130,7 @@ void AbstractFramebuffer::bindImplementationSingle(FramebufferTarget) { inline #endif void AbstractFramebuffer::bindImplementationDefault(FramebufferTarget target) { - Implementation::FramebufferState& state = *Context::current()->state().framebuffer; + Implementation::FramebufferState& state = *Context::current().state().framebuffer; if(target == FramebufferTarget::Read) { if(state.readBinding == _id) return; @@ -147,7 +147,7 @@ void AbstractFramebuffer::bindImplementationDefault(FramebufferTarget target) { FramebufferTarget AbstractFramebuffer::bindInternal() { #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - return (this->*Context::current()->state().framebuffer->bindInternalImplementation)(); + return (this->*Context::current().state().framebuffer->bindInternalImplementation)(); #else return bindImplementationDefault(); #endif @@ -155,7 +155,7 @@ FramebufferTarget AbstractFramebuffer::bindInternal() { #ifdef MAGNUM_TARGET_GLES2 FramebufferTarget AbstractFramebuffer::bindImplementationSingle() { - Implementation::FramebufferState& state = *Context::current()->state().framebuffer; + Implementation::FramebufferState& state = *Context::current().state().framebuffer; CORRADE_INTERNAL_ASSERT(state.readBinding == state.drawBinding); /* Bind the framebuffer, if not already */ @@ -175,7 +175,7 @@ FramebufferTarget AbstractFramebuffer::bindImplementationSingle() { inline #endif FramebufferTarget AbstractFramebuffer::bindImplementationDefault() { - Implementation::FramebufferState& state = *Context::current()->state().framebuffer; + Implementation::FramebufferState& state = *Context::current().state().framebuffer; /* Return target to which the framebuffer is already bound */ if(state.readBinding == _id) @@ -194,7 +194,7 @@ FramebufferTarget AbstractFramebuffer::bindImplementationDefault() { #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) void AbstractFramebuffer::blit(AbstractFramebuffer& source, AbstractFramebuffer& destination, const Range2Di& sourceRectangle, const Range2Di& destinationRectangle, const FramebufferBlitMask mask, const FramebufferBlitFilter filter) { - Context::current()->state().framebuffer->blitImplementation(source, destination, sourceRectangle, destinationRectangle, mask, filter); + Context::current().state().framebuffer->blitImplementation(source, destination, sourceRectangle, destinationRectangle, mask, filter); } #endif @@ -250,14 +250,14 @@ AbstractFramebuffer& AbstractFramebuffer::setViewport(const Range2Di& rectangle) _viewport = rectangle; /* Update the viewport if the framebuffer is currently bound */ - if(Context::current()->state().framebuffer->drawBinding == _id) + if(Context::current().state().framebuffer->drawBinding == _id) setViewportInternal(); return *this; } void AbstractFramebuffer::setViewportInternal() { - Implementation::FramebufferState& state = *Context::current()->state().framebuffer; + Implementation::FramebufferState& state = *Context::current().state().framebuffer; CORRADE_INTERNAL_ASSERT(_viewport != Implementation::FramebufferState::DisengagedViewport); CORRADE_INTERNAL_ASSERT(state.drawBinding == _id); @@ -291,7 +291,7 @@ void AbstractFramebuffer::read(const Range2Di& rectangle, Image2D& image) { Buffer::unbindInternal(Buffer::TargetHint::PixelPack); #endif image.storage().applyPack(); - (Context::current()->state().framebuffer->readImplementation)(rectangle, image.format(), image.type(), data.size(), data + (Context::current().state().framebuffer->readImplementation)(rectangle, image.format(), image.type(), data.size(), data #ifdef MAGNUM_TARGET_GLES2 + Implementation::pixelStorageSkipOffsetFor(image, rectangle.size()) #endif @@ -317,7 +317,7 @@ void AbstractFramebuffer::read(const Range2Di& rectangle, BufferImage2D& image, image.buffer().bindInternal(Buffer::TargetHint::PixelPack); image.storage().applyPack(); - (Context::current()->state().framebuffer->readImplementation)(rectangle, image.format(), image.type(), dataSize, nullptr); + (Context::current().state().framebuffer->readImplementation)(rectangle, image.format(), image.type(), dataSize, nullptr); } BufferImage2D AbstractFramebuffer::read(const Range2Di& rectangle, BufferImage2D&& image, BufferUsage usage) { diff --git a/src/Magnum/AbstractObject.cpp b/src/Magnum/AbstractObject.cpp index a9ff8c2f9..65f672c02 100644 --- a/src/Magnum/AbstractObject.cpp +++ b/src/Magnum/AbstractObject.cpp @@ -113,10 +113,10 @@ namespace { #endif Int AbstractObject::maxLabelLength() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; - GLint& value = Context::current()->state().debug->maxLabelLength; + GLint& value = Context::current().state().debug->maxLabelLength; if(value == 0) { #ifndef MAGNUM_TARGET_GLES diff --git a/src/Magnum/AbstractQuery.cpp b/src/Magnum/AbstractQuery.cpp index 0feead69e..b62ab29b8 100644 --- a/src/Magnum/AbstractQuery.cpp +++ b/src/Magnum/AbstractQuery.cpp @@ -37,7 +37,7 @@ namespace Magnum { AbstractQuery::AbstractQuery(GLenum target): _target{target}, _flags{ObjectFlag::DeleteOnDestruction} { - (this->*Context::current()->state().query->createImplementation)(); + (this->*Context::current().state().query->createImplementation)(); } #ifdef MAGNUM_BUILD_DEPRECATED @@ -79,17 +79,17 @@ void AbstractQuery::createImplementationDSA() { #ifndef MAGNUM_TARGET_WEBGL std::string AbstractQuery::label() const { #ifndef MAGNUM_TARGET_GLES - return Context::current()->state().debug->getLabelImplementation(GL_QUERY, _id); + return Context::current().state().debug->getLabelImplementation(GL_QUERY, _id); #else - return Context::current()->state().debug->getLabelImplementation(GL_QUERY_KHR, _id); + return Context::current().state().debug->getLabelImplementation(GL_QUERY_KHR, _id); #endif } AbstractQuery& AbstractQuery::setLabelInternal(const Containers::ArrayView label) { #ifndef MAGNUM_TARGET_GLES - Context::current()->state().debug->labelImplementation(GL_QUERY, _id, label); + Context::current().state().debug->labelImplementation(GL_QUERY, _id, label); #else - Context::current()->state().debug->labelImplementation(GL_QUERY_KHR, _id, label); + Context::current().state().debug->labelImplementation(GL_QUERY_KHR, _id, label); #endif return *this; } diff --git a/src/Magnum/AbstractShaderProgram.cpp b/src/Magnum/AbstractShaderProgram.cpp index 88f825150..ccd222392 100644 --- a/src/Magnum/AbstractShaderProgram.cpp +++ b/src/Magnum/AbstractShaderProgram.cpp @@ -50,7 +50,7 @@ namespace Implementation { } Int AbstractShaderProgram::maxVertexAttributes() { - GLint& value = Context::current()->state().shaderProgram->maxVertexAttributes; + GLint& value = Context::current().state().shaderProgram->maxVertexAttributes; /* Get the value, if not already cached */ if(value == 0) @@ -62,13 +62,13 @@ Int AbstractShaderProgram::maxVertexAttributes() { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) Int AbstractShaderProgram::maxAtomicCounterBufferSize() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return 0; - GLint& value = Context::current()->state().shaderProgram->maxAtomicCounterBufferSize; + GLint& value = Context::current().state().shaderProgram->maxAtomicCounterBufferSize; if(value == 0) glGetIntegerv(GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE, &value); @@ -78,13 +78,13 @@ Int AbstractShaderProgram::maxAtomicCounterBufferSize() { Int AbstractShaderProgram::maxComputeSharedMemorySize() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return 0; - GLint& value = Context::current()->state().shaderProgram->maxComputeSharedMemorySize; + GLint& value = Context::current().state().shaderProgram->maxComputeSharedMemorySize; if(value == 0) glGetIntegerv(GL_MAX_COMPUTE_SHARED_MEMORY_SIZE, &value); @@ -94,13 +94,13 @@ Int AbstractShaderProgram::maxComputeSharedMemorySize() { Int AbstractShaderProgram::maxComputeWorkGroupInvocations() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return 0; - GLint& value = Context::current()->state().shaderProgram->maxComputeWorkGroupInvocations; + GLint& value = Context::current().state().shaderProgram->maxComputeWorkGroupInvocations; if(value == 0) glGetIntegerv(GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS, &value); @@ -110,13 +110,13 @@ Int AbstractShaderProgram::maxComputeWorkGroupInvocations() { Int AbstractShaderProgram::maxImageUnits() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return 0; - GLint& value = Context::current()->state().shaderProgram->maxImageUnits; + GLint& value = Context::current().state().shaderProgram->maxImageUnits; if(value == 0) glGetIntegerv(GL_MAX_IMAGE_UNITS, &value); @@ -127,10 +127,10 @@ Int AbstractShaderProgram::maxImageUnits() { #ifndef MAGNUM_TARGET_GLES Int AbstractShaderProgram::maxImageSamples() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; - GLint& value = Context::current()->state().shaderProgram->maxImageSamples; + GLint& value = Context::current().state().shaderProgram->maxImageSamples; if(value == 0) glGetIntegerv(GL_MAX_IMAGE_SAMPLES, &value); @@ -143,13 +143,13 @@ Int AbstractShaderProgram::maxImageSamples() { #ifndef MAGNUM_TARGET_WEBGL Int AbstractShaderProgram::maxCombinedShaderOutputResources() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported() || !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() || !Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return 0; - GLint& value = Context::current()->state().shaderProgram->maxCombinedShaderOutputResources; + GLint& value = Context::current().state().shaderProgram->maxCombinedShaderOutputResources; if(value == 0) glGetIntegerv(GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES, &value); @@ -159,13 +159,13 @@ Int AbstractShaderProgram::maxCombinedShaderOutputResources() { Long AbstractShaderProgram::maxShaderStorageBlockSize() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return 0; - GLint64& value = Context::current()->state().shaderProgram->maxShaderStorageBlockSize; + GLint64& value = Context::current().state().shaderProgram->maxShaderStorageBlockSize; if(value == 0) glGetInteger64v(GL_MAX_SHADER_STORAGE_BLOCK_SIZE, &value); @@ -176,11 +176,11 @@ Long AbstractShaderProgram::maxShaderStorageBlockSize() { Int AbstractShaderProgram::maxUniformBlockSize() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().shaderProgram->maxUniformBlockSize; + GLint& value = Context::current().state().shaderProgram->maxUniformBlockSize; if(value == 0) glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &value); @@ -191,13 +191,13 @@ Int AbstractShaderProgram::maxUniformBlockSize() { #ifndef MAGNUM_TARGET_WEBGL Int AbstractShaderProgram::maxUniformLocations() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return 0; - GLint& value = Context::current()->state().shaderProgram->maxUniformLocations; + GLint& value = Context::current().state().shaderProgram->maxUniformLocations; if(value == 0) glGetIntegerv(GL_MAX_UNIFORM_LOCATIONS, &value); @@ -208,11 +208,11 @@ Int AbstractShaderProgram::maxUniformLocations() { Int AbstractShaderProgram::minTexelOffset() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().shaderProgram->minTexelOffset; + GLint& value = Context::current().state().shaderProgram->minTexelOffset; if(value == 0) glGetIntegerv(GL_MIN_PROGRAM_TEXEL_OFFSET, &value); @@ -222,11 +222,11 @@ Int AbstractShaderProgram::minTexelOffset() { Int AbstractShaderProgram::maxTexelOffset() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().shaderProgram->maxTexelOffset; + GLint& value = Context::current().state().shaderProgram->maxTexelOffset; if(value == 0) glGetIntegerv(GL_MAX_PROGRAM_TEXEL_OFFSET, &value); @@ -245,7 +245,7 @@ AbstractShaderProgram::AbstractShaderProgram(AbstractShaderProgram&& other) noex AbstractShaderProgram::~AbstractShaderProgram() { /* Remove current usage from the state */ - GLuint& current = Context::current()->state().shaderProgram->current; + GLuint& current = Context::current().state().shaderProgram->current; if(current == _id) current = 0; if(_id) glDeleteProgram(_id); @@ -260,17 +260,17 @@ AbstractShaderProgram& AbstractShaderProgram::operator=(AbstractShaderProgram&& #ifndef MAGNUM_TARGET_WEBGL std::string AbstractShaderProgram::label() const { #ifndef MAGNUM_TARGET_GLES - return Context::current()->state().debug->getLabelImplementation(GL_PROGRAM, _id); + return Context::current().state().debug->getLabelImplementation(GL_PROGRAM, _id); #else - return Context::current()->state().debug->getLabelImplementation(GL_PROGRAM_KHR, _id); + return Context::current().state().debug->getLabelImplementation(GL_PROGRAM_KHR, _id); #endif } AbstractShaderProgram& AbstractShaderProgram::setLabelInternal(const Containers::ArrayView label) { #ifndef MAGNUM_TARGET_GLES - Context::current()->state().debug->labelImplementation(GL_PROGRAM, _id, label); + Context::current().state().debug->labelImplementation(GL_PROGRAM, _id, label); #else - Context::current()->state().debug->labelImplementation(GL_PROGRAM_KHR, _id, label); + Context::current().state().debug->labelImplementation(GL_PROGRAM_KHR, _id, label); #endif return *this; } @@ -296,7 +296,7 @@ std::pair AbstractShaderProgram::validate() { void AbstractShaderProgram::use() { /* Use only if the program isn't already in use */ - GLuint& current = Context::current()->state().shaderProgram->current; + GLuint& current = Context::current().state().shaderProgram->current; if(current != _id) glUseProgram(current = _id); } @@ -402,7 +402,7 @@ Int AbstractShaderProgram::uniformLocationInternal(const Containers::ArrayView values) { - (this->*Context::current()->state().shaderProgram->uniform1fvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniform1fvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const GLfloat* const values) { @@ -430,7 +430,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniform2fvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniform2fvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<2, GLfloat>* const values) { @@ -458,7 +458,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniform3fvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniform3fvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<3, GLfloat>* const values) { @@ -486,7 +486,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniform4fvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniform4fvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<4, GLfloat>* const values) { @@ -514,7 +514,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView values) { - (this->*Context::current()->state().shaderProgram->uniform1ivImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniform1ivImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const GLint* values) { @@ -542,7 +542,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniform2ivImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniform2ivImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<2, GLint>* const values) { @@ -570,7 +570,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniform3ivImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniform3ivImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<3, GLint>* const values) { @@ -598,7 +598,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniform4ivImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniform4ivImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<4, GLint>* const values) { @@ -627,7 +627,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #ifndef MAGNUM_TARGET_GLES2 void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView values) { - (this->*Context::current()->state().shaderProgram->uniform1uivImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniform1uivImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const GLuint* const values) { @@ -646,7 +646,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniform2uivImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniform2uivImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<2, GLuint>* const values) { @@ -665,7 +665,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniform3uivImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniform3uivImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<3, GLuint>* const values) { @@ -684,7 +684,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniform4uivImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniform4uivImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<4, GLuint>* const values) { @@ -705,7 +705,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #ifndef MAGNUM_TARGET_GLES void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView values) { - (this->*Context::current()->state().shaderProgram->uniform1dvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniform1dvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const GLdouble* const values) { @@ -722,7 +722,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co } void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniform2dvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniform2dvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<2, GLdouble>* const values) { @@ -739,7 +739,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co } void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniform3dvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniform3dvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<3, GLdouble>* const values) { @@ -756,7 +756,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co } void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniform4dvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniform4dvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<4, GLdouble>* const values) { @@ -774,7 +774,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix2fvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix2fvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 2, GLfloat>* const values) { @@ -802,7 +802,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix3fvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix3fvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 3, GLfloat>* const values) { @@ -830,7 +830,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix4fvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix4fvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 4, GLfloat>* const values) { @@ -859,7 +859,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #ifndef MAGNUM_TARGET_GLES2 void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix2x3fvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix2x3fvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 3, GLfloat>* const values) { @@ -878,7 +878,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix3x2fvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix3x2fvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 2, GLfloat>* const values) { @@ -897,7 +897,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix2x4fvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix2x4fvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 4, GLfloat>* const values) { @@ -916,7 +916,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix4x2fvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix4x2fvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 2, GLfloat>* const values) { @@ -935,7 +935,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix3x4fvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix3x4fvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 4, GLfloat>* const values) { @@ -954,7 +954,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #endif void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix4x3fvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix4x3fvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 3, GLfloat>* const values) { @@ -975,7 +975,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat #ifndef MAGNUM_TARGET_GLES void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix2dvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix2dvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 2, GLdouble>* const values) { @@ -992,7 +992,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co } void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix3dvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix3dvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 3, GLdouble>* const values) { @@ -1009,7 +1009,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co } void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix4dvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix4dvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 4, GLdouble>* const values) { @@ -1026,7 +1026,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co } void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix2x3dvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix2x3dvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 3, GLdouble>* const values) { @@ -1043,7 +1043,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co } void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix3x2dvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix3x2dvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 2, GLdouble>* const values) { @@ -1060,7 +1060,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co } void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix2x4dvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix2x4dvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 4, GLdouble>* const values) { @@ -1077,7 +1077,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co } void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix4x2dvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix4x2dvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 2, GLdouble>* const values) { @@ -1094,7 +1094,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co } void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix3x4dvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix3x4dvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 4, GLdouble>* const values) { @@ -1111,7 +1111,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co } void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView> values) { - (this->*Context::current()->state().shaderProgram->uniformMatrix4x3dvImplementation)(location, values.size(), values); + (this->*Context::current().state().shaderProgram->uniformMatrix4x3dvImplementation)(location, values.size(), values); } void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 3, GLdouble>* const values) { diff --git a/src/Magnum/AbstractTexture.cpp b/src/Magnum/AbstractTexture.cpp index d2603e1f6..16cdd7c81 100644 --- a/src/Magnum/AbstractTexture.cpp +++ b/src/Magnum/AbstractTexture.cpp @@ -49,7 +49,7 @@ namespace Magnum { #ifndef MAGNUM_TARGET_GLES2 Float AbstractTexture::maxLodBias() { - GLfloat& value = Context::current()->state().texture->maxLodBias; + GLfloat& value = Context::current().state().texture->maxLodBias; /* Get the value, if not already cached */ if(value == 0.0f) @@ -62,13 +62,13 @@ Float AbstractTexture::maxLodBias() { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) Int AbstractTexture::maxColorSamples() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return 0; - GLint& value = Context::current()->state().texture->maxColorSamples; + GLint& value = Context::current().state().texture->maxColorSamples; /* Get the value, if not already cached */ if(value == 0) @@ -79,13 +79,13 @@ Int AbstractTexture::maxColorSamples() { Int AbstractTexture::maxDepthSamples() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return 0; - GLint& value = Context::current()->state().texture->maxDepthSamples; + GLint& value = Context::current().state().texture->maxDepthSamples; /* Get the value, if not already cached */ if(value == 0) @@ -96,13 +96,13 @@ Int AbstractTexture::maxDepthSamples() { Int AbstractTexture::maxIntegerSamples() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return 0; - GLint& value = Context::current()->state().texture->maxIntegerSamples; + GLint& value = Context::current().state().texture->maxIntegerSamples; /* Get the value, if not already cached */ if(value == 0) @@ -113,18 +113,18 @@ Int AbstractTexture::maxIntegerSamples() { #endif void AbstractTexture::unbind(const Int textureUnit) { - Implementation::TextureState& textureState = *Context::current()->state().texture; + Implementation::TextureState& textureState = *Context::current().state().texture; /* If given texture unit is already unbound, nothing to do */ if(textureState.bindings[textureUnit].second == 0) return; /* Unbind the texture, reset state tracker */ - Context::current()->state().texture->unbindImplementation(textureUnit); + Context::current().state().texture->unbindImplementation(textureUnit); textureState.bindings[textureUnit] = {}; } void AbstractTexture::unbindImplementationDefault(const GLint textureUnit) { - Implementation::TextureState& textureState = *Context::current()->state().texture; + Implementation::TextureState& textureState = *Context::current().state().texture; /* Activate given texture unit if not already active, update state tracker */ if(textureState.currentTextureUnit != textureUnit) @@ -141,12 +141,12 @@ void AbstractTexture::unbindImplementationMulti(const GLint textureUnit) { } void AbstractTexture::unbindImplementationDSA(const GLint textureUnit) { - CORRADE_INTERNAL_ASSERT(Context::current()->state().texture->bindings[textureUnit].first != 0); + CORRADE_INTERNAL_ASSERT(Context::current().state().texture->bindings[textureUnit].first != 0); glBindTextureUnit(textureUnit, 0); } void AbstractTexture::unbindImplementationDSAEXT(const GLint textureUnit) { - Implementation::TextureState& textureState = *Context::current()->state().texture; + Implementation::TextureState& textureState = *Context::current().state().texture; CORRADE_INTERNAL_ASSERT(textureState.bindings[textureUnit].first != 0); glBindMultiTextureEXT(GL_TEXTURE0 + textureUnit, textureState.bindings[textureUnit].first, 0); @@ -155,13 +155,13 @@ void AbstractTexture::unbindImplementationDSAEXT(const GLint textureUnit) { void AbstractTexture::unbind(const Int firstTextureUnit, const std::size_t count) { /* State tracker is updated in the implementations */ - Context::current()->state().texture->bindMultiImplementation(firstTextureUnit, {nullptr, count}); + Context::current().state().texture->bindMultiImplementation(firstTextureUnit, {nullptr, count}); } /** @todoc const std::initializer_list makes Doxygen grumpy */ void AbstractTexture::bind(const Int firstTextureUnit, std::initializer_list textures) { /* State tracker is updated in the implementations */ - Context::current()->state().texture->bindMultiImplementation(firstTextureUnit, {textures.begin(), textures.size()}); + Context::current().state().texture->bindMultiImplementation(firstTextureUnit, {textures.begin(), textures.size()}); } void AbstractTexture::bindImplementationFallback(const GLint firstTextureUnit, const Containers::ArrayView textures) { @@ -172,7 +172,7 @@ void AbstractTexture::bindImplementationFallback(const GLint firstTextureUnit, c #ifndef MAGNUM_TARGET_GLES /** @todoc const Containers::ArrayView makes Doxygen grumpy */ void AbstractTexture::bindImplementationMulti(const GLint firstTextureUnit, Containers::ArrayView textures) { - Implementation::TextureState& textureState = *Context::current()->state().texture; + Implementation::TextureState& textureState = *Context::current().state().texture; /* Create array of IDs and also update bindings in state tracker */ /** @todo VLAs */ @@ -199,7 +199,7 @@ void AbstractTexture::bindImplementationMulti(const GLint firstTextureUnit, Cont #ifndef MAGNUM_TARGET_GLES Int AbstractTexture::compressedBlockDataSize(const GLenum target, const TextureFormat format) { - return (Context::current()->state().texture->compressedBlockDataSizeImplementation)(target, format); + return (Context::current().state().texture->compressedBlockDataSizeImplementation)(target, format); } Int AbstractTexture::compressedBlockDataSizeImplementationDefault(const GLenum target, const TextureFormat format) { @@ -215,7 +215,7 @@ Int AbstractTexture::compressedBlockDataSizeImplementationBitsWorkaround(const G #endif AbstractTexture::AbstractTexture(GLenum target): _target{target}, _flags{ObjectFlag::DeleteOnDestruction} { - (this->*Context::current()->state().texture->createImplementation)(); + (this->*Context::current().state().texture->createImplementation)(); CORRADE_INTERNAL_ASSERT(_id != Implementation::State::DisengagedBinding); } @@ -235,7 +235,7 @@ AbstractTexture::~AbstractTexture() { if(!_id || !(_flags & ObjectFlag::DeleteOnDestruction)) return; /* Remove all bindings */ - for(auto& binding: Context::current()->state().texture->bindings) + for(auto& binding: Context::current().state().texture->bindings) { /* MSVC 2015 needs the parentheses around */ if(binding.second == _id) binding = {}; @@ -259,18 +259,18 @@ void AbstractTexture::createIfNotAlready() { #ifndef MAGNUM_TARGET_WEBGL std::string AbstractTexture::label() { createIfNotAlready(); - return Context::current()->state().debug->getLabelImplementation(GL_TEXTURE, _id); + return Context::current().state().debug->getLabelImplementation(GL_TEXTURE, _id); } AbstractTexture& AbstractTexture::setLabelInternal(const Containers::ArrayView label) { createIfNotAlready(); - Context::current()->state().debug->labelImplementation(GL_TEXTURE, _id, label); + Context::current().state().debug->labelImplementation(GL_TEXTURE, _id, label); return *this; } #endif void AbstractTexture::bind(Int textureUnit) { - Implementation::TextureState& textureState = *Context::current()->state().texture; + Implementation::TextureState& textureState = *Context::current().state().texture; /* If already bound in given texture unit, nothing to do */ if(textureState.bindings[textureUnit].second == _id) return; @@ -281,7 +281,7 @@ void AbstractTexture::bind(Int textureUnit) { } void AbstractTexture::bindImplementationDefault(GLint textureUnit) { - Implementation::TextureState& textureState = *Context::current()->state().texture; + Implementation::TextureState& textureState = *Context::current().state().texture; /* Activate given texture unit if not already active, update state tracker */ if(textureState.currentTextureUnit != textureUnit) @@ -310,13 +310,13 @@ void AbstractTexture::bindImplementationDSAEXT(GLint textureUnit) { #ifndef MAGNUM_TARGET_GLES2 void AbstractTexture::setBaseLevel(Int level) { - (this->*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_BASE_LEVEL, level); + (this->*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_BASE_LEVEL, level); } #endif #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) void AbstractTexture::setMaxLevel(Int level) { - (this->*Context::current()->state().texture->parameteriImplementation)( + (this->*Context::current().state().texture->parameteriImplementation)( #ifndef MAGNUM_TARGET_GLES2 GL_TEXTURE_MAX_LEVEL #else @@ -327,32 +327,32 @@ void AbstractTexture::setMaxLevel(Int level) { #endif void AbstractTexture::setMinificationFilter(Sampler::Filter filter, Sampler::Mipmap mipmap) { - (this->*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_MIN_FILTER, GLint(filter)|GLint(mipmap)); + (this->*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_MIN_FILTER, GLint(filter)|GLint(mipmap)); } void AbstractTexture::setMagnificationFilter(const Sampler::Filter filter) { - (this->*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_MAG_FILTER, GLint(filter)); + (this->*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_MAG_FILTER, GLint(filter)); } #ifndef MAGNUM_TARGET_GLES2 void AbstractTexture::setMinLod(const Float lod) { - (this->*Context::current()->state().texture->parameterfImplementation)(GL_TEXTURE_MIN_LOD, lod); + (this->*Context::current().state().texture->parameterfImplementation)(GL_TEXTURE_MIN_LOD, lod); } void AbstractTexture::setMaxLod(const Float lod) { - (this->*Context::current()->state().texture->parameterfImplementation)(GL_TEXTURE_MAX_LOD, lod); + (this->*Context::current().state().texture->parameterfImplementation)(GL_TEXTURE_MAX_LOD, lod); } #endif #ifndef MAGNUM_TARGET_GLES void AbstractTexture::setLodBias(const Float bias) { - (this->*Context::current()->state().texture->parameterfImplementation)(GL_TEXTURE_LOD_BIAS, bias); + (this->*Context::current().state().texture->parameterfImplementation)(GL_TEXTURE_LOD_BIAS, bias); } #endif #ifndef MAGNUM_TARGET_WEBGL void AbstractTexture::setBorderColor(const Color4& color) { - (this->*Context::current()->state().texture->parameterfvImplementation)( + (this->*Context::current().state().texture->parameterfvImplementation)( #ifndef MAGNUM_TARGET_GLES GL_TEXTURE_BORDER_COLOR, #else @@ -363,7 +363,7 @@ void AbstractTexture::setBorderColor(const Color4& color) { #ifndef MAGNUM_TARGET_GLES2 void AbstractTexture::setBorderColor(const Vector4ui& color) { - (this->*Context::current()->state().texture->parameterIuivImplementation)( + (this->*Context::current().state().texture->parameterIuivImplementation)( #ifndef MAGNUM_TARGET_GLES GL_TEXTURE_BORDER_COLOR, #else @@ -373,7 +373,7 @@ void AbstractTexture::setBorderColor(const Vector4ui& color) { } void AbstractTexture::setBorderColor(const Vector4i& color) { - (this->*Context::current()->state().texture->parameterIivImplementation)( + (this->*Context::current().state().texture->parameterIivImplementation)( #ifndef MAGNUM_TARGET_GLES GL_TEXTURE_BORDER_COLOR, #else @@ -385,12 +385,12 @@ void AbstractTexture::setBorderColor(const Vector4i& color) { #endif void AbstractTexture::setMaxAnisotropy(const Float anisotropy) { - (this->*Context::current()->state().texture->setMaxAnisotropyImplementation)(anisotropy); + (this->*Context::current().state().texture->setMaxAnisotropyImplementation)(anisotropy); } #ifndef MAGNUM_TARGET_WEBGL void AbstractTexture::setSRGBDecode(bool decode) { - (this->*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_SRGB_DECODE_EXT, + (this->*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_SRGB_DECODE_EXT, decode ? GL_DECODE_EXT : GL_SKIP_DECODE_EXT); } #endif @@ -399,19 +399,19 @@ void AbstractTexture::setSRGBDecode(bool decode) { void AbstractTexture::setSwizzleInternal(const GLint r, const GLint g, const GLint b, const GLint a) { #ifndef MAGNUM_TARGET_GLES const GLint rgba[] = {r, g, b, a}; - (this->*Context::current()->state().texture->parameterivImplementation)(GL_TEXTURE_SWIZZLE_RGBA, rgba); + (this->*Context::current().state().texture->parameterivImplementation)(GL_TEXTURE_SWIZZLE_RGBA, rgba); #else - (this->*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_SWIZZLE_R, r); - (this->*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_SWIZZLE_G, g); - (this->*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_SWIZZLE_B, b); - (this->*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_SWIZZLE_A, a); + (this->*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_SWIZZLE_R, r); + (this->*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_SWIZZLE_G, g); + (this->*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_SWIZZLE_B, b); + (this->*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_SWIZZLE_A, a); #endif } #endif #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) void AbstractTexture::setCompareMode(const Sampler::CompareMode mode) { - (this->*Context::current()->state().texture->parameteriImplementation)( + (this->*Context::current().state().texture->parameteriImplementation)( #ifndef MAGNUM_TARGET_GLES2 GL_TEXTURE_COMPARE_MODE #else @@ -421,7 +421,7 @@ void AbstractTexture::setCompareMode(const Sampler::CompareMode mode) { } void AbstractTexture::setCompareFunction(const Sampler::CompareFunction function) { - (this->*Context::current()->state().texture->parameteriImplementation)( + (this->*Context::current().state().texture->parameteriImplementation)( #ifndef MAGNUM_TARGET_GLES2 GL_TEXTURE_COMPARE_FUNC #else @@ -433,16 +433,16 @@ void AbstractTexture::setCompareFunction(const Sampler::CompareFunction function #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void AbstractTexture::setDepthStencilMode(const Sampler::DepthStencilMode mode) { - (this->*Context::current()->state().texture->parameteriImplementation)(GL_DEPTH_STENCIL_TEXTURE_MODE, GLenum(mode)); + (this->*Context::current().state().texture->parameteriImplementation)(GL_DEPTH_STENCIL_TEXTURE_MODE, GLenum(mode)); } #endif void AbstractTexture::invalidateImage(const Int level) { - (this->*Context::current()->state().texture->invalidateImageImplementation)(level); + (this->*Context::current().state().texture->invalidateImageImplementation)(level); } void AbstractTexture::generateMipmap() { - (this->*Context::current()->state().texture->mipmapImplementation)(); + (this->*Context::current().state().texture->mipmapImplementation)(); } void AbstractTexture::mipmapImplementationDefault() { @@ -466,7 +466,7 @@ void AbstractTexture::bindInternal() { functions need to have the texture bound in *currently active* unit, so we would need to call glActiveTexture() afterwards anyway. */ - Implementation::TextureState& textureState = *Context::current()->state().texture; + Implementation::TextureState& textureState = *Context::current().state().texture; /* If the texture is already bound in current unit, nothing to do */ if(textureState.bindings[textureState.currentTextureUnit].second == _id) @@ -1107,7 +1107,7 @@ void AbstractTexture::parameterIImplementationDSAEXT(GLenum parameter, const GLi void AbstractTexture::setMaxAnisotropyImplementationNoOp(GLfloat) {} void AbstractTexture::setMaxAnisotropyImplementationExt(GLfloat anisotropy) { - (this->*Context::current()->state().texture->parameterfImplementation)(GL_TEXTURE_MAX_ANISOTROPY_EXT, anisotropy); + (this->*Context::current().state().texture->parameterfImplementation)(GL_TEXTURE_MAX_ANISOTROPY_EXT, anisotropy); } #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) @@ -1520,7 +1520,7 @@ template void AbstractTexture::image(GLint level, Image< Buffer::unbindInternal(Buffer::TargetHint::PixelPack); image.storage().applyPack(); - (this->*Context::current()->state().texture->getImageImplementation)(level, image.format(), image.type(), data.size(), data); + (this->*Context::current().state().texture->getImageImplementation)(level, image.format(), image.type(), data.size(), data); image.setData(image.storage(), image.format(), image.type(), size, std::move(data)); } @@ -1540,7 +1540,7 @@ template void AbstractTexture::image(GLint level, Buffer image.buffer().bindInternal(Buffer::TargetHint::PixelPack); image.storage().applyPack(); - (this->*Context::current()->state().texture->getImageImplementation)(level, image.format(), image.type(), dataSize, nullptr); + (this->*Context::current().state().texture->getImageImplementation)(level, image.format(), image.type(), dataSize, nullptr); } template void MAGNUM_EXPORT AbstractTexture::image<1>(GLint, BufferImage<1>&, BufferUsage); @@ -1550,10 +1550,10 @@ template void MAGNUM_EXPORT AbstractTexture::image<3>(GLint, BufferImage<3>&, Bu template void AbstractTexture::compressedImage(const GLint level, CompressedImage& image) { const Math::Vector size = DataHelper::imageSize(*this, level); GLint textureDataSize; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + (this->*Context::current().state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current().state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ Containers::Array data{image.release()}; @@ -1562,7 +1562,7 @@ template void AbstractTexture::compressedImage(const GLi Buffer::unbindInternal(Buffer::TargetHint::PixelPack); image.storage().applyPack(); - (this->*Context::current()->state().texture->getCompressedImageImplementation)(level, data.size(), data); + (this->*Context::current().state().texture->getCompressedImageImplementation)(level, data.size(), data); image.setData(image.storage(), CompressedPixelFormat(format), size, std::move(data)); } @@ -1573,10 +1573,10 @@ template void MAGNUM_EXPORT AbstractTexture::compressedImage<3>(GLint, Compresse template void AbstractTexture::compressedImage(const GLint level, CompressedBufferImage& image, BufferUsage usage) { const Math::Vector size = DataHelper::imageSize(*this, level); GLint textureDataSize; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + (this->*Context::current().state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current().state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ if(image.dataSize() < dataSize) @@ -1586,7 +1586,7 @@ template void AbstractTexture::compressedImage(const GLi image.buffer().bindInternal(Buffer::TargetHint::PixelPack); image.storage().applyPack(); - (this->*Context::current()->state().texture->getCompressedImageImplementation)(level, dataSize, nullptr); + (this->*Context::current().state().texture->getCompressedImageImplementation)(level, dataSize, nullptr); } template void MAGNUM_EXPORT AbstractTexture::compressedImage<1>(GLint, CompressedBufferImage<1>&, BufferUsage); @@ -1654,7 +1654,7 @@ template void AbstractTexture::compressedSubImage(const const Vector3i paddedOffset = Vector3i::pad(range.min()); const Vector3i paddedSize = Vector3i::pad(size, 1); GLint format; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current().state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, compressedSubImageSize(TextureFormat(format), size)); /* Reallocate only if needed */ @@ -1679,7 +1679,7 @@ template void AbstractTexture::compressedSubImage(const const Vector3i paddedOffset = Vector3i::pad(range.min()); const Vector3i paddedSize = Vector3i::pad(size, 1); GLint format; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current().state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, compressedSubImageSize(TextureFormat(format), size)); /* Reallocate only if needed */ @@ -1723,14 +1723,14 @@ Vector3i AbstractTexture::DataHelper<3>::compressedBlockSize(const GLenum target #ifndef MAGNUM_TARGET_GLES Math::Vector<1, GLint> AbstractTexture::DataHelper<1>::imageSize(AbstractTexture& texture, const GLint level) { Math::Vector<1, GLint> value; - (texture.*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_WIDTH, &value[0]); + (texture.*Context::current().state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_WIDTH, &value[0]); return value; } #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) Vector2i AbstractTexture::DataHelper<2>::imageSize(AbstractTexture& texture, const GLint level) { - const Implementation::TextureState& state = *Context::current()->state().texture; + const Implementation::TextureState& state = *Context::current().state().texture; Vector2i value; (texture.*state.getLevelParameterivImplementation)(level, GL_TEXTURE_WIDTH, &value[0]); @@ -1739,7 +1739,7 @@ Vector2i AbstractTexture::DataHelper<2>::imageSize(AbstractTexture& texture, con } Vector3i AbstractTexture::DataHelper<3>::imageSize(AbstractTexture& texture, const GLint level) { - const Implementation::TextureState& state = *Context::current()->state().texture; + const Implementation::TextureState& state = *Context::current().state().texture; Vector3i value; (texture.*state.getLevelParameterivImplementation)(level, GL_TEXTURE_WIDTH, &value[0]); @@ -1751,27 +1751,27 @@ Vector3i AbstractTexture::DataHelper<3>::imageSize(AbstractTexture& texture, con #ifndef MAGNUM_TARGET_GLES void AbstractTexture::DataHelper<1>::setStorage(AbstractTexture& texture, const GLsizei levels, const TextureFormat internalFormat, const Math::Vector< 1, GLsizei >& size) { - (texture.*Context::current()->state().texture->storage1DImplementation)(levels, internalFormat, size); + (texture.*Context::current().state().texture->storage1DImplementation)(levels, internalFormat, size); } #endif void AbstractTexture::DataHelper<2>::setStorage(AbstractTexture& texture, const GLsizei levels, const TextureFormat internalFormat, const Vector2i& size) { - (texture.*Context::current()->state().texture->storage2DImplementation)(levels, internalFormat, size); + (texture.*Context::current().state().texture->storage2DImplementation)(levels, internalFormat, size); } #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) void AbstractTexture::DataHelper<3>::setStorage(AbstractTexture& texture, const GLsizei levels, const TextureFormat internalFormat, const Vector3i& size) { - (texture.*Context::current()->state().texture->storage3DImplementation)(levels, internalFormat, size); + (texture.*Context::current().state().texture->storage3DImplementation)(levels, internalFormat, size); } #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void AbstractTexture::DataHelper<2>::setStorageMultisample(AbstractTexture& texture, const GLsizei samples, const TextureFormat internalFormat, const Vector2i& size, const GLboolean fixedSampleLocations) { - (texture.*Context::current()->state().texture->storage2DMultisampleImplementation)(samples, internalFormat, size, fixedSampleLocations); + (texture.*Context::current().state().texture->storage2DMultisampleImplementation)(samples, internalFormat, size, fixedSampleLocations); } void AbstractTexture::DataHelper<3>::setStorageMultisample(AbstractTexture& texture, const GLsizei samples, const TextureFormat internalFormat, const Vector3i& size, const GLboolean fixedSampleLocations) { - (texture.*Context::current()->state().texture->storage3DMultisampleImplementation)(samples, internalFormat, size, fixedSampleLocations); + (texture.*Context::current().state().texture->storage3DMultisampleImplementation)(samples, internalFormat, size, fixedSampleLocations); } #endif @@ -1807,25 +1807,25 @@ void AbstractTexture::DataHelper<1>::setCompressedImage(AbstractTexture& texture void AbstractTexture::DataHelper<1>::setSubImage(AbstractTexture& texture, const GLint level, const Math::Vector<1, GLint>& offset, const ImageView1D& image) { Buffer::unbindInternal(Buffer::TargetHint::PixelUnpack); image.storage().applyUnpack(); - (texture.*Context::current()->state().texture->subImage1DImplementation)(level, offset, image.size(), image.format(), image.type(), image.data()); + (texture.*Context::current().state().texture->subImage1DImplementation)(level, offset, image.size(), image.format(), image.type(), image.data()); } void AbstractTexture::DataHelper<1>::setCompressedSubImage(AbstractTexture& texture, const GLint level, const Math::Vector<1, GLint>& offset, const CompressedImageView1D& image) { Buffer::unbindInternal(Buffer::TargetHint::PixelUnpack); image.storage().applyUnpack(); - (texture.*Context::current()->state().texture->compressedSubImage1DImplementation)(level, offset, image.size(), image.format(), image.data(), Implementation::occupiedCompressedImageDataSize(image, image.data().size())); + (texture.*Context::current().state().texture->compressedSubImage1DImplementation)(level, offset, image.size(), image.format(), image.data(), Implementation::occupiedCompressedImageDataSize(image, image.data().size())); } void AbstractTexture::DataHelper<1>::setSubImage(AbstractTexture& texture, const GLint level, const Math::Vector<1, GLint>& offset, BufferImage1D& image) { image.buffer().bindInternal(Buffer::TargetHint::PixelUnpack); image.storage().applyUnpack(); - (texture.*Context::current()->state().texture->subImage1DImplementation)(level, offset, image.size(), image.format(), image.type(), nullptr); + (texture.*Context::current().state().texture->subImage1DImplementation)(level, offset, image.size(), image.format(), image.type(), nullptr); } void AbstractTexture::DataHelper<1>::setCompressedSubImage(AbstractTexture& texture, const GLint level, const Math::Vector<1, GLint>& offset, CompressedBufferImage1D& image) { image.buffer().bindInternal(Buffer::TargetHint::PixelUnpack); image.storage().applyUnpack(); - (texture.*Context::current()->state().texture->compressedSubImage1DImplementation)(level, offset, image.size(), image.format(), nullptr, Implementation::occupiedCompressedImageDataSize(image, image.dataSize())); + (texture.*Context::current().state().texture->compressedSubImage1DImplementation)(level, offset, image.size(), image.format(), nullptr, Implementation::occupiedCompressedImageDataSize(image, image.dataSize())); } #endif @@ -1880,7 +1880,7 @@ void AbstractTexture::DataHelper<2>::setSubImage(AbstractTexture& texture, const Buffer::unbindInternal(Buffer::TargetHint::PixelUnpack); #endif image.storage().applyUnpack(); - (texture.*Context::current()->state().texture->subImage2DImplementation)(level, offset, image.size(), image.format(), image.type(), image.data() + (texture.*Context::current().state().texture->subImage2DImplementation)(level, offset, image.size(), image.format(), image.type(), image.data() #ifdef MAGNUM_TARGET_GLES2 + Implementation::pixelStorageSkipOffset(image) #endif @@ -1896,14 +1896,14 @@ void AbstractTexture::DataHelper<2>::setCompressedSubImage(AbstractTexture& text to reset anything */ image.storage().applyUnpack(); #endif - (texture.*Context::current()->state().texture->compressedSubImage2DImplementation)(level, offset, image.size(), image.format(), image.data(), Implementation::occupiedCompressedImageDataSize(image, image.data().size())); + (texture.*Context::current().state().texture->compressedSubImage2DImplementation)(level, offset, image.size(), image.format(), image.data(), Implementation::occupiedCompressedImageDataSize(image, image.data().size())); } #ifndef MAGNUM_TARGET_GLES2 void AbstractTexture::DataHelper<2>::setSubImage(AbstractTexture& texture, const GLint level, const Vector2i& offset, BufferImage2D& image) { image.buffer().bindInternal(Buffer::TargetHint::PixelUnpack); image.storage().applyUnpack(); - (texture.*Context::current()->state().texture->subImage2DImplementation)(level, offset, image.size(), image.format(), image.type(), nullptr); + (texture.*Context::current().state().texture->subImage2DImplementation)(level, offset, image.size(), image.format(), image.type(), nullptr); } void AbstractTexture::DataHelper<2>::setCompressedSubImage(AbstractTexture& texture, const GLint level, const Vector2i& offset, CompressedBufferImage2D& image) { @@ -1913,7 +1913,7 @@ void AbstractTexture::DataHelper<2>::setCompressedSubImage(AbstractTexture& text to reset anything */ image.storage().applyUnpack(); #endif - (texture.*Context::current()->state().texture->compressedSubImage2DImplementation)(level, offset, image.size(), image.format(), nullptr, Implementation::occupiedCompressedImageDataSize(image, image.dataSize())); + (texture.*Context::current().state().texture->compressedSubImage2DImplementation)(level, offset, image.size(), image.format(), nullptr, Implementation::occupiedCompressedImageDataSize(image, image.dataSize())); } #endif @@ -1984,7 +1984,7 @@ void AbstractTexture::DataHelper<3>::setSubImage(AbstractTexture& texture, const Buffer::unbindInternal(Buffer::TargetHint::PixelUnpack); #endif image.storage().applyUnpack(); - (texture.*Context::current()->state().texture->subImage3DImplementation)(level, offset, image.size(), image.format(), image.type(), image.data() + (texture.*Context::current().state().texture->subImage3DImplementation)(level, offset, image.size(), image.format(), image.type(), image.data() #ifdef MAGNUM_TARGET_GLES2 + Implementation::pixelStorageSkipOffset(image) #endif @@ -2000,7 +2000,7 @@ void AbstractTexture::DataHelper<3>::setCompressedSubImage(AbstractTexture& text to reset anything */ image.storage().applyUnpack(); #endif - (texture.*Context::current()->state().texture->compressedSubImage3DImplementation)(level, offset, image.size(), image.format(), image.data(), Implementation::occupiedCompressedImageDataSize(image, image.data().size())); + (texture.*Context::current().state().texture->compressedSubImage3DImplementation)(level, offset, image.size(), image.format(), image.data(), Implementation::occupiedCompressedImageDataSize(image, image.data().size())); } #endif @@ -2008,7 +2008,7 @@ void AbstractTexture::DataHelper<3>::setCompressedSubImage(AbstractTexture& text void AbstractTexture::DataHelper<3>::setSubImage(AbstractTexture& texture, const GLint level, const Vector3i& offset, BufferImage3D& image) { image.buffer().bindInternal(Buffer::TargetHint::PixelUnpack); image.storage().applyUnpack(); - (texture.*Context::current()->state().texture->subImage3DImplementation)(level, offset, image.size(), image.format(), image.type(), nullptr); + (texture.*Context::current().state().texture->subImage3DImplementation)(level, offset, image.size(), image.format(), image.type(), nullptr); } void AbstractTexture::DataHelper<3>::setCompressedSubImage(AbstractTexture& texture, const GLint level, const Vector3i& offset, CompressedBufferImage3D& image) { @@ -2018,32 +2018,32 @@ void AbstractTexture::DataHelper<3>::setCompressedSubImage(AbstractTexture& text to reset anything */ image.storage().applyUnpack(); #endif - (texture.*Context::current()->state().texture->compressedSubImage3DImplementation)(level, offset, image.size(), image.format(), nullptr, Implementation::occupiedCompressedImageDataSize(image, image.dataSize())); + (texture.*Context::current().state().texture->compressedSubImage3DImplementation)(level, offset, image.size(), image.format(), nullptr, Implementation::occupiedCompressedImageDataSize(image, image.dataSize())); } #endif #ifndef MAGNUM_TARGET_GLES void AbstractTexture::DataHelper<1>::invalidateSubImage(AbstractTexture& texture, const GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLint>& size) { - (texture.*Context::current()->state().texture->invalidateSubImageImplementation)(level, {offset[0], 0, 0}, {size[0], 1, 1}); + (texture.*Context::current().state().texture->invalidateSubImageImplementation)(level, {offset[0], 0, 0}, {size[0], 1, 1}); } #endif void AbstractTexture::DataHelper<2>::invalidateSubImage(AbstractTexture& texture, const GLint level, const Vector2i& offset, const Vector2i& size) { - (texture.*Context::current()->state().texture->invalidateSubImageImplementation)(level, {offset, 0}, {size, 1}); + (texture.*Context::current().state().texture->invalidateSubImageImplementation)(level, {offset, 0}, {size, 1}); } void AbstractTexture::DataHelper<3>::invalidateSubImage(AbstractTexture& texture, const GLint level, const Vector3i& offset, const Vector3i& size) { - (texture.*Context::current()->state().texture->invalidateSubImageImplementation)(level, offset, size); + (texture.*Context::current().state().texture->invalidateSubImageImplementation)(level, offset, size); } #ifndef MAGNUM_TARGET_GLES void AbstractTexture::DataHelper<1>::setWrapping(AbstractTexture& texture, const Array1D& wrapping) { - (texture.*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_WRAP_S, GLint(wrapping.x())); + (texture.*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_WRAP_S, GLint(wrapping.x())); } #endif void AbstractTexture::DataHelper<2>::setWrapping(AbstractTexture& texture, const Array2D& wrapping) { - const Implementation::TextureState& state = *Context::current()->state().texture; + const Implementation::TextureState& state = *Context::current().state().texture; (texture.*state.parameteriImplementation)(GL_TEXTURE_WRAP_S, GLint(wrapping.x())); (texture.*state.parameteriImplementation)(GL_TEXTURE_WRAP_T, GLint(wrapping.y())); @@ -2051,7 +2051,7 @@ void AbstractTexture::DataHelper<2>::setWrapping(AbstractTexture& texture, const #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) void AbstractTexture::DataHelper<3>::setWrapping(AbstractTexture& texture, const Array3D& wrapping) { - const Implementation::TextureState& state = *Context::current()->state().texture; + const Implementation::TextureState& state = *Context::current().state().texture; (texture.*state.parameteriImplementation)(GL_TEXTURE_WRAP_S, GLint(wrapping.x())); (texture.*state.parameteriImplementation)(GL_TEXTURE_WRAP_T, GLint(wrapping.y())); diff --git a/src/Magnum/Audio/Context.h b/src/Magnum/Audio/Context.h index f1809a943..23dfa8142 100644 --- a/src/Magnum/Audio/Context.h +++ b/src/Magnum/Audio/Context.h @@ -237,7 +237,7 @@ class MAGNUM_AUDIO_EXPORT Context { * Extensions usable with this function are listed in @ref Extensions * namespace in header @ref Extensions.h. Example usage: * @code - * if(Context::current()->isExtensionSupported()) { + * if(Context::current().isExtensionSupported()) { * // amazing binaural audio * } else { * // probably left/right stereo only diff --git a/src/Magnum/Buffer.cpp b/src/Magnum/Buffer.cpp index 7b11a5534..a81d5de30 100644 --- a/src/Magnum/Buffer.cpp +++ b/src/Magnum/Buffer.cpp @@ -41,10 +41,10 @@ namespace Magnum { #ifndef MAGNUM_TARGET_GLES Int Buffer::minMapAlignment() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 1; - GLint& value = Context::current()->state().buffer->minMapAlignment; + GLint& value = Context::current().state().buffer->minMapAlignment; if(value == 0) glGetIntegerv(GL_MIN_MAP_BUFFER_ALIGNMENT, &value); @@ -57,13 +57,13 @@ Int Buffer::minMapAlignment() { #ifndef MAGNUM_TARGET_WEBGL Int Buffer::maxAtomicCounterBindings() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return 0; - GLint& value = Context::current()->state().buffer->maxAtomicCounterBindings; + GLint& value = Context::current().state().buffer->maxAtomicCounterBindings; if(value == 0) glGetIntegerv(GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, &value); @@ -73,13 +73,13 @@ Int Buffer::maxAtomicCounterBindings() { Int Buffer::maxShaderStorageBindings() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return 0; - GLint& value = Context::current()->state().buffer->maxShaderStorageBindings; + GLint& value = Context::current().state().buffer->maxShaderStorageBindings; if(value == 0) glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &value); @@ -90,11 +90,11 @@ Int Buffer::maxShaderStorageBindings() { Int Buffer::uniformOffsetAlignment() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 1; #endif - GLint& value = Context::current()->state().buffer->uniformOffsetAlignment; + GLint& value = Context::current().state().buffer->uniformOffsetAlignment; if(value == 0) glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &value); @@ -105,13 +105,13 @@ Int Buffer::uniformOffsetAlignment() { #ifndef MAGNUM_TARGET_WEBGL Int Buffer::shaderStorageOffsetAlignment() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return 1; - GLint& value = Context::current()->state().buffer->shaderStorageOffsetAlignment; + GLint& value = Context::current().state().buffer->shaderStorageOffsetAlignment; if(value == 0) glGetIntegerv(GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, &value); @@ -122,11 +122,11 @@ Int Buffer::shaderStorageOffsetAlignment() { Int Buffer::maxUniformBindings() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().buffer->maxUniformBindings; + GLint& value = Context::current().state().buffer->maxUniformBindings; if(value == 0) glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &value); @@ -153,7 +153,7 @@ void Buffer::unbind(const Target target, const UnsignedInt firstIndex, const std CORRADE_INTERNAL_ASSERT(target == Target::Uniform); #endif #endif - Context::current()->state().buffer->bindBasesImplementation(target, firstIndex, {nullptr, count}); + Context::current().state().buffer->bindBasesImplementation(target, firstIndex, {nullptr, count}); } /** @todoc const std::initializer_list makes Doxygen grumpy */ @@ -165,7 +165,7 @@ void Buffer::bind(const Target target, const UnsignedInt firstIndex, std::initia CORRADE_INTERNAL_ASSERT(target == Target::Uniform || GLenum(target) == GL_TRANSFORM_FEEDBACK_BUFFER); #endif #endif - Context::current()->state().buffer->bindRangesImplementation(target, firstIndex, {buffers.begin(), buffers.size()}); + Context::current().state().buffer->bindRangesImplementation(target, firstIndex, {buffers.begin(), buffers.size()}); } /** @todoc const std::initializer_list makes Doxygen grumpy */ @@ -177,11 +177,11 @@ void Buffer::bind(const Target target, const UnsignedInt firstIndex, std::initia CORRADE_INTERNAL_ASSERT(target == Target::Uniform || GLenum(target) == GL_TRANSFORM_FEEDBACK_BUFFER); #endif #endif - Context::current()->state().buffer->bindBasesImplementation(target, firstIndex, {buffers.begin(), buffers.size()}); + Context::current().state().buffer->bindBasesImplementation(target, firstIndex, {buffers.begin(), buffers.size()}); } void Buffer::copy(Buffer& read, Buffer& write, const GLintptr readOffset, const GLintptr writeOffset, const GLsizeiptr size) { - Context::current()->state().buffer->copyImplementation(read, write, readOffset, writeOffset, size); + Context::current().state().buffer->copyImplementation(read, write, readOffset, writeOffset, size); } #endif @@ -190,7 +190,7 @@ Buffer::Buffer(const TargetHint targetHint): _targetHint{targetHint}, _flags{Obj , _mappedBuffer{nullptr} #endif { - (this->*Context::current()->state().buffer->createImplementation)(); + (this->*Context::current().state().buffer->createImplementation)(); CORRADE_INTERNAL_ASSERT(_id != Implementation::State::DisengagedBinding); } @@ -209,7 +209,7 @@ Buffer::~Buffer() { /* Moved out or not deleting on destruction, nothing to do */ if(!_id || !(_flags & ObjectFlag::DeleteOnDestruction)) return; - GLuint* bindings = Context::current()->state().buffer->bindings; + GLuint* bindings = Context::current().state().buffer->bindings; /* Remove all current bindings from the state */ for(std::size_t i = 1; i != Implementation::BufferState::TargetCount; ++i) @@ -234,18 +234,18 @@ inline void Buffer::createIfNotAlready() { std::string Buffer::label() { createIfNotAlready(); #ifndef MAGNUM_TARGET_GLES - return Context::current()->state().debug->getLabelImplementation(GL_BUFFER, _id); + return Context::current().state().debug->getLabelImplementation(GL_BUFFER, _id); #else - return Context::current()->state().debug->getLabelImplementation(GL_BUFFER_KHR, _id); + return Context::current().state().debug->getLabelImplementation(GL_BUFFER_KHR, _id); #endif } Buffer& Buffer::setLabelInternal(const Containers::ArrayView label) { createIfNotAlready(); #ifndef MAGNUM_TARGET_GLES - Context::current()->state().debug->labelImplementation(GL_BUFFER, _id, label); + Context::current().state().debug->labelImplementation(GL_BUFFER, _id, label); #else - Context::current()->state().debug->labelImplementation(GL_BUFFER_KHR, _id, label); + Context::current().state().debug->labelImplementation(GL_BUFFER_KHR, _id, label); #endif return *this; } @@ -253,7 +253,7 @@ Buffer& Buffer::setLabelInternal(const Containers::ArrayView label) void Buffer::bindInternal(const TargetHint target, Buffer* const buffer) { const GLuint id = buffer ? buffer->_id : 0; - GLuint& bound = Context::current()->state().buffer->bindings[Implementation::BufferState::indexForTarget(target)]; + GLuint& bound = Context::current().state().buffer->bindings[Implementation::BufferState::indexForTarget(target)]; /* Already bound, nothing to do */ if(bound == id) return; @@ -265,7 +265,7 @@ void Buffer::bindInternal(const TargetHint target, Buffer* const buffer) { } auto Buffer::bindSomewhereInternal(const TargetHint hint) -> TargetHint { - GLuint* bindings = Context::current()->state().buffer->bindings; + GLuint* bindings = Context::current().state().buffer->bindings; GLuint& hintBinding = bindings[Implementation::BufferState::indexForTarget(hint)]; /* Shortcut - if already bound to hint, return */ @@ -315,33 +315,33 @@ Int Buffer::size() { * couldn't find any matching extension, though) */ GLint size; - (this->*Context::current()->state().buffer->getParameterImplementation)(GL_BUFFER_SIZE, &size); + (this->*Context::current().state().buffer->getParameterImplementation)(GL_BUFFER_SIZE, &size); return size; } Buffer& Buffer::setData(const Containers::ArrayView data, const BufferUsage usage) { - (this->*Context::current()->state().buffer->dataImplementation)(data.size(), data, usage); + (this->*Context::current().state().buffer->dataImplementation)(data.size(), data, usage); return *this; } Buffer& Buffer::setSubData(const GLintptr offset, const Containers::ArrayView data) { - (this->*Context::current()->state().buffer->subDataImplementation)(offset, data.size(), data); + (this->*Context::current().state().buffer->subDataImplementation)(offset, data.size(), data); return *this; } Buffer& Buffer::invalidateData() { - (this->*Context::current()->state().buffer->invalidateImplementation)(); + (this->*Context::current().state().buffer->invalidateImplementation)(); return *this; } Buffer& Buffer::invalidateSubData(const GLintptr offset, const GLsizeiptr length) { - (this->*Context::current()->state().buffer->invalidateSubImplementation)(offset, length); + (this->*Context::current().state().buffer->invalidateSubImplementation)(offset, length); return *this; } #ifndef MAGNUM_TARGET_WEBGL void* Buffer::map(const MapAccess access) { - return (this->*Context::current()->state().buffer->mapImplementation)(access); + return (this->*Context::current().state().buffer->mapImplementation)(access); } #if defined(DOXYGEN_GENERATING_OUTPUT) || defined(CORRADE_TARGET_NACL) @@ -352,15 +352,15 @@ void* Buffer::mapSub(const GLintptr offset, const GLsizeiptr length, const MapAc #endif void* Buffer::map(const GLintptr offset, const GLsizeiptr length, const MapFlags flags) { - return (this->*Context::current()->state().buffer->mapRangeImplementation)(offset, length, flags); + return (this->*Context::current().state().buffer->mapRangeImplementation)(offset, length, flags); } Buffer& Buffer::flushMappedRange(const GLintptr offset, const GLsizeiptr length) { - (this->*Context::current()->state().buffer->flushMappedRangeImplementation)(offset, length); + (this->*Context::current().state().buffer->flushMappedRangeImplementation)(offset, length); return *this; } -bool Buffer::unmap() { return (this->*Context::current()->state().buffer->unmapImplementation)(); } +bool Buffer::unmap() { return (this->*Context::current().state().buffer->unmapImplementation)(); } #if defined(DOXYGEN_GENERATING_OUTPUT) || defined(CORRADE_TARGET_NACL) void Buffer::unmapSub() { @@ -373,7 +373,7 @@ void Buffer::unmapSub() { #ifndef MAGNUM_TARGET_GLES void Buffer::subDataInternal(GLintptr offset, GLsizeiptr size, GLvoid* data) { - (this->*Context::current()->state().buffer->getSubDataImplementation)(offset, size, data); + (this->*Context::current().state().buffer->getSubDataImplementation)(offset, size, data); } #endif diff --git a/src/Magnum/BufferTexture.cpp b/src/Magnum/BufferTexture.cpp index 742895fb1..e7b5258a8 100644 --- a/src/Magnum/BufferTexture.cpp +++ b/src/Magnum/BufferTexture.cpp @@ -37,14 +37,14 @@ namespace Magnum { Int BufferTexture::maxSize() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().texture->maxBufferSize; + GLint& value = Context::current().state().texture->maxBufferSize; /* Get the value, if not already cached */ if(value == 0) glGetIntegerv( @@ -60,14 +60,14 @@ Int BufferTexture::maxSize() { Int BufferTexture::offsetAlignment() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 1; #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().texture->bufferOffsetAlignment; + GLint& value = Context::current().state().texture->bufferOffsetAlignment; /* Get the value, if not already cached */ if(value == 0) glGetIntegerv( @@ -82,12 +82,12 @@ Int BufferTexture::offsetAlignment() { } BufferTexture& BufferTexture::setBuffer(const BufferTextureFormat internalFormat, Buffer& buffer) { - (this->*Context::current()->state().texture->setBufferImplementation)(internalFormat, buffer); + (this->*Context::current().state().texture->setBufferImplementation)(internalFormat, buffer); return *this; } BufferTexture& BufferTexture::setBuffer(const BufferTextureFormat internalFormat, Buffer& buffer, const GLintptr offset, const GLsizeiptr size) { - (this->*Context::current()->state().texture->setBufferRangeImplementation)(internalFormat, buffer, offset, size); + (this->*Context::current().state().texture->setBufferRangeImplementation)(internalFormat, buffer, offset, size); return *this; } diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index eae3215c1..6710438c9 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/Context.cpp @@ -403,6 +403,13 @@ const std::vector& Extension::extensions(Version version) { Context* Context::_current = nullptr; +bool Context::hasCurrent() { return _current; } + +Context& Context::current() { + CORRADE_ASSERT(_current, "Context::current(): no current context", *_current); + return *_current; +} + Context::Context(NoCreateT, Int argc, char** argv, void functionLoader()): _functionLoader{functionLoader}, _version{Version::None} { /* Parse arguments */ Utility::Arguments args{"magnum"}; diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index e56440f59..885a02cb1 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -234,6 +234,21 @@ class MAGNUM_EXPORT Context { */ typedef Containers::EnumSet DetectedDrivers; + /** + * @brief Whether there is any current context + * + * @see @ref current() + */ + static bool hasCurrent(); + + /** + * @brief Current context + * + * Expect that there is current context. + * @see @ref hasCurrent() + */ + static Context& current(); + /** @brief Copying is not allowed */ Context(const Context&) = delete; @@ -248,8 +263,10 @@ class MAGNUM_EXPORT Context { /** @brief Move assignment is not allowed */ Context& operator=(Context&&) = delete; - /** @brief Current context */ - static Context* current() { return _current; } + #if defined(MAGNUM_BUILD_DEPRECATED) && !defined(DOXYGEN_GENERATING_OUTPUT) + CORRADE_DEPRECATED("Context::current() returns reference now") Context* operator->() { return this; } + CORRADE_DEPRECATED("Context::current() returns reference now") operator Context*() { return this; } + #endif /** * @brief OpenGL version @@ -380,7 +397,7 @@ class MAGNUM_EXPORT Context { * Extensions usable with this function are listed in @ref Extensions * namespace in header @ref Extensions.h. Example usage: * @code - * if(Context::current()->isExtensionSupported()) { + * if(Context::current().isExtensionSupported()) { * // draw fancy detailed model * } else { * // texture fallback @@ -403,8 +420,8 @@ class MAGNUM_EXPORT Context { * @p version. Useful mainly in shader compilation when the decisions * depend on selected GLSL version, for example: * @code - * const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL300, Version::GL210}); - * if(Context::current()->isExtensionSupported(version)) { + * const Version version = Context::current()supportedVersion({Version::GL320, Version::GL300, Version::GL210}); + * if(Context::current().isExtensionSupported(version)) { * // Called only if ARB_explicit_attrib_location is supported * // *and* version is higher than GL 3.1 * } @@ -487,7 +504,7 @@ class MAGNUM_EXPORT Context { Implementation::State& state() { return *_state; } private: - static Context* _current; + MAGNUM_LOCAL static Context* _current; explicit Context(NoCreateT, Int argc, char** argv, void functionLoader()); @@ -544,7 +561,7 @@ MAGNUM_ASSERT_VERSION_SUPPORTED(Version::GL330); #else #define MAGNUM_ASSERT_VERSION_SUPPORTED(version) \ do { \ - if(!Magnum::Context::current()->isVersionSupported(version)) { \ + if(!Magnum::Context::current().isVersionSupported(version)) { \ Corrade::Utility::Error() << "Magnum: required version" << version << "is not supported"; \ std::abort(); \ } \ @@ -574,7 +591,7 @@ MAGNUM_ASSERT_EXTENSION_SUPPORTED(Extensions::GL::ARB::geometry_shader4); #else #define MAGNUM_ASSERT_EXTENSION_SUPPORTED(extension) \ do { \ - if(!Magnum::Context::current()->isExtensionSupported()) { \ + if(!Magnum::Context::current().isExtensionSupported()) { \ Corrade::Utility::Error() << "Magnum: required extension" << extension::string() << "is not supported"; \ std::abort(); \ } \ diff --git a/src/Magnum/CubeMapTexture.cpp b/src/Magnum/CubeMapTexture.cpp index 49d2ef01a..5bee2d8ef 100644 --- a/src/Magnum/CubeMapTexture.cpp +++ b/src/Magnum/CubeMapTexture.cpp @@ -51,7 +51,7 @@ Vector2i CubeMapTexture::maxSize() { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) Vector2i CubeMapTexture::imageSize(const Int level) { - const Implementation::TextureState& state = *Context::current()->state().texture; + const Implementation::TextureState& state = *Context::current().state().texture; Vector2i value; (this->*state.getCubeLevelParameterivImplementation)(level, GL_TEXTURE_WIDTH, &value[0]); @@ -109,11 +109,11 @@ void CubeMapTexture::compressedImage(const Int level, CompressedImage3D& image) createIfNotAlready(); const Vector3i size{imageSize(level), 6}; - const GLint textureDataSize = (this->*Context::current()->state().texture->getCubeLevelCompressedImageSizeImplementation)(level); + const GLint textureDataSize = (this->*Context::current().state().texture->getCubeLevelCompressedImageSizeImplementation)(level); std::size_t dataOffset, dataSize; std::tie(dataOffset, dataSize) = Implementation::compressedImageDataOffsetSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current().state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ Containers::Array data{image.release()}; @@ -122,7 +122,7 @@ void CubeMapTexture::compressedImage(const Int level, CompressedImage3D& image) Buffer::unbindInternal(Buffer::TargetHint::PixelPack); image.storage().applyPack(); - (this->*Context::current()->state().texture->getFullCompressedCubeImageImplementation)(level, size.xy(), dataOffset, dataSize, data); + (this->*Context::current().state().texture->getFullCompressedCubeImageImplementation)(level, size.xy(), dataOffset, dataSize, data); image.setData(image.storage(), CompressedPixelFormat(format), size, std::move(data)); } @@ -135,11 +135,11 @@ void CubeMapTexture::compressedImage(const Int level, CompressedBufferImage3D& i createIfNotAlready(); const Vector3i size{imageSize(level), 6}; - const GLint textureDataSize = (this->*Context::current()->state().texture->getCubeLevelCompressedImageSizeImplementation)(level); + const GLint textureDataSize = (this->*Context::current().state().texture->getCubeLevelCompressedImageSizeImplementation)(level); std::size_t dataOffset, dataSize; std::tie(dataOffset, dataSize) = Implementation::compressedImageDataOffsetSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current().state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ if(image.dataSize() < dataOffset + dataSize) @@ -149,7 +149,7 @@ void CubeMapTexture::compressedImage(const Int level, CompressedBufferImage3D& i image.buffer().bindInternal(Buffer::TargetHint::PixelPack); image.storage().applyPack(); - (this->*Context::current()->state().texture->getFullCompressedCubeImageImplementation)(level, size.xy(), dataOffset, dataSize, nullptr); + (this->*Context::current().state().texture->getFullCompressedCubeImageImplementation)(level, size.xy(), dataOffset, dataSize, nullptr); } CompressedBufferImage3D CubeMapTexture::compressedImage(const Int level, CompressedBufferImage3D&& image, const BufferUsage usage) { @@ -168,7 +168,7 @@ void CubeMapTexture::image(const Coordinate coordinate, const Int level, Image2D Buffer::unbindInternal(Buffer::TargetHint::PixelPack); image.storage().applyPack(); - (this->*Context::current()->state().texture->getCubeImageImplementation)(coordinate, level, size, image.format(), image.type(), data.size(), data); + (this->*Context::current().state().texture->getCubeImageImplementation)(coordinate, level, size, image.format(), image.type(), data.size(), data); image.setData(image.storage(), image.format(), image.type(), size, std::move(data)); } @@ -189,7 +189,7 @@ void CubeMapTexture::image(const Coordinate coordinate, const Int level, BufferI image.buffer().bindInternal(Buffer::TargetHint::PixelPack); image.storage().applyPack(); - (this->*Context::current()->state().texture->getCubeImageImplementation)(coordinate, level, size, image.format(), image.type(), dataSize, nullptr); + (this->*Context::current().state().texture->getCubeImageImplementation)(coordinate, level, size, image.format(), image.type(), dataSize, nullptr); } BufferImage2D CubeMapTexture::image(const Coordinate coordinate, const Int level, BufferImage2D&& image, const BufferUsage usage) { @@ -201,10 +201,10 @@ void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int leve const Vector2i size = imageSize(level); /* The function returns size of all six faces, divide the result to get size of one face */ - const GLint textureDataSize = (this->*Context::current()->state().texture->getCubeLevelCompressedImageSizeImplementation)(level)/6; + const GLint textureDataSize = (this->*Context::current().state().texture->getCubeLevelCompressedImageSizeImplementation)(level)/6; const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current().state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ Containers::Array data{image.release()}; @@ -213,7 +213,7 @@ void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int leve Buffer::unbindInternal(Buffer::TargetHint::PixelPack); image.storage().applyPack(); - (this->*Context::current()->state().texture->getCompressedCubeImageImplementation)(coordinate, level, size, data.size(), data); + (this->*Context::current().state().texture->getCompressedCubeImageImplementation)(coordinate, level, size, data.size(), data); image.setData(image.storage(), CompressedPixelFormat(format), size, std::move(data)); } @@ -226,10 +226,10 @@ void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int leve const Vector2i size = imageSize(level); /* The function returns size of all six faces, divide the result to get size of one face */ - const GLint textureDataSize = (this->*Context::current()->state().texture->getCubeLevelCompressedImageSizeImplementation)(level)/6; + const GLint textureDataSize = (this->*Context::current().state().texture->getCubeLevelCompressedImageSizeImplementation)(level)/6; const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current().state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ if(image.dataSize() < dataSize) @@ -239,7 +239,7 @@ void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int leve image.buffer().bindInternal(Buffer::TargetHint::PixelPack); image.storage().applyPack(); - (this->*Context::current()->state().texture->getCompressedCubeImageImplementation)(coordinate, level, size, dataSize, nullptr); + (this->*Context::current().state().texture->getCompressedCubeImageImplementation)(coordinate, level, size, dataSize, nullptr); } CompressedBufferImage2D CubeMapTexture::compressedImage(const Coordinate coordinate, const Int level, CompressedBufferImage2D&& image, const BufferUsage usage) { @@ -309,7 +309,7 @@ CubeMapTexture& CubeMapTexture::setSubImage(const Coordinate coordinate, const I Buffer::unbindInternal(Buffer::TargetHint::PixelUnpack); #endif image.storage().applyUnpack(); - (this->*Context::current()->state().texture->cubeSubImageImplementation)(coordinate, level, offset, image.size(), image.format(), image.type(), image.data() + (this->*Context::current().state().texture->cubeSubImageImplementation)(coordinate, level, offset, image.size(), image.format(), image.type(), image.data() #ifdef MAGNUM_TARGET_GLES2 + Implementation::pixelStorageSkipOffset(image) #endif @@ -321,7 +321,7 @@ CubeMapTexture& CubeMapTexture::setSubImage(const Coordinate coordinate, const I CubeMapTexture& CubeMapTexture::setSubImage(const Coordinate coordinate, const Int level, const Vector2i& offset, BufferImage2D& image) { image.buffer().bindInternal(Buffer::TargetHint::PixelUnpack); image.storage().applyUnpack(); - (this->*Context::current()->state().texture->cubeSubImageImplementation)(coordinate, level, offset, image.size(), image.format(), image.type(), nullptr); + (this->*Context::current().state().texture->cubeSubImageImplementation)(coordinate, level, offset, image.size(), image.format(), image.type(), nullptr); return *this; } #endif @@ -335,7 +335,7 @@ CubeMapTexture& CubeMapTexture::setCompressedSubImage(const Coordinate coordinat to reset anything */ image.storage().applyUnpack(); #endif - (this->*Context::current()->state().texture->cubeCompressedSubImageImplementation)(coordinate, level, offset, image.size(), image.format(), image.data(), Implementation::occupiedCompressedImageDataSize(image, image.data().size())); + (this->*Context::current().state().texture->cubeCompressedSubImageImplementation)(coordinate, level, offset, image.size(), image.format(), image.data(), Implementation::occupiedCompressedImageDataSize(image, image.data().size())); return *this; } @@ -347,7 +347,7 @@ CubeMapTexture& CubeMapTexture::setCompressedSubImage(const Coordinate coordinat to reset anything */ image.storage().applyUnpack(); #endif - (this->*Context::current()->state().texture->cubeCompressedSubImageImplementation)(coordinate, level, offset, image.size(), image.format(), nullptr, Implementation::occupiedCompressedImageDataSize(image, image.dataSize())); + (this->*Context::current().state().texture->cubeCompressedSubImageImplementation)(coordinate, level, offset, image.size(), image.format(), nullptr, Implementation::occupiedCompressedImageDataSize(image, image.dataSize())); return *this; } #endif diff --git a/src/Magnum/CubeMapTextureArray.cpp b/src/Magnum/CubeMapTextureArray.cpp index 009a6acf7..9aed8ae62 100644 --- a/src/Magnum/CubeMapTextureArray.cpp +++ b/src/Magnum/CubeMapTextureArray.cpp @@ -37,10 +37,10 @@ namespace Magnum { Vector3i CubeMapTextureArray::maxSize() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return {}; #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return {}; #endif diff --git a/src/Magnum/DebugOutput.cpp b/src/Magnum/DebugOutput.cpp index 966d8f6cc..457111eec 100644 --- a/src/Magnum/DebugOutput.cpp +++ b/src/Magnum/DebugOutput.cpp @@ -48,7 +48,7 @@ void APIENTRY #endif callbackWrapper(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam) { - Context::current()->state().debug->messageCallback(DebugOutput::Source(source), DebugOutput::Type(type), id, DebugOutput::Severity(severity), std::string{message, std::size_t(length)}, userParam); + Context::current().state().debug->messageCallback(DebugOutput::Source(source), DebugOutput::Type(type), id, DebugOutput::Severity(severity), std::string{message, std::size_t(length)}, userParam); } #endif @@ -123,10 +123,10 @@ void defaultCallback(const DebugOutput::Source source, const DebugOutput::Type t } Int DebugOutput::maxLoggedMessages() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; - GLint& value = Context::current()->state().debug->maxLoggedMessages; + GLint& value = Context::current().state().debug->maxLoggedMessages; if(value == 0) { #ifndef MAGNUM_TARGET_GLES @@ -140,10 +140,10 @@ Int DebugOutput::maxLoggedMessages() { } Int DebugOutput::maxMessageLength() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; - GLint& value = Context::current()->state().debug->maxMessageLength; + GLint& value = Context::current().state().debug->maxMessageLength; if(value == 0) { #ifndef MAGNUM_TARGET_GLES @@ -157,7 +157,7 @@ Int DebugOutput::maxMessageLength() { } void DebugOutput::setCallback(const Callback callback, const void* userParam) { - Context::current()->state().debug->callbackImplementation(callback, userParam); + Context::current().state().debug->callbackImplementation(callback, userParam); } void DebugOutput::setDefaultCallback() { @@ -165,7 +165,7 @@ void DebugOutput::setDefaultCallback() { } void DebugOutput::setEnabledInternal(const GLenum source, const GLenum type, const GLenum severity, const std::initializer_list ids, const bool enabled) { - Context::current()->state().debug->controlImplementation(source, type, severity, ids, enabled); + Context::current().state().debug->controlImplementation(source, type, severity, ids, enabled); } void DebugOutput::controlImplementationNoOp(GLenum, GLenum, GLenum, std::initializer_list, bool) {} @@ -192,8 +192,8 @@ void DebugOutput::callbackImplementationNoOp(Callback, const void*) {} void DebugOutput::callbackImplementationKhr(const Callback callback, const void* userParam) { /* Replace the callback */ - const Callback original = Context::current()->state().debug->messageCallback; - Context::current()->state().debug->messageCallback = callback; + const Callback original = Context::current().state().debug->messageCallback; + Context::current().state().debug->messageCallback = callback; /* Adding callback */ if(!original && callback) { @@ -273,7 +273,7 @@ Debug& operator<<(Debug& debug, const DebugOutput::Severity value) { #endif void DebugMessage::insertInternal(const Source source, const Type type, const UnsignedInt id, const DebugOutput::Severity severity, const Containers::ArrayView string) { - Context::current()->state().debug->messageInsertImplementation(source, type, id, severity, string); + Context::current().state().debug->messageInsertImplementation(source, type, id, severity, string); } void DebugMessage::insertImplementationNoOp(Source, Type, UnsignedInt, DebugOutput::Severity, const Containers::ArrayView) {} @@ -348,10 +348,10 @@ Debug& operator<<(Debug& debug, const DebugMessage::Type value) { #endif Int DebugGroup::maxStackDepth() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; - GLint& value = Context::current()->state().debug->maxStackDepth; + GLint& value = Context::current().state().debug->maxStackDepth; if(value == 0) { #ifndef MAGNUM_TARGET_GLES @@ -366,13 +366,13 @@ Int DebugGroup::maxStackDepth() { void DebugGroup::pushInternal(const Source source, const UnsignedInt id, const Containers::ArrayView message) { CORRADE_ASSERT(!_active, "DebugGroup::push(): group is already active", ); - Context::current()->state().debug->pushGroupImplementation(source, id, message); + Context::current().state().debug->pushGroupImplementation(source, id, message); _active = true; } void DebugGroup::pop() { CORRADE_ASSERT(_active, "DebugGroup::pop(): group is not active", ); - Context::current()->state().debug->popGroupImplementation(); + Context::current().state().debug->popGroupImplementation(); _active = false; } diff --git a/src/Magnum/DefaultFramebuffer.cpp b/src/Magnum/DefaultFramebuffer.cpp index 0f4b8949e..1cfb524f5 100644 --- a/src/Magnum/DefaultFramebuffer.cpp +++ b/src/Magnum/DefaultFramebuffer.cpp @@ -42,7 +42,7 @@ DefaultFramebuffer::DefaultFramebuffer() { } DefaultFramebuffer::Status DefaultFramebuffer::checkStatus(const FramebufferTarget target) { - return Status((this->*Context::current()->state().framebuffer->checkStatusImplementation)(target)); + return Status((this->*Context::current().state().framebuffer->checkStatusImplementation)(target)); } DefaultFramebuffer& DefaultFramebuffer::mapForDraw(std::initializer_list> attachments) { @@ -58,22 +58,22 @@ DefaultFramebuffer& DefaultFramebuffer::mapForDraw(std::initializer_list*Context::current()->state().framebuffer->drawBuffersImplementation)(max+1, _attachments); + (this->*Context::current().state().framebuffer->drawBuffersImplementation)(max+1, _attachments); return *this; } DefaultFramebuffer& DefaultFramebuffer::mapForDraw(const DrawAttachment attachment) { #ifndef MAGNUM_TARGET_GLES - (this->*Context::current()->state().framebuffer->drawBufferImplementation)(GLenum(attachment)); + (this->*Context::current().state().framebuffer->drawBufferImplementation)(GLenum(attachment)); #else - (this->*Context::current()->state().framebuffer->drawBuffersImplementation)(1, reinterpret_cast(&attachment)); + (this->*Context::current().state().framebuffer->drawBuffersImplementation)(1, reinterpret_cast(&attachment)); #endif return *this; } #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) DefaultFramebuffer& DefaultFramebuffer::mapForRead(const ReadAttachment attachment) { - (this->*Context::current()->state().framebuffer->readBufferImplementation)(GLenum(attachment)); + (this->*Context::current().state().framebuffer->readBufferImplementation)(GLenum(attachment)); return *this; } @@ -83,7 +83,7 @@ void DefaultFramebuffer::invalidate(std::initializer_list*Context::current()->state().framebuffer->invalidateImplementation)(attachments.size(), _attachments); + (this->*Context::current().state().framebuffer->invalidateImplementation)(attachments.size(), _attachments); } #endif @@ -94,7 +94,7 @@ void DefaultFramebuffer::invalidate(std::initializer_list*Context::current()->state().framebuffer->invalidateSubImplementation)(attachments.size(), _attachments, rectangle); + (this->*Context::current().state().framebuffer->invalidateSubImplementation)(attachments.size(), _attachments, rectangle); } #endif diff --git a/src/Magnum/Framebuffer.cpp b/src/Magnum/Framebuffer.cpp index f17861a1a..719273564 100644 --- a/src/Magnum/Framebuffer.cpp +++ b/src/Magnum/Framebuffer.cpp @@ -73,16 +73,16 @@ const Framebuffer::InvalidationAttachment Framebuffer::InvalidationAttachment::S Int Framebuffer::maxColorAttachments() { #ifdef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) return 0; #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif #endif - GLint& value = Context::current()->state().framebuffer->maxColorAttachments; + GLint& value = Context::current().state().framebuffer->maxColorAttachments; if(value == 0) { #ifndef MAGNUM_TARGET_GLES2 @@ -98,7 +98,7 @@ Int Framebuffer::maxColorAttachments() { Framebuffer::Framebuffer(const Range2Di& viewport) { CORRADE_INTERNAL_ASSERT(viewport != Implementation::FramebufferState::DisengagedViewport); _viewport = viewport; - (this->*Context::current()->state().framebuffer->createImplementation)(); + (this->*Context::current().state().framebuffer->createImplementation)(); CORRADE_INTERNAL_ASSERT(_id != Implementation::State::DisengagedBinding); } @@ -118,7 +118,7 @@ Framebuffer::~Framebuffer() { if(!_id || !(_flags & ObjectFlag::DeleteOnDestruction)) return; /* If bound, remove itself from state */ - Implementation::FramebufferState& state = *Context::current()->state().framebuffer; + Implementation::FramebufferState& state = *Context::current().state().framebuffer; if(state.readBinding == _id) state.readBinding = 0; /* For draw binding reset also viewport */ @@ -138,18 +138,18 @@ Framebuffer::~Framebuffer() { #ifndef MAGNUM_TARGET_WEBGL std::string Framebuffer::label() { createIfNotAlready(); - return Context::current()->state().debug->getLabelImplementation(GL_FRAMEBUFFER, _id); + return Context::current().state().debug->getLabelImplementation(GL_FRAMEBUFFER, _id); } Framebuffer& Framebuffer::setLabelInternal(const Containers::ArrayView label) { createIfNotAlready(); - Context::current()->state().debug->labelImplementation(GL_FRAMEBUFFER, _id, label); + Context::current().state().debug->labelImplementation(GL_FRAMEBUFFER, _id, label); return *this; } #endif Framebuffer::Status Framebuffer::checkStatus(const FramebufferTarget target) { - return Status((this->*Context::current()->state().framebuffer->checkStatusImplementation)(target)); + return Status((this->*Context::current().state().framebuffer->checkStatusImplementation)(target)); } Framebuffer& Framebuffer::mapForDraw(std::initializer_list> attachments) { @@ -165,22 +165,22 @@ Framebuffer& Framebuffer::mapForDraw(std::initializer_list*Context::current()->state().framebuffer->drawBuffersImplementation)(max+1, _attachments); + (this->*Context::current().state().framebuffer->drawBuffersImplementation)(max+1, _attachments); return *this; } Framebuffer& Framebuffer::mapForDraw(const DrawAttachment attachment) { #ifndef MAGNUM_TARGET_GLES - (this->*Context::current()->state().framebuffer->drawBufferImplementation)(GLenum(attachment)); + (this->*Context::current().state().framebuffer->drawBufferImplementation)(GLenum(attachment)); #else - (this->*Context::current()->state().framebuffer->drawBuffersImplementation)(1, reinterpret_cast(&attachment)); + (this->*Context::current().state().framebuffer->drawBuffersImplementation)(1, reinterpret_cast(&attachment)); #endif return *this; } #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) Framebuffer& Framebuffer::mapForRead(const ColorAttachment attachment) { - (this->*Context::current()->state().framebuffer->readBufferImplementation)(GLenum(attachment)); + (this->*Context::current().state().framebuffer->readBufferImplementation)(GLenum(attachment)); return *this; } @@ -190,7 +190,7 @@ void Framebuffer::invalidate(std::initializer_list attac for(std::size_t i = 0; i != attachments.size(); ++i) _attachments[i] = GLenum(*(attachments.begin()+i)); - (this->*Context::current()->state().framebuffer->invalidateImplementation)(attachments.size(), _attachments); + (this->*Context::current().state().framebuffer->invalidateImplementation)(attachments.size(), _attachments); } #ifndef MAGNUM_TARGET_GLES2 @@ -200,116 +200,116 @@ void Framebuffer::invalidate(std::initializer_list attac for(std::size_t i = 0; i != attachments.size(); ++i) _attachments[i] = GLenum(*(attachments.begin()+i)); - (this->*Context::current()->state().framebuffer->invalidateSubImplementation)(attachments.size(), _attachments, rectangle); + (this->*Context::current().state().framebuffer->invalidateSubImplementation)(attachments.size(), _attachments, rectangle); } #endif #endif Framebuffer& Framebuffer::attachRenderbuffer(const BufferAttachment attachment, Renderbuffer& renderbuffer) { - (this->*Context::current()->state().framebuffer->renderbufferImplementation)(attachment, renderbuffer.id()); + (this->*Context::current().state().framebuffer->renderbufferImplementation)(attachment, renderbuffer.id()); return *this; } #ifndef MAGNUM_TARGET_GLES Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, Texture1D& texture, const Int level) { - (this->*Context::current()->state().framebuffer->texture1DImplementation)(attachment, texture.id(), level); + (this->*Context::current().state().framebuffer->texture1DImplementation)(attachment, texture.id(), level); return *this; } #endif Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, Texture2D& texture, const Int level) { - (this->*Context::current()->state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_2D, texture.id(), level); + (this->*Context::current().state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_2D, texture.id(), level); return *this; } #ifndef MAGNUM_TARGET_GLES Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, RectangleTexture& texture) { - (this->*Context::current()->state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_RECTANGLE, texture.id(), 0); + (this->*Context::current().state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_RECTANGLE, texture.id(), 0); return *this; } #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, MultisampleTexture2D& texture) { - (this->*Context::current()->state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_2D_MULTISAMPLE, texture.id(), 0); + (this->*Context::current().state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_2D_MULTISAMPLE, texture.id(), 0); return *this; } #endif Framebuffer& Framebuffer::attachCubeMapTexture(const BufferAttachment attachment, CubeMapTexture& texture, CubeMapTexture::Coordinate coordinate, const Int level) { - (this->*Context::current()->state().framebuffer->textureCubeMapImplementation)(attachment, GLenum(coordinate), texture.id(), level); + (this->*Context::current().state().framebuffer->textureCubeMapImplementation)(attachment, GLenum(coordinate), texture.id(), level); return *this; } #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) Framebuffer& Framebuffer::attachTextureLayer(const BufferAttachment attachment, Texture3D& texture, Int level, Int layer) { - (this->*Context::current()->state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer); + (this->*Context::current().state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer); return *this; } #endif #ifndef MAGNUM_TARGET_GLES Framebuffer& Framebuffer::attachTextureLayer(const BufferAttachment attachment, Texture1DArray& texture, Int level, Int layer) { - (this->*Context::current()->state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer); + (this->*Context::current().state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer); return *this; } #endif #ifndef MAGNUM_TARGET_GLES2 Framebuffer& Framebuffer::attachTextureLayer(const BufferAttachment attachment, Texture2DArray& texture, Int level, Int layer) { - (this->*Context::current()->state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer); + (this->*Context::current().state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer); return *this; } #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) Framebuffer& Framebuffer::attachTextureLayer(const BufferAttachment attachment, CubeMapTextureArray& texture, Int level, Int layer) { - (this->*Context::current()->state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer); + (this->*Context::current().state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer); return *this; } Framebuffer& Framebuffer::attachTextureLayer(const BufferAttachment attachment, MultisampleTexture2DArray& texture, Int layer) { - (this->*Context::current()->state().framebuffer->textureLayerImplementation)(attachment, texture.id(), 0, layer); + (this->*Context::current().state().framebuffer->textureLayerImplementation)(attachment, texture.id(), 0, layer); return *this; } #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) Framebuffer& Framebuffer::attachLayeredTexture(const BufferAttachment attachment, Texture3D& texture, const Int level) { - (this->*Context::current()->state().framebuffer->textureImplementation)(attachment, texture.id(), level); + (this->*Context::current().state().framebuffer->textureImplementation)(attachment, texture.id(), level); return *this; } #ifndef MAGNUM_TARGET_GLES Framebuffer& Framebuffer::attachLayeredTexture(const BufferAttachment attachment, Texture1DArray& texture, const Int level) { - (this->*Context::current()->state().framebuffer->textureImplementation)(attachment, texture.id(), level); + (this->*Context::current().state().framebuffer->textureImplementation)(attachment, texture.id(), level); return *this; } #endif Framebuffer& Framebuffer::attachLayeredTexture(const BufferAttachment attachment, Texture2DArray& texture, const Int level) { - (this->*Context::current()->state().framebuffer->textureImplementation)(attachment, texture.id(), level); + (this->*Context::current().state().framebuffer->textureImplementation)(attachment, texture.id(), level); return *this; } Framebuffer& Framebuffer::attachLayeredTexture(const BufferAttachment attachment, CubeMapTexture& texture, const Int level) { - (this->*Context::current()->state().framebuffer->textureImplementation)(attachment, texture.id(), level); + (this->*Context::current().state().framebuffer->textureImplementation)(attachment, texture.id(), level); return *this; } Framebuffer& Framebuffer::attachLayeredTexture(const BufferAttachment attachment, CubeMapTextureArray& texture, const Int level) { - (this->*Context::current()->state().framebuffer->textureImplementation)(attachment, texture.id(), level); + (this->*Context::current().state().framebuffer->textureImplementation)(attachment, texture.id(), level); return *this; } Framebuffer& Framebuffer::attachLayeredTexture(const BufferAttachment attachment, MultisampleTexture2DArray& texture) { - (this->*Context::current()->state().framebuffer->textureImplementation)(attachment, texture.id(), 0); + (this->*Context::current().state().framebuffer->textureImplementation)(attachment, texture.id(), 0); return *this; } #endif Framebuffer& Framebuffer::detach(const BufferAttachment attachment) { - (this->*Context::current()->state().framebuffer->renderbufferImplementation)(attachment, 0); + (this->*Context::current().state().framebuffer->renderbufferImplementation)(attachment, 0); return *this; } diff --git a/src/Magnum/Implementation/driverSpecific.cpp b/src/Magnum/Implementation/driverSpecific.cpp index 1469a4647..89e98b10e 100644 --- a/src/Magnum/Implementation/driverSpecific.cpp +++ b/src/Magnum/Implementation/driverSpecific.cpp @@ -83,7 +83,7 @@ bool isShaderCompilationLogEmpty(const std::string&); bool isShaderCompilationLogEmpty(const std::string& result) { #if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_TARGET_GLES) /* Intel Windows drivers are too chatty */ - if((Context::current()->detectedDriver() & Context::DetectedDriver::IntelWindows) && result == "No errors.\n") + if((Context::current()detectedDriver() & Context::DetectedDriver::IntelWindows) && result == "No errors.\n") return true; #else static_cast(result); @@ -97,7 +97,7 @@ bool isProgramLinkLogEmpty(const std::string&); bool isProgramLinkLogEmpty(const std::string& result) { #if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_TARGET_GLES) /* Intel Windows drivers are too chatty */ - if((Context::current()->detectedDriver() & Context::DetectedDriver::IntelWindows) && result == "No errors.\n") + if((Context::current()detectedDriver() & Context::DetectedDriver::IntelWindows) && result == "No errors.\n") return true; #else static_cast(result); diff --git a/src/Magnum/Implementation/maxTextureSize.cpp b/src/Magnum/Implementation/maxTextureSize.cpp index ed4cc2e5f..8da698595 100644 --- a/src/Magnum/Implementation/maxTextureSize.cpp +++ b/src/Magnum/Implementation/maxTextureSize.cpp @@ -33,7 +33,7 @@ namespace Magnum { namespace Implementation { GLint maxTextureSideSize() { - GLint& value = Context::current()->state().texture->maxSize; + GLint& value = Context::current().state().texture->maxSize; if(value == 0) glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value); @@ -43,7 +43,7 @@ GLint maxTextureSideSize() { #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) GLint max3DTextureDepth() { - GLint& value = Context::current()->state().texture->max3DSize; + GLint& value = Context::current().state().texture->max3DSize; if(value == 0) #ifndef MAGNUM_TARGET_GLES2 @@ -58,7 +58,7 @@ GLint max3DTextureDepth() { #ifndef MAGNUM_TARGET_GLES2 GLint maxTextureArrayLayers() { - GLint& value = Context::current()->state().texture->maxArrayLayers; + GLint& value = Context::current().state().texture->maxArrayLayers; if(value == 0) glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &value); @@ -68,7 +68,7 @@ GLint maxTextureArrayLayers() { #endif GLint maxCubeMapTextureSideSize() { - GLint& value = Context::current()->state().texture->maxCubeMapSize; + GLint& value = Context::current().state().texture->maxCubeMapSize; if(value == 0) glGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &value); diff --git a/src/Magnum/Mesh.cpp b/src/Magnum/Mesh.cpp index acf2917d6..23ae425ca 100644 --- a/src/Magnum/Mesh.cpp +++ b/src/Magnum/Mesh.cpp @@ -68,7 +68,7 @@ Int Mesh::maxElementIndex() #endif { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0xFFFFFFFFl; #endif @@ -77,7 +77,7 @@ Int Mesh::maxElementIndex() #else GLint& value = #endif - Context::current()->state().mesh->maxElementIndex; + Context::current().state().mesh->maxElementIndex; /* Get the value, if not already cached */ if(value == 0) { @@ -92,7 +92,7 @@ Int Mesh::maxElementIndex() } Int Mesh::maxElementsIndices() { - GLint& value = Context::current()->state().mesh->maxElementsIndices; + GLint& value = Context::current().state().mesh->maxElementsIndices; /* Get the value, if not already cached */ if(value == 0) @@ -102,7 +102,7 @@ Int Mesh::maxElementsIndices() { } Int Mesh::maxElementsVertices() { - GLint& value = Context::current()->state().mesh->maxElementsVertices; + GLint& value = Context::current().state().mesh->maxElementsVertices; /* Get the value, if not already cached */ if(value == 0) @@ -131,7 +131,7 @@ Mesh::Mesh(const MeshPrimitive primitive): _primitive{primitive}, _flags{ObjectF #endif _indexOffset(0), _indexType(IndexType::UnsignedInt), _indexBuffer(nullptr) { - (this->*Context::current()->state().mesh->createImplementation)(); + (this->*Context::current().state().mesh->createImplementation)(); } Mesh::Mesh(NoCreateT) noexcept: _id{0}, _primitive{MeshPrimitive::Triangles}, _flags{ObjectFlag::DeleteOnDestruction}, _count{0}, _baseVertex{0}, _instanceCount{1}, @@ -148,10 +148,10 @@ Mesh::~Mesh() { if(!_id || !(_flags & ObjectFlag::DeleteOnDestruction)) return; /* Remove current vao from the state */ - GLuint& current = Context::current()->state().mesh->currentVAO; + GLuint& current = Context::current().state().mesh->currentVAO; if(current == _id) current = 0; - (this->*Context::current()->state().mesh->destroyImplementation)(); + (this->*Context::current().state().mesh->destroyImplementation)(); } Mesh::Mesh(Mesh&& other) noexcept: _id(other._id), _primitive(other._primitive), _flags{other._flags}, _count(other._count), _baseVertex{other._baseVertex}, _instanceCount{other._instanceCount}, @@ -207,18 +207,18 @@ inline void Mesh::createIfNotAlready() { std::string Mesh::label() { createIfNotAlready(); #ifndef MAGNUM_TARGET_GLES - return Context::current()->state().debug->getLabelImplementation(GL_VERTEX_ARRAY, _id); + return Context::current().state().debug->getLabelImplementation(GL_VERTEX_ARRAY, _id); #else - return Context::current()->state().debug->getLabelImplementation(GL_VERTEX_ARRAY_KHR, _id); + return Context::current().state().debug->getLabelImplementation(GL_VERTEX_ARRAY_KHR, _id); #endif } Mesh& Mesh::setLabelInternal(const Containers::ArrayView label) { createIfNotAlready(); #ifndef MAGNUM_TARGET_GLES - Context::current()->state().debug->labelImplementation(GL_VERTEX_ARRAY, _id, label); + Context::current().state().debug->labelImplementation(GL_VERTEX_ARRAY, _id, label); #else - Context::current()->state().debug->labelImplementation(GL_VERTEX_ARRAY_KHR, _id, label); + Context::current().state().debug->labelImplementation(GL_VERTEX_ARRAY_KHR, _id, label); #endif return *this; } @@ -240,7 +240,7 @@ Mesh& Mesh::setIndexBuffer(Buffer& buffer, GLintptr offset, IndexType type, Unsi static_cast(start); static_cast(end); #endif - (this->*Context::current()->state().mesh->bindIndexBufferImplementation)(buffer); + (this->*Context::current().state().mesh->bindIndexBufferImplementation)(buffer); return *this; } @@ -264,7 +264,7 @@ void Mesh::drawInternal(Int count, Int baseVertex, Int instanceCount, GLintptr i void Mesh::drawInternal(Int count, Int baseVertex, Int instanceCount, GLintptr indexOffset) #endif { - const Implementation::MeshState& state = *Context::current()->state().mesh; + const Implementation::MeshState& state = *Context::current().state().mesh; /* Nothing to draw */ if(!count || !instanceCount) return; @@ -364,7 +364,7 @@ void Mesh::drawInternal(Int count, Int baseVertex, Int instanceCount, GLintptr i } void Mesh::bindVAO() { - GLuint& current = Context::current()->state().mesh->currentVAO; + GLuint& current = Context::current().state().mesh->currentVAO; if(current != _id) { /* Binding the VAO finally creates it */ _flags |= ObjectFlag::Created; @@ -419,7 +419,7 @@ void Mesh::attributePointerInternal(const Buffer& buffer, const GLuint location, } void Mesh::attributePointerInternal(AttributeLayout& attribute) { - (this->*Context::current()->state().mesh->attributePointerImplementation)(attribute); + (this->*Context::current().state().mesh->attributePointerImplementation)(attribute); } void Mesh::attributePointerImplementationDefault(AttributeLayout& attribute) { @@ -460,7 +460,7 @@ void Mesh::attributePointerImplementationDSAEXT(AttributeLayout& attribute) { } if(attribute.divisor) - (this->*Context::current()->state().mesh->vertexAttribDivisorImplementation)(attribute.location, attribute.divisor); + (this->*Context::current().state().mesh->vertexAttribDivisorImplementation)(attribute.location, attribute.divisor); } #endif @@ -485,7 +485,7 @@ void Mesh::vertexAttribPointer(AttributeLayout& attribute) { #ifndef MAGNUM_TARGET_GLES2 glVertexAttribDivisor(attribute.location, attribute.divisor); #else - (this->*Context::current()->state().mesh->vertexAttribDivisorImplementation)(attribute.location, attribute.divisor); + (this->*Context::current().state().mesh->vertexAttribDivisorImplementation)(attribute.location, attribute.divisor); #endif } } @@ -537,7 +537,7 @@ void Mesh::bindIndexBufferImplementationVAO(Buffer& buffer) { /* Reset ElementArray binding to force explicit glBindBuffer call later */ /** @todo Do this cleaner way */ - Context::current()->state().buffer->bindings[Implementation::BufferState::indexForTarget(Buffer::TargetHint::ElementArray)] = 0; + Context::current().state().buffer->bindings[Implementation::BufferState::indexForTarget(Buffer::TargetHint::ElementArray)] = 0; buffer.bindInternal(Buffer::TargetHint::ElementArray); } diff --git a/src/Magnum/MeshTools/FullScreenTriangle.cpp b/src/Magnum/MeshTools/FullScreenTriangle.cpp index 26f317f21..dac85334c 100644 --- a/src/Magnum/MeshTools/FullScreenTriangle.cpp +++ b/src/Magnum/MeshTools/FullScreenTriangle.cpp @@ -62,7 +62,7 @@ std::pair, Mesh> fullScreenTriangle(Version version) { } std::pair, Mesh> fullScreenTriangle() { - return fullScreenTriangle(Context::current()->version()); + return fullScreenTriangle(Context::current().version()); } }} diff --git a/src/Magnum/MeshView.cpp b/src/Magnum/MeshView.cpp index 154f608f4..2ccd072b7 100644 --- a/src/Magnum/MeshView.cpp +++ b/src/Magnum/MeshView.cpp @@ -52,7 +52,7 @@ void MeshView::draw(AbstractShaderProgram& shader, std::initializer_liststate().mesh->multiDrawImplementation(meshes); + Context::current().state().mesh->multiDrawImplementation(meshes); #endif } @@ -60,7 +60,7 @@ void MeshView::draw(AbstractShaderProgram& shader, std::initializer_list> meshes) { CORRADE_INTERNAL_ASSERT(meshes.size()); - const Implementation::MeshState& state = *Context::current()->state().mesh; + const Implementation::MeshState& state = *Context::current().state().mesh; Mesh& original = meshes.begin()->get()._original; Containers::Array count{meshes.size()}; diff --git a/src/Magnum/MultisampleTexture.cpp b/src/Magnum/MultisampleTexture.cpp index ac44ef5b8..f8cefc265 100644 --- a/src/Magnum/MultisampleTexture.cpp +++ b/src/Magnum/MultisampleTexture.cpp @@ -35,9 +35,9 @@ namespace Magnum { namespace Implementation { template<> Vector2i MAGNUM_EXPORT maxMultisampleTextureSize<2>() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return Vector2i{0}; @@ -46,10 +46,10 @@ template<> Vector2i MAGNUM_EXPORT maxMultisampleTextureSize<2>() { template<> Vector3i MAGNUM_EXPORT maxMultisampleTextureSize<3>() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return Vector3i{0}; #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return Vector3i{0}; #endif diff --git a/src/Magnum/PixelStorage.cpp b/src/Magnum/PixelStorage.cpp index da9d3a89b..fa357da3b 100644 --- a/src/Magnum/PixelStorage.cpp +++ b/src/Magnum/PixelStorage.cpp @@ -194,8 +194,8 @@ std::tuple, std::size_t> CompressedPixel void PixelStorage::applyInternal(const bool isUnpack) { Implementation::RendererState::PixelStorage& state = isUnpack ? - Context::current()->state().renderer->unpackPixelStorage : - Context::current()->state().renderer->packPixelStorage; + Context::current().state().renderer->unpackPixelStorage : + Context::current().state().renderer->packPixelStorage; #ifndef MAGNUM_TARGET_GLES /* Byte swap */ @@ -256,7 +256,7 @@ void PixelStorage::applyUnpack() { applyInternal(true); #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_GLES2) - Implementation::RendererState::PixelStorage& state = Context::current()->state().renderer->unpackPixelStorage; + Implementation::RendererState::PixelStorage& state = Context::current().state().renderer->unpackPixelStorage; /* Image height (on ES for unpack only) */ if(state.imageHeight == Implementation::RendererState::PixelStorage::DisengagedValue || state.imageHeight != _imageHeight) @@ -273,8 +273,8 @@ void CompressedPixelStorage::applyInternal(const bool isUnpack) { PixelStorage::applyInternal(isUnpack); Implementation::RendererState::PixelStorage& state = isUnpack ? - Context::current()->state().renderer->unpackPixelStorage : - Context::current()->state().renderer->packPixelStorage; + Context::current().state().renderer->unpackPixelStorage : + Context::current().state().renderer->packPixelStorage; /* Compressed block width */ if(state.compressedBlockSize.x() == Implementation::RendererState::PixelStorage::DisengagedValue || state.compressedBlockSize.x() != _blockSize.x()) diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index 04063e78e..0722a0769 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -236,7 +236,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat /* Create context here, so the context creation info is displayed at proper place */ createContext(); - Context* c = Context::current(); + Context& c = Context::current(); Debug() << "Context flags:"; #ifndef MAGNUM_TARGET_GLES @@ -244,10 +244,10 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #else for(const auto flag: {Context::Flag::Debug}) #endif - if(c->flags() & flag) Debug() << " " << flag; + if(c.flags() & flag) Debug() << " " << flag; Debug() << "Supported GLSL versions:"; - const std::vector shadingLanguageVersions = c->shadingLanguageVersionStrings(); + const std::vector shadingLanguageVersions = c.shadingLanguageVersionStrings(); for(const auto& version: shadingLanguageVersions) Debug() << " " << version; @@ -279,7 +279,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat std::size_t future = 0; if(!args.isSet("all-extensions")) - while(versions[future] != Version::None && c->isVersionSupported(versions[future])) + while(versions[future] != Version::None && c.isVersionSupported(versions[future])) ++future; /* Display supported OpenGL extensions from unsupported versions */ @@ -292,11 +292,11 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat std::string extensionName = extension.string(); Debug d; d << " " << extensionName << std::string(60-extensionName.size(), ' '); - if(c->isExtensionSupported(extension)) + if(c.isExtensionSupported(extension)) d << "SUPPORTED"; - else if(c->isExtensionDisabled(extension)) + else if(c.isExtensionDisabled(extension)) d << " removed"; - else if(c->isVersionSupported(extension.requiredVersion())) + else if(c.isVersionSupported(extension.requiredVersion())) d << " -"; else d << " n/a"; @@ -356,7 +356,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat _lvec(CubeMapTexture::maxSize()) #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) { + if(c.isExtensionSupported()) { _h(ARB::blend_func_extended) _l(AbstractFramebuffer::maxDualSourceDrawBuffers()) @@ -365,7 +365,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #endif { #ifndef MAGNUM_TARGET_GLES @@ -377,7 +377,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat } #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #endif { #ifndef MAGNUM_TARGET_GLES @@ -390,7 +390,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #endif { #ifndef MAGNUM_TARGET_GLES @@ -416,7 +416,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat } #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #endif { #ifndef MAGNUM_TARGET_GLES @@ -438,7 +438,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat } #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #endif { #ifndef MAGNUM_TARGET_GLES @@ -459,7 +459,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #endif { #ifndef MAGNUM_TARGET_GLES @@ -475,7 +475,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #endif #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) { + if(c.isExtensionSupported()) { _h(ARB::texture_rectangle) _lvec(RectangleTexture::maxSize()) @@ -484,7 +484,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #endif { #ifndef MAGNUM_TARGET_GLES @@ -509,7 +509,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat } #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #endif { #ifndef MAGNUM_TARGET_GLES @@ -522,7 +522,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat } #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #endif { #ifndef MAGNUM_TARGET_GLES @@ -538,7 +538,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #endif { #ifndef MAGNUM_TARGET_GLES @@ -552,7 +552,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #endif #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) { + if(c.isExtensionSupported()) { _h(ARB::transform_feedback3) _l(TransformFeedback::maxBuffers()) @@ -561,9 +561,9 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #else - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #endif { #ifndef MAGNUM_TARGET_GLES @@ -580,9 +580,9 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #else - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #endif { #ifndef MAGNUM_TARGET_GLES @@ -603,9 +603,9 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #else - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #endif { #ifndef MAGNUM_TARGET_GLES @@ -618,9 +618,9 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat } #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #else - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #endif { #ifndef MAGNUM_TARGET_GLES @@ -633,9 +633,9 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat } #ifndef MAGNUM_TARGET_GLES - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #else - if(c->isExtensionSupported()) + if(c.isExtensionSupported()) #endif { #ifndef MAGNUM_TARGET_GLES @@ -648,13 +648,13 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat } #endif - if(c->isExtensionSupported()) { + if(c.isExtensionSupported()) { _h(EXT::texture_filter_anisotropic) _l(Sampler::maxMaxAnisotropy()) } - if(c->isExtensionSupported()) { + if(c.isExtensionSupported()) { _h(KHR::debug) _l(AbstractObject::maxLabelLength()) @@ -664,7 +664,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat } #ifdef MAGNUM_TARGET_GLES2 - if(c->isExtensionSupported()) { + if(c.isExtensionSupported()) { _h(OES::texture_3D) _lvec(Texture3D::maxSize()) diff --git a/src/Magnum/RectangleTexture.cpp b/src/Magnum/RectangleTexture.cpp index ef516190f..e4dbd54f3 100644 --- a/src/Magnum/RectangleTexture.cpp +++ b/src/Magnum/RectangleTexture.cpp @@ -37,10 +37,10 @@ namespace Magnum { Vector2i RectangleTexture::maxSize() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return {}; - GLint& value = Context::current()->state().texture->maxRectangleSize; + GLint& value = Context::current().state().texture->maxRectangleSize; if(value == 0) glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE, &value); diff --git a/src/Magnum/Renderbuffer.cpp b/src/Magnum/Renderbuffer.cpp index 9872f7dee..81ecc492c 100644 --- a/src/Magnum/Renderbuffer.cpp +++ b/src/Magnum/Renderbuffer.cpp @@ -37,7 +37,7 @@ namespace Magnum { Int Renderbuffer::maxSize() { - GLint& value = Context::current()->state().framebuffer->maxRenderbufferSize; + GLint& value = Context::current().state().framebuffer->maxRenderbufferSize; /* Get the value, if not already cached */ if(value == 0) @@ -49,11 +49,11 @@ Int Renderbuffer::maxSize() { #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) Int Renderbuffer::maxSamples() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported() && !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && !Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().framebuffer->maxSamples; + GLint& value = Context::current().state().framebuffer->maxSamples; /* Get the value, if not already cached */ if(value == 0) { @@ -69,7 +69,7 @@ Int Renderbuffer::maxSamples() { #endif Renderbuffer::Renderbuffer(): _flags{ObjectFlag::DeleteOnDestruction} { - (this->*Context::current()->state().framebuffer->createRenderbufferImplementation)(); + (this->*Context::current().state().framebuffer->createRenderbufferImplementation)(); } void Renderbuffer::createImplementationDefault() { @@ -88,7 +88,7 @@ Renderbuffer::~Renderbuffer() { if(!_id || !(_flags & ObjectFlag::DeleteOnDestruction)) return; /* If bound, remove itself from state */ - GLuint& binding = Context::current()->state().framebuffer->renderbufferBinding; + GLuint& binding = Context::current().state().framebuffer->renderbufferBinding; if(binding == _id) binding = 0; glDeleteRenderbuffers(1, &_id); @@ -108,28 +108,28 @@ inline void Renderbuffer::createIfNotAlready() { #ifndef MAGNUM_TARGET_WEBGL std::string Renderbuffer::label() { createIfNotAlready(); - return Context::current()->state().debug->getLabelImplementation(GL_RENDERBUFFER, _id); + return Context::current().state().debug->getLabelImplementation(GL_RENDERBUFFER, _id); } Renderbuffer& Renderbuffer::setLabelInternal(const Containers::ArrayView label) { createIfNotAlready(); - Context::current()->state().debug->labelImplementation(GL_RENDERBUFFER, _id, label); + Context::current().state().debug->labelImplementation(GL_RENDERBUFFER, _id, label); return *this; } #endif void Renderbuffer::setStorage(const RenderbufferFormat internalFormat, const Vector2i& size) { - (this->*Context::current()->state().framebuffer->renderbufferStorageImplementation)(internalFormat, size); + (this->*Context::current().state().framebuffer->renderbufferStorageImplementation)(internalFormat, size); } #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) void Renderbuffer::setStorageMultisample(const Int samples, const RenderbufferFormat internalFormat, const Vector2i& size) { - (this->*Context::current()->state().framebuffer->renderbufferStorageMultisampleImplementation)(samples, internalFormat, size); + (this->*Context::current().state().framebuffer->renderbufferStorageMultisampleImplementation)(samples, internalFormat, size); } #endif void Renderbuffer::bind() { - GLuint& binding = Context::current()->state().framebuffer->renderbufferBinding; + GLuint& binding = Context::current().state().framebuffer->renderbufferBinding; if(binding == _id) return; diff --git a/src/Magnum/Renderer.cpp b/src/Magnum/Renderer.cpp index 87222fbf6..8480d9854 100644 --- a/src/Magnum/Renderer.cpp +++ b/src/Magnum/Renderer.cpp @@ -62,7 +62,7 @@ void Renderer::setClearDepth(const Double depth) { #endif void Renderer::setClearDepth(Float depth) { - Context::current()->state().renderer->clearDepthfImplementation(depth); + Context::current().state().renderer->clearDepthfImplementation(depth); } void Renderer::setClearStencil(const Int stencil) { @@ -182,13 +182,13 @@ void Renderer::setLogicOperation(const LogicOperation operation) { #ifndef MAGNUM_TARGET_WEBGL Renderer::ResetNotificationStrategy Renderer::resetNotificationStrategy() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #endif return ResetNotificationStrategy::NoResetNotification; - ResetNotificationStrategy& strategy = Context::current()->state().renderer->resetNotificationStrategy; + ResetNotificationStrategy& strategy = Context::current().state().renderer->resetNotificationStrategy; if(strategy == ResetNotificationStrategy()) { #ifndef MAGNUM_TARGET_GLES @@ -202,7 +202,7 @@ Renderer::ResetNotificationStrategy Renderer::resetNotificationStrategy() { } Renderer::GraphicsResetStatus Renderer::graphicsResetStatus() { - return Context::current()->state().renderer->graphicsResetStatusImplementation(); + return Context::current().state().renderer->graphicsResetStatusImplementation(); } #endif diff --git a/src/Magnum/Sampler.cpp b/src/Magnum/Sampler.cpp index d9ebb810d..208d95386 100644 --- a/src/Magnum/Sampler.cpp +++ b/src/Magnum/Sampler.cpp @@ -48,10 +48,10 @@ static_assert((filter_or(Nearest, Base) == GL_NEAREST) && #undef filter_or Float Sampler::maxMaxAnisotropy() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0.0f; - GLfloat& value = Context::current()->state().texture->maxMaxAnisotropy; + GLfloat& value = Context::current().state().texture->maxMaxAnisotropy; /* Get the value, if not already cached */ if(value == 0.0f) diff --git a/src/Magnum/Shader.cpp b/src/Magnum/Shader.cpp index cd4d6556b..036a6d340 100644 --- a/src/Magnum/Shader.cpp +++ b/src/Magnum/Shader.cpp @@ -89,26 +89,26 @@ UnsignedInt typeToIndex(const Shader::Type type) { #ifndef MAGNUM_TARGET_GLES bool isTypeSupported(const Shader::Type type) { - if(type == Shader::Type::Geometry && !Context::current()->isExtensionSupported()) + if(type == Shader::Type::Geometry && !Context::current().isExtensionSupported()) return false; - if((type == Shader::Type::TessellationControl || type == Shader::Type::TessellationEvaluation) && !Context::current()->isExtensionSupported()) + if((type == Shader::Type::TessellationControl || type == Shader::Type::TessellationEvaluation) && !Context::current().isExtensionSupported()) return false; - if(type == Shader::Type::Compute && !Context::current()->isExtensionSupported()) + if(type == Shader::Type::Compute && !Context::current().isExtensionSupported()) return false; return true; } #elif !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) bool isTypeSupported(const Shader::Type type) { - if(type == Shader::Type::Geometry && !Context::current()->isExtensionSupported()) + if(type == Shader::Type::Geometry && !Context::current().isExtensionSupported()) return false; - if((type == Shader::Type::TessellationControl || type == Shader::Type::TessellationEvaluation) && !Context::current()->isExtensionSupported()) + if((type == Shader::Type::TessellationControl || type == Shader::Type::TessellationEvaluation) && !Context::current().isExtensionSupported()) return false; - if(type == Shader::Type::Compute && !Context::current()->isVersionSupported(Version::GLES310)) + if(type == Shader::Type::Compute && !Context::current().isVersionSupported(Version::GLES310)) return false; return true; @@ -120,12 +120,12 @@ constexpr bool isTypeSupported(Shader::Type) { return true; } } Int Shader::maxVertexOutputComponents() { - GLint& value = Context::current()->state().shader->maxVertexOutputComponents; + GLint& value = Context::current().state().shader->maxVertexOutputComponents; /* Get the value, if not already cached */ if(value == 0) { #ifndef MAGNUM_TARGET_GLES - if(Context::current()->isVersionSupported(Version::GL320)) + if(Context::current().isVersionSupported(Version::GL320)) glGetIntegerv(GL_MAX_VERTEX_OUTPUT_COMPONENTS, &value); else glGetIntegerv(GL_MAX_VARYING_COMPONENTS, &value); @@ -143,14 +143,14 @@ Int Shader::maxVertexOutputComponents() { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) Int Shader::maxTessellationControlInputComponents() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().shader->maxTessellationControlInputComponents; + GLint& value = Context::current().state().shader->maxTessellationControlInputComponents; /* Get the value, if not already cached */ if(value == 0) glGetIntegerv( @@ -166,14 +166,14 @@ Int Shader::maxTessellationControlInputComponents() { Int Shader::maxTessellationControlOutputComponents() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().shader->maxTessellationControlOutputComponents; + GLint& value = Context::current().state().shader->maxTessellationControlOutputComponents; /* Get the value, if not already cached */ if(value == 0) glGetIntegerv( @@ -189,14 +189,14 @@ Int Shader::maxTessellationControlOutputComponents() { Int Shader::maxTessellationControlTotalOutputComponents() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().shader->maxTessellationControlTotalOutputComponents; + GLint& value = Context::current().state().shader->maxTessellationControlTotalOutputComponents; /* Get the value, if not already cached */ if(value == 0) glGetIntegerv( @@ -212,14 +212,14 @@ Int Shader::maxTessellationControlTotalOutputComponents() { Int Shader::maxTessellationEvaluationInputComponents() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().shader->maxTessellationEvaluationInputComponents; + GLint& value = Context::current().state().shader->maxTessellationEvaluationInputComponents; /* Get the value, if not already cached */ if(value == 0) glGetIntegerv( @@ -235,14 +235,14 @@ Int Shader::maxTessellationEvaluationInputComponents() { Int Shader::maxTessellationEvaluationOutputComponents() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().shader->maxTessellationEvaluationOutputComponents; + GLint& value = Context::current().state().shader->maxTessellationEvaluationOutputComponents; /* Get the value, if not already cached */ if(value == 0) glGetIntegerv( @@ -258,14 +258,14 @@ Int Shader::maxTessellationEvaluationOutputComponents() { Int Shader::maxGeometryInputComponents() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().shader->maxGeometryInputComponents; + GLint& value = Context::current().state().shader->maxGeometryInputComponents; /* Get the value, if not already cached */ /** @todo The extension has only `GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB`, this is supported since GL 3.2 (wtf?) */ @@ -282,14 +282,14 @@ Int Shader::maxGeometryInputComponents() { Int Shader::maxGeometryOutputComponents() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().shader->maxGeometryOutputComponents; + GLint& value = Context::current().state().shader->maxGeometryOutputComponents; /* Get the value, if not already cached */ /** @todo The extension has only `GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB`, this is supported since GL 3.2 (wtf?) */ @@ -306,14 +306,14 @@ Int Shader::maxGeometryOutputComponents() { Int Shader::maxGeometryTotalOutputComponents() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().shader->maxGeometryTotalOutputComponents; + GLint& value = Context::current().state().shader->maxGeometryTotalOutputComponents; /* Get the value, if not already cached */ if(value == 0) glGetIntegerv( @@ -329,12 +329,12 @@ Int Shader::maxGeometryTotalOutputComponents() { #endif Int Shader::maxFragmentInputComponents() { - GLint& value = Context::current()->state().shader->maxFragmentInputComponents; + GLint& value = Context::current().state().shader->maxFragmentInputComponents; /* Get the value, if not already cached */ if(value == 0) { #ifndef MAGNUM_TARGET_GLES - if(Context::current()->isVersionSupported(Version::GL320)) + if(Context::current().isVersionSupported(Version::GL320)) glGetIntegerv(GL_MAX_FRAGMENT_INPUT_COMPONENTS, &value); else glGetIntegerv(GL_MAX_VARYING_COMPONENTS, &value); @@ -353,9 +353,9 @@ Int Shader::maxFragmentInputComponents() { Int Shader::maxAtomicCounterBuffers(const Type type) { if( #ifndef MAGNUM_TARGET_GLES - !Context::current()->isExtensionSupported() || + !Context::current().isExtensionSupported() || #else - !Context::current()->isVersionSupported(Version::GLES310) || + !Context::current().isVersionSupported(Version::GLES310) || #endif !isTypeSupported(type)) { @@ -363,7 +363,7 @@ Int Shader::maxAtomicCounterBuffers(const Type type) { } const UnsignedInt index = typeToIndex(type); - GLint& value = Context::current()->state().shader->maxAtomicCounterBuffers[index]; + GLint& value = Context::current().state().shader->maxAtomicCounterBuffers[index]; /* Get the value, if not already cached */ constexpr static GLenum what[] = { @@ -386,13 +386,13 @@ Int Shader::maxAtomicCounterBuffers(const Type type) { Int Shader::maxCombinedAtomicCounterBuffers() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return 0; - GLint& value = Context::current()->state().shader->maxCombinedAtomicCounterBuffers; + GLint& value = Context::current().state().shader->maxCombinedAtomicCounterBuffers; /* Get the value, if not already cached */ if(value == 0) @@ -404,9 +404,9 @@ Int Shader::maxCombinedAtomicCounterBuffers() { Int Shader::maxAtomicCounters(const Type type) { if( #ifndef MAGNUM_TARGET_GLES - !Context::current()->isExtensionSupported() || + !Context::current().isExtensionSupported() || #else - !Context::current()->isVersionSupported(Version::GLES310) || + !Context::current().isVersionSupported(Version::GLES310) || #endif !isTypeSupported(type)) { @@ -414,7 +414,7 @@ Int Shader::maxAtomicCounters(const Type type) { } const UnsignedInt index = typeToIndex(type); - GLint& value = Context::current()->state().shader->maxAtomicCounters[index]; + GLint& value = Context::current().state().shader->maxAtomicCounters[index]; /* Get the value, if not already cached */ constexpr static GLenum what[] = { @@ -437,13 +437,13 @@ Int Shader::maxAtomicCounters(const Type type) { Int Shader::maxCombinedAtomicCounters() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return 0; - GLint& value = Context::current()->state().shader->maxCombinedAtomicCounters; + GLint& value = Context::current().state().shader->maxCombinedAtomicCounters; /* Get the value, if not already cached */ if(value == 0) @@ -455,9 +455,9 @@ Int Shader::maxCombinedAtomicCounters() { Int Shader::maxImageUniforms(const Type type) { if( #ifndef MAGNUM_TARGET_GLES - !Context::current()->isExtensionSupported() || + !Context::current().isExtensionSupported() || #else - !Context::current()->isVersionSupported(Version::GLES310) || + !Context::current().isVersionSupported(Version::GLES310) || #endif !isTypeSupported(type)) { @@ -465,7 +465,7 @@ Int Shader::maxImageUniforms(const Type type) { } const UnsignedInt index = typeToIndex(type); - GLint& value = Context::current()->state().shader->maxImageUniforms[index]; + GLint& value = Context::current().state().shader->maxImageUniforms[index]; /* Get the value, if not already cached */ constexpr static GLenum what[] = { @@ -488,13 +488,13 @@ Int Shader::maxImageUniforms(const Type type) { Int Shader::maxCombinedImageUniforms() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return 0; - GLint& value = Context::current()->state().shader->maxCombinedImageUniforms; + GLint& value = Context::current().state().shader->maxCombinedImageUniforms; /* Get the value, if not already cached */ if(value == 0) @@ -506,9 +506,9 @@ Int Shader::maxCombinedImageUniforms() { Int Shader::maxShaderStorageBlocks(const Type type) { if( #ifndef MAGNUM_TARGET_GLES - !Context::current()->isExtensionSupported() || + !Context::current().isExtensionSupported() || #else - !Context::current()->isVersionSupported(Version::GLES310) || + !Context::current().isVersionSupported(Version::GLES310) || #endif !isTypeSupported(type)) { @@ -516,7 +516,7 @@ Int Shader::maxShaderStorageBlocks(const Type type) { } const UnsignedInt index = typeToIndex(type); - GLint& value = Context::current()->state().shader->maxShaderStorageBlocks[index]; + GLint& value = Context::current().state().shader->maxShaderStorageBlocks[index]; /* Get the value, if not already cached */ constexpr static GLenum what[] = { @@ -539,13 +539,13 @@ Int Shader::maxShaderStorageBlocks(const Type type) { Int Shader::maxCombinedShaderStorageBlocks() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) #endif return 0; - GLint& value = Context::current()->state().shader->maxCombinedShaderStorageBlocks; + GLint& value = Context::current().state().shader->maxCombinedShaderStorageBlocks; /* Get the value, if not already cached */ if(value == 0) @@ -560,7 +560,7 @@ Int Shader::maxTextureImageUnits(const Type type) { return 0; const UnsignedInt index = typeToIndex(type); - GLint& value = Context::current()->state().shader->maxTextureImageUnits[index]; + GLint& value = Context::current().state().shader->maxTextureImageUnits[index]; /* Get the value, if not already cached */ constexpr static GLenum what[] = { @@ -584,7 +584,7 @@ Int Shader::maxTextureImageUnits(const Type type) { } Int Shader::maxCombinedTextureImageUnits() { - GLint& value = Context::current()->state().shader->maxTextureImageUnitsCombined; + GLint& value = Context::current().state().shader->maxTextureImageUnitsCombined; /* Get the value, if not already cached */ if(value == 0) @@ -596,14 +596,14 @@ Int Shader::maxCombinedTextureImageUnits() { #ifndef MAGNUM_TARGET_GLES2 Int Shader::maxUniformBlocks(const Type type) { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported() || !isTypeSupported(type)) + if(!Context::current().isExtensionSupported() || !isTypeSupported(type)) #else if(!isTypeSupported(type)) #endif return 0; const UnsignedInt index = typeToIndex(type); - GLint& value = Context::current()->state().shader->maxUniformBlocks[index]; + GLint& value = Context::current().state().shader->maxUniformBlocks[index]; /* Get the value, if not already cached */ constexpr static GLenum what[] = { @@ -628,11 +628,11 @@ Int Shader::maxUniformBlocks(const Type type) { Int Shader::maxCombinedUniformBlocks() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().shader->maxCombinedUniformBlocks; + GLint& value = Context::current().state().shader->maxCombinedUniformBlocks; /* Get the value, if not already cached */ if(value == 0) @@ -647,7 +647,7 @@ Int Shader::maxUniformComponents(const Type type) { return 0; const UnsignedInt index = typeToIndex(type); - GLint& value = Context::current()->state().shader->maxUniformComponents[index]; + GLint& value = Context::current().state().shader->maxUniformComponents[index]; /* Get the value, if not already cached */ #ifndef MAGNUM_TARGET_GLES2 @@ -686,14 +686,14 @@ Int Shader::maxUniformComponents(const Type type) { #ifndef MAGNUM_TARGET_GLES2 Int Shader::maxCombinedUniformComponents(const Type type) { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported() || !isTypeSupported(type)) + if(!Context::current().isExtensionSupported() || !isTypeSupported(type)) #else if(!isTypeSupported(type)) #endif return 0; const UnsignedInt index = typeToIndex(type); - GLint& value = Context::current()->state().shader->maxCombinedUniformComponents[index]; + GLint& value = Context::current().state().shader->maxCombinedUniformComponents[index]; /* Get the value, if not already cached */ constexpr static GLenum what[] = { @@ -758,17 +758,17 @@ Shader::~Shader() { #ifndef MAGNUM_TARGET_WEBGL std::string Shader::label() const { #ifndef MAGNUM_TARGET_GLES - return Context::current()->state().debug->getLabelImplementation(GL_SHADER, _id); + return Context::current().state().debug->getLabelImplementation(GL_SHADER, _id); #else - return Context::current()->state().debug->getLabelImplementation(GL_SHADER_KHR, _id); + return Context::current().state().debug->getLabelImplementation(GL_SHADER_KHR, _id); #endif } Shader& Shader::setLabelInternal(const Containers::ArrayView label) { #ifndef MAGNUM_TARGET_GLES - Context::current()->state().debug->labelImplementation(GL_SHADER, _id, label); + Context::current().state().debug->labelImplementation(GL_SHADER, _id, label); #else - Context::current()->state().debug->labelImplementation(GL_SHADER_KHR, _id, label); + Context::current().state().debug->labelImplementation(GL_SHADER_KHR, _id, label); #endif return *this; } diff --git a/src/Magnum/Shaders/DistanceFieldVector.cpp b/src/Magnum/Shaders/DistanceFieldVector.cpp index 6459d5005..c45541ce2 100644 --- a/src/Magnum/Shaders/DistanceFieldVector.cpp +++ b/src/Magnum/Shaders/DistanceFieldVector.cpp @@ -50,9 +50,9 @@ template DistanceFieldVector::DistanceFieldV Utility::Resource rs("MagnumShaders"); #ifndef MAGNUM_TARGET_GLES - const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); + const Version version = Context::current().supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); #else - const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); + const Version version = Context::current().supportedVersion({Version::GLES300, Version::GLES200}); #endif Shader frag = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex); @@ -67,9 +67,9 @@ template DistanceFieldVector::DistanceFieldV AbstractShaderProgram::attachShaders({frag, vert}); #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported(version)) + if(!Context::current().isExtensionSupported(version)) #else - if(!Context::current()->isVersionSupported(Version::GLES300)) + if(!Context::current().isVersionSupported(Version::GLES300)) #endif { AbstractShaderProgram::bindAttributeLocation(AbstractVector::Position::Location, "position"); @@ -79,7 +79,7 @@ template DistanceFieldVector::DistanceFieldV CORRADE_INTERNAL_ASSERT_OUTPUT(AbstractShaderProgram::link()); #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported(version)) + if(!Context::current().isExtensionSupported(version)) #endif { transformationProjectionMatrixUniform = AbstractShaderProgram::uniformLocation("transformationProjectionMatrix"); @@ -90,7 +90,7 @@ template DistanceFieldVector::DistanceFieldV } #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported(version)) + if(!Context::current().isExtensionSupported(version)) #endif { AbstractShaderProgram::setUniform(AbstractShaderProgram::uniformLocation("vectorTexture"), diff --git a/src/Magnum/Shaders/Flat.cpp b/src/Magnum/Shaders/Flat.cpp index 5d62c9acf..0a791fa0e 100644 --- a/src/Magnum/Shaders/Flat.cpp +++ b/src/Magnum/Shaders/Flat.cpp @@ -53,9 +53,9 @@ template Flat::Flat(const Flags flags): tran Utility::Resource rs("MagnumShaders"); #ifndef MAGNUM_TARGET_GLES - const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); + const Version version = Context::current().supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); #else - const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); + const Version version = Context::current().supportedVersion({Version::GLES300, Version::GLES200}); #endif Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex); @@ -72,9 +72,9 @@ template Flat::Flat(const Flags flags): tran attachShaders({vert, frag}); #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported(version)) + if(!Context::current().isExtensionSupported(version)) #else - if(!Context::current()->isVersionSupported(Version::GLES300)) + if(!Context::current().isVersionSupported(Version::GLES300)) #endif { bindAttributeLocation(Position::Location, "position"); @@ -84,7 +84,7 @@ template Flat::Flat(const Flags flags): tran CORRADE_INTERNAL_ASSERT_OUTPUT(link()); #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported(version)) + if(!Context::current().isExtensionSupported(version)) #endif { transformationProjectionMatrixUniform = uniformLocation("transformationProjectionMatrix"); @@ -92,7 +92,7 @@ template Flat::Flat(const Flags flags): tran } #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported(version)) + if(!Context::current().isExtensionSupported(version)) #endif { if(flags & Flag::Textured) setUniform(uniformLocation("textureData"), TextureLayer); diff --git a/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h b/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h index 472f3a9c1..f6eaaad67 100644 --- a/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h +++ b/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h @@ -45,11 +45,11 @@ inline Shader createCompatibilityShader(const Utility::Resource& rs, Version ver Shader shader(version, type); #ifndef MAGNUM_TARGET_GLES - if(Context::current()->isExtensionDisabled(version)) + if(Context::current().isExtensionDisabled(version)) shader.addSource("#define DISABLE_GL_ARB_explicit_attrib_location\n"); - if(Context::current()->isExtensionDisabled(version)) + if(Context::current().isExtensionDisabled(version)) shader.addSource("#define DISABLE_GL_ARB_shading_language_420pack\n"); - if(Context::current()->isExtensionDisabled(version)) + if(Context::current().isExtensionDisabled(version)) shader.addSource("#define DISABLE_GL_ARB_explicit_uniform_location\n"); #endif diff --git a/src/Magnum/Shaders/MeshVisualizer.cpp b/src/Magnum/Shaders/MeshVisualizer.cpp index 431918bd8..8336daec7 100644 --- a/src/Magnum/Shaders/MeshVisualizer.cpp +++ b/src/Magnum/Shaders/MeshVisualizer.cpp @@ -59,13 +59,13 @@ MeshVisualizer::MeshVisualizer(const Flags flags): flags(flags), transformationP Utility::Resource rs("MagnumShaders"); #ifndef MAGNUM_TARGET_GLES - const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); + const Version version = Context::current().supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); CORRADE_INTERNAL_ASSERT(!flags || flags & Flag::NoGeometryShader || version >= Version::GL320); #elif !defined(MAGNUM_TARGET_WEBGL) - const Version version = Context::current()->supportedVersion({Version::GLES310, Version::GLES300, Version::GLES200}); + const Version version = Context::current().supportedVersion({Version::GLES310, Version::GLES300, Version::GLES200}); CORRADE_INTERNAL_ASSERT(!flags || flags & Flag::NoGeometryShader || version >= Version::GLES310); #else - const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); + const Version version = Context::current().supportedVersion({Version::GLES300, Version::GLES200}); #endif Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex); @@ -76,7 +76,7 @@ MeshVisualizer::MeshVisualizer(const Flags flags): flags(flags), transformationP #ifdef MAGNUM_TARGET_WEBGL .addSource("#define SUBSCRIPTING_WORKAROUND\n") #elif defined(MAGNUM_TARGET_GLES2) - .addSource(Context::current()->detectedDriver() & Context::DetectedDriver::ProbablyAngle ? + .addSource(Context::current()detectedDriver() & Context::DetectedDriver::ProbablyAngle ? "#define SUBSCRIPTING_WORKAROUND\n" : "") #endif .addSource(rs.get("generic.glsl")) @@ -105,16 +105,16 @@ MeshVisualizer::MeshVisualizer(const Flags flags): flags(flags), transformationP #endif #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported(version)) + if(!Context::current().isExtensionSupported(version)) #else - if(!Context::current()->isVersionSupported(Version::GLES300)) + if(!Context::current().isVersionSupported(Version::GLES300)) #endif { bindAttributeLocation(Position::Location, "position"); #if !defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_GLES2) #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isVersionSupported(Version::GL310)) + if(!Context::current().isVersionSupported(Version::GL310)) #endif { bindAttributeLocation(VertexIndex::Location, "vertexIndex"); @@ -125,7 +125,7 @@ MeshVisualizer::MeshVisualizer(const Flags flags): flags(flags), transformationP CORRADE_INTERNAL_ASSERT_OUTPUT(link()); #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported(version)) + if(!Context::current().isExtensionSupported(version)) #endif { transformationProjectionMatrixUniform = uniformLocation("transformationProjectionMatrix"); diff --git a/src/Magnum/Shaders/Phong.cpp b/src/Magnum/Shaders/Phong.cpp index 61aa8a37e..4e7519575 100644 --- a/src/Magnum/Shaders/Phong.cpp +++ b/src/Magnum/Shaders/Phong.cpp @@ -53,9 +53,9 @@ Phong::Phong(const Flags flags): transformationMatrixUniform(0), projectionMatri Utility::Resource rs("MagnumShaders"); #ifndef MAGNUM_TARGET_GLES - const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); + const Version version = Context::current().supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); #else - const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); + const Version version = Context::current().supportedVersion({Version::GLES300, Version::GLES200}); #endif Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex); @@ -74,9 +74,9 @@ Phong::Phong(const Flags flags): transformationMatrixUniform(0), projectionMatri attachShaders({vert, frag}); #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported(version)) + if(!Context::current().isExtensionSupported(version)) #else - if(!Context::current()->isVersionSupported(Version::GLES300)) + if(!Context::current().isVersionSupported(Version::GLES300)) #endif { bindAttributeLocation(Position::Location, "position"); @@ -87,7 +87,7 @@ Phong::Phong(const Flags flags): transformationMatrixUniform(0), projectionMatri CORRADE_INTERNAL_ASSERT_OUTPUT(link()); #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported(version)) + if(!Context::current().isExtensionSupported(version)) #endif { transformationMatrixUniform = uniformLocation("transformationMatrix"); @@ -102,7 +102,7 @@ Phong::Phong(const Flags flags): transformationMatrixUniform(0), projectionMatri } #ifndef MAGNUM_TARGET_GLES - if(flags && !Context::current()->isExtensionSupported(version)) + if(flags && !Context::current().isExtensionSupported(version)) #endif { if(flags & Flag::AmbientTexture) setUniform(uniformLocation("ambientTexture"), AmbientTextureLayer); diff --git a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp index 38ab4f6f7..3e2b355dc 100644 --- a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp +++ b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp @@ -56,15 +56,15 @@ void MeshVisualizerGLTest::compile() { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void MeshVisualizerGLTest::compileWireframeGeometryShader() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not supported")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not supported")); #endif #ifdef MAGNUM_TARGET_GLES - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) Debug() << "Using" << Extensions::GL::NV::shader_noperspective_interpolation::string(); #endif diff --git a/src/Magnum/Shaders/Vector.cpp b/src/Magnum/Shaders/Vector.cpp index 05e3c3d50..3acad1def 100644 --- a/src/Magnum/Shaders/Vector.cpp +++ b/src/Magnum/Shaders/Vector.cpp @@ -50,9 +50,9 @@ template Vector::Vector(): transformationPro Utility::Resource rs("MagnumShaders"); #ifndef MAGNUM_TARGET_GLES - const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); + const Version version = Context::current().supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); #else - const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); + const Version version = Context::current().supportedVersion({Version::GLES300, Version::GLES200}); #endif Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex); @@ -67,9 +67,9 @@ template Vector::Vector(): transformationPro AbstractShaderProgram::attachShaders({vert, frag}); #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported(version)) + if(!Context::current().isExtensionSupported(version)) #else - if(!Context::current()->isVersionSupported(Version::GLES300)) + if(!Context::current().isVersionSupported(Version::GLES300)) #endif { AbstractShaderProgram::bindAttributeLocation(AbstractVector::Position::Location, "position"); @@ -79,7 +79,7 @@ template Vector::Vector(): transformationPro CORRADE_INTERNAL_ASSERT_OUTPUT(AbstractShaderProgram::link()); #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported(version)) + if(!Context::current().isExtensionSupported(version)) #endif { transformationProjectionMatrixUniform = AbstractShaderProgram::uniformLocation("transformationProjectionMatrix"); @@ -88,7 +88,7 @@ template Vector::Vector(): transformationPro } #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported(version)) + if(!Context::current().isExtensionSupported(version)) #endif { AbstractShaderProgram::setUniform(AbstractShaderProgram::uniformLocation("vectorTexture"), AbstractVector::VectorTextureLayer); diff --git a/src/Magnum/Shaders/VertexColor.cpp b/src/Magnum/Shaders/VertexColor.cpp index 9183a3db5..d8dd0396b 100644 --- a/src/Magnum/Shaders/VertexColor.cpp +++ b/src/Magnum/Shaders/VertexColor.cpp @@ -50,9 +50,9 @@ template VertexColor::VertexColor(): transfo Utility::Resource rs("MagnumShaders"); #ifndef MAGNUM_TARGET_GLES - const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); + const Version version = Context::current().supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); #else - const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); + const Version version = Context::current().supportedVersion({Version::GLES300, Version::GLES200}); #endif Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex); @@ -67,9 +67,9 @@ template VertexColor::VertexColor(): transfo attachShaders({vert, frag}); #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported(version)) + if(!Context::current().isExtensionSupported(version)) #else - if(!Context::current()->isVersionSupported(Version::GLES300)) + if(!Context::current().isVersionSupported(Version::GLES300)) #endif { bindAttributeLocation(Position::Location, "position"); @@ -79,7 +79,7 @@ template VertexColor::VertexColor(): transfo CORRADE_INTERNAL_ASSERT_OUTPUT(link()); #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported(version)) + if(!Context::current().isExtensionSupported(version)) #endif { transformationProjectionMatrixUniform = uniformLocation("transformationProjectionMatrix"); diff --git a/src/Magnum/Test/AbstractObjectGLTest.cpp b/src/Magnum/Test/AbstractObjectGLTest.cpp index 1c1441b5a..0cece2beb 100644 --- a/src/Magnum/Test/AbstractObjectGLTest.cpp +++ b/src/Magnum/Test/AbstractObjectGLTest.cpp @@ -41,7 +41,7 @@ AbstractObjectGLTest::AbstractObjectGLTest() { } void AbstractObjectGLTest::labelNoOp() { - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is supported.")); Buffer buffer; diff --git a/src/Magnum/Test/AbstractOpenGLTester.h b/src/Magnum/Test/AbstractOpenGLTester.h index 25d255280..94be55706 100644 --- a/src/Magnum/Test/AbstractOpenGLTester.h +++ b/src/Magnum/Test/AbstractOpenGLTester.h @@ -76,7 +76,7 @@ AbstractOpenGLTester::AbstractOpenGLTester(): _windowlessApplication{*_windowles _windowlessApplication.createContext(); #endif - if(Context::current()->isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { Renderer::enable(Renderer::Feature::DebugOutput); Renderer::enable(Renderer::Feature::DebugOutputSynchronous); DebugOutput::setDefaultCallback(); diff --git a/src/Magnum/Test/AbstractQueryGLTest.cpp b/src/Magnum/Test/AbstractQueryGLTest.cpp index a4553b24a..2e9ad073b 100644 --- a/src/Magnum/Test/AbstractQueryGLTest.cpp +++ b/src/Magnum/Test/AbstractQueryGLTest.cpp @@ -48,7 +48,7 @@ AbstractQueryGLTest::AbstractQueryGLTest() { void AbstractQueryGLTest::construct() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not supported.")); #endif @@ -73,7 +73,7 @@ void AbstractQueryGLTest::constructCopy() { void AbstractQueryGLTest::constructMove() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not supported.")); #endif @@ -108,13 +108,13 @@ void AbstractQueryGLTest::constructMove() { void AbstractQueryGLTest::label() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not supported.")); #endif /* No-Op version is tested in AbstractObjectGLTest */ - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available"); #ifndef MAGNUM_TARGET_GLES @@ -124,7 +124,7 @@ void AbstractQueryGLTest::label() { #endif #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #endif { query.begin(); query.end(); diff --git a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp index 7c6a0b6b2..bda6908c2 100644 --- a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp @@ -125,8 +125,8 @@ void AbstractShaderProgramGLTest::constructMove() { void AbstractShaderProgramGLTest::label() { /* No-Op version is tested in AbstractObjectGLTest */ - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available"); DummyShader shader; diff --git a/src/Magnum/Test/AbstractTextureGLTest.cpp b/src/Magnum/Test/AbstractTextureGLTest.cpp index ed75c9907..88e031eb6 100644 --- a/src/Magnum/Test/AbstractTextureGLTest.cpp +++ b/src/Magnum/Test/AbstractTextureGLTest.cpp @@ -88,8 +88,8 @@ void AbstractTextureGLTest::constructMove() { void AbstractTextureGLTest::label() { /* No-Op version is tested in AbstractObjectGLTest */ - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available"); Texture2D texture; diff --git a/src/Magnum/Test/BufferGLTest.cpp b/src/Magnum/Test/BufferGLTest.cpp index c64b702cc..3a8da1ba2 100644 --- a/src/Magnum/Test/BufferGLTest.cpp +++ b/src/Magnum/Test/BufferGLTest.cpp @@ -158,8 +158,8 @@ void BufferGLTest::wrap() { void BufferGLTest::label() { /* No-Op version is tested in AbstractObjectGLTest */ - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available"); Buffer buffer; @@ -176,7 +176,7 @@ void BufferGLTest::label() { #ifndef MAGNUM_TARGET_GLES2 void BufferGLTest::bindBase() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::uniform_buffer_object::string() + std::string{" is not supported."}); #endif @@ -200,7 +200,7 @@ void BufferGLTest::bindBase() { void BufferGLTest::bindRange() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::uniform_buffer_object::string() + std::string{" is not supported."}); #endif @@ -286,7 +286,7 @@ void BufferGLTest::data() { void BufferGLTest::map() { #ifdef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::mapbuffer::string() + std::string(" is not supported")); #endif Buffer buffer; @@ -320,7 +320,7 @@ void BufferGLTest::map() { #ifdef CORRADE_TARGET_NACL void BufferGLTest::mapSub() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::CHROMIUM::map_sub::string() + std::string(" is not supported")); Buffer buffer; @@ -343,10 +343,10 @@ void BufferGLTest::mapSub() { void BufferGLTest::mapRange() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::map_buffer_range::string() + std::string(" is not supported")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::map_buffer_range::string() + std::string(" is not supported")); #endif @@ -374,10 +374,10 @@ void BufferGLTest::mapRange() { void BufferGLTest::mapRangeExplicitFlush() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::map_buffer_range::string() + std::string(" is not supported")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::map_buffer_range::string() + std::string(" is not supported")); #endif diff --git a/src/Magnum/Test/BufferTextureGLTest.cpp b/src/Magnum/Test/BufferTextureGLTest.cpp index 52b266b4a..16d7484a8 100644 --- a/src/Magnum/Test/BufferTextureGLTest.cpp +++ b/src/Magnum/Test/BufferTextureGLTest.cpp @@ -56,10 +56,10 @@ BufferTextureGLTest::BufferTextureGLTest() { void BufferTextureGLTest::construct() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_buffer::string() + std::string(" is not supported.")); #endif @@ -86,10 +86,10 @@ void BufferTextureGLTest::constructNoCreate() { void BufferTextureGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_buffer::string() + std::string(" is not supported.")); #endif @@ -109,10 +109,10 @@ void BufferTextureGLTest::wrap() { void BufferTextureGLTest::bind() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_buffer::string() + std::string(" is not supported.")); #endif @@ -136,10 +136,10 @@ void BufferTextureGLTest::bind() { void BufferTextureGLTest::setBuffer() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_buffer::string() + std::string(" is not supported.")); #endif @@ -157,12 +157,12 @@ void BufferTextureGLTest::setBuffer() { void BufferTextureGLTest::setBufferOffset() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_range::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_buffer::string() + std::string(" is not supported.")); #endif diff --git a/src/Magnum/Test/ContextGLTest.cpp b/src/Magnum/Test/ContextGLTest.cpp index 650bd42db..abb025023 100644 --- a/src/Magnum/Test/ContextGLTest.cpp +++ b/src/Magnum/Test/ContextGLTest.cpp @@ -60,10 +60,10 @@ void ContextGLTest::constructCopyMove() { } void ContextGLTest::isVersionSupported() { - const Version v = Context::current()->version(); - CORRADE_VERIFY(Context::current()->isVersionSupported(v)); - CORRADE_VERIFY(Context::current()->isVersionSupported(Version(Int(v)-1))); - CORRADE_VERIFY(!Context::current()->isVersionSupported(Version(Int(v)+1))); + const Version v = Context::current().version(); + CORRADE_VERIFY(Context::current().isVersionSupported(v)); + CORRADE_VERIFY(Context::current().isVersionSupported(Version(Int(v)-1))); + CORRADE_VERIFY(!Context::current().isVersionSupported(Version(Int(v)+1))); /* No assertions should be fired */ MAGNUM_ASSERT_VERSION_SUPPORTED(v); @@ -71,34 +71,34 @@ void ContextGLTest::isVersionSupported() { } void ContextGLTest::supportedVersion() { - const Version v = Context::current()->version(); + const Version v = Context::current().version(); /* Selects first supported version (thus not necessarily the highest) */ - CORRADE_VERIFY(Context::current()->supportedVersion({Version(Int(v)+1), v, Version(Int(v)-1)}) == v); - CORRADE_VERIFY(Context::current()->supportedVersion({Version(Int(v)+1), Version(Int(v)-1), v}) == Version(Int(v)-1)); + CORRADE_VERIFY(Context::current().supportedVersion({Version(Int(v)+1), v, Version(Int(v)-1)}) == v); + CORRADE_VERIFY(Context::current().supportedVersion({Version(Int(v)+1), Version(Int(v)-1), v}) == Version(Int(v)-1)); } void ContextGLTest::isExtensionSupported() { #ifndef MAGNUM_TARGET_GLES - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::GREMEDY::string_marker::string() + std::string(" extension should not be supported, can't test")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_filter_anisotropic::string() + std::string(" extension should be supported, can't test")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::explicit_attrib_location::string() + std::string(" extension should be supported, can't test")); /* Test that we have proper extension list parser */ - std::vector extensions = Context::current()->extensionStrings(); + std::vector extensions = Context::current().extensionStrings(); CORRADE_VERIFY(std::find(extensions.begin(), extensions.end(), Extensions::GL::EXT::texture_filter_anisotropic::string()) != extensions.end()); CORRADE_VERIFY(std::find(extensions.begin(), extensions.end(), Extensions::GL::GREMEDY::string_marker::string()) == extensions.end()); /* This is disabled in GL < 3.2 to work around GLSL compiler bugs */ - CORRADE_VERIFY(!Context::current()->isExtensionSupported(Version::GL310)); - CORRADE_VERIFY(Context::current()->isExtensionSupported(Version::GL320)); + CORRADE_VERIFY(!Context::current().isExtensionSupported(Version::GL310)); + CORRADE_VERIFY(Context::current().isExtensionSupported(Version::GL320)); #else CORRADE_SKIP("No useful extensions to test on OpenGL ES"); #endif @@ -106,18 +106,18 @@ void ContextGLTest::isExtensionSupported() { void ContextGLTest::isExtensionDisabled() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::vertex_array_object::string() + std::string(" extension should be supported, can't test")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::explicit_attrib_location::string() + std::string(" extension should be supported, can't test")); /* This is not disabled anywhere */ - CORRADE_VERIFY(!Context::current()->isExtensionDisabled()); + CORRADE_VERIFY(!Context::current().isExtensionDisabled()); /* This is disabled in GL < 3.2 to work around GLSL compiler bugs */ - CORRADE_VERIFY(Context::current()->isExtensionDisabled(Version::GL310)); - CORRADE_VERIFY(!Context::current()->isExtensionDisabled(Version::GL320)); + CORRADE_VERIFY(Context::current().isExtensionDisabled(Version::GL310)); + CORRADE_VERIFY(!Context::current().isExtensionDisabled(Version::GL320)); #else CORRADE_SKIP("No useful extensions to test on OpenGL ES"); #endif diff --git a/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp b/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp index 984ee06ee..a79ecf784 100644 --- a/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp @@ -122,7 +122,7 @@ CubeMapTextureArrayGLTest::CubeMapTextureArrayGLTest() { &CubeMapTextureArrayGLTest::invalidateSubImage}); #ifndef MAGNUM_TARGET_GLES - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) { _compressedDataStorage = _compressedSubDataStorage = CompressedPixelStorage{} .setCompressedBlockSize({4, 4, 1}) @@ -148,10 +148,10 @@ namespace { void CubeMapTextureArrayGLTest::construct() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif @@ -178,10 +178,10 @@ void CubeMapTextureArrayGLTest::constructNoCreate() { void CubeMapTextureArrayGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif @@ -201,10 +201,10 @@ void CubeMapTextureArrayGLTest::wrap() { void CubeMapTextureArrayGLTest::bind() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif @@ -228,10 +228,10 @@ void CubeMapTextureArrayGLTest::bind() { void CubeMapTextureArrayGLTest::sampling() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif @@ -260,13 +260,13 @@ void CubeMapTextureArrayGLTest::sampling() { void CubeMapTextureArrayGLTest::samplingSRGBDecode() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); CubeMapTextureArray texture; @@ -277,14 +277,14 @@ void CubeMapTextureArrayGLTest::samplingSRGBDecode() { void CubeMapTextureArrayGLTest::samplingBorderInteger() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported.")); #endif @@ -300,12 +300,12 @@ void CubeMapTextureArrayGLTest::samplingBorderInteger() { void CubeMapTextureArrayGLTest::samplingSwizzle() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif @@ -317,12 +317,12 @@ void CubeMapTextureArrayGLTest::samplingSwizzle() { void CubeMapTextureArrayGLTest::samplingDepthStencilMode() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif @@ -334,9 +334,9 @@ void CubeMapTextureArrayGLTest::samplingDepthStencilMode() { #ifdef MAGNUM_TARGET_GLES void CubeMapTextureArrayGLTest::samplingBorder() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported.")); CubeMapTextureArray texture; @@ -349,10 +349,10 @@ void CubeMapTextureArrayGLTest::samplingBorder() { void CubeMapTextureArrayGLTest::storage() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif @@ -416,10 +416,10 @@ namespace { void CubeMapTextureArrayGLTest::image() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif @@ -444,13 +444,13 @@ void CubeMapTextureArrayGLTest::image() { void CubeMapTextureArrayGLTest::compressedImage() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); CubeMapTextureArray texture; @@ -476,10 +476,10 @@ void CubeMapTextureArrayGLTest::compressedImage() { void CubeMapTextureArrayGLTest::imageBuffer() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif @@ -504,13 +504,13 @@ void CubeMapTextureArrayGLTest::imageBuffer() { void CubeMapTextureArrayGLTest::compressedImageBuffer() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); CubeMapTextureArray texture; @@ -666,10 +666,10 @@ namespace { void CubeMapTextureArrayGLTest::subImage() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif @@ -696,20 +696,20 @@ void CubeMapTextureArrayGLTest::subImage() { void CubeMapTextureArrayGLTest::compressedSubImage() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #ifndef MAGNUM_TARGET_GLES /* Compressed pixel storage for array textures is underspecified. If the extension is supported, first test with default values to ensure we are not that far off, then continue as usual */ - if(Context::current()->isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { CubeMapTextureArray texture; texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 12, 6}, CompressedZero}); @@ -747,7 +747,7 @@ void CubeMapTextureArrayGLTest::compressedSubImage() { CORRADE_COMPARE(image.size(), (Vector3i{12, 12, 6})); { - CORRADE_EXPECT_FAIL_IF(Context::current()->isExtensionSupported() && (Context::current()->detectedDriver() & Context::DetectedDriver::NVidia), + CORRADE_EXPECT_FAIL_IF(Context::current().isExtensionSupported() && (Context::current().detectedDriver() & Context::DetectedDriver::NVidia), "Non-default compressed pixel storage for cube map textures behaves weirdly on NVidia for client-memory images"); CORRADE_COMPARE_AS( @@ -759,10 +759,10 @@ void CubeMapTextureArrayGLTest::compressedSubImage() { void CubeMapTextureArrayGLTest::subImageBuffer() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif @@ -788,13 +788,13 @@ void CubeMapTextureArrayGLTest::subImageBuffer() { void CubeMapTextureArrayGLTest::compressedSubImageBuffer() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); CubeMapTextureArray texture; @@ -822,9 +822,9 @@ void CubeMapTextureArrayGLTest::compressedSubImageBuffer() { #ifndef MAGNUM_TARGET_GLES void CubeMapTextureArrayGLTest::subImageQuery() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); CubeMapTextureArray texture; @@ -845,9 +845,9 @@ void CubeMapTextureArrayGLTest::subImageQuery() { } void CubeMapTextureArrayGLTest::compressedSubImageQuery() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); CubeMapTextureArray texture; @@ -858,7 +858,7 @@ void CubeMapTextureArrayGLTest::compressedSubImageQuery() { /* Test also without compressed pixel storage to ensure that both size computations work */ - if(Context::current()->isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 1}, Vector3i{4}), {}); MAGNUM_VERIFY_NO_ERROR(); @@ -880,9 +880,9 @@ void CubeMapTextureArrayGLTest::compressedSubImageQuery() { } void CubeMapTextureArrayGLTest::subImageQueryBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); CubeMapTextureArray texture; @@ -903,9 +903,9 @@ void CubeMapTextureArrayGLTest::subImageQueryBuffer() { } void CubeMapTextureArrayGLTest::compressedSubImageQueryBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); CubeMapTextureArray texture; @@ -916,7 +916,7 @@ void CubeMapTextureArrayGLTest::compressedSubImageQueryBuffer() { /* Test also without compressed pixel storage to ensure that both size computations work */ - if(Context::current()->isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 1}, Vector3i{4}), {}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); @@ -938,12 +938,12 @@ void CubeMapTextureArrayGLTest::compressedSubImageQueryBuffer() { void CubeMapTextureArrayGLTest::generateMipmap() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif @@ -970,10 +970,10 @@ void CubeMapTextureArrayGLTest::generateMipmap() { void CubeMapTextureArrayGLTest::invalidateImage() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif @@ -986,10 +986,10 @@ void CubeMapTextureArrayGLTest::invalidateImage() { void CubeMapTextureArrayGLTest::invalidateSubImage() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif diff --git a/src/Magnum/Test/CubeMapTextureGLTest.cpp b/src/Magnum/Test/CubeMapTextureGLTest.cpp index a1600dd4a..6b3b68fac 100644 --- a/src/Magnum/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureGLTest.cpp @@ -173,7 +173,7 @@ CubeMapTextureGLTest::CubeMapTextureGLTest() { _dataOffset = 8; #ifdef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #endif { _dataStorage = {}; @@ -182,7 +182,7 @@ CubeMapTextureGLTest::CubeMapTextureGLTest() { #endif #ifndef MAGNUM_TARGET_GLES - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) { _compressedDataStorage = CompressedPixelStorage{} .setCompressedBlockSize({4, 4, 1}) @@ -299,10 +299,10 @@ void CubeMapTextureGLTest::sampling() { void CubeMapTextureGLTest::samplingSRGBDecode() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::sRGB::string() + std::string(" is not supported.")); #endif - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); CubeMapTexture texture; @@ -314,7 +314,7 @@ void CubeMapTextureGLTest::samplingSRGBDecode() { #ifndef MAGNUM_TARGET_GLES2 void CubeMapTextureGLTest::samplingSwizzle() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported.")); #endif @@ -325,7 +325,7 @@ void CubeMapTextureGLTest::samplingSwizzle() { } #else void CubeMapTextureGLTest::samplingMaxLevel() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::APPLE::texture_max_level::string() + std::string(" is not supported.")); CubeMapTexture texture; @@ -335,8 +335,8 @@ void CubeMapTextureGLTest::samplingMaxLevel() { } void CubeMapTextureGLTest::samplingCompare() { - if(!Context::current()->isExtensionSupported() || - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() || + !Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::NV::shadow_samplers_cube::string() + std::string(" is not supported.")); CubeMapTexture texture; @@ -350,10 +350,10 @@ void CubeMapTextureGLTest::samplingCompare() { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void CubeMapTextureGLTest::samplingBorderInteger() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported.")); #endif @@ -371,10 +371,10 @@ void CubeMapTextureGLTest::samplingBorderInteger() { #ifndef MAGNUM_TARGET_GLES2 void CubeMapTextureGLTest::samplingDepthStencilMode() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported.")); #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 not supported."); #endif @@ -387,8 +387,8 @@ void CubeMapTextureGLTest::samplingDepthStencilMode() { #ifdef MAGNUM_TARGET_GLES void CubeMapTextureGLTest::samplingBorder() { - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("No required extension is supported."); CubeMapTexture texture; @@ -407,7 +407,7 @@ void CubeMapTextureGLTest::storage() { #ifndef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 not supported, skipping image size testing"); #endif @@ -459,10 +459,10 @@ void CubeMapTextureGLTest::image() { void CubeMapTextureGLTest::compressedImage() { #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif @@ -518,10 +518,10 @@ void CubeMapTextureGLTest::imageBuffer() { void CubeMapTextureGLTest::compressedImageBuffer() { #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif @@ -557,13 +557,13 @@ void CubeMapTextureGLTest::compressedImageBuffer() { void CubeMapTextureGLTest::immutableCompressedImage() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_storage::string() + std::string(" is not supported.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_storage::string() + std::string(" is not supported.")); #endif - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); /* Testing that GL_TEXTURE_COMPRESSED_IMAGE_SIZE is consistent and returns @@ -657,7 +657,7 @@ namespace { } void CubeMapTextureGLTest::fullImageQuery() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); CubeMapTexture texture; @@ -678,9 +678,9 @@ void CubeMapTextureGLTest::fullImageQuery() { } void CubeMapTextureGLTest::compressedFullImageQuery() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); CubeMapTexture texture; @@ -700,7 +700,7 @@ void CubeMapTextureGLTest::compressedFullImageQuery() { } void CubeMapTextureGLTest::fullImageQueryBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); CubeMapTexture texture; @@ -721,9 +721,9 @@ void CubeMapTextureGLTest::fullImageQueryBuffer() { } void CubeMapTextureGLTest::compressedFullImageQueryBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); CubeMapTexture texture; @@ -815,10 +815,10 @@ void CubeMapTextureGLTest::subImage() { void CubeMapTextureGLTest::compressedSubImage() { #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif @@ -826,7 +826,7 @@ void CubeMapTextureGLTest::compressedSubImage() { /* Compressed pixel storage for array textures is underspecified. If the extension is supported, first test with default values to ensure we are not that far off, then continue as usual */ - if(Context::current()->isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { CubeMapTexture texture; texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveX, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); @@ -885,7 +885,7 @@ void CubeMapTextureGLTest::compressedSubImage() { CORRADE_COMPARE(image.size(), Vector2i{12}); { - CORRADE_EXPECT_FAIL_IF(Context::current()->isExtensionSupported() && Context::current()->isExtensionSupported() && (Context::current()->detectedDriver() & Context::DetectedDriver::NVidia), + CORRADE_EXPECT_FAIL_IF(Context::current().isExtensionSupported() && Context::current().isExtensionSupported() && (Context::current().detectedDriver() & Context::DetectedDriver::NVidia), "Non-default compressed pixel storage for cube map textures behaves weirdly on NVidia for client-memory images when using ARB_direct_state_access"); CORRADE_COMPARE_AS( @@ -929,10 +929,10 @@ void CubeMapTextureGLTest::subImageBuffer() { void CubeMapTextureGLTest::compressedSubImageBuffer() { #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif @@ -972,10 +972,10 @@ void CubeMapTextureGLTest::compressedSubImageBuffer() { #ifndef MAGNUM_TARGET_GLES void CubeMapTextureGLTest::subImageQuery() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); /* I'm too lazy to call setSubImage() six times */ - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); CubeMapTexture texture; @@ -996,12 +996,12 @@ void CubeMapTextureGLTest::subImageQuery() { } void CubeMapTextureGLTest::compressedSubImageQuery() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); /* I'm too lazy to call setSubImage() six times */ - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); CubeMapTexture texture; @@ -1012,7 +1012,7 @@ void CubeMapTextureGLTest::compressedSubImageQuery() { /* Test also without compressed pixel storage to ensure that both size computations work */ - if(Context::current()->isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 0}, {4, 4, 1}), {}); MAGNUM_VERIFY_NO_ERROR(); @@ -1034,10 +1034,10 @@ void CubeMapTextureGLTest::compressedSubImageQuery() { } void CubeMapTextureGLTest::subImageQueryBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); /* I'm too lazy to call setSubImage() six times */ - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); CubeMapTexture texture; @@ -1057,12 +1057,12 @@ void CubeMapTextureGLTest::subImageQueryBuffer() { } void CubeMapTextureGLTest::compressedSubImageQueryBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); /* I'm too lazy to call setSubImage() six times */ - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); CubeMapTexture texture; @@ -1073,7 +1073,7 @@ void CubeMapTextureGLTest::compressedSubImageQueryBuffer() { /* Test also without compressed pixel storage to ensure that both size computations work */ - if(Context::current()->isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 0}, {4, 4, 1}), {}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); diff --git a/src/Magnum/Test/DebugOutputGLTest.cpp b/src/Magnum/Test/DebugOutputGLTest.cpp index 370db947d..2aa8fd2be 100644 --- a/src/Magnum/Test/DebugOutputGLTest.cpp +++ b/src/Magnum/Test/DebugOutputGLTest.cpp @@ -61,7 +61,7 @@ DebugOutputGLTest::DebugOutputGLTest() { } void DebugOutputGLTest::setCallback() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is not supported")); /* Need to be careful, because the test runner is using debug output too */ @@ -71,7 +71,7 @@ void DebugOutputGLTest::setCallback() { } void DebugOutputGLTest::setEnabled() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is not supported")); /* Try at least some combinations */ @@ -83,10 +83,10 @@ void DebugOutputGLTest::setEnabled() { } void DebugOutputGLTest::messageNoOp() { - if(Context::current()->isExtensionSupported() || - Context::current()->isExtensionSupported() + if(Context::current().isExtensionSupported() || + Context::current().isExtensionSupported() #ifndef MAGNUM_TARGET_GLES - || Context::current()->isExtensionSupported() + || Context::current().isExtensionSupported() #endif ) CORRADE_SKIP("The extensions are supported, cannot test."); @@ -98,7 +98,7 @@ void DebugOutputGLTest::messageNoOp() { } void DebugOutputGLTest::message() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is not supported")); /* Need to be careful, because the test runner is using debug output too */ @@ -113,10 +113,10 @@ void DebugOutputGLTest::message() { } void DebugOutputGLTest::messageFallback() { - if(Context::current()->isExtensionSupported() || - (!Context::current()->isExtensionSupported() + if(Context::current().isExtensionSupported() || + (!Context::current().isExtensionSupported() #ifndef MAGNUM_TARGET_GLES - && !Context::current()->isExtensionSupported() + && !Context::current().isExtensionSupported() #endif )) CORRADE_SKIP("No proper extension is supported"); @@ -128,8 +128,8 @@ void DebugOutputGLTest::messageFallback() { } void DebugOutputGLTest::groupNoOp() { - if(Context::current()->isExtensionSupported() || - Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported() || + Context::current().isExtensionSupported()) CORRADE_SKIP("The extensions are supported, cannot test."); { @@ -140,7 +140,7 @@ void DebugOutputGLTest::groupNoOp() { } void DebugOutputGLTest::group() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is not supported")); /* Need to be careful, because the test runner is using debug output too */ @@ -162,8 +162,8 @@ void DebugOutputGLTest::group() { } void DebugOutputGLTest::groupFallback() { - if(Context::current()->isExtensionSupported() || - !Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported() || + !Context::current().isExtensionSupported()) CORRADE_SKIP("No proper extension is supported"); { diff --git a/src/Magnum/Test/FramebufferGLTest.cpp b/src/Magnum/Test/FramebufferGLTest.cpp index 820d9e894..c8cd7b7a1 100644 --- a/src/Magnum/Test/FramebufferGLTest.cpp +++ b/src/Magnum/Test/FramebufferGLTest.cpp @@ -177,7 +177,7 @@ FramebufferGLTest::FramebufferGLTest() { &FramebufferGLTest::blit}); #ifdef MAGNUM_TARGET_GLES2 - if(Context::current()->isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { rgbaFormatES2 = TextureFormat::RGBA8; depthStencilFormatES2 = TextureFormat::Depth24Stencil8; } else { @@ -189,7 +189,7 @@ FramebufferGLTest::FramebufferGLTest() { void FramebufferGLTest::construct() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif @@ -222,7 +222,7 @@ void FramebufferGLTest::constructCopy() { void FramebufferGLTest::constructMove() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif @@ -251,7 +251,7 @@ void FramebufferGLTest::constructMove() { void FramebufferGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif @@ -271,13 +271,13 @@ void FramebufferGLTest::wrap() { void FramebufferGLTest::label() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif /* No-Op version is tested in AbstractObjectGLTest */ - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available"); Framebuffer framebuffer({{}, Vector2i(32)}); @@ -293,7 +293,7 @@ void FramebufferGLTest::label() { void FramebufferGLTest::attachRenderbuffer() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif @@ -308,7 +308,7 @@ void FramebufferGLTest::attachRenderbuffer() { on my NVidia, thus we need to do this juggling with one renderbuffer */ Renderbuffer depthStencil; #ifdef MAGNUM_TARGET_GLES2 - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #ifdef MAGNUM_TARGET_GLES2 @@ -325,7 +325,7 @@ void FramebufferGLTest::attachRenderbuffer() { .attachRenderbuffer(Framebuffer::BufferAttachment::Depth, depthStencil); #ifdef MAGNUM_TARGET_GLES2 - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { framebuffer.attachRenderbuffer(Framebuffer::BufferAttachment::Stencil, depthStencil); @@ -338,11 +338,11 @@ void FramebufferGLTest::attachRenderbuffer() { void FramebufferGLTest::attachRenderbufferMultisample() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available."); #endif @@ -376,7 +376,7 @@ void FramebufferGLTest::attachRenderbufferMultisample() { #ifndef MAGNUM_TARGET_GLES void FramebufferGLTest::attachTexture1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); Texture1D color; @@ -397,7 +397,7 @@ void FramebufferGLTest::attachTexture1D() { void FramebufferGLTest::attachTexture2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif @@ -421,7 +421,7 @@ void FramebufferGLTest::attachTexture2D() { MAGNUM_VERIFY_NO_ERROR(); #ifdef MAGNUM_TARGET_GLES2 - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #ifdef MAGNUM_TARGET_GLES2 @@ -441,7 +441,7 @@ void FramebufferGLTest::attachTexture2D() { } #ifdef MAGNUM_TARGET_GLES2 - else if(Context::current()->isExtensionSupported()) { + else if(Context::current().isExtensionSupported()) { Debug() << "Using" << Extensions::GL::OES::depth_texture::string(); Texture2D depth; @@ -457,10 +457,10 @@ void FramebufferGLTest::attachTexture2D() { void FramebufferGLTest::attachTexture3D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not available.")); #endif @@ -481,7 +481,7 @@ void FramebufferGLTest::attachTexture3D() { #ifndef MAGNUM_TARGET_GLES void FramebufferGLTest::attachTexture1DArray() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); Texture1DArray color; @@ -503,9 +503,9 @@ void FramebufferGLTest::attachTexture1DArray() { #ifndef MAGNUM_TARGET_GLES2 void FramebufferGLTest::attachTexture2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not available.")); #endif @@ -528,12 +528,12 @@ void FramebufferGLTest::attachTexture2DArray() { #ifndef MAGNUM_TARGET_GLES2 void FramebufferGLTest::attachTexture2DMultisample() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not available.")); #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); #endif @@ -556,12 +556,12 @@ void FramebufferGLTest::attachTexture2DMultisample() { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void FramebufferGLTest::attachTexture2DMultisampleArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not available.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not available.")); #endif @@ -583,9 +583,9 @@ void FramebufferGLTest::attachTexture2DMultisampleArray() { #ifndef MAGNUM_TARGET_GLES void FramebufferGLTest::attachRectangleTexture() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not available.")); RectangleTexture color; @@ -606,7 +606,7 @@ void FramebufferGLTest::attachRectangleTexture() { void FramebufferGLTest::attachCubeMapTexture() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif @@ -623,7 +623,7 @@ void FramebufferGLTest::attachCubeMapTexture() { CubeMapTexture depthStencil; #ifdef MAGNUM_TARGET_GLES2 - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #ifdef MAGNUM_TARGET_GLES2 @@ -641,7 +641,7 @@ void FramebufferGLTest::attachCubeMapTexture() { } #ifdef MAGNUM_TARGET_GLES2 - else if(Context::current()->isExtensionSupported()) { + else if(Context::current().isExtensionSupported()) { Debug() << "Using" << Extensions::GL::OES::depth_texture::string(); depthStencil.setStorage(1, TextureFormat::DepthComponent16, Vector2i(128)); @@ -657,12 +657,12 @@ void FramebufferGLTest::attachCubeMapTexture() { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void FramebufferGLTest::attachCubeMapTextureArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not available.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not available.")); #endif @@ -685,12 +685,12 @@ void FramebufferGLTest::attachCubeMapTextureArray() { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void FramebufferGLTest::attachLayeredTexture3D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not available.")); #endif @@ -707,9 +707,9 @@ void FramebufferGLTest::attachLayeredTexture3D() { #ifndef MAGNUM_TARGET_GLES void FramebufferGLTest::attachLayeredTexture1DArray() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available.")); Texture1DArray color; @@ -730,12 +730,12 @@ void FramebufferGLTest::attachLayeredTexture1DArray() { void FramebufferGLTest::attachLayeredTexture2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not available.")); #endif @@ -756,12 +756,12 @@ void FramebufferGLTest::attachLayeredTexture2DArray() { void FramebufferGLTest::attachLayeredCubeMapTexture() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not available.")); #endif @@ -782,16 +782,16 @@ void FramebufferGLTest::attachLayeredCubeMapTexture() { void FramebufferGLTest::attachLayeredCubeMapTextureArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not available.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not available.")); #endif @@ -812,16 +812,16 @@ void FramebufferGLTest::attachLayeredCubeMapTextureArray() { void FramebufferGLTest::attachLayeredTexture2DMultisampleArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not available.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not available.")); #endif @@ -843,7 +843,7 @@ void FramebufferGLTest::attachLayeredTexture2DMultisampleArray() { void FramebufferGLTest::detach() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif @@ -857,11 +857,11 @@ void FramebufferGLTest::detach() { void FramebufferGLTest::multipleColorOutputs() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("No required extension available."); #endif @@ -890,7 +890,7 @@ void FramebufferGLTest::multipleColorOutputs() { {1, Framebuffer::ColorAttachment(0)}}); #ifdef MAGNUM_TARGET_GLES2 - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #ifdef MAGNUM_TARGET_GLES2 @@ -906,7 +906,7 @@ void FramebufferGLTest::multipleColorOutputs() { void FramebufferGLTest::clear() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif @@ -921,7 +921,7 @@ void FramebufferGLTest::clear() { on my NVidia, thus we need to do this juggling with one renderbuffer */ Renderbuffer depthStencil; #ifdef MAGNUM_TARGET_GLES2 - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #ifdef MAGNUM_TARGET_GLES2 @@ -938,7 +938,7 @@ void FramebufferGLTest::clear() { .attachRenderbuffer(Framebuffer::BufferAttachment::Depth, depthStencil); #ifdef MAGNUM_TARGET_GLES2 - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { framebuffer.attachRenderbuffer(Framebuffer::BufferAttachment::Stencil, depthStencil); @@ -954,7 +954,7 @@ void FramebufferGLTest::clear() { void FramebufferGLTest::invalidate() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif @@ -982,7 +982,7 @@ void FramebufferGLTest::invalidate() { #ifndef MAGNUM_TARGET_GLES2 void FramebufferGLTest::invalidateSub() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif @@ -1014,7 +1014,7 @@ namespace { void FramebufferGLTest::read() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif @@ -1029,7 +1029,7 @@ void FramebufferGLTest::read() { on my NVidia, thus we need to do this juggling with one renderbuffer */ Renderbuffer depthStencil; #ifdef MAGNUM_TARGET_GLES2 - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #ifdef MAGNUM_TARGET_GLES2 @@ -1046,7 +1046,7 @@ void FramebufferGLTest::read() { .attachRenderbuffer(Framebuffer::BufferAttachment::Depth, depthStencil); #ifdef MAGNUM_TARGET_GLES2 - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { framebuffer.attachRenderbuffer(Framebuffer::BufferAttachment::Stencil, depthStencil); @@ -1070,7 +1070,7 @@ void FramebufferGLTest::read() { CORRADE_COMPARE(colorImage.data()[DataOffset], Color4ub(128, 64, 32, 17)); #ifdef MAGNUM_TARGET_GLES - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #ifdef MAGNUM_TARGET_GLES @@ -1084,7 +1084,7 @@ void FramebufferGLTest::read() { } #ifdef MAGNUM_TARGET_GLES - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #ifdef MAGNUM_TARGET_GLES @@ -1098,7 +1098,7 @@ void FramebufferGLTest::read() { } #ifdef MAGNUM_TARGET_GLES - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #ifdef MAGNUM_TARGET_GLES @@ -1117,7 +1117,7 @@ void FramebufferGLTest::read() { #ifndef MAGNUM_TARGET_GLES2 void FramebufferGLTest::readBuffer() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif @@ -1156,11 +1156,11 @@ void FramebufferGLTest::readBuffer() { void FramebufferGLTest::blit() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available."); #endif diff --git a/src/Magnum/Test/MeshGLTest.cpp b/src/Magnum/Test/MeshGLTest.cpp index 8c55275d9..1c1513481 100644 --- a/src/Magnum/Test/MeshGLTest.cpp +++ b/src/Magnum/Test/MeshGLTest.cpp @@ -237,9 +237,9 @@ void MeshGLTest::construct() { MAGNUM_VERIFY_NO_ERROR(); #ifndef MAGNUM_TARGET_GLES - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #elif defined(MAGNUM_TARGET_GLES2) - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { CORRADE_VERIFY(mesh.id() > 0); @@ -272,9 +272,9 @@ void MeshGLTest::constructMove() { MAGNUM_VERIFY_NO_ERROR(); #ifndef MAGNUM_TARGET_GLES - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #elif defined(MAGNUM_TARGET_GLES2) - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { CORRADE_VERIFY(id > 0); @@ -292,9 +292,9 @@ void MeshGLTest::constructMove() { MAGNUM_VERIFY_NO_ERROR(); #ifndef MAGNUM_TARGET_GLES - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #elif defined(MAGNUM_TARGET_GLES2) - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { CORRADE_VERIFY(cId > 0); @@ -306,10 +306,10 @@ void MeshGLTest::constructMove() { void MeshGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::vertex_array_object::string() + std::string{" is not supported."}); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::vertex_array_object::string() + std::string{" is not supported."}); #endif @@ -337,8 +337,8 @@ void MeshGLTest::wrap() { void MeshGLTest::label() { /* No-Op version is tested in AbstractObjectGLTest */ - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available"); Mesh mesh; @@ -514,7 +514,7 @@ template T Checker::get(PixelFormat format, PixelType type) { #ifndef MAGNUM_TARGET_GLES2 void MeshGLTest::addVertexBufferUnsignedInt() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available.")); #endif @@ -539,7 +539,7 @@ void MeshGLTest::addVertexBufferUnsignedInt() { void MeshGLTest::addVertexBufferInt() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available.")); #endif @@ -590,7 +590,7 @@ void MeshGLTest::addVertexBufferFloat() { #ifndef MAGNUM_TARGET_GLES void MeshGLTest::addVertexBufferDouble() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::vertex_attrib_64bit::string() + std::string(" is not available.")); typedef Attribute<0, Double> Attribute; @@ -616,7 +616,7 @@ void MeshGLTest::addVertexBufferDouble() { #ifndef MAGNUM_TARGET_GLES2 void MeshGLTest::addVertexBufferVectorNui() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available.")); #endif @@ -641,7 +641,7 @@ void MeshGLTest::addVertexBufferVectorNui() { void MeshGLTest::addVertexBufferVectorNi() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available.")); #endif @@ -692,7 +692,7 @@ void MeshGLTest::addVertexBufferVectorN() { #ifndef MAGNUM_TARGET_GLES void MeshGLTest::addVertexBufferVectorNd() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::vertex_attrib_64bit::string() + std::string(" is not available.")); typedef Attribute<0, Vector4d> Attribute; @@ -745,7 +745,7 @@ void MeshGLTest::addVertexBufferMatrixNxN() { #ifndef MAGNUM_TARGET_GLES void MeshGLTest::addVertexBufferMatrixNxNd() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::vertex_attrib_64bit::string() + std::string(" is not available.")); typedef Attribute<0, Matrix3x3d> Attribute; @@ -810,7 +810,7 @@ void MeshGLTest::addVertexBufferMatrixMxN() { #ifndef MAGNUM_TARGET_GLES void MeshGLTest::addVertexBufferMatrixMxNd() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::vertex_attrib_64bit::string() + std::string(" is not available.")); typedef Attribute<0, Matrix3x4d> Attribute; @@ -849,7 +849,7 @@ void MeshGLTest::addVertexBufferMatrixMxNd() { #ifndef MAGNUM_TARGET_GLES2 void MeshGLTest::addVertexBufferUnsignedIntWithUnsignedShort() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available.")); #endif @@ -874,7 +874,7 @@ void MeshGLTest::addVertexBufferUnsignedIntWithUnsignedShort() { void MeshGLTest::addVertexBufferUnsignedIntWithShort() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available.")); #endif @@ -899,7 +899,7 @@ void MeshGLTest::addVertexBufferUnsignedIntWithShort() { void MeshGLTest::addVertexBufferIntWithUnsignedShort() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available.")); #endif @@ -924,7 +924,7 @@ void MeshGLTest::addVertexBufferIntWithUnsignedShort() { void MeshGLTest::addVertexBufferIntWithShort() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available.")); #endif @@ -950,10 +950,10 @@ void MeshGLTest::addVertexBufferIntWithShort() { void MeshGLTest::addVertexBufferFloatWithHalfFloat() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::half_float_vertex::string() + std::string(" is not supported.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::vertex_half_float::string() + std::string(" is not supported.")); #endif @@ -993,7 +993,7 @@ void MeshGLTest::addVertexBufferFloatWithDouble() { void MeshGLTest::addVertexBufferVector3WithUnsignedInt10f11f11fRev() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::vertex_type_10f_11f_11f_rev::string() + std::string(" is not available.")); #endif @@ -1014,7 +1014,7 @@ void MeshGLTest::addVertexBufferVector3WithUnsignedInt10f11f11fRev() { #ifndef MAGNUM_TARGET_GLES2 void MeshGLTest::addVertexBufferVector4WithUnsignedInt2101010Rev() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::vertex_type_2_10_10_10_rev::string() + std::string(" is not available.")); #endif @@ -1033,7 +1033,7 @@ void MeshGLTest::addVertexBufferVector4WithUnsignedInt2101010Rev() { void MeshGLTest::addVertexBufferVector4WithInt2101010Rev() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::vertex_type_2_10_10_10_rev::string() + std::string(" is not available.")); #endif @@ -1107,7 +1107,7 @@ void MeshGLTest::addVertexBufferNormalized() { #ifndef MAGNUM_TARGET_GLES void MeshGLTest::addVertexBufferBGRA() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::vertex_array_bgra::string() + std::string(" is not available.")); #endif @@ -1375,7 +1375,7 @@ void MeshGLTest::setIndexBufferRange() { void MeshGLTest::setIndexBufferUnsignedInt() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::element_index_uint::string() + std::string(" is not available.")); #endif @@ -1407,7 +1407,7 @@ void MeshGLTest::setIndexBufferUnsignedInt() { #ifndef MAGNUM_TARGET_GLES void MeshGLTest::setBaseVertex() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::draw_elements_base_vertex::string() + std::string(" is not available.")); Buffer vertices; @@ -1440,10 +1440,12 @@ void MeshGLTest::setInstanceCount() { it didn't generate any error and rendered something */ #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current()->isExtensionSupported() && !Context::current()->isExtensionSupported() && !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available."); #endif @@ -1479,10 +1481,12 @@ void MeshGLTest::setInstanceCountIndexed() { it didn't generate any error and rendered something */ #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current()->isExtensionSupported() && !Context::current()->isExtensionSupported() && !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available."); #endif @@ -1520,9 +1524,9 @@ void MeshGLTest::setInstanceCountBaseInstance() { value. I'm too lazy to invent proper test case, so I'll just check that it didn't generate any error and rendered something */ - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::base_instance::string() + std::string(" is not available.")); typedef Attribute<0, Float> Attribute; @@ -1553,9 +1557,9 @@ void MeshGLTest::setInstanceCountBaseInstanceIndexed() { same value. I'm too lazy to invent proper test case, so I'll just check that it didn't generate any error and rendered something */ - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::base_instance::string() + std::string(" is not available.")); Buffer vertices; @@ -1587,9 +1591,9 @@ void MeshGLTest::setInstanceCountBaseVertex() { value. I'm too lazy to invent proper test case, so I'll just check that it didn't generate any error and rendered something */ - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::draw_elements_base_vertex::string() + std::string(" is not available.")); Buffer vertices; @@ -1621,11 +1625,11 @@ void MeshGLTest::setInstanceCountBaseVertexBaseInstance() { value. I'm too lazy to invent proper test case, so I'll just check that it didn't generate any error and rendered something */ - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::draw_elements_base_vertex::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::base_instance::string() + std::string(" is not available.")); Buffer vertices; @@ -1655,14 +1659,18 @@ void MeshGLTest::setInstanceCountBaseVertexBaseInstance() { void MeshGLTest::addVertexBufferInstancedFloat() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::instanced_arrays::string() + std::string(" is not available.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current()->isExtensionSupported() && !Context::current()->isExtensionSupported() && !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required instancing extension is not available."); - if(!Context::current()->isExtensionSupported() && !Context::current()->isExtensionSupported() && !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required drawing extension is not available."); #endif @@ -1699,11 +1707,11 @@ void MeshGLTest::addVertexBufferInstancedFloat() { #ifndef MAGNUM_TARGET_GLES2 void MeshGLTest::addVertexBufferInstancedInteger() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::instanced_arrays::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available.")); #endif @@ -1735,11 +1743,11 @@ void MeshGLTest::addVertexBufferInstancedInteger() { #ifndef MAGNUM_TARGET_GLES void MeshGLTest::addVertexBufferInstancedDouble() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::instanced_arrays::string() + std::string(" is not available.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::vertex_attrib_64bit::string() + std::string(" is not available.")); typedef Attribute<0, Double> Attribute; @@ -1816,7 +1824,7 @@ template T MultiChecker::get(PixelFormat format, PixelType type) { void MeshGLTest::multiDraw() { #ifdef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) Debug() << Extensions::GL::EXT::multi_draw_arrays::string() << "not supported, using fallback implementation"; #endif @@ -1840,7 +1848,7 @@ void MeshGLTest::multiDraw() { void MeshGLTest::multiDrawIndexed() { #ifdef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) Debug() << Extensions::GL::EXT::multi_draw_arrays::string() << "not supported, using fallback implementation"; #endif @@ -1866,7 +1874,7 @@ void MeshGLTest::multiDrawIndexed() { #ifndef MAGNUM_TARGET_GLES void MeshGLTest::multiDrawBaseVertex() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::draw_elements_base_vertex::string() + std::string(" is not available.")); Buffer vertices; diff --git a/src/Magnum/Test/MultisampleTextureGLTest.cpp b/src/Magnum/Test/MultisampleTextureGLTest.cpp index f83f1ff51..1439c2306 100644 --- a/src/Magnum/Test/MultisampleTextureGLTest.cpp +++ b/src/Magnum/Test/MultisampleTextureGLTest.cpp @@ -82,10 +82,10 @@ MultisampleTextureGLTest::MultisampleTextureGLTest() { void MultisampleTextureGLTest::construct2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); #endif @@ -112,10 +112,10 @@ void MultisampleTextureGLTest::construct2DNoCreate() { void MultisampleTextureGLTest::construct2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); #endif @@ -142,10 +142,10 @@ void MultisampleTextureGLTest::construct2DArrayNoCreate() { void MultisampleTextureGLTest::wrap2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string{" is not supported."}); #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); #endif @@ -165,10 +165,10 @@ void MultisampleTextureGLTest::wrap2D() { void MultisampleTextureGLTest::wrap2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); #endif @@ -188,10 +188,10 @@ void MultisampleTextureGLTest::wrap2DArray() { void MultisampleTextureGLTest::bind2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); #endif @@ -215,10 +215,10 @@ void MultisampleTextureGLTest::bind2D() { void MultisampleTextureGLTest::bind2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); #endif @@ -242,10 +242,10 @@ void MultisampleTextureGLTest::bind2DArray() { void MultisampleTextureGLTest::storage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); #endif @@ -261,10 +261,10 @@ void MultisampleTextureGLTest::storage2D() { void MultisampleTextureGLTest::storage2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); #endif @@ -280,10 +280,10 @@ void MultisampleTextureGLTest::storage2DArray() { void MultisampleTextureGLTest::invalidateImage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); #endif @@ -296,10 +296,10 @@ void MultisampleTextureGLTest::invalidateImage2D() { void MultisampleTextureGLTest::invalidateImage2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); #endif @@ -312,10 +312,10 @@ void MultisampleTextureGLTest::invalidateImage2DArray() { void MultisampleTextureGLTest::invalidateSubImage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); #endif @@ -328,10 +328,10 @@ void MultisampleTextureGLTest::invalidateSubImage2D() { void MultisampleTextureGLTest::invalidateSubImage2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); #endif diff --git a/src/Magnum/Test/PixelStorageGLTest.cpp b/src/Magnum/Test/PixelStorageGLTest.cpp index fd2a1aff3..472862ab5 100644 --- a/src/Magnum/Test/PixelStorageGLTest.cpp +++ b/src/Magnum/Test/PixelStorageGLTest.cpp @@ -102,7 +102,7 @@ namespace { void PixelStorageGLTest::unpack2D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::unpack_subimage::string() + std::string(" is not supported.")); #endif @@ -140,7 +140,7 @@ void PixelStorageGLTest::unpack2D() { void PixelStorageGLTest::pack2D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::NV::pack_subimage::string() + std::string(" is not supported.")); #endif @@ -288,7 +288,7 @@ namespace { } void PixelStorageGLTest::unpackCompressed2D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); CompressedPixelStorage storage; @@ -315,7 +315,7 @@ void PixelStorageGLTest::unpackCompressed2D() { } void PixelStorageGLTest::packCompressed2D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); CompressedImageView2D actual{CompressedPixelFormat::RGBAS3tcDxt3, {4, 4}, ActualCompressedData}; @@ -396,7 +396,7 @@ namespace { } void PixelStorageGLTest::unpackCompressed3D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); CompressedPixelStorage storage; @@ -424,7 +424,7 @@ void PixelStorageGLTest::unpackCompressed3D() { } void PixelStorageGLTest::packCompressed3D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); CompressedImageView3D actual{CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 1}, ActualCompressedData}; diff --git a/src/Magnum/Test/PrimitiveQueryGLTest.cpp b/src/Magnum/Test/PrimitiveQueryGLTest.cpp index 4cc974246..b0f704744 100644 --- a/src/Magnum/Test/PrimitiveQueryGLTest.cpp +++ b/src/Magnum/Test/PrimitiveQueryGLTest.cpp @@ -72,7 +72,7 @@ void PrimitiveQueryGLTest::constructNoCreate() { void PrimitiveQueryGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not available.")); #endif @@ -92,7 +92,7 @@ void PrimitiveQueryGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES void PrimitiveQueryGLTest::primitivesGenerated() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::transform_feedback::string() + std::string(" is not available.")); struct MyShader: AbstractShaderProgram { @@ -146,7 +146,7 @@ void PrimitiveQueryGLTest::primitivesGenerated() { void PrimitiveQueryGLTest::transformFeedbackPrimitivesWritten() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not available.")); #endif diff --git a/src/Magnum/Test/RectangleTextureGLTest.cpp b/src/Magnum/Test/RectangleTextureGLTest.cpp index 091dee333..51ecff200 100644 --- a/src/Magnum/Test/RectangleTextureGLTest.cpp +++ b/src/Magnum/Test/RectangleTextureGLTest.cpp @@ -113,7 +113,7 @@ namespace { } void RectangleTextureGLTest::construct() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); { @@ -138,7 +138,7 @@ void RectangleTextureGLTest::constructNoCreate() { } void RectangleTextureGLTest::wrap() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); GLuint id; @@ -156,7 +156,7 @@ void RectangleTextureGLTest::wrap() { } void RectangleTextureGLTest::bind() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; @@ -178,7 +178,7 @@ void RectangleTextureGLTest::bind() { } void RectangleTextureGLTest::sampling() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; @@ -194,9 +194,9 @@ void RectangleTextureGLTest::sampling() { } void RectangleTextureGLTest::samplingSRGBDecode() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); RectangleTexture texture; @@ -206,9 +206,9 @@ void RectangleTextureGLTest::samplingSRGBDecode() { } void RectangleTextureGLTest::samplingBorderInteger() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); RectangleTexture a; @@ -222,9 +222,9 @@ void RectangleTextureGLTest::samplingBorderInteger() { } void RectangleTextureGLTest::samplingSwizzle() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported.")); RectangleTexture texture; @@ -234,9 +234,9 @@ void RectangleTextureGLTest::samplingSwizzle() { } void RectangleTextureGLTest::samplingDepthStencilMode() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported.")); RectangleTexture texture; @@ -246,7 +246,7 @@ void RectangleTextureGLTest::samplingDepthStencilMode() { } void RectangleTextureGLTest::storage() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; @@ -270,7 +270,7 @@ namespace { } void RectangleTextureGLTest::image() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; @@ -294,7 +294,7 @@ void RectangleTextureGLTest::compressedImage() { } void RectangleTextureGLTest::imageBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; @@ -329,7 +329,7 @@ namespace { } void RectangleTextureGLTest::subImage() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; @@ -355,7 +355,7 @@ void RectangleTextureGLTest::compressedSubImage() { } void RectangleTextureGLTest::subImageBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; @@ -380,9 +380,9 @@ void RectangleTextureGLTest::compressedSubImageBuffer() { } void RectangleTextureGLTest::subImageQuery() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); RectangleTexture texture; @@ -407,9 +407,9 @@ void RectangleTextureGLTest::compressedSubImageQuery() { } void RectangleTextureGLTest::subImageQueryBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); RectangleTexture texture; @@ -434,7 +434,7 @@ void RectangleTextureGLTest::compressedSubImageQueryBuffer() { } void RectangleTextureGLTest::invalidateImage() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; @@ -445,7 +445,7 @@ void RectangleTextureGLTest::invalidateImage() { } void RectangleTextureGLTest::invalidateSubImage() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; diff --git a/src/Magnum/Test/RenderbufferGLTest.cpp b/src/Magnum/Test/RenderbufferGLTest.cpp index b591879c7..254883253 100644 --- a/src/Magnum/Test/RenderbufferGLTest.cpp +++ b/src/Magnum/Test/RenderbufferGLTest.cpp @@ -62,7 +62,7 @@ RenderbufferGLTest::RenderbufferGLTest() { void RenderbufferGLTest::construct() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif @@ -94,7 +94,7 @@ void RenderbufferGLTest::constructCopy() { void RenderbufferGLTest::constructMove() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif @@ -121,7 +121,7 @@ void RenderbufferGLTest::constructMove() { void RenderbufferGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif @@ -141,11 +141,11 @@ void RenderbufferGLTest::wrap() { void RenderbufferGLTest::label() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available"); Renderbuffer renderbuffer; @@ -161,7 +161,7 @@ void RenderbufferGLTest::label() { void RenderbufferGLTest::setStorage() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif @@ -178,11 +178,11 @@ void RenderbufferGLTest::setStorage() { void RenderbufferGLTest::setStorageMultisample() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available."); #endif diff --git a/src/Magnum/Test/SampleQueryGLTest.cpp b/src/Magnum/Test/SampleQueryGLTest.cpp index 9f1b417ae..096425fd2 100644 --- a/src/Magnum/Test/SampleQueryGLTest.cpp +++ b/src/Magnum/Test/SampleQueryGLTest.cpp @@ -74,7 +74,7 @@ void SampleQueryGLTest::constructNoCreate() { void SampleQueryGLTest::wrap() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not available.")); #endif @@ -141,7 +141,7 @@ MyShader::MyShader() { void SampleQueryGLTest::querySamplesPassed() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not available.")); #endif @@ -196,7 +196,7 @@ void SampleQueryGLTest::querySamplesPassed() { #ifndef MAGNUM_TARGET_GLES void SampleQueryGLTest::conditionalRender() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::NV::conditional_render::string() + std::string(" is not available.")); Renderbuffer renderbuffer; diff --git a/src/Magnum/Test/ShaderGLTest.cpp b/src/Magnum/Test/ShaderGLTest.cpp index 8351123f4..ef46df54b 100644 --- a/src/Magnum/Test/ShaderGLTest.cpp +++ b/src/Magnum/Test/ShaderGLTest.cpp @@ -137,8 +137,8 @@ void ShaderGLTest::constructMove() { void ShaderGLTest::label() { /* No-Op version is tested in AbstractObjectGLTest */ - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available"); #ifndef MAGNUM_TARGET_GLES diff --git a/src/Magnum/Test/TextureArrayGLTest.cpp b/src/Magnum/Test/TextureArrayGLTest.cpp index da8a88d93..b9e170ba9 100644 --- a/src/Magnum/Test/TextureArrayGLTest.cpp +++ b/src/Magnum/Test/TextureArrayGLTest.cpp @@ -261,7 +261,7 @@ TextureArrayGLTest::TextureArrayGLTest() { }); #ifndef MAGNUM_TARGET_GLES - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) { _compressedDataStorage2D = CompressedPixelStorage{} .setCompressedBlockSize({4, 4, 1}) @@ -287,7 +287,7 @@ namespace { #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::construct1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); { @@ -314,7 +314,7 @@ void TextureArrayGLTest::construct1DNoCreate() { void TextureArrayGLTest::construct2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); #endif @@ -358,7 +358,7 @@ void TextureArrayGLTest::wrap1D() { void TextureArrayGLTest::wrap2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); #endif @@ -378,7 +378,7 @@ void TextureArrayGLTest::wrap2D() { #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::bind1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; @@ -402,7 +402,7 @@ void TextureArrayGLTest::bind1D() { void TextureArrayGLTest::bind2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); #endif @@ -426,7 +426,7 @@ void TextureArrayGLTest::bind2D() { #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::sampling1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; @@ -447,9 +447,9 @@ void TextureArrayGLTest::sampling1D() { } void TextureArrayGLTest::samplingSRGBDecode1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); Texture1DArray texture; @@ -459,9 +459,9 @@ void TextureArrayGLTest::samplingSRGBDecode1D() { } void TextureArrayGLTest::samplingSwizzle1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported.")); Texture1DArray texture; @@ -471,9 +471,9 @@ void TextureArrayGLTest::samplingSwizzle1D() { } void TextureArrayGLTest::samplingBorderInteger1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); Texture1DArray a; @@ -487,9 +487,9 @@ void TextureArrayGLTest::samplingBorderInteger1D() { } void TextureArrayGLTest::samplingDepthStencilMode1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported.")); Texture1DArray texture; @@ -501,7 +501,7 @@ void TextureArrayGLTest::samplingDepthStencilMode1D() { void TextureArrayGLTest::sampling2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); #endif @@ -535,10 +535,10 @@ void TextureArrayGLTest::sampling2D() { void TextureArrayGLTest::samplingSRGBDecode2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); #endif - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); Texture2DArray texture; @@ -550,9 +550,9 @@ void TextureArrayGLTest::samplingSRGBDecode2D() { #ifndef MAGNUM_TARGET_GLES2 void TextureArrayGLTest::samplingSwizzle2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported.")); #endif @@ -563,7 +563,7 @@ void TextureArrayGLTest::samplingSwizzle2D() { } #else void TextureArrayGLTest::samplingMaxLevel2D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::APPLE::texture_max_level::string() + std::string(" is not supported.")); Texture2DArray texture; @@ -573,8 +573,8 @@ void TextureArrayGLTest::samplingMaxLevel2D() { } void TextureArrayGLTest::samplingCompare2D() { - if(!Context::current()->isExtensionSupported() || - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() || + !Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::NV::shadow_samplers_array::string() + std::string(" is not supported.")); Texture2DArray texture; @@ -588,12 +588,12 @@ void TextureArrayGLTest::samplingCompare2D() { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void TextureArrayGLTest::samplingBorderInteger2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported.")); #endif @@ -611,12 +611,12 @@ void TextureArrayGLTest::samplingBorderInteger2D() { #ifndef MAGNUM_TARGET_GLES2 void TextureArrayGLTest::samplingDepthStencilMode2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported.")); #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); #endif @@ -629,8 +629,8 @@ void TextureArrayGLTest::samplingDepthStencilMode2D() { #ifdef MAGNUM_TARGET_GLES void TextureArrayGLTest::samplingBorder2D() { - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("No required extension is supported."); Texture2DArray texture; @@ -643,7 +643,7 @@ void TextureArrayGLTest::samplingBorder2D() { #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::storage1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; @@ -664,7 +664,7 @@ void TextureArrayGLTest::storage1D() { void TextureArrayGLTest::storage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); #endif @@ -675,7 +675,7 @@ void TextureArrayGLTest::storage2D() { #ifndef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 not supported, skipping image size testing"); #endif @@ -702,7 +702,7 @@ namespace { #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::image1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; @@ -726,7 +726,7 @@ void TextureArrayGLTest::compressedImage1D() { } void TextureArrayGLTest::image1DBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; @@ -775,7 +775,7 @@ namespace { void TextureArrayGLTest::image2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); #endif @@ -800,14 +800,14 @@ void TextureArrayGLTest::image2D() { void TextureArrayGLTest::compressedImage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif @@ -834,7 +834,7 @@ void TextureArrayGLTest::compressedImage2D() { void TextureArrayGLTest::image2DBuffer() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); #endif @@ -859,14 +859,14 @@ void TextureArrayGLTest::image2DBuffer() { void TextureArrayGLTest::compressedImage2DBuffer() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif @@ -903,7 +903,7 @@ namespace { #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::subImage1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; @@ -929,7 +929,7 @@ void TextureArrayGLTest::compressedSubImage1D() { } void TextureArrayGLTest::subImage1DBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; @@ -954,9 +954,9 @@ void TextureArrayGLTest::compressedSubImage1DBuffer() { } void TextureArrayGLTest::subImage1DQuery() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture1DArray texture; @@ -980,9 +980,9 @@ void TextureArrayGLTest::compressedSubImage1DQuery() { } void TextureArrayGLTest::subImage1DQueryBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture1DArray texture; @@ -1069,7 +1069,7 @@ namespace { void TextureArrayGLTest::subImage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); #endif @@ -1095,14 +1095,14 @@ void TextureArrayGLTest::subImage2D() { void TextureArrayGLTest::compressedSubImage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif @@ -1110,7 +1110,7 @@ void TextureArrayGLTest::compressedSubImage2D() { /* Compressed pixel storage for array textures is underspecified. If the extension is supported, first test with default values to ensure we are not that far off, then continue as usual */ - if(Context::current()->isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { Texture2DArray texture; texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, Vector3i{12, 4, 4}, CompressedZero2D}); @@ -1147,7 +1147,7 @@ void TextureArrayGLTest::compressedSubImage2D() { CORRADE_COMPARE(image.size(), (Vector3i{12, 4, 4})); { - CORRADE_EXPECT_FAIL_IF(Context::current()->isExtensionSupported() && (Context::current()->detectedDriver() & Context::DetectedDriver::NVidia), + CORRADE_EXPECT_FAIL_IF(Context::current().isExtensionSupported() && (Context::current().detectedDriver() & Context::DetectedDriver::NVidia), "Non-default compressed pixel storage for array textures behaves weirdly on NVidia"); CORRADE_COMPARE_AS( @@ -1158,7 +1158,7 @@ void TextureArrayGLTest::compressedSubImage2D() { void TextureArrayGLTest::subImage2DBuffer() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); #endif @@ -1184,14 +1184,14 @@ void TextureArrayGLTest::subImage2DBuffer() { void TextureArrayGLTest::compressedSubImage2DBuffer() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif @@ -1199,7 +1199,7 @@ void TextureArrayGLTest::compressedSubImage2DBuffer() { /* Compressed pixel storage for array textures is underspecified. If the extension is supported, first test with default values to ensure we are not that far off, then continue as usual */ - if(Context::current()->isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { Texture2DArray texture; texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, Vector3i{12, 4, 4}, CompressedZero2D}); @@ -1237,7 +1237,7 @@ void TextureArrayGLTest::compressedSubImage2DBuffer() { CORRADE_COMPARE(image.size(), (Vector3i{12, 4, 4})); { - CORRADE_EXPECT_FAIL_IF(Context::current()->isExtensionSupported() && (Context::current()->detectedDriver() & Context::DetectedDriver::NVidia), + CORRADE_EXPECT_FAIL_IF(Context::current().isExtensionSupported() && (Context::current().detectedDriver() & Context::DetectedDriver::NVidia), "Non-default compressed pixel storage for array textures behaves weirdly on NVidia"); CORRADE_COMPARE_AS(imageData, Containers::ArrayView{CompressedSubData2DComplete}, TestSuite::Compare::Container); @@ -1247,9 +1247,9 @@ void TextureArrayGLTest::compressedSubImage2DBuffer() { #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::subImage2DQuery() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture2DArray texture; @@ -1269,11 +1269,11 @@ void TextureArrayGLTest::subImage2DQuery() { } void TextureArrayGLTest::compressedSubImage2DQuery() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); Texture2DArray texture; @@ -1285,7 +1285,7 @@ void TextureArrayGLTest::compressedSubImage2DQuery() { /* Test also without compressed pixel storage to ensure that both size computations work */ - if(Context::current()->isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 1}, {4, 4, 2}), {}); MAGNUM_VERIFY_NO_ERROR(); @@ -1307,9 +1307,9 @@ void TextureArrayGLTest::compressedSubImage2DQuery() { } void TextureArrayGLTest::subImage2DQueryBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture2DArray texture; @@ -1330,11 +1330,11 @@ void TextureArrayGLTest::subImage2DQueryBuffer() { } void TextureArrayGLTest::compressedSubImage2DQueryBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); Texture2DArray texture; @@ -1360,9 +1360,9 @@ void TextureArrayGLTest::compressedSubImage2DQueryBuffer() { } void TextureArrayGLTest::generateMipmap1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; @@ -1389,9 +1389,9 @@ void TextureArrayGLTest::generateMipmap1D() { void TextureArrayGLTest::generateMipmap2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); #endif @@ -1423,7 +1423,7 @@ void TextureArrayGLTest::generateMipmap2D() { #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::invalidateImage1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; @@ -1436,7 +1436,7 @@ void TextureArrayGLTest::invalidateImage1D() { void TextureArrayGLTest::invalidateImage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); #endif @@ -1449,7 +1449,7 @@ void TextureArrayGLTest::invalidateImage2D() { #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::invalidateSubImage1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; @@ -1462,7 +1462,7 @@ void TextureArrayGLTest::invalidateSubImage1D() { void TextureArrayGLTest::invalidateSubImage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); #endif diff --git a/src/Magnum/Test/TextureGLTest.cpp b/src/Magnum/Test/TextureGLTest.cpp index efaaaeb00..6029591d8 100644 --- a/src/Magnum/Test/TextureGLTest.cpp +++ b/src/Magnum/Test/TextureGLTest.cpp @@ -346,7 +346,7 @@ TextureGLTest::TextureGLTest() { _dataOffset3D = 16; #ifdef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #endif { _dataStorage2D = _dataStorage3D = {}; @@ -355,7 +355,7 @@ TextureGLTest::TextureGLTest() { #endif #ifndef MAGNUM_TARGET_GLES - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) { _compressedDataStorage2D = CompressedPixelStorage{} .setCompressedBlockSize({4, 4, 1}) @@ -432,7 +432,7 @@ void TextureGLTest::construct2DNoCreate() { void TextureGLTest::construct3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); #endif @@ -491,7 +491,7 @@ void TextureGLTest::wrap2D() { void TextureGLTest::wrap3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); #endif @@ -551,7 +551,7 @@ void TextureGLTest::bind2D() { void TextureGLTest::bind3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); #endif @@ -593,7 +593,7 @@ void TextureGLTest::sampling1D() { } void TextureGLTest::samplingSRGBDecode1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); Texture1D texture; @@ -603,7 +603,7 @@ void TextureGLTest::samplingSRGBDecode1D() { } void TextureGLTest::samplingSwizzle1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported.")); Texture1D texture; @@ -613,7 +613,7 @@ void TextureGLTest::samplingSwizzle1D() { } void TextureGLTest::samplingBorderInteger1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); Texture1D a; @@ -627,7 +627,7 @@ void TextureGLTest::samplingBorderInteger1D() { } void TextureGLTest::samplingDepthStencilMode1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported.")); Texture1D texture; @@ -665,10 +665,10 @@ void TextureGLTest::sampling2D() { void TextureGLTest::samplingSRGBDecode2D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::sRGB::string() + std::string(" is not supported.")); #endif - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); Texture2D texture; @@ -680,7 +680,7 @@ void TextureGLTest::samplingSRGBDecode2D() { #ifndef MAGNUM_TARGET_GLES2 void TextureGLTest::samplingSwizzle2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported.")); #endif @@ -691,7 +691,7 @@ void TextureGLTest::samplingSwizzle2D() { } #else void TextureGLTest::samplingMaxLevel2D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::APPLE::texture_max_level::string() + std::string(" is not supported.")); Texture2D texture; @@ -701,7 +701,7 @@ void TextureGLTest::samplingMaxLevel2D() { } void TextureGLTest::samplingCompare2D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::shadow_samplers::string() + std::string(" is not supported.")); Texture2D texture; @@ -715,10 +715,10 @@ void TextureGLTest::samplingCompare2D() { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void TextureGLTest::samplingBorderInteger2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported.")); #endif @@ -736,10 +736,10 @@ void TextureGLTest::samplingBorderInteger2D() { #ifndef MAGNUM_TARGET_GLES2 void TextureGLTest::samplingDepthStencilMode2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported.")); #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); #endif @@ -752,8 +752,8 @@ void TextureGLTest::samplingDepthStencilMode2D() { #ifdef MAGNUM_TARGET_GLES void TextureGLTest::samplingBorder2D() { - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("No required extension is supported."); Texture2D texture; @@ -766,7 +766,7 @@ void TextureGLTest::samplingBorder2D() { void TextureGLTest::sampling3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); #endif @@ -795,12 +795,12 @@ void TextureGLTest::sampling3D() { void TextureGLTest::samplingSRGBDecode3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::sRGB::string() + std::string(" is not supported.")); #endif - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); Texture3D texture; @@ -812,7 +812,7 @@ void TextureGLTest::samplingSRGBDecode3D() { #ifndef MAGNUM_TARGET_GLES2 void TextureGLTest::samplingSwizzle3D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported.")); #endif @@ -823,9 +823,9 @@ void TextureGLTest::samplingSwizzle3D() { } #else void TextureGLTest::samplingMaxLevel3D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::APPLE::texture_max_level::string() + std::string(" is not supported.")); Texture3D texture; @@ -838,10 +838,10 @@ void TextureGLTest::samplingMaxLevel3D() { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void TextureGLTest::samplingBorderInteger3D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported.")); #endif @@ -859,10 +859,10 @@ void TextureGLTest::samplingBorderInteger3D() { #ifndef MAGNUM_TARGET_GLES2 void TextureGLTest::samplingDepthStencilMode3D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported.")); #else - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); #endif @@ -876,12 +876,12 @@ void TextureGLTest::samplingDepthStencilMode3D() { #ifdef MAGNUM_TARGET_GLES void TextureGLTest::samplingBorder3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); #endif - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("No required extension is supported."); Texture3D texture; @@ -918,7 +918,7 @@ void TextureGLTest::storage2D() { #ifndef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 not supported, skipping image size testing."); #endif @@ -935,7 +935,7 @@ void TextureGLTest::storage2D() { void TextureGLTest::storage3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); #endif @@ -946,7 +946,7 @@ void TextureGLTest::storage3D() { #ifndef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES - if(!Context::current()->isVersionSupported(Version::GLES310)) + if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 not supported, skipping image size testing."); #endif @@ -1049,10 +1049,10 @@ void TextureGLTest::image2D() { void TextureGLTest::compressedImage2D() { #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif @@ -1102,10 +1102,10 @@ void TextureGLTest::image2DBuffer() { void TextureGLTest::compressedImage2DBuffer() { #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif @@ -1158,7 +1158,7 @@ namespace { void TextureGLTest::image3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); #endif @@ -1186,7 +1186,7 @@ void TextureGLTest::compressedImage3D() { /** @todo ASTC HDR, when available on any ES driver */ CORRADE_SKIP("No 3D texture compression format available on OpenGL ES."); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); Texture3D texture; @@ -1233,7 +1233,7 @@ void TextureGLTest::compressedImage3DBuffer() { /** @todo ASTC HDR, when available on any ES driver */ CORRADE_SKIP("No 3D texture compression format available on OpenGL ES."); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); Texture3D texture; @@ -1309,7 +1309,7 @@ void TextureGLTest::compressedSubImage1DBuffer() { } void TextureGLTest::subImage1DQuery() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture1D texture; @@ -1333,7 +1333,7 @@ void TextureGLTest::compressedSubImage1DQuery() { } void TextureGLTest::subImage1DQueryBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture1D texture; @@ -1406,10 +1406,10 @@ void TextureGLTest::subImage2D() { void TextureGLTest::compressedSubImage2D() { #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif @@ -1460,10 +1460,10 @@ void TextureGLTest::subImage2DBuffer() { void TextureGLTest::compressedSubImage2DBuffer() { #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif @@ -1492,7 +1492,7 @@ void TextureGLTest::compressedSubImage2DBuffer() { #ifndef MAGNUM_TARGET_GLES void TextureGLTest::subImage2DQuery() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture2D texture; @@ -1512,9 +1512,9 @@ void TextureGLTest::subImage2DQuery() { } void TextureGLTest::compressedSubImage2DQuery() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); Texture2D texture; @@ -1525,7 +1525,7 @@ void TextureGLTest::compressedSubImage2DQuery() { /* Test also without compressed pixel storage to ensure that both size computations work */ - if(Context::current()->isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { CompressedImage2D image = texture.compressedSubImage(0, Range2Di::fromSize({4, 0}, Vector2i{4}), {}); MAGNUM_VERIFY_NO_ERROR(); @@ -1547,7 +1547,7 @@ void TextureGLTest::compressedSubImage2DQuery() { } void TextureGLTest::subImage2DQueryBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture2D texture; @@ -1568,9 +1568,9 @@ void TextureGLTest::subImage2DQueryBuffer() { } void TextureGLTest::compressedSubImage2DQueryBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); Texture2D texture; @@ -1581,7 +1581,7 @@ void TextureGLTest::compressedSubImage2DQueryBuffer() { /* Test also without compressed pixel storage to ensure that both size computations work */ - if(Context::current()->isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { CompressedBufferImage2D image = texture.compressedSubImage(0, Range2Di::fromSize({4, 0}, Vector2i{4}), {}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); @@ -1673,7 +1673,7 @@ namespace { void TextureGLTest::subImage3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); #endif @@ -1703,7 +1703,7 @@ void TextureGLTest::compressedSubImage3D() { /** @todo ASTC HDR, when available on any ES driver */ CORRADE_SKIP("No 3D texture compression format available on OpenGL ES."); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); Texture3D texture; @@ -1752,7 +1752,7 @@ void TextureGLTest::compressedSubImage3DBuffer() { /** @todo ASTC HDR, when available on any ES driver */ CORRADE_SKIP("No 3D texture compression format available on OpenGL ES."); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); Texture3D texture; @@ -1776,7 +1776,7 @@ void TextureGLTest::compressedSubImage3DBuffer() { #ifndef MAGNUM_TARGET_GLES void TextureGLTest::subImage3DQuery() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture3D texture; @@ -1796,9 +1796,9 @@ void TextureGLTest::subImage3DQuery() { } void TextureGLTest::compressedSubImage3DQuery() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); Texture3D texture; @@ -1809,14 +1809,14 @@ void TextureGLTest::compressedSubImage3DQuery() { /* Test also without compressed pixel storage to ensure that both size computations work */ - if(Context::current()->isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 0}, Vector3i{4}), {}); MAGNUM_VERIFY_NO_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4})); - CORRADE_EXPECT_FAIL_IF(!!(Context::current()->detectedDriver() & Context::DetectedDriver::NVidia), + CORRADE_EXPECT_FAIL_IF(!!(Context::current().detectedDriver() & Context::DetectedDriver::NVidia), "Default compressed pixel storage behaves weirdly with BPTC compression on NVidia"); CORRADE_COMPARE_AS( @@ -1835,7 +1835,7 @@ void TextureGLTest::compressedSubImage3DQuery() { } void TextureGLTest::subImage3DQueryBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture3D texture; @@ -1856,9 +1856,9 @@ void TextureGLTest::subImage3DQueryBuffer() { } void TextureGLTest::compressedSubImage3DQueryBuffer() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); Texture3D texture; @@ -1869,7 +1869,7 @@ void TextureGLTest::compressedSubImage3DQueryBuffer() { /* Test also without compressed pixel storage to ensure that both size computations work */ - if(Context::current()->isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 0}, Vector3i{4}), {}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); @@ -1877,7 +1877,7 @@ void TextureGLTest::compressedSubImage3DQueryBuffer() { CORRADE_COMPARE(image.size(), Vector3i{4}); - CORRADE_EXPECT_FAIL_IF(!!(Context::current()->detectedDriver() & Context::DetectedDriver::NVidia), + CORRADE_EXPECT_FAIL_IF(!!(Context::current().detectedDriver() & Context::DetectedDriver::NVidia), "Default compressed pixel storage behaves weirdly with BPTC compression on NVidia"); CORRADE_COMPARE_AS(imageData, Containers::ArrayView{CompressedData3D}, TestSuite::Compare::Container); @@ -1893,7 +1893,7 @@ void TextureGLTest::compressedSubImage3DQueryBuffer() { } void TextureGLTest::generateMipmap1D() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported.")); Texture1D texture; @@ -1920,7 +1920,7 @@ void TextureGLTest::generateMipmap1D() { void TextureGLTest::generateMipmap2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported.")); #endif @@ -1953,10 +1953,10 @@ void TextureGLTest::generateMipmap2D() { void TextureGLTest::generateMipmap3D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); #endif @@ -2007,7 +2007,7 @@ void TextureGLTest::invalidateImage2D() { void TextureGLTest::invalidateImage3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); #endif @@ -2038,7 +2038,7 @@ void TextureGLTest::invalidateSubImage2D() { void TextureGLTest::invalidateSubImage3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); #endif diff --git a/src/Magnum/Test/TimeQueryGLTest.cpp b/src/Magnum/Test/TimeQueryGLTest.cpp index f14ea888a..e650aeabd 100644 --- a/src/Magnum/Test/TimeQueryGLTest.cpp +++ b/src/Magnum/Test/TimeQueryGLTest.cpp @@ -59,10 +59,10 @@ void TimeQueryGLTest::constructNoCreate() { void TimeQueryGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::timer_query::string() + std::string(" is not available")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::disjoint_timer_query::string() + std::string(" is not available")); #endif @@ -90,10 +90,10 @@ void TimeQueryGLTest::wrap() { void TimeQueryGLTest::queryTime() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::timer_query::string() + std::string(" is not available")); #else - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::disjoint_timer_query::string() + std::string(" is not available")); #endif @@ -117,7 +117,7 @@ void TimeQueryGLTest::queryTime() { void TimeQueryGLTest::queryTimestamp() { #ifdef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::disjoint_timer_query::string() + std::string(" is not available")); #endif diff --git a/src/Magnum/Test/TransformFeedbackGLTest.cpp b/src/Magnum/Test/TransformFeedbackGLTest.cpp index 9c41bdd04..b2024101a 100644 --- a/src/Magnum/Test/TransformFeedbackGLTest.cpp +++ b/src/Magnum/Test/TransformFeedbackGLTest.cpp @@ -76,7 +76,7 @@ TransformFeedbackGLTest::TransformFeedbackGLTest() { void TransformFeedbackGLTest::construct() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif @@ -108,7 +108,7 @@ void TransformFeedbackGLTest::constructCopy() { void TransformFeedbackGLTest::constructMove() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif @@ -135,7 +135,7 @@ void TransformFeedbackGLTest::constructMove() { void TransformFeedbackGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif @@ -156,11 +156,11 @@ void TransformFeedbackGLTest::wrap() { void TransformFeedbackGLTest::label() { /* No-Op version is tested in AbstractObjectGLTest */ #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available"); TransformFeedback feedback; @@ -219,7 +219,7 @@ XfbShader::XfbShader() { void TransformFeedbackGLTest::attachBase() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif @@ -255,7 +255,7 @@ void TransformFeedbackGLTest::attachBase() { void TransformFeedbackGLTest::attachRange() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif @@ -331,7 +331,7 @@ XfbMultiShader::XfbMultiShader() { void TransformFeedbackGLTest::attachBases() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif @@ -373,7 +373,7 @@ void TransformFeedbackGLTest::attachBases() { void TransformFeedbackGLTest::attachRanges() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif @@ -419,7 +419,7 @@ void TransformFeedbackGLTest::attachRanges() { #ifndef MAGNUM_TARGET_GLES void TransformFeedbackGLTest::interleaved() { /* ARB_transform_feedback3 needed for gl_SkipComponents1 */ - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::transform_feedback3::string() + std::string(" is not supported.")); struct XfbInterleavedShader: AbstractShaderProgram { diff --git a/src/Magnum/Text/DistanceFieldGlyphCache.cpp b/src/Magnum/Text/DistanceFieldGlyphCache.cpp index 0fbd1984c..97a19e929 100644 --- a/src/Magnum/Text/DistanceFieldGlyphCache.cpp +++ b/src/Magnum/Text/DistanceFieldGlyphCache.cpp @@ -41,7 +41,7 @@ DistanceFieldGlyphCache::DistanceFieldGlyphCache(const Vector2i& originalSize, c GlyphCache(TextureFormat::R8, originalSize, size, Vector2i(radius)), #elif !defined(MAGNUM_TARGET_WEBGL) /* Luminance is not renderable in most cases */ - GlyphCache(Context::current()->isExtensionSupported() ? + GlyphCache(Context::current().isExtensionSupported() ? TextureFormat::Red : TextureFormat::RGB, originalSize, size, Vector2i(radius)), #else GlyphCache(TextureFormat::RGB, originalSize, size, Vector2i(radius)), @@ -54,7 +54,7 @@ DistanceFieldGlyphCache::DistanceFieldGlyphCache(const Vector2i& originalSize, c #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) /* Luminance is not renderable in most cases */ - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) Warning() << "Text::DistanceFieldGlyphCache:" << Extensions::GL::EXT::texture_rg::string() << "not supported, using inefficient RGB format for glyph cache texture"; #endif } @@ -67,7 +67,7 @@ void DistanceFieldGlyphCache::setImage(const Vector2i& offset, const ImageView2D #else TextureFormat internalFormat; #ifndef MAGNUM_TARGET_WEBGL - if(Context::current()->isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { internalFormat = TextureFormat::Red; CORRADE_ASSERT(image.format() == PixelFormat::Red, "Text::DistanceFieldGlyphCache::setImage(): expected" << PixelFormat::Red << "but got" << image.format(), ); @@ -96,7 +96,7 @@ void DistanceFieldGlyphCache::setDistanceFieldImage(const Vector2i& offset, cons "Text::DistanceFieldGlyphCache::setDistanceFieldImage(): expected" << PixelFormat::Red << "but got" << image.format(), ); #else #ifndef MAGNUM_TARGET_WEBGL - if(Context::current()->isExtensionSupported()) + if(Context::current().isExtensionSupported()) CORRADE_ASSERT(image.format() == PixelFormat::Red, "Text::DistanceFieldGlyphCache::setDistanceFieldImage(): expected" << PixelFormat::Red << "but got" << image.format(), ); else diff --git a/src/Magnum/Text/GlyphCache.cpp b/src/Magnum/Text/GlyphCache.cpp index 5ef9a4fcd..97713094a 100644 --- a/src/Magnum/Text/GlyphCache.cpp +++ b/src/Magnum/Text/GlyphCache.cpp @@ -51,8 +51,8 @@ GlyphCache::GlyphCache(const Vector2i& originalSize, const Vector2i& size, const const TextureFormat internalFormat = TextureFormat::R8; #elif !defined(MAGNUM_TARGET_WEBGL) TextureFormat internalFormat; - if(Context::current()->isExtensionSupported()) { - internalFormat = Context::current()->isExtensionSupported() ? + if(Context::current().isExtensionSupported()) { + internalFormat = Context::current().isExtensionSupported() ? TextureFormat::R8 : TextureFormat::Red; } else internalFormat = TextureFormat::Luminance; #else diff --git a/src/Magnum/Text/Renderer.cpp b/src/Magnum/Text/Renderer.cpp index cde237fc6..19bbcdee6 100644 --- a/src/Magnum/Text/Renderer.cpp +++ b/src/Magnum/Text/Renderer.cpp @@ -306,11 +306,11 @@ AbstractRenderer::AbstractRenderer(AbstractFont& font, const GlyphCache& cache, #ifndef MAGNUM_TARGET_GLES MAGNUM_ASSERT_EXTENSION_SUPPORTED(Extensions::GL::ARB::map_buffer_range); #elif defined(MAGNUM_TARGET_GLES2) && !defined(CORRADE_TARGET_EMSCRIPTEN) - if(Context::current()->isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { bufferMapImplementation = &AbstractRenderer::bufferMapImplementationRange; } #ifdef CORRADE_TARGET_NACL - else if(Context::current()->isExtensionSupported()) { + else if(Context::current().isExtensionSupported()) { bufferMapImplementation = &AbstractRenderer::bufferMapImplementationSub; bufferUnmapImplementation = &AbstractRenderer::bufferUnmapImplementationSub; } diff --git a/src/Magnum/Text/Test/RendererGLTest.cpp b/src/Magnum/Text/Test/RendererGLTest.cpp index 012930460..803068a55 100644 --- a/src/Magnum/Text/Test/RendererGLTest.cpp +++ b/src/Magnum/Text/Test/RendererGLTest.cpp @@ -258,13 +258,13 @@ void RendererGLTest::renderMeshIndexType() { void RendererGLTest::mutableText() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::map_buffer_range::string() + std::string(" is not supported")); #elif defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_EMSCRIPTEN) - if(!Context::current()->isExtensionSupported() && - !Context::current()->isExtensionSupported() + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported() #ifdef CORRADE_TARGET_NACL - && !Context::current()->isExtensionSupported() + && !Context::current().isExtensionSupported() #endif ) { CORRADE_SKIP("No required extension is supported"); diff --git a/src/Magnum/Texture.cpp b/src/Magnum/Texture.cpp index db9553812..01c4f5b7c 100644 --- a/src/Magnum/Texture.cpp +++ b/src/Magnum/Texture.cpp @@ -53,7 +53,7 @@ template MAGNUM_EXPORT Vector2i maxTextureSize<2>(); #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) template<> MAGNUM_EXPORT Vector3i maxTextureSize<3>() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return {}; #endif return {Vector2i(Implementation::maxTextureSideSize()), Implementation::max3DTextureDepth()}; diff --git a/src/Magnum/TextureArray.cpp b/src/Magnum/TextureArray.cpp index e30f6cd6a..134575138 100644 --- a/src/Magnum/TextureArray.cpp +++ b/src/Magnum/TextureArray.cpp @@ -46,7 +46,7 @@ namespace { template VectorTypeFor TextureArray::maxSize() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return {}; #endif diff --git a/src/Magnum/TextureTools/DistanceField.cpp b/src/Magnum/TextureTools/DistanceField.cpp index 55a049470..5810f973b 100644 --- a/src/Magnum/TextureTools/DistanceField.cpp +++ b/src/Magnum/TextureTools/DistanceField.cpp @@ -91,9 +91,9 @@ DistanceFieldShader::DistanceFieldShader(): radiusUniform(0), scalingUniform(1) Utility::Resource rs("MagnumTextureTools"); #ifndef MAGNUM_TARGET_GLES - const Version v = Context::current()->supportedVersion({Version::GL320, Version::GL300, Version::GL210}); + const Version v = Context::current().supportedVersion({Version::GL320, Version::GL300, Version::GL210}); #else - const Version v = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); + const Version v = Context::current().supportedVersion({Version::GLES300, Version::GLES200}); #endif Shader vert = Shaders::Implementation::createCompatibilityShader(rs, v, Shader::Type::Vertex); @@ -109,9 +109,9 @@ DistanceFieldShader::DistanceFieldShader(): radiusUniform(0), scalingUniform(1) /* Older GLSL doesn't have gl_VertexID, vertices must be supplied explicitly */ #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isVersionSupported(Version::GL300)) + if(!Context::current().isVersionSupported(Version::GL300)) #else - if(!Context::current()->isVersionSupported(Version::GLES300)) + if(!Context::current().isVersionSupported(Version::GLES300)) #endif { bindAttributeLocation(Position::Location, "position"); @@ -120,16 +120,16 @@ DistanceFieldShader::DistanceFieldShader(): radiusUniform(0), scalingUniform(1) CORRADE_INTERNAL_ASSERT_OUTPUT(link()); #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #endif { radiusUniform = uniformLocation("radius"); scalingUniform = uniformLocation("scaling"); #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isVersionSupported(Version::GL320)) + if(!Context::current().isVersionSupported(Version::GL320)) #else - if(!Context::current()->isVersionSupported(Version::GLES300)) + if(!Context::current().isVersionSupported(Version::GLES300)) #endif { imageSizeInvertedUniform = uniformLocation("imageSizeInverted"); @@ -137,7 +137,7 @@ DistanceFieldShader::DistanceFieldShader(): radiusUniform(0), scalingUniform(1) } #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #endif { setUniform(uniformLocation("textureData"), TextureUnit); @@ -179,9 +179,9 @@ void distanceField(Texture2D& input, Texture2D& output, const Range2Di& rectangl .setTexture(input); #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isVersionSupported(Version::GL320)) + if(!Context::current().isVersionSupported(Version::GL320)) #else - if(!Context::current()->isVersionSupported(Version::GLES300)) + if(!Context::current().isVersionSupported(Version::GLES300)) #endif { shader.setImageSizeInverted(1.0f/Vector2(imageSize)); @@ -194,9 +194,9 @@ void distanceField(Texture2D& input, Texture2D& output, const Range2Di& rectangl /* Older GLSL doesn't have gl_VertexID, vertices must be supplied explicitly */ Buffer buffer; #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isVersionSupported(Version::GL300)) + if(!Context::current().isVersionSupported(Version::GL300)) #else - if(!Context::current()->isVersionSupported(Version::GLES300)) + if(!Context::current().isVersionSupported(Version::GLES300)) #endif { constexpr Vector2 triangle[] = { diff --git a/src/Magnum/TransformFeedback.cpp b/src/Magnum/TransformFeedback.cpp index 8be2f5588..fbc9762b3 100644 --- a/src/Magnum/TransformFeedback.cpp +++ b/src/Magnum/TransformFeedback.cpp @@ -42,11 +42,11 @@ namespace Magnum { Int TransformFeedback::maxInterleavedComponents() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().transformFeedback->maxInterleavedComponents; + GLint& value = Context::current().state().transformFeedback->maxInterleavedComponents; if(value == 0) glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS, &value); @@ -56,11 +56,11 @@ Int TransformFeedback::maxInterleavedComponents() { Int TransformFeedback::maxSeparateAttributes() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().transformFeedback->maxSeparateAttributes; + GLint& value = Context::current().state().transformFeedback->maxSeparateAttributes; if(value == 0) glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, &value); @@ -70,11 +70,11 @@ Int TransformFeedback::maxSeparateAttributes() { Int TransformFeedback::maxSeparateComponents() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return 0; #endif - GLint& value = Context::current()->state().transformFeedback->maxSeparateComponents; + GLint& value = Context::current().state().transformFeedback->maxSeparateComponents; if(value == 0) glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS, &value); @@ -84,10 +84,10 @@ Int TransformFeedback::maxSeparateComponents() { #ifndef MAGNUM_TARGET_GLES Int TransformFeedback::maxBuffers() { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return maxSeparateAttributes(); - GLint& value = Context::current()->state().transformFeedback->maxBuffers; + GLint& value = Context::current().state().transformFeedback->maxBuffers; if(value == 0) glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_BUFFERS, &value); @@ -97,7 +97,7 @@ Int TransformFeedback::maxBuffers() { #endif TransformFeedback::TransformFeedback(): _flags{ObjectFlag::DeleteOnDestruction} { - (this->*Context::current()->state().transformFeedback->createImplementation)(); + (this->*Context::current().state().transformFeedback->createImplementation)(); CORRADE_INTERNAL_ASSERT(_id != Implementation::State::DisengagedBinding); } @@ -117,14 +117,14 @@ TransformFeedback::~TransformFeedback() { if(!_id || !(_flags & ObjectFlag::DeleteOnDestruction)) return; /* If bound, remove itself from state */ - GLuint& binding = Context::current()->state().transformFeedback->binding; + GLuint& binding = Context::current().state().transformFeedback->binding; if(binding == _id) binding = 0; glDeleteTransformFeedbacks(1, &_id); } void TransformFeedback::bindInternal() { - GLuint& bound = Context::current()->state().transformFeedback->binding; + GLuint& bound = Context::current().state().transformFeedback->binding; /* Already bound, nothing to do */ if(bound == _id) return; @@ -149,23 +149,23 @@ inline void TransformFeedback::createIfNotAlready() { #ifndef MAGNUM_TARGET_WEBGL std::string TransformFeedback::label() { createIfNotAlready(); - return Context::current()->state().debug->getLabelImplementation(GL_TRANSFORM_FEEDBACK, _id); + return Context::current().state().debug->getLabelImplementation(GL_TRANSFORM_FEEDBACK, _id); } TransformFeedback& TransformFeedback::setLabelInternal(const Containers::ArrayView label) { createIfNotAlready(); - Context::current()->state().debug->labelImplementation(GL_TRANSFORM_FEEDBACK, _id, label); + Context::current().state().debug->labelImplementation(GL_TRANSFORM_FEEDBACK, _id, label); return *this; } #endif TransformFeedback& TransformFeedback::attachBuffer(const UnsignedInt index, Buffer& buffer, const GLintptr offset, const GLsizeiptr size) { - (this->*Context::current()->state().transformFeedback->attachRangeImplementation)(index, buffer, offset, size); + (this->*Context::current().state().transformFeedback->attachRangeImplementation)(index, buffer, offset, size); return *this; } TransformFeedback& TransformFeedback::attachBuffer(const UnsignedInt index, Buffer& buffer) { - (this->*Context::current()->state().transformFeedback->attachBaseImplementation)(index, buffer); + (this->*Context::current().state().transformFeedback->attachBaseImplementation)(index, buffer); return *this; } @@ -193,13 +193,13 @@ void TransformFeedback::attachImplementationDSA(const GLuint index, Buffer& buff /** @todoc const std::initializer_list makes Doxygen grumpy */ TransformFeedback& TransformFeedback::attachBuffers(const UnsignedInt firstIndex, std::initializer_list> buffers) { - (this->*Context::current()->state().transformFeedback->attachRangesImplementation)(firstIndex, buffers); + (this->*Context::current().state().transformFeedback->attachRangesImplementation)(firstIndex, buffers); return *this; } /** @todoc const std::initializer_list makes Doxygen grumpy */ TransformFeedback& TransformFeedback::attachBuffers(const UnsignedInt firstIndex, std::initializer_list buffers) { - (this->*Context::current()->state().transformFeedback->attachBasesImplementation)(firstIndex, buffers); + (this->*Context::current().state().transformFeedback->attachBasesImplementation)(firstIndex, buffers); return *this; } diff --git a/src/MagnumPlugins/TgaImporter/TgaImporter.cpp b/src/MagnumPlugins/TgaImporter/TgaImporter.cpp index e09fb1b77..bcddbaba0 100644 --- a/src/MagnumPlugins/TgaImporter/TgaImporter.cpp +++ b/src/MagnumPlugins/TgaImporter/TgaImporter.cpp @@ -100,7 +100,7 @@ std::optional TgaImporter::doImage2D(UnsignedInt) { /* Grayscale */ } else if(header.imageType == 3) { #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - format = Context::current() && Context::current()->isExtensionSupported() ? + format = Context::current() && Context::current().isExtensionSupported() ? PixelFormat::Red : PixelFormat::Luminance; #elif !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) format = PixelFormat::Red; From 162b7b9926a204915fa6457b8f3bd93b67270e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 18:50:31 +0100 Subject: [PATCH 050/258] Audio: return reference also from Audio::Context::current(). Similarly to previous commit, the old way is backwards compatible but deprecated. --- src/Magnum/Audio/Context.cpp | 7 +++++++ src/Magnum/Audio/Context.h | 29 +++++++++++++++++++++------ src/Magnum/Audio/Test/ContextTest.cpp | 2 +- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/Magnum/Audio/Context.cpp b/src/Magnum/Audio/Context.cpp index 9c5d0437a..58977313e 100644 --- a/src/Magnum/Audio/Context.cpp +++ b/src/Magnum/Audio/Context.cpp @@ -70,6 +70,13 @@ Debug& operator<<(Debug& debug, const Context::HrtfStatus value) { Context* Context::_current = nullptr; +bool Context::hasCurrent() { return _current; } + +Context& Context::current() { + CORRADE_ASSERT(_current, "Audio::Context::current(): no current context", *_current); + return *_current; +} + Context::Context(): Context{Configuration{}} {} Context::Context(const Configuration& config) { diff --git a/src/Magnum/Audio/Context.h b/src/Magnum/Audio/Context.h index 23dfa8142..f44782c20 100644 --- a/src/Magnum/Audio/Context.h +++ b/src/Magnum/Audio/Context.h @@ -127,8 +127,20 @@ class MAGNUM_AUDIO_EXPORT Context { UnsupportedFormat = ALC_HRTF_UNSUPPORTED_FORMAT_SOFT }; - /** @brief Current context */ - static Context* current() { return _current; } + /** + * @brief Whether there is any current context + * + * @see @ref current() + */ + static bool hasCurrent(); + + /** + * @brief Current context + * + * Expect that there is current context. + * @see @ref hasCurrent() + */ + static Context& current(); class Configuration; @@ -151,6 +163,11 @@ class MAGNUM_AUDIO_EXPORT Context { */ ~Context(); + #if defined(MAGNUM_BUILD_DEPRECATED) && !defined(DOXYGEN_GENERATING_OUTPUT) + CORRADE_DEPRECATED("Audio::Context::current() returns reference now") Context* operator->() { return this; } + CORRADE_DEPRECATED("Audio::Context::current() returns reference now") operator Context*() { return this; } + #endif + /** * @brief Whether HRTFs (Head Related Transfer Functions) are enabled * @@ -265,7 +282,7 @@ class MAGNUM_AUDIO_EXPORT Context { } private: - static Context* _current; + MAGNUM_AUDIO_LOCAL static Context* _current; /* Create a context with given configuration. Returns `true` on success. * @ref alcCreateContext(). */ @@ -410,9 +427,9 @@ MAGNUM_ASSERT_AUDIO_EXTENSION_SUPPORTED(Extensions::ALC::SOFTX::HRTF); #ifdef CORRADE_NO_ASSERT #define MAGNUM_ASSERT_AUDIO_EXTENSION_SUPPORTED(extension) do {} while(0) #else -#define MAGNUM_ASSERT_AUDIO_EXTENSION_SUPPORTED(extension) \ +#define MAGNUM_ASSERT_AUDIO_EXTENSION_SUPPORTED(extension) \ do { \ - if(!Magnum::Audio::Context::current()->isExtensionSupported()) { \ + if(!Magnum::Audio::Context::current().isExtensionSupported()) { \ Corrade::Utility::Error() << "Magnum: required OpenAL extension" << extension::string() << "is not supported"; \ std::abort(); \ } \ @@ -429,7 +446,7 @@ inline bool Context::isHrtfEnabled() const { } inline Context::HrtfStatus Context::hrtfStatus() const { - if(!Context::current()->isExtensionSupported()) + if(!Context::current().isExtensionSupported()) return isHrtfEnabled() ? HrtfStatus::Enabled : HrtfStatus::Disabled; Int status; diff --git a/src/Magnum/Audio/Test/ContextTest.cpp b/src/Magnum/Audio/Test/ContextTest.cpp index dbd384ceb..652488904 100644 --- a/src/Magnum/Audio/Test/ContextTest.cpp +++ b/src/Magnum/Audio/Test/ContextTest.cpp @@ -56,7 +56,7 @@ void ContextTest::extensionsString() { } void ContextTest::isExtensionEnabled() { - CORRADE_VERIFY(Context::current()->isExtensionSupported()); + CORRADE_VERIFY(Context::current().isExtensionSupported()); } void ContextTest::hrtfStatus() { From 5623b2ca3848c438199896eb7989761395c3c310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 18:52:39 +0100 Subject: [PATCH 051/258] Audio: well this is superfluous. --- src/Magnum/Audio/Context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/Audio/Context.h b/src/Magnum/Audio/Context.h index f44782c20..e8638154c 100644 --- a/src/Magnum/Audio/Context.h +++ b/src/Magnum/Audio/Context.h @@ -446,7 +446,7 @@ inline bool Context::isHrtfEnabled() const { } inline Context::HrtfStatus Context::hrtfStatus() const { - if(!Context::current().isExtensionSupported()) + if(!isExtensionSupported()) return isHrtfEnabled() ? HrtfStatus::Enabled : HrtfStatus::Disabled; Int status; From a5cea792cbe8113e1ef581f3dce0dd269364e295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 18:53:52 +0100 Subject: [PATCH 052/258] package/ci: run Jenkins GL tests also with extension subsets. Hardened test cases! --- package/ci/jenkins-gltests.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/package/ci/jenkins-gltests.xml b/package/ci/jenkins-gltests.xml index d6794e420..9f291c445 100644 --- a/package/ci/jenkins-gltests.xml +++ b/package/ci/jenkins-gltests.xml @@ -82,6 +82,18 @@ cd build-${compiler}-${libraries}-${compatibility}-${gl} ninja ctest --output-on-failure -R GLTest -j5 || true +if [ ${gl} = "desktop" ] ; then + MAGNUM_DISABLE_EXTENSIONS="GL_ARB_direct_state_access" ctest --output-on-failure -R GLTest -j5 || true + MAGNUM_DISABLE_EXTENSIONS="GL_ARB_direct_state_access GL_EXT_direct_state_access" ctest --output-on-failure -R GLTest -j5 || true + MAGNUM_DISABLE_EXTENSIONS="GL_ARB_direct_state_access GL_EXT_direct_state_access GL_ARB_get_texture_sub_image" ctest --output-on-failure -R GLTest -j5 || true + MAGNUM_DISABLE_EXTENSIONS="GL_ARB_direct_state_access GL_EXT_direct_state_access GL_ARB_get_texture_sub_image GL_ARB_multi_bind" ctest --output-on-failure -R GLTest -j5 || true + MAGNUM_DISABLE_EXTENSIONS="GL_ARB_direct_state_access GL_EXT_direct_state_access GL_ARB_get_texture_sub_image GL_ARB_multi_bind GL_ARB_robustness" ctest --output-on-failure -R GLTest -j5 || true + MAGNUM_DISABLE_EXTENSIONS="GL_ARB_direct_state_access GL_EXT_direct_state_access GL_ARB_get_texture_sub_image GL_ARB_multi_bind GL_ARB_robustness GL_ARB_separate_shader_objects" ctest --output-on-failure -R GLTest -j5 || true + MAGNUM_DISABLE_EXTENSIONS="GL_ARB_direct_state_access GL_EXT_direct_state_access GL_ARB_get_texture_sub_image GL_ARB_multi_bind GL_ARB_robustness GL_ARB_separate_shader_objects GL_ARB_texture_storage" ctest --output-on-failure -R GLTest -j5 || true + MAGNUM_DISABLE_EXTENSIONS="GL_ARB_direct_state_access GL_EXT_direct_state_access GL_ARB_get_texture_sub_image GL_ARB_multi_bind GL_ARB_robustness GL_ARB_separate_shader_objects GL_ARB_texture_storage GL_ARB_texture_storage_multisample" ctest --output-on-failure -R GLTest -j5 || true + MAGNUM_DISABLE_EXTENSIONS="GL_ARB_direct_state_access GL_EXT_direct_state_access GL_ARB_get_texture_sub_image GL_ARB_multi_bind GL_ARB_robustness GL_ARB_separate_shader_objects GL_ARB_texture_storage GL_ARB_texture_storage_multisample GL_KHR_debug" ctest --output-on-failure -R GLTest -j5 || true + MAGNUM_DISABLE_EXTENSIONS="GL_ARB_direct_state_access GL_EXT_direct_state_access GL_ARB_get_texture_sub_image GL_ARB_multi_bind GL_ARB_robustness GL_ARB_separate_shader_objects GL_ARB_texture_storage GL_ARB_texture_storage_multisample GL_KHR_debug GL_ARB_compressed_texture_pixel_storage" ctest --output-on-failure -R GLTest -j5 || true +fi ]]> From 20b4c98a9b0dcaef916d26b5d1dc70a2afa67d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 19:17:36 +0100 Subject: [PATCH 053/258] More NVidia-specific XFAILs for compressed pixel storage. Or I misunderstood the 3D BPTC compression completely. --- src/Magnum/Test/TextureGLTest.cpp | 40 ++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/src/Magnum/Test/TextureGLTest.cpp b/src/Magnum/Test/TextureGLTest.cpp index 6029591d8..9fc1d9234 100644 --- a/src/Magnum/Test/TextureGLTest.cpp +++ b/src/Magnum/Test/TextureGLTest.cpp @@ -1719,9 +1719,15 @@ void TextureGLTest::compressedSubImage3D() { MAGNUM_VERIFY_NO_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{12, 4, 4})); - CORRADE_COMPARE_AS( - (Containers::ArrayView{image.data(), image.data().size()}), - Containers::ArrayView{CompressedSubData3DComplete}, TestSuite::Compare::Container); + + { + CORRADE_EXPECT_FAIL_IF(!Context::current().isExtensionSupported() && (Context::current().detectedDriver() & Context::DetectedDriver::NVidia), + "Default compressed pixel storage behaves weirdly with BPTC compression on NVidia"); + + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}), + Containers::ArrayView{CompressedSubData3DComplete}, TestSuite::Compare::Container); + } #endif } @@ -1769,7 +1775,13 @@ void TextureGLTest::compressedSubImage3DBuffer() { MAGNUM_VERIFY_NO_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{12, 4, 4})); - CORRADE_COMPARE_AS(imageData, Containers::ArrayView{CompressedSubData3DComplete}, TestSuite::Compare::Container); + + { + CORRADE_EXPECT_FAIL_IF(!Context::current().isExtensionSupported() && (Context::current().detectedDriver() & Context::DetectedDriver::NVidia), + "Default compressed pixel storage behaves weirdly with BPTC compression on NVidia"); + + CORRADE_COMPARE_AS(imageData, Containers::ArrayView{CompressedSubData3DComplete}, TestSuite::Compare::Container); + } #endif } #endif @@ -1829,9 +1841,15 @@ void TextureGLTest::compressedSubImage3DQuery() { MAGNUM_VERIFY_NO_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4})); - CORRADE_COMPARE_AS( - (Containers::ArrayView{image.data(), image.data().size()}.suffix(_compressedDataOffset3D)), - Containers::ArrayView{CompressedData3D}, TestSuite::Compare::Container); + + { + CORRADE_EXPECT_FAIL_IF(!Context::current().isExtensionSupported() && (Context::current().detectedDriver() & Context::DetectedDriver::NVidia), + "Default compressed pixel storage behaves weirdly with BPTC compression on NVidia"); + + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}.suffix(_compressedDataOffset3D)), + Containers::ArrayView{CompressedData3D}, TestSuite::Compare::Container); + } } void TextureGLTest::subImage3DQueryBuffer() { @@ -1889,7 +1907,13 @@ void TextureGLTest::compressedSubImage3DQueryBuffer() { MAGNUM_VERIFY_NO_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{4}); - CORRADE_COMPARE_AS(imageData.suffix(_compressedDataOffset3D), Containers::ArrayView{CompressedData3D}, TestSuite::Compare::Container); + + { + CORRADE_EXPECT_FAIL_IF(!Context::current().isExtensionSupported() && (Context::current().detectedDriver() & Context::DetectedDriver::NVidia), + "Default compressed pixel storage behaves weirdly with BPTC compression on NVidia"); + + CORRADE_COMPARE_AS(imageData.suffix(_compressedDataOffset3D), Containers::ArrayView{CompressedData3D}, TestSuite::Compare::Container); + } } void TextureGLTest::generateMipmap1D() { From 395450cd5b5567f532f028fe29aad0637c7b8e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 19:27:15 +0100 Subject: [PATCH 054/258] Fix compilation on Windows. --- src/Magnum/Implementation/driverSpecific.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Implementation/driverSpecific.cpp b/src/Magnum/Implementation/driverSpecific.cpp index 89e98b10e..3efda5e03 100644 --- a/src/Magnum/Implementation/driverSpecific.cpp +++ b/src/Magnum/Implementation/driverSpecific.cpp @@ -83,7 +83,7 @@ bool isShaderCompilationLogEmpty(const std::string&); bool isShaderCompilationLogEmpty(const std::string& result) { #if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_TARGET_GLES) /* Intel Windows drivers are too chatty */ - if((Context::current()detectedDriver() & Context::DetectedDriver::IntelWindows) && result == "No errors.\n") + if((Context::current().detectedDriver() & Context::DetectedDriver::IntelWindows) && result == "No errors.\n") return true; #else static_cast(result); @@ -97,7 +97,7 @@ bool isProgramLinkLogEmpty(const std::string&); bool isProgramLinkLogEmpty(const std::string& result) { #if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_TARGET_GLES) /* Intel Windows drivers are too chatty */ - if((Context::current()detectedDriver() & Context::DetectedDriver::IntelWindows) && result == "No errors.\n") + if((Context::current().detectedDriver() & Context::DetectedDriver::IntelWindows) && result == "No errors.\n") return true; #else static_cast(result); From e0645d30dfb1564b05b0a5c71af57fa89b28d627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 19:39:32 +0100 Subject: [PATCH 055/258] TgaImporter: fix compilation on ES2. --- src/MagnumPlugins/TgaImporter/TgaImporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MagnumPlugins/TgaImporter/TgaImporter.cpp b/src/MagnumPlugins/TgaImporter/TgaImporter.cpp index bcddbaba0..e052eceeb 100644 --- a/src/MagnumPlugins/TgaImporter/TgaImporter.cpp +++ b/src/MagnumPlugins/TgaImporter/TgaImporter.cpp @@ -100,7 +100,7 @@ std::optional TgaImporter::doImage2D(UnsignedInt) { /* Grayscale */ } else if(header.imageType == 3) { #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - format = Context::current() && Context::current().isExtensionSupported() ? + format = Context::hasCurrent() && Context::current().isExtensionSupported() ? PixelFormat::Red : PixelFormat::Luminance; #elif !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) format = PixelFormat::Red; From 2557c963ab253b17284da2d043cb34ef9a108f5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 19:48:05 +0100 Subject: [PATCH 056/258] Shaders: fix compilation on ES2. --- src/Magnum/Shaders/MeshVisualizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/Shaders/MeshVisualizer.cpp b/src/Magnum/Shaders/MeshVisualizer.cpp index 8336daec7..aad6727df 100644 --- a/src/Magnum/Shaders/MeshVisualizer.cpp +++ b/src/Magnum/Shaders/MeshVisualizer.cpp @@ -76,7 +76,7 @@ MeshVisualizer::MeshVisualizer(const Flags flags): flags(flags), transformationP #ifdef MAGNUM_TARGET_WEBGL .addSource("#define SUBSCRIPTING_WORKAROUND\n") #elif defined(MAGNUM_TARGET_GLES2) - .addSource(Context::current()detectedDriver() & Context::DetectedDriver::ProbablyAngle ? + .addSource(Context::current().detectedDriver() & Context::DetectedDriver::ProbablyAngle ? "#define SUBSCRIPTING_WORKAROUND\n" : "") #endif .addSource(rs.get("generic.glsl")) From fede9f3f8d72acd531f17c2ac7c4ee0bffa58c0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 5 Jan 2016 14:56:20 +0100 Subject: [PATCH 057/258] Math: fix test compilation on XCode. See file comment for details. Yet another instance of the problem described in #37. --- src/Magnum/CMakeLists.txt | 3 ++- src/Magnum/Math/dummy.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/Magnum/Math/dummy.cpp diff --git a/src/Magnum/CMakeLists.txt b/src/Magnum/CMakeLists.txt index 124c16061..95e8f6f2f 100644 --- a/src/Magnum/CMakeLists.txt +++ b/src/Magnum/CMakeLists.txt @@ -310,7 +310,8 @@ endif() if(BUILD_TESTS) # Library with graceful assert for testing add_library(MagnumMathTestLib ${SHARED_OR_STATIC} - $) + $ + Math/dummy.cpp) # XCode workaround, see file comment for details set_target_properties(MagnumMathTestLib PROPERTIES COMPILE_FLAGS "-DCORRADE_GRACEFUL_ASSERT" DEBUG_POSTFIX "-d") diff --git a/src/Magnum/Math/dummy.cpp b/src/Magnum/Math/dummy.cpp new file mode 100644 index 000000000..4bb556a95 --- /dev/null +++ b/src/Magnum/Math/dummy.cpp @@ -0,0 +1,30 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + 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. +*/ + +/* XCode-generated project files have a limitation that you can't create a + library target from OBJECT sources only and you have to provide at least one + file. Otherwise the generated library gets replaced with self-pointing + symlink and the build then obviously fails with "File not found" error. That + affected the MagnumMathTestLib library and this file should fix it. */ From 931f78d577bb0b525d9c9df6e27dcb546dfd29f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 6 Jan 2016 08:51:55 +0100 Subject: [PATCH 058/258] Fix object label queries with EXT_debug_label. --- src/Magnum/AbstractObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/AbstractObject.cpp b/src/Magnum/AbstractObject.cpp index 65f672c02..2e0f55041 100644 --- a/src/Magnum/AbstractObject.cpp +++ b/src/Magnum/AbstractObject.cpp @@ -205,7 +205,7 @@ std::string AbstractObject::getLabelImplementationExt(const GLenum identifier, c std::string label; label.resize(size+1); #ifndef CORRADE_TARGET_NACL - glGetObjectLabelEXT(identifier, name, size+1, nullptr, &label[0]); + glGetObjectLabelEXT(type, name, size+1, nullptr, &label[0]); #else CORRADE_ASSERT_UNREACHABLE(); #endif From 39f6e849a6fd86621cbcf772477bad749473b6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Jan 2016 09:12:58 +0100 Subject: [PATCH 059/258] Properly check for all extensions in object label test. --- src/Magnum/Test/AbstractObjectGLTest.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Magnum/Test/AbstractObjectGLTest.cpp b/src/Magnum/Test/AbstractObjectGLTest.cpp index 0cece2beb..eb010b8dd 100644 --- a/src/Magnum/Test/AbstractObjectGLTest.cpp +++ b/src/Magnum/Test/AbstractObjectGLTest.cpp @@ -43,6 +43,8 @@ AbstractObjectGLTest::AbstractObjectGLTest() { void AbstractObjectGLTest::labelNoOp() { if(Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is supported.")); + if(Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::debug_label::string() + std::string(" is supported.")); Buffer buffer; buffer.setLabel("MyBuffer"); From 2e6e53b552bf7800eee262154d05fe2c1d7623e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Jan 2016 09:16:30 +0100 Subject: [PATCH 060/258] Don't use GLSL < 130 in GL tests on OSX. OSX doesn't support anything below what's in GL 3.1 when using core contexts. --- .../Test/AbstractShaderProgramGLTest.cpp | 89 ++++++++++-- .../MyShader.frag | 10 +- .../MyShader.vert | 6 +- src/Magnum/Test/MeshGLTest.cpp | 127 ++++++++++++------ src/Magnum/Test/PrimitiveQueryGLTest.cpp | 22 ++- src/Magnum/Test/SampleQueryGLTest.cpp | 28 +++- src/Magnum/Test/ShaderGLTest.cpp | 8 +- src/Magnum/Test/TransformFeedbackGLTest.cpp | 24 +++- 8 files changed, 249 insertions(+), 65 deletions(-) diff --git a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp index bda6908c2..e3f97fc7f 100644 --- a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp @@ -155,7 +155,13 @@ void AbstractShaderProgramGLTest::create() { Utility::Resource rs("AbstractShaderProgramGLTest"); #ifndef MAGNUM_TARGET_GLES - Shader vert(Version::GL210, Shader::Type::Vertex); + Shader vert( + #ifndef CORRADE_TARGET_APPLE + Version::GL210 + #else + Version::GL310 + #endif + , Shader::Type::Vertex); #else Shader vert(Version::GLES200, Shader::Type::Vertex); #endif @@ -163,7 +169,13 @@ void AbstractShaderProgramGLTest::create() { const bool vertCompiled = vert.compile(); #ifndef MAGNUM_TARGET_GLES - Shader frag(Version::GL210, Shader::Type::Fragment); + Shader frag( + #ifndef CORRADE_TARGET_APPLE + Version::GL210 + #else + Version::GL310 + #endif + , Shader::Type::Fragment); #else Shader frag(Version::GLES200, Shader::Type::Fragment); #endif @@ -203,11 +215,23 @@ void AbstractShaderProgramGLTest::createMultipleOutputs() { #ifndef MAGNUM_TARGET_GLES Utility::Resource rs("AbstractShaderProgramGLTest"); - Shader vert(Version::GL210, Shader::Type::Vertex); + Shader vert( + #ifndef CORRADE_TARGET_APPLE + Version::GL210 + #else + Version::GL310 + #endif + , Shader::Type::Vertex); vert.addSource(rs.get("MyShader.vert")); const bool vertCompiled = vert.compile(); - Shader frag(Version::GL300, Shader::Type::Fragment); + Shader frag( + #ifndef CORRADE_TARGET_APPLE + Version::GL300 + #else + Version::GL310 + #endif + , Shader::Type::Fragment); frag.addSource(rs.get("MyShaderFragmentOutputs.frag")); const bool fragCompiled = frag.compile(); @@ -240,11 +264,23 @@ void AbstractShaderProgramGLTest::createMultipleOutputs() { void AbstractShaderProgramGLTest::createMultipleOutputsIndexed() { Utility::Resource rs("AbstractShaderProgramGLTest"); - Shader vert(Version::GL210, Shader::Type::Vertex); + Shader vert( + #ifndef CORRADE_TARGET_APPLE + Version::GL210 + #else + Version::GL310 + #endif + , Shader::Type::Vertex); vert.addSource(rs.get("MyShader.vert")); const bool vertCompiled = vert.compile(); - Shader frag(Version::GL300, Shader::Type::Fragment); + Shader frag( + #ifndef CORRADE_TARGET_APPLE + Version::GL300 + #else + Version::GL310 + #endif + , Shader::Type::Fragment); frag.addSource(rs.get("MyShaderFragmentOutputs.frag")); const bool fragCompiled = frag.compile(); @@ -273,14 +309,33 @@ void AbstractShaderProgramGLTest::uniformLocationOptimizedOut() { MyPublicShader program; #ifndef MAGNUM_TARGET_GLES - Shader vert(Version::GL210, Shader::Type::Vertex); - Shader frag(Version::GL210, Shader::Type::Fragment); + Shader vert( + #ifndef CORRADE_TARGET_APPLE + Version::GL210 + #else + Version::GL310 + #endif + , Shader::Type::Vertex); + Shader frag( + #ifndef CORRADE_TARGET_APPLE + Version::GL210 + #else + Version::GL310 + #endif + , Shader::Type::Fragment); #else Shader vert(Version::GLES200, Shader::Type::Vertex); Shader frag(Version::GLES200, Shader::Type::Fragment); #endif vert.addSource("void main() { gl_Position = vec4(0.0); }"); - frag.addSource("void main() { gl_FragColor = vec4(1.0); }"); + frag.addSource( + #ifndef CORRADE_TARGET_APPLE + "void main() { gl_FragColor = vec4(1.0); }" + #else + "out vec4 color;\n" + "void main() { color = vec4(1.0); }" + #endif + ); CORRADE_VERIFY(Shader::compile({vert, frag})); program.attachShaders({vert, frag}); @@ -313,8 +368,20 @@ MyShader::MyShader() { Utility::Resource rs("AbstractShaderProgramGLTest"); #ifndef MAGNUM_TARGET_GLES - Shader vert(Version::GL210, Shader::Type::Vertex); - Shader frag(Version::GL210, Shader::Type::Fragment); + Shader vert( + #ifndef CORRADE_TARGET_APPLE + Version::GL210 + #else + Version::GL310 + #endif + , Shader::Type::Vertex); + Shader frag( + #ifndef CORRADE_TARGET_APPLE + Version::GL210 + #else + Version::GL310 + #endif + , Shader::Type::Fragment); #else Shader vert(Version::GLES200, Shader::Type::Vertex); Shader frag(Version::GLES200, Shader::Type::Fragment); diff --git a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/MyShader.frag b/src/Magnum/Test/AbstractShaderProgramGLTestFiles/MyShader.frag index c15b54a91..a0b53ae68 100644 --- a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/MyShader.frag +++ b/src/Magnum/Test/AbstractShaderProgramGLTestFiles/MyShader.frag @@ -2,10 +2,18 @@ #define lowp #endif +#if defined(GL_ES) || __VERSION__ == 120 +#define fragColor gl_FragColor +#endif + uniform lowp float multiplier; uniform lowp vec4 color; uniform lowp vec4 additions[3]; +#if !defined(GL_ES) && __VERSION__ >= 130 +out lowp vec4 fragColor; +#endif + void main() { - gl_FragColor = color*multiplier + additions[0] + additions[1] + additions[2]; + fragColor = color*multiplier + additions[0] + additions[1] + additions[2]; } diff --git a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/MyShader.vert b/src/Magnum/Test/AbstractShaderProgramGLTestFiles/MyShader.vert index 5d8ff9029..d839d0f7e 100644 --- a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/MyShader.vert +++ b/src/Magnum/Test/AbstractShaderProgramGLTestFiles/MyShader.vert @@ -2,7 +2,11 @@ #define mediump #endif -attribute mediump vec4 position; +#if defined(GL_ES) || __VERSION__ == 120 +#define in attribute +#endif + +in mediump vec4 position; uniform mediump mat4 matrix; diff --git a/src/Magnum/Test/MeshGLTest.cpp b/src/Magnum/Test/MeshGLTest.cpp index 1c1513481..e8e74cc89 100644 --- a/src/Magnum/Test/MeshGLTest.cpp +++ b/src/Magnum/Test/MeshGLTest.cpp @@ -384,8 +384,20 @@ FloatShader::FloatShader(const std::string& type, const std::string& conversion) /* We need special version for ES3, because GLSL in ES2 doesn't support rectangle matrices */ #ifndef MAGNUM_TARGET_GLES - Shader vert(Version::GL210, Shader::Type::Vertex); - Shader frag(Version::GL210, Shader::Type::Fragment); + Shader vert( + #ifndef CORRADE_TARGET_APPLE + Version::GL210 + #else + Version::GL310 + #endif + , Shader::Type::Vertex); + Shader frag( + #ifndef CORRADE_TARGET_APPLE + Version::GL210 + #else + Version::GL310 + #endif + , Shader::Type::Fragment); #elif defined(MAGNUM_TARGET_GLES2) Shader vert(Version::GLES200, Shader::Type::Vertex); Shader frag(Version::GLES200, Shader::Type::Fragment); @@ -395,32 +407,32 @@ FloatShader::FloatShader(const std::string& type, const std::string& conversion) #endif vert.addSource( - #if !defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_GLES2) "#if !defined(GL_ES) && __VERSION__ == 120\n" "#define mediump\n" "#endif\n" - "attribute mediump " + type + " value;\n" - "varying mediump " + type + " valueInterpolated;\n" - #else + "#if defined(GL_ES) || __VERSION__ == 120\n" + "#define in attribute\n" + "#define out varying\n" + "#endif\n" "in mediump " + type + " value;\n" "out mediump " + type + " valueInterpolated;\n" - #endif "void main() {\n" " valueInterpolated = value;\n" " gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n" "}\n"); - - #if !defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_GLES2) - frag.addSource("#if !defined(GL_ES) && __VERSION__ == 120\n" - "#define mediump\n" - "#endif\n" - "varying mediump " + type + " valueInterpolated;\n" - "void main() { gl_FragColor = " + conversion + "; }\n"); - #else - frag.addSource("in mediump " + type + " valueInterpolated;\n" - "out mediump vec4 result;\n" - "void main() { result = " + conversion + "; }\n"); - #endif + frag.addSource( + "#if !defined(GL_ES) && __VERSION__ == 120\n" + "#define mediump\n" + "#endif\n" + "#if defined(GL_ES) || __VERSION__ == 120\n" + "#define in varying\n" + "#define result gl_FragColor\n" + "#endif\n" + "in mediump " + type + " valueInterpolated;\n" + "#if !defined(GL_ES) && __VERSION__ >= 130\n" + "out mediump vec4 result;\n" + "#endif\n" + "void main() { result = " + conversion + "; }\n"); CORRADE_INTERNAL_ASSERT_OUTPUT(Shader::compile({vert, frag})); @@ -434,8 +446,20 @@ FloatShader::FloatShader(const std::string& type, const std::string& conversion) #ifndef MAGNUM_TARGET_GLES2 IntegerShader::IntegerShader(const std::string& type) { #ifndef MAGNUM_TARGET_GLES - Shader vert(Version::GL300, Shader::Type::Vertex); - Shader frag(Version::GL300, Shader::Type::Fragment); + Shader vert( + #ifndef CORRADE_TARGET_APPLE + Version::GL300 + #else + Version::GL310 + #endif + , Shader::Type::Vertex); + Shader frag( + #ifndef CORRADE_TARGET_APPLE + Version::GL300 + #else + Version::GL310 + #endif + , Shader::Type::Fragment); #else Shader vert(Version::GLES300, Shader::Type::Vertex); Shader frag(Version::GLES300, Shader::Type::Fragment); @@ -1144,29 +1168,54 @@ namespace { #ifndef DOXYGEN_GENERATING_OUTPUT MultipleShader::MultipleShader() { #ifndef MAGNUM_TARGET_GLES - Shader vert(Version::GL210, Shader::Type::Vertex); - Shader frag(Version::GL210, Shader::Type::Fragment); + Shader vert( + #ifndef CORRADE_TARGET_APPLE + Version::GL210 + #else + Version::GL310 + #endif + , Shader::Type::Vertex); + Shader frag( + #ifndef CORRADE_TARGET_APPLE + Version::GL210 + #else + Version::GL310 + #endif + , Shader::Type::Fragment); #else Shader vert(Version::GLES200, Shader::Type::Vertex); Shader frag(Version::GLES200, Shader::Type::Fragment); #endif - vert.addSource("#if !defined(GL_ES) && __VERSION__ == 120\n" - "#define mediump\n" - "#endif\n" - "attribute mediump vec4 position;\n" - "attribute mediump vec3 normal;\n" - "attribute mediump vec2 textureCoordinates;\n" - "varying mediump vec4 valueInterpolated;\n" - "void main() {\n" - " valueInterpolated = position + vec4(normal, 0.0) + vec4(textureCoordinates, 0.0, 0.0);\n" - " gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n" - "}\n"); - frag.addSource("#if !defined(GL_ES) && __VERSION__ == 120\n" - "#define mediump\n" - "#endif\n" - "varying mediump vec4 valueInterpolated;\n" - "void main() { gl_FragColor = valueInterpolated; }\n"); + vert.addSource( + "#if !defined(GL_ES) && __VERSION__ == 120\n" + "#define mediump\n" + "#endif\n" + "#if defined(GL_ES) || __VERSION__ == 120\n" + "#define in attribute\n" + "#define out varying\n" + "#endif\n" + "in mediump vec4 position;\n" + "in mediump vec3 normal;\n" + "in mediump vec2 textureCoordinates;\n" + "out mediump vec4 valueInterpolated;\n" + "void main() {\n" + " valueInterpolated = position + vec4(normal, 0.0) + vec4(textureCoordinates, 0.0, 0.0);\n" + " gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n" + "}\n"); + frag.addSource( + "#if !defined(GL_ES) && __VERSION__ == 120\n" + "#define mediump\n" + "#endif\n" + "#if defined(GL_ES) || __VERSION__ == 120\n" + "#define in varying\n" + "#define result gl_FragColor\n" + "#endif\n" + "in mediump vec4 valueInterpolated;\n" + "#if !defined(GL_ES) && __VERSION__ >= 130\n" + "out mediump vec4 result;\n" + "#endif\n" + "void main() { result = valueInterpolated; }\n"); CORRADE_INTERNAL_ASSERT_OUTPUT(Shader::compile({vert, frag})); diff --git a/src/Magnum/Test/PrimitiveQueryGLTest.cpp b/src/Magnum/Test/PrimitiveQueryGLTest.cpp index b0f704744..c4f09d2da 100644 --- a/src/Magnum/Test/PrimitiveQueryGLTest.cpp +++ b/src/Magnum/Test/PrimitiveQueryGLTest.cpp @@ -99,13 +99,19 @@ void PrimitiveQueryGLTest::primitivesGenerated() { typedef Attribute<0, Vector2> Position; explicit MyShader() { - Shader vert(Version::GL210, Shader::Type::Vertex); + Shader vert( + #ifndef CORRADE_TARGET_APPLE + Version::GL210 + #else + Version::GL310 + #endif + , Shader::Type::Vertex); CORRADE_INTERNAL_ASSERT_OUTPUT(vert.addSource( - "#if !defined(GL_ES) && __VERSION__ == 120\n" - "#define lowp\n" + "#if __VERSION__ >= 130\n" + "#define attribute in\n" "#endif\n" - "attribute lowp vec4 position;\n" + "attribute vec4 position;\n" "void main() {\n" " gl_Position = position;\n" "}\n").compile()); @@ -153,7 +159,13 @@ void PrimitiveQueryGLTest::transformFeedbackPrimitivesWritten() { struct MyShader: AbstractShaderProgram { explicit MyShader() { #ifndef MAGNUM_TARGET_GLES - Shader vert(Version::GL300, Shader::Type::Vertex); + Shader vert( + #ifndef CORRADE_TARGET_APPLE + Version::GL300 + #else + Version::GL310 + #endif + , Shader::Type::Vertex); #else Shader vert(Version::GLES300, Shader::Type::Vertex); Shader frag(Version::GLES300, Shader::Type::Fragment); diff --git a/src/Magnum/Test/SampleQueryGLTest.cpp b/src/Magnum/Test/SampleQueryGLTest.cpp index 096425fd2..786e16bb4 100644 --- a/src/Magnum/Test/SampleQueryGLTest.cpp +++ b/src/Magnum/Test/SampleQueryGLTest.cpp @@ -111,8 +111,20 @@ namespace { #ifndef DOXYGEN_GENERATING_OUTPUT MyShader::MyShader() { #ifndef MAGNUM_TARGET_GLES - Shader vert(Version::GL210, Shader::Type::Vertex); - Shader frag(Version::GL210, Shader::Type::Fragment); + Shader vert( + #ifndef CORRADE_TARGET_APPLE + Version::GL210 + #else + Version::GL310 + #endif + , Shader::Type::Vertex); + Shader frag( + #ifndef CORRADE_TARGET_APPLE + Version::GL210 + #else + Version::GL310 + #endif + , Shader::Type::Fragment); #else Shader vert(Version::GLES200, Shader::Type::Vertex); Shader frag(Version::GLES200, Shader::Type::Fragment); @@ -122,13 +134,21 @@ MyShader::MyShader() { "#if !defined(GL_ES) && __VERSION__ == 120\n" "#define lowp\n" "#endif\n" - "attribute lowp vec4 position;\n" + "#if defined(GL_ES) || __VERSION__ == 120\n" + "#define in attribute\n" + "#endif\n" + "in lowp vec4 position;\n" "void main() {\n" " gl_Position = position;\n" "}\n"); frag.addSource( + "#if !defined(GL_ES) && __VERSION__ >= 130\n" + "out vec4 color;\n" + "#else\n" + "#define color gl_FragColor\n" + "#endif\n" "void main() {\n" - " gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n" + " color = vec4(1.0, 1.0, 1.0, 1.0);\n" "}\n"); CORRADE_INTERNAL_ASSERT_OUTPUT(Shader::compile({vert, frag})); diff --git a/src/Magnum/Test/ShaderGLTest.cpp b/src/Magnum/Test/ShaderGLTest.cpp index ef46df54b..205d9ce86 100644 --- a/src/Magnum/Test/ShaderGLTest.cpp +++ b/src/Magnum/Test/ShaderGLTest.cpp @@ -209,7 +209,13 @@ void ShaderGLTest::addFile() { void ShaderGLTest::compile() { #ifndef MAGNUM_TARGET_GLES - constexpr Version v = Version::GL210; + constexpr Version v = + #ifndef CORRADE_TARGET_APPLE + Version::GL210 + #else + Version::GL310 + #endif + ; #else constexpr Version v = Version::GLES200; #endif diff --git a/src/Magnum/Test/TransformFeedbackGLTest.cpp b/src/Magnum/Test/TransformFeedbackGLTest.cpp index b2024101a..d7012ec2b 100644 --- a/src/Magnum/Test/TransformFeedbackGLTest.cpp +++ b/src/Magnum/Test/TransformFeedbackGLTest.cpp @@ -189,7 +189,13 @@ struct XfbShader: AbstractShaderProgram { XfbShader::XfbShader() { #ifndef MAGNUM_TARGET_GLES - Shader vert(Version::GL300, Shader::Type::Vertex); + Shader vert( + #ifndef CORRADE_TARGET_APPLE + Version::GL300 + #else + Version::GL310 + #endif + , Shader::Type::Vertex); #else Shader vert(Version::GLES300, Shader::Type::Vertex); Shader frag(Version::GLES300, Shader::Type::Fragment); @@ -299,7 +305,13 @@ struct XfbMultiShader: AbstractShaderProgram { XfbMultiShader::XfbMultiShader() { #ifndef MAGNUM_TARGET_GLES - Shader vert(Version::GL300, Shader::Type::Vertex); + Shader vert( + #ifndef CORRADE_TARGET_APPLE + Version::GL300 + #else + Version::GL310 + #endif + , Shader::Type::Vertex); #else Shader vert(Version::GLES300, Shader::Type::Vertex); Shader frag(Version::GLES300, Shader::Type::Fragment); @@ -426,7 +438,13 @@ void TransformFeedbackGLTest::interleaved() { typedef Attribute<0, Vector2> Input; explicit XfbInterleavedShader() { - Shader vert(Version::GL300, Shader::Type::Vertex); + Shader vert( + #ifndef CORRADE_TARGET_APPLE + Version::GL300 + #else + Version::GL310 + #endif + , Shader::Type::Vertex); CORRADE_INTERNAL_ASSERT_OUTPUT(vert.addSource( "in mediump vec2 inputData;\n" "out mediump vec2 output1;\n" From 7ac84644dae6834ab719a9bffb54ecae4c528af5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Jan 2016 09:18:11 +0100 Subject: [PATCH 061/258] Avoid errors in GL tests on windowless applications w/o default FB. Like the one on OSX. --- src/Magnum/Test/PrimitiveQueryGLTest.cpp | 17 +++++++++ src/Magnum/Test/TransformFeedbackGLTest.cpp | 38 +++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/src/Magnum/Test/PrimitiveQueryGLTest.cpp b/src/Magnum/Test/PrimitiveQueryGLTest.cpp index c4f09d2da..93d3f1016 100644 --- a/src/Magnum/Test/PrimitiveQueryGLTest.cpp +++ b/src/Magnum/Test/PrimitiveQueryGLTest.cpp @@ -28,8 +28,11 @@ #include "Magnum/AbstractShaderProgram.h" #include "Magnum/Buffer.h" +#include "Magnum/Framebuffer.h" #include "Magnum/Mesh.h" #include "Magnum/PrimitiveQuery.h" +#include "Magnum/Renderbuffer.h" +#include "Magnum/RenderbufferFormat.h" #include "Magnum/Shader.h" #include "Magnum/TransformFeedback.h" #include "Magnum/Math/Vector2.h" @@ -95,6 +98,13 @@ void PrimitiveQueryGLTest::primitivesGenerated() { if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::transform_feedback::string() + std::string(" is not available.")); + /* Bind some FB to avoid errors on contexts w/o default FB */ + Renderbuffer color; + color.setStorage(RenderbufferFormat::RGBA8, Vector2i{32}); + Framebuffer fb{{{}, Vector2i{32}}}; + fb.attachRenderbuffer(Framebuffer::ColorAttachment{0}, color) + .bind(); + struct MyShader: AbstractShaderProgram { typedef Attribute<0, Vector2> Position; @@ -156,6 +166,13 @@ void PrimitiveQueryGLTest::transformFeedbackPrimitivesWritten() { CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not available.")); #endif + /* Bind some FB to avoid errors on contexts w/o default FB */ + Renderbuffer color; + color.setStorage(RenderbufferFormat::RGBA8, Vector2i{32}); + Framebuffer fb{{{}, Vector2i{32}}}; + fb.attachRenderbuffer(Framebuffer::ColorAttachment{0}, color) + .bind(); + struct MyShader: AbstractShaderProgram { explicit MyShader() { #ifndef MAGNUM_TARGET_GLES diff --git a/src/Magnum/Test/TransformFeedbackGLTest.cpp b/src/Magnum/Test/TransformFeedbackGLTest.cpp index d7012ec2b..a59cbe7db 100644 --- a/src/Magnum/Test/TransformFeedbackGLTest.cpp +++ b/src/Magnum/Test/TransformFeedbackGLTest.cpp @@ -25,7 +25,10 @@ #include "Magnum/AbstractShaderProgram.h" #include "Magnum/Buffer.h" +#include "Magnum/Framebuffer.h" #include "Magnum/Mesh.h" +#include "Magnum/Renderbuffer.h" +#include "Magnum/RenderbufferFormat.h" #include "Magnum/Shader.h" #include "Magnum/TransformFeedback.h" #include "Magnum/Math/Vector2.h" @@ -229,6 +232,13 @@ void TransformFeedbackGLTest::attachBase() { CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif + /* Bind some FB to avoid errors on contexts w/o default FB */ + Renderbuffer color; + color.setStorage(RenderbufferFormat::RGBA8, Vector2i{32}); + Framebuffer fb{{{}, Vector2i{32}}}; + fb.attachRenderbuffer(Framebuffer::ColorAttachment{0}, color) + .bind(); + XfbShader shader; Buffer input; @@ -265,6 +275,13 @@ void TransformFeedbackGLTest::attachRange() { CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif + /* Bind some FB to avoid errors on contexts w/o default FB */ + Renderbuffer color; + color.setStorage(RenderbufferFormat::RGBA8, Vector2i{32}); + Framebuffer fb{{{}, Vector2i{32}}}; + fb.attachRenderbuffer(Framebuffer::ColorAttachment{0}, color) + .bind(); + XfbShader shader; Buffer input; @@ -347,6 +364,13 @@ void TransformFeedbackGLTest::attachBases() { CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif + /* Bind some FB to avoid errors on contexts w/o default FB */ + Renderbuffer color; + color.setStorage(RenderbufferFormat::RGBA8, Vector2i{32}); + Framebuffer fb{{{}, Vector2i{32}}}; + fb.attachRenderbuffer(Framebuffer::ColorAttachment{0}, color) + .bind(); + XfbMultiShader shader; Buffer input; @@ -389,6 +413,13 @@ void TransformFeedbackGLTest::attachRanges() { CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif + /* Bind some FB to avoid errors on contexts w/o default FB */ + Renderbuffer color; + color.setStorage(RenderbufferFormat::RGBA8, Vector2i{32}); + Framebuffer fb{{{}, Vector2i{32}}}; + fb.attachRenderbuffer(Framebuffer::ColorAttachment{0}, color) + .bind(); + Buffer input; input.setData(inputData, BufferUsage::StaticDraw); Buffer output1, output2; @@ -434,6 +465,13 @@ void TransformFeedbackGLTest::interleaved() { if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::transform_feedback3::string() + std::string(" is not supported.")); + /* Bind some FB to avoid errors on contexts w/o default FB */ + Renderbuffer color; + color.setStorage(RenderbufferFormat::RGBA8, Vector2i{32}); + Framebuffer fb{{{}, Vector2i{32}}}; + fb.attachRenderbuffer(Framebuffer::ColorAttachment{0}, color) + .bind(); + struct XfbInterleavedShader: AbstractShaderProgram { typedef Attribute<0, Vector2> Input; From 6d067e389f11c93b65747cb4044fdaa1bf78d3ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Jan 2016 09:38:24 +0100 Subject: [PATCH 062/258] Forgotten enumset operators for Context::DetectedDrivers. --- src/Magnum/Context.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index 885a02cb1..6e75f0319 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -534,6 +534,8 @@ class MAGNUM_EXPORT Context { std::vector _disabledExtensions; }; +CORRADE_ENUMSET_OPERATORS(Context::DetectedDrivers) + #ifndef MAGNUM_TARGET_WEBGL /** @debugoperatorclassenum{Magnum::Context,Magnum::Context::Flag} */ MAGNUM_EXPORT Debug& operator<<(Debug& debug, Context::Flag value); From b52d0e345d8075d58d109140bb4fd13bdb188032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Jan 2016 17:50:58 +0100 Subject: [PATCH 063/258] Fix false-positive AMD/NVidia driver detection on OSX. Apple has its own drivers but still names the vendor the same way as if it were the Windows/Linux binary drivers. Weird and/or sneaky. --- src/Magnum/Context.h | 2 +- src/Magnum/Implementation/driverSpecific.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index 6e75f0319..06a2e93d5 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -212,7 +212,7 @@ class MAGNUM_EXPORT Context { #endif #ifndef MAGNUM_TARGET_WEBGL - /** Binary NVidia drivers */ + /** Binary NVidia drivers on Windows and Linux */ NVidia = 1 << 2, #endif diff --git a/src/Magnum/Implementation/driverSpecific.cpp b/src/Magnum/Implementation/driverSpecific.cpp index 3efda5e03..f480b3805 100644 --- a/src/Magnum/Implementation/driverSpecific.cpp +++ b/src/Magnum/Implementation/driverSpecific.cpp @@ -115,6 +115,8 @@ auto Context::detectedDriver() -> DetectedDrivers { const std::string vendor = vendorString(); + /* Apple has its own drivers */ + #ifndef CORRADE_TARGET_APPLE #ifndef MAGNUM_TARGET_GLES /* AMD binary desktop drivers */ if(vendor.find("ATI Technologies Inc.") != std::string::npos) @@ -131,6 +133,7 @@ auto Context::detectedDriver() -> DetectedDrivers { if(vendor.find("NVIDIA Corporation") != std::string::npos) return *_detectedDrivers |= DetectedDriver::NVidia; #endif + #endif /** @todo there is also D3D9/D3D11 distinction on webglreport.com, is it useful? */ #ifdef MAGNUM_TARGET_GLES From d5fa09714383dc84416aa5ebe0ecff158bd62cc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Jan 2016 17:52:27 +0100 Subject: [PATCH 064/258] Don't do shader validation in GL tests on OSX. Apple wants insane amount of state to return true (bound FB, bound VAO, etc.). Ugh. --- .../Test/DistanceFieldVectorGLTest.cpp | 14 ++++- src/Magnum/Shaders/Test/FlatGLTest.cpp | 28 ++++++++-- .../Shaders/Test/MeshVisualizerGLTest.cpp | 21 ++++++- src/Magnum/Shaders/Test/PhongGLTest.cpp | 56 ++++++++++++++++--- src/Magnum/Shaders/Test/VectorGLTest.cpp | 14 ++++- src/Magnum/Shaders/Test/VertexColorGLTest.cpp | 14 ++++- .../Test/AbstractShaderProgramGLTest.cpp | 21 ++++++- 7 files changed, 144 insertions(+), 24 deletions(-) diff --git a/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp b/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp index 680f8e133..838a60d18 100644 --- a/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp +++ b/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp @@ -42,12 +42,22 @@ DistanceFieldVectorGLTest::DistanceFieldVectorGLTest() { void DistanceFieldVectorGLTest::compile2D() { Shaders::DistanceFieldVector2D shader; - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } void DistanceFieldVectorGLTest::compile3D() { Shaders::DistanceFieldVector3D shader; - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } }}} diff --git a/src/Magnum/Shaders/Test/FlatGLTest.cpp b/src/Magnum/Shaders/Test/FlatGLTest.cpp index 2991b5a67..8310d4a26 100644 --- a/src/Magnum/Shaders/Test/FlatGLTest.cpp +++ b/src/Magnum/Shaders/Test/FlatGLTest.cpp @@ -46,22 +46,42 @@ FlatGLTest::FlatGLTest() { void FlatGLTest::compile2D() { Shaders::Flat2D shader; - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } void FlatGLTest::compile3D() { Shaders::Flat3D shader; - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } void FlatGLTest::compile2DTextured() { Shaders::Flat2D shader(Shaders::Flat2D::Flag::Textured); - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } void FlatGLTest::compile3DTextured() { Shaders::Flat3D shader(Shaders::Flat3D::Flag::Textured); - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } }}} diff --git a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp index 3e2b355dc..d6d203d41 100644 --- a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp +++ b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp @@ -50,7 +50,12 @@ MeshVisualizerGLTest::MeshVisualizerGLTest() { void MeshVisualizerGLTest::compile() { Shaders::MeshVisualizer shader; - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) @@ -69,13 +74,23 @@ void MeshVisualizerGLTest::compileWireframeGeometryShader() { #endif Shaders::MeshVisualizer shader(Shaders::MeshVisualizer::Flag::Wireframe); - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } #endif void MeshVisualizerGLTest::compileWireframeNoGeometryShader() { Shaders::MeshVisualizer shader(Shaders::MeshVisualizer::Flag::Wireframe|Shaders::MeshVisualizer::Flag::NoGeometryShader); - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } }}} diff --git a/src/Magnum/Shaders/Test/PhongGLTest.cpp b/src/Magnum/Shaders/Test/PhongGLTest.cpp index ccdbb33d4..1cbb15dca 100644 --- a/src/Magnum/Shaders/Test/PhongGLTest.cpp +++ b/src/Magnum/Shaders/Test/PhongGLTest.cpp @@ -54,42 +54,82 @@ PhongGLTest::PhongGLTest() { void PhongGLTest::compile() { Shaders::Phong shader; - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } void PhongGLTest::compileAmbientTexture() { Shaders::Phong shader(Shaders::Phong::Flag::AmbientTexture); - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } void PhongGLTest::compileDiffuseTexture() { Shaders::Phong shader(Shaders::Phong::Flag::DiffuseTexture); - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } void PhongGLTest::compileSpecularTexture() { Shaders::Phong shader(Shaders::Phong::Flag::SpecularTexture); - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } void PhongGLTest::compileAmbientDiffuseTexture() { Shaders::Phong shader(Shaders::Phong::Flag::AmbientTexture|Shaders::Phong::Flag::DiffuseTexture); - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } void PhongGLTest::compileAmbientSpecularTexture() { Shaders::Phong shader(Shaders::Phong::Flag::AmbientTexture|Shaders::Phong::Flag::SpecularTexture); - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } void PhongGLTest::compileDiffuseSpecularTexture() { Shaders::Phong shader(Shaders::Phong::Flag::DiffuseTexture|Shaders::Phong::Flag::SpecularTexture); - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } void PhongGLTest::compileAmbientDiffuseSpecularTexture() { Shaders::Phong shader(Shaders::Phong::Flag::AmbientTexture|Shaders::Phong::Flag::DiffuseTexture|Shaders::Phong::Flag::SpecularTexture); - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } }}} diff --git a/src/Magnum/Shaders/Test/VectorGLTest.cpp b/src/Magnum/Shaders/Test/VectorGLTest.cpp index ca78e7150..1303ed85f 100644 --- a/src/Magnum/Shaders/Test/VectorGLTest.cpp +++ b/src/Magnum/Shaders/Test/VectorGLTest.cpp @@ -42,12 +42,22 @@ VectorGLTest::VectorGLTest() { void VectorGLTest::compile2D() { Shaders::Vector2D shader; - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } void VectorGLTest::compile3D() { Shaders::Vector3D shader; - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } }}} diff --git a/src/Magnum/Shaders/Test/VertexColorGLTest.cpp b/src/Magnum/Shaders/Test/VertexColorGLTest.cpp index 05b568c39..9d7958d9c 100644 --- a/src/Magnum/Shaders/Test/VertexColorGLTest.cpp +++ b/src/Magnum/Shaders/Test/VertexColorGLTest.cpp @@ -42,12 +42,22 @@ VertexColorGLTest::VertexColorGLTest() { void VertexColorGLTest::compile2D() { Shaders::VertexColor2D shader; - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } void VertexColorGLTest::compile3D() { Shaders::VertexColor3D shader; - CORRADE_VERIFY(shader.validate().first); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(shader.validate().first); + } } }}} diff --git a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp index e3f97fc7f..259ad94d2 100644 --- a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp @@ -197,7 +197,12 @@ void AbstractShaderProgramGLTest::create() { MAGNUM_VERIFY_NO_ERROR(); CORRADE_VERIFY(linked); - CORRADE_VERIFY(valid); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(valid); + } const Int matrixUniform = program.uniformLocation("matrix"); const Int multiplierUniform = program.uniformLocation("multiplier"); @@ -252,7 +257,12 @@ void AbstractShaderProgramGLTest::createMultipleOutputs() { MAGNUM_VERIFY_NO_ERROR(); CORRADE_VERIFY(linked); - CORRADE_VERIFY(valid); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(valid); + } #elif !defined(MAGNUM_TARGET_GLES2) CORRADE_SKIP("Only explicit location specification supported in ES 3.0."); #else @@ -301,7 +311,12 @@ void AbstractShaderProgramGLTest::createMultipleOutputsIndexed() { MAGNUM_VERIFY_NO_ERROR(); CORRADE_VERIFY(linked); - CORRADE_VERIFY(valid); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(valid); + } } #endif From 5908609a2da0ccca10922dd704c1b5207f4d76ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Jan 2016 17:55:42 +0100 Subject: [PATCH 065/258] Prevent test crash on drivers w/o ARB_get_texture_sub_image. --- src/Magnum/Test/CubeMapTextureArrayGLTest.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp b/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp index a79ecf784..e449cc465 100644 --- a/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp @@ -847,6 +847,8 @@ void CubeMapTextureArrayGLTest::subImageQuery() { void CubeMapTextureArrayGLTest::compressedSubImageQuery() { if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); @@ -905,6 +907,8 @@ void CubeMapTextureArrayGLTest::subImageQueryBuffer() { void CubeMapTextureArrayGLTest::compressedSubImageQueryBuffer() { if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); From 407f01997748b0f5ed05f5eb6f6596d11921e395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Jan 2016 17:56:45 +0100 Subject: [PATCH 066/258] Make the XFAIL in Mesh GL test more restrictive. Surprisingly OSX drivers are the only ones that are doing it right?! --- src/Magnum/Test/MeshGLTest.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Test/MeshGLTest.cpp b/src/Magnum/Test/MeshGLTest.cpp index e8e74cc89..1cff747f6 100644 --- a/src/Magnum/Test/MeshGLTest.cpp +++ b/src/Magnum/Test/MeshGLTest.cpp @@ -795,13 +795,14 @@ void MeshGLTest::addVertexBufferMatrixNxNd() { MAGNUM_VERIFY_NO_ERROR(); { - CORRADE_EXPECT_FAIL("Somehow only first two values are extracted"); + CORRADE_EXPECT_FAIL_IF(Context::current().detectedDriver() & (Context::DetectedDriver::AMD|Context::DetectedDriver::NVidia), "Somehow only first two values are extracted"); CORRADE_COMPARE(value, Math::Vector3(315, 65201, 2576)); } /* This is wrong, but check if it's still the right wrong. Fails on AMD 15.201.1151 but seems to be fixed in 15.300.1025.0 */ - CORRADE_COMPARE(value, Math::Vector3(315, 65201, 0)); + if(Context::current().detectedDriver() & (Context::DetectedDriver::AMD|Context::DetectedDriver::NVidia)) + CORRADE_COMPARE(value, Math::Vector3(315, 65201, 0)); } #endif @@ -860,13 +861,14 @@ void MeshGLTest::addVertexBufferMatrixMxNd() { MAGNUM_VERIFY_NO_ERROR(); { - CORRADE_EXPECT_FAIL("Somehow only first two values are extracted"); + CORRADE_EXPECT_FAIL_IF(Context::current().detectedDriver() & (Context::DetectedDriver::AMD|Context::DetectedDriver::NVidia), "Somehow only first two values are extracted"); CORRADE_COMPARE(value, Math::Vector3(315, 65201, 2576)); } /* This is wrong, but check if it's still the right wrong. Fails on AMD 15.201.1151 but seems to be fixed in 15.300.1025.0 */ - CORRADE_COMPARE(value, Math::Vector3(315, 65201, 0)); + if(Context::current().detectedDriver() & (Context::DetectedDriver::AMD|Context::DetectedDriver::NVidia)) + CORRADE_COMPARE(value, Math::Vector3(315, 65201, 0)); } #endif From 3820ec39d7afd058ac64cd70986b47a1f52d344f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Jan 2016 17:58:30 +0100 Subject: [PATCH 067/258] Adapt to Corrade improvements. --- src/Magnum/Test/TextureGLTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Test/TextureGLTest.cpp b/src/Magnum/Test/TextureGLTest.cpp index 9fc1d9234..c74e5eacb 100644 --- a/src/Magnum/Test/TextureGLTest.cpp +++ b/src/Magnum/Test/TextureGLTest.cpp @@ -1828,7 +1828,7 @@ void TextureGLTest::compressedSubImage3DQuery() { CORRADE_COMPARE(image.size(), (Vector3i{4})); - CORRADE_EXPECT_FAIL_IF(!!(Context::current().detectedDriver() & Context::DetectedDriver::NVidia), + CORRADE_EXPECT_FAIL_IF(Context::current().detectedDriver() & Context::DetectedDriver::NVidia, "Default compressed pixel storage behaves weirdly with BPTC compression on NVidia"); CORRADE_COMPARE_AS( @@ -1895,7 +1895,7 @@ void TextureGLTest::compressedSubImage3DQueryBuffer() { CORRADE_COMPARE(image.size(), Vector3i{4}); - CORRADE_EXPECT_FAIL_IF(!!(Context::current().detectedDriver() & Context::DetectedDriver::NVidia), + CORRADE_EXPECT_FAIL_IF(Context::current().detectedDriver() & Context::DetectedDriver::NVidia, "Default compressed pixel storage behaves weirdly with BPTC compression on NVidia"); CORRADE_COMPARE_AS(imageData, Containers::ArrayView{CompressedData3D}, TestSuite::Compare::Container); From 6849acb5c0677a7be05eba342c204dae6dda4b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 8 Jan 2016 21:47:33 +0100 Subject: [PATCH 068/258] Doc++ --- src/Magnum/AbstractShaderProgram.h | 47 +++++++++++++++++------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/src/Magnum/AbstractShaderProgram.h b/src/Magnum/AbstractShaderProgram.h index 635424774..f5178040b 100644 --- a/src/Magnum/AbstractShaderProgram.h +++ b/src/Magnum/AbstractShaderProgram.h @@ -136,8 +136,8 @@ The preferred workflow is to specify attribute location for vertex shader input attributes and fragment shader output attributes explicitly in the shader code, e.g.: @code -// GLSL 3.30, or -#extension GL_ARB_explicit_attrib_location: enable +// GLSL 3.30, GLSL ES 3.00 or +#extension GL_ARB_explicit_attrib_location: require layout(location = 0) in vec4 position; layout(location = 1) in vec3 normal; layout(location = 2) in vec2 textureCoordinates; @@ -151,8 +151,8 @@ layout(location = 0, index = 0) out vec4 color; layout(location = 1, index = 1) out vec3 normal; @endcode -If you don't have the required extension, declare the attributes without -`layout()` qualifier and use functions @ref bindAttributeLocation() and +If you don't have the required version/extension, declare the attributes +without `layout()` qualifier and use functions @ref bindAttributeLocation() and @ref bindFragmentDataLocation() / @ref bindFragmentDataLocationIndexed() between attaching the shaders and linking the program. Note that additional syntax changes may be needed for GLSL 1.20 and GLSL ES. @@ -178,7 +178,7 @@ bindFragmentDataLocationIndexed(NormalOutput, 1, "normal"); // Link... @endcode -@see @ref Mesh::maxVertexAttributes(), @ref AbstractFramebuffer::maxDrawBuffers() +@see @ref maxVertexAttributes(), @ref AbstractFramebuffer::maxDrawBuffers() @requires_gl30 Extension @extension{EXT,gpu_shader4} for using @ref bindFragmentDataLocation(). @requires_gl33 Extension @extension{ARB,blend_func_extended} for using @@ -208,15 +208,15 @@ bindFragmentDataLocationIndexed(NormalOutput, 1, "normal"); The preferred workflow is to specify uniform locations directly in the shader code, e.g.: @code -// GLSL 4.30, or -#extension GL_ARB_explicit_uniform_location: enable +// GLSL 4.30, GLSL ES 3.10 or +#extension GL_ARB_explicit_uniform_location: require layout(location = 0) uniform mat4 projectionMatrix; layout(location = 1) uniform mat4 transformationMatrix; layout(location = 2) uniform mat3 normalMatrix; @endcode -If you don't have the required extension, declare the uniforms without the -`layout()` qualifier, get uniform location using @ref uniformLocation() *after* +If you don't have the required version/extension, declare the uniforms without +the `layout()` qualifier, get uniform location using @ref uniformLocation() *after* linking stage and then use the queried location in uniform setting functions. Note that additional syntax changes may be needed for GLSL 1.20 and GLSL ES. @code @@ -244,16 +244,16 @@ Int normalMatrixUniform = uniformLocation("normalMatrix"); The preferred workflow is to specify texture binding unit directly in the shader code, e.g.: @code -// GLSL 4.20, or -#extension GL_ARB_shading_language_420pack: enable +// GLSL 4.20, GLSL ES 3.10 or +#extension GL_ARB_shading_language_420pack: require layout(binding = 0) uniform sampler2D diffuseTexture; layout(binding = 1) uniform sampler2D specularTexture; @endcode -If you don't have the required extension, declare the uniforms without the -`binding` qualifier and set the texture binding unit using +If you don't have the required version/extension, declare the uniforms without +the `binding` qualifier and set the texture binding unit using @ref setUniform(Int, const T&) "setUniform(Int, Int)". Note that additional -syntax changes may be needed for GLSL 1.20 and GLSL ES 1.0. +syntax changes may be needed for GLSL ES. @code uniform sampler2D diffuseTexture; uniform sampler2D specularTexture; @@ -280,7 +280,7 @@ The preferred workflow is to specify output binding points directly in the shader code, e.g.: @code // GLSL 4.40, or -#extension GL_ARB_enhanced_layouts: enable +#extension GL_ARB_enhanced_layouts: require layout(xfb_buffer = 0, xfb_stride = 32) out block { layout(xfb_offset = 0) vec3 position; layout(xfb_offset = 16) vec3 normal; @@ -288,8 +288,8 @@ layout(xfb_buffer = 0, xfb_stride = 32) out block { layout(xfb_buffer = 1) out vec3 velocity; @endcode -If you don't have the required extension, declare the uniforms without the -`xfb_*` qualifier and set the binding points using @ref setTransformFeedbackOutputs(). +If you don't have the required version/extension, declare the uniforms without +the `xfb_*` qualifier and set the binding points using @ref setTransformFeedbackOutputs(). Equivalent setup for the previous code would be the following: @code out block { @@ -310,14 +310,17 @@ setTransformFeedbackOutputs({ @see @ref TransformFeedback::maxInterleavedComponents(), @ref TransformFeedback::maxSeparateAttributes(), @ref TransformFeedback::maxSeparateComponents() +@requires_gl40 Extension @extension{ARB,transform_feedback2} @requires_gl40 Extension @extension{ARB,transform_feedback3} for using `gl_NextBuffer` or `gl_SkipComponents#` names in @ref setTransformFeedbackOutputs() function. @requires_gl44 Extension @extension{ARB,enhanced_layouts} for explicit transform feedback output specification instead of using @ref setTransformFeedbackOutputs(). +@requires_gles30 Transform feedback is not available in OpenGL ES 2.0. @requires_gl Explicit transform feedback output specification is not available in OpenGL ES or WebGL. +@requires_webgl20 Transform feedback is not available in WebGL 1.0. @anchor AbstractShaderProgram-rendering-workflow ## Rendering workflow @@ -858,7 +861,9 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * @brief Get uniform location * @param name Uniform name * - * @see @fn_gl{GetUniformLocation} + * If given uniform is not found in the linked shader, a warning is + * printed and `-1` is returned. + * @see @ref setUniform(), @fn_gl{GetUniformLocation} * @deprecated_gl Preferred usage is to specify uniform location * explicitly in the shader instead of using this function. See * @ref AbstractShaderProgram-uniform-location "class documentation" @@ -881,6 +886,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * Convenience alternative for setting one value, see * @ref setUniform(Int, Containers::ArrayView) for more * information. + * @see @ref uniformLocation() */ #ifdef DOXYGEN_GENERATING_OUTPUT template inline void setUniform(Int location, const T& value); @@ -919,8 +925,9 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * @es_extension{EXT,separate_shader_objects} OpenGL ES extension nor * OpenGL ES 3.1 is available, the shader is marked for use before the * operation. - * @see @ref setUniform(Int, const T&), @fn_gl{UseProgram}, @fn_gl{Uniform} - * or @fn_gl{ProgramUniform}/@fn_gl_extension{ProgramUniform,EXT,direct_state_access}. + * @see @ref setUniform(Int, const T&), @ref uniformLocation(), + * @fn_gl{UseProgram}, @fn_gl{Uniform} or @fn_gl{ProgramUniform}/ + * @fn_gl_extension{ProgramUniform,EXT,direct_state_access}. */ void setUniform(Int location, Containers::ArrayView values); void setUniform(Int location, Containers::ArrayView> values); /**< @overload */ From 19d9fb452dba757419bbd019f1b131778b8066bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 8 Jan 2016 21:53:43 +0100 Subject: [PATCH 069/258] Platform: put the limit into proper section. --- src/Magnum/Platform/magnum-info.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index 0722a0769..76e9e60de 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -492,6 +492,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #endif _l(Buffer::uniformOffsetAlignment()) + _l(Buffer::maxUniformBindings()) _l(Shader::maxUniformBlocks(Shader::Type::Vertex)) _l(Shader::maxUniformBlocks(Shader::Type::TessellationControl)) _l(Shader::maxUniformBlocks(Shader::Type::TessellationEvaluation)) @@ -516,7 +517,6 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat _h(EXT::gpu_shader4) #endif - _l(Buffer::maxUniformBindings()) _l(AbstractShaderProgram::minTexelOffset()) _l(AbstractShaderProgram::maxTexelOffset()) } From c463526feb299eb16c53d4d1f212bd927d592f5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 8 Jan 2016 22:56:29 +0100 Subject: [PATCH 070/258] Don't yell at people. Also minor cleanup and string copy optimization. --- src/Magnum/AbstractShaderProgram.cpp | 4 ++-- src/Magnum/Test/AbstractShaderProgramGLTest.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Magnum/AbstractShaderProgram.cpp b/src/Magnum/AbstractShaderProgram.cpp index ccd222392..709dc3263 100644 --- a/src/Magnum/AbstractShaderProgram.cpp +++ b/src/Magnum/AbstractShaderProgram.cpp @@ -395,9 +395,9 @@ bool AbstractShaderProgram::link(std::initializer_list name) { - GLint location = glGetUniformLocation(_id, name); + const GLint location = glGetUniformLocation(_id, name); if(location == -1) - Warning() << "AbstractShaderProgram: location of uniform \'" + std::string{name, name.size()} + "\' cannot be retrieved!"; + Warning() << "AbstractShaderProgram: location of uniform \'" << Debug::nospace << std::string{name, name.size()} << Debug::nospace << "\' cannot be retrieved"; return location; } diff --git a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp index 259ad94d2..72791d79c 100644 --- a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp @@ -51,7 +51,7 @@ struct AbstractShaderProgramGLTest: AbstractOpenGLTester { void createMultipleOutputsIndexed(); #endif - void uniformLocationOptimizedOut(); + void uniformNotFound(); void uniform(); void uniformVector(); void uniformMatrix(); @@ -71,7 +71,7 @@ AbstractShaderProgramGLTest::AbstractShaderProgramGLTest() { &AbstractShaderProgramGLTest::createMultipleOutputsIndexed, #endif - &AbstractShaderProgramGLTest::uniformLocationOptimizedOut, + &AbstractShaderProgramGLTest::uniformNotFound, &AbstractShaderProgramGLTest::uniform, &AbstractShaderProgramGLTest::uniformVector, &AbstractShaderProgramGLTest::uniformMatrix, @@ -320,7 +320,7 @@ void AbstractShaderProgramGLTest::createMultipleOutputsIndexed() { } #endif -void AbstractShaderProgramGLTest::uniformLocationOptimizedOut() { +void AbstractShaderProgramGLTest::uniformNotFound() { MyPublicShader program; #ifndef MAGNUM_TARGET_GLES @@ -361,8 +361,8 @@ void AbstractShaderProgramGLTest::uniformLocationOptimizedOut() { program.uniformLocation("nonexistent"); program.uniformLocation(std::string{"another"}); CORRADE_COMPARE(out.str(), - "AbstractShaderProgram: location of uniform 'nonexistent' cannot be retrieved!\n" - "AbstractShaderProgram: location of uniform 'another' cannot be retrieved!\n"); + "AbstractShaderProgram: location of uniform 'nonexistent' cannot be retrieved\n" + "AbstractShaderProgram: location of uniform 'another' cannot be retrieved\n"); } namespace { From 7fb268bb6282c4d14d75486ebf6f12ee8ad58d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 8 Jan 2016 22:57:13 +0100 Subject: [PATCH 071/258] Preprocessor madness cleanup. --- .../Test/AbstractShaderProgramGLTest.cpp | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp index 72791d79c..3c1bc5e89 100644 --- a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp @@ -154,31 +154,31 @@ namespace { void AbstractShaderProgramGLTest::create() { Utility::Resource rs("AbstractShaderProgramGLTest"); - #ifndef MAGNUM_TARGET_GLES Shader vert( + #ifndef MAGNUM_TARGET_GLES #ifndef CORRADE_TARGET_APPLE Version::GL210 #else Version::GL310 #endif + #else + Version::GLES200 + #endif , Shader::Type::Vertex); - #else - Shader vert(Version::GLES200, Shader::Type::Vertex); - #endif vert.addSource(rs.get("MyShader.vert")); const bool vertCompiled = vert.compile(); - #ifndef MAGNUM_TARGET_GLES Shader frag( + #ifndef MAGNUM_TARGET_GLES #ifndef CORRADE_TARGET_APPLE Version::GL210 #else Version::GL310 #endif + #else + Version::GLES200 + #endif , Shader::Type::Fragment); - #else - Shader frag(Version::GLES200, Shader::Type::Fragment); - #endif frag.addSource(rs.get("MyShader.frag")); const bool fragCompiled = frag.compile(); @@ -323,25 +323,28 @@ void AbstractShaderProgramGLTest::createMultipleOutputsIndexed() { void AbstractShaderProgramGLTest::uniformNotFound() { MyPublicShader program; - #ifndef MAGNUM_TARGET_GLES Shader vert( + #ifndef MAGNUM_TARGET_GLES #ifndef CORRADE_TARGET_APPLE Version::GL210 #else Version::GL310 #endif + #else + Version::GLES200 + #endif , Shader::Type::Vertex); Shader frag( + #ifndef MAGNUM_TARGET_GLES #ifndef CORRADE_TARGET_APPLE Version::GL210 #else Version::GL310 #endif + #else + Version::GLES200 + #endif , Shader::Type::Fragment); - #else - Shader vert(Version::GLES200, Shader::Type::Vertex); - Shader frag(Version::GLES200, Shader::Type::Fragment); - #endif vert.addSource("void main() { gl_Position = vec4(0.0); }"); frag.addSource( #ifndef CORRADE_TARGET_APPLE @@ -382,25 +385,28 @@ namespace { MyShader::MyShader() { Utility::Resource rs("AbstractShaderProgramGLTest"); - #ifndef MAGNUM_TARGET_GLES Shader vert( + #ifndef MAGNUM_TARGET_GLES #ifndef CORRADE_TARGET_APPLE Version::GL210 #else Version::GL310 #endif + #else + Version::GLES200 + #endif , Shader::Type::Vertex); Shader frag( + #ifndef MAGNUM_TARGET_GLES #ifndef CORRADE_TARGET_APPLE Version::GL210 #else Version::GL310 #endif + #else + Version::GLES200 + #endif , Shader::Type::Fragment); - #else - Shader vert(Version::GLES200, Shader::Type::Vertex); - Shader frag(Version::GLES200, Shader::Type::Fragment); - #endif vert.addSource(rs.get("MyShader.vert")); frag.addSource(rs.get("MyShader.frag")); From 1caf96a3475383651e266788be265610855a8406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 8 Jan 2016 22:58:31 +0100 Subject: [PATCH 072/258] Finally completed ARB_uniform_buffer_object. Also with ES3/WebGL2 port. --- doc/opengl-mapping.dox | 4 +- doc/opengl-support.dox | 2 +- src/Magnum/AbstractShaderProgram.cpp | 9 + src/Magnum/AbstractShaderProgram.h | 99 +++++++++++ .../Test/AbstractShaderProgramGLTest.cpp | 159 +++++++++++++++++- .../UniformBlockShader.frag | 11 ++ .../UniformBlockShader.vert | 10 ++ .../resources.conf | 6 + 8 files changed, 296 insertions(+), 4 deletions(-) create mode 100644 src/Magnum/Test/AbstractShaderProgramGLTestFiles/UniformBlockShader.frag create mode 100644 src/Magnum/Test/AbstractShaderProgramGLTestFiles/UniformBlockShader.vert diff --git a/doc/opengl-mapping.dox b/doc/opengl-mapping.dox index 1edffe2be..90d45f817 100644 --- a/doc/opengl-mapping.dox +++ b/doc/opengl-mapping.dox @@ -219,7 +219,7 @@ OpenGL function | Matching API @fn_gl{GetTransformFeedback} | not queryable, @ref TransformFeedback::attachBuffer() and @ref TransformFeedback::attachBuffers() setters only @fn_gl{GetTransformFeedbackVarying} | not queryable, @ref AbstractShaderProgram::setTransformFeedbackOutputs() setter only @fn_gl{GetUniform}, \n `glGetnUniform()`, \n @fn_gl_extension{GetnUniform,ARB,robustness} | not queryable, @ref AbstractShaderProgram::setUniform() setter only -@fn_gl{GetUniformBlockIndex} | | +@fn_gl{GetUniformBlockIndex} | @ref AbstractShaderProgram::uniformBlockIndex() @fn_gl{GetUniformIndices} | | @fn_gl{GetUniformLocation} | @ref AbstractShaderProgram::uniformLocation() @fn_gl{GetUniformSubroutine} | | @@ -350,7 +350,7 @@ OpenGL function | Matching API --------------------------------------- | ------------ @fn_gl{Uniform}, \n @fn_gl{ProgramUniform}, \n @fn_gl_extension{ProgramUniform,EXT,direct_state_access} | @ref AbstractShaderProgram::setUniform() @fn_gl_extension{UniformHandle,ARB,bindless_texture}, \n @fn_gl_extension{ProgramUniformHandle,ARB,bindless_texture} | | -@fn_gl{UniformBlockBinding} | | +@fn_gl{UniformBlockBinding} | @ref AbstractShaderProgram::setUniformBlockBinding() @fn_gl{UniformSubroutines} | | @fn_gl{UseProgram} | @ref Mesh::draw(), @ref MeshView::draw() @fn_gl{UseProgramStages} | | diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index f8ac8924b..cfa0c079e 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -80,7 +80,7 @@ GLSL 1.40 | done @extension{ARB,texture_rectangle} | done @extension{ARB,draw_instanced} | done @extension{ARB,texture_buffer_object} | done -@extension{ARB,uniform_buffer_object} | missing uniform block binding +@extension{ARB,uniform_buffer_object} | done @extension{ARB,copy_buffer} | done @extension{EXT,texture_snorm} | done @extension{NV,primitive_restart} | | diff --git a/src/Magnum/AbstractShaderProgram.cpp b/src/Magnum/AbstractShaderProgram.cpp index 709dc3263..933c1b47e 100644 --- a/src/Magnum/AbstractShaderProgram.cpp +++ b/src/Magnum/AbstractShaderProgram.cpp @@ -401,6 +401,15 @@ Int AbstractShaderProgram::uniformLocationInternal(const Containers::ArrayView name) { + const GLuint index = glGetUniformBlockIndex(_id, name); + if(index == GL_INVALID_INDEX) + Warning() << "AbstractShaderProgram: index of uniform block \'" << Debug::nospace << std::string{name, name.size()} << Debug::nospace << "\' cannot be retrieved"; + return index; +} +#endif + void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView values) { (this->*Context::current().state().shaderProgram->uniform1fvImplementation)(location, values.size(), values); } diff --git a/src/Magnum/AbstractShaderProgram.h b/src/Magnum/AbstractShaderProgram.h index f5178040b..ac0552193 100644 --- a/src/Magnum/AbstractShaderProgram.h +++ b/src/Magnum/AbstractShaderProgram.h @@ -238,6 +238,57 @@ Int normalMatrixUniform = uniformLocation("normalMatrix"); @requires_gles Explicit uniform location is not supported in WebGL. Use @ref uniformLocation() instead. +@anchor AbstractShaderProgram-uniform-block-binding +### Uniform block bindings + +The preferred workflow is to specify uniform block binding directly in the +shader code, e.g.: +@code +// GLSL 4.20, GLSL ES 3.10 or +#extension GL_ARB_shading_language_420pack: require +layout(std140, binding = 0) uniform matrices { + mat4 projectionMatrix; + mat4 transformationMatrix; +}; +layout(std140, binding = 1) uniform material { + vec4 diffuse; + vec4 specular; +}; +@endcode + +If you don't have the required version/extension, declare the uniform blocks +without the `layout()` qualifier, get uniform block index using +@ref uniformBlockIndex() and then map it to the uniform buffer binding using +@ref setUniformBlockBinding(). Note that additional syntax changes may be +needed for GLSL ES. +@code +layout(std140) uniform matrices { + mat4 projectionMatrix; + mat4 transformationMatrix; +}; +layout(std140) uniform material { + vec4 diffuse; + vec4 specular; +}; +@endcode +@code +setUniformBlockBinding(uniformBlockIndex("matrices"), 0); +setUniformBlockBinding(uniformBlockIndex("material"), 1); +@endcode + +@see @ref Buffer::maxUniformBindings() +@requires_gl31 Extension @extension{ARB,uniform_buffer_object} +@requires_gl42 Extension @extension{ARB,shading_language_420pack} for explicit + uniform block binding instead of using @ref uniformBlockIndex() and + @ref setUniformBlockBinding(). +@requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. +@requires_gles31 Explicit uniform block binding is not supported in OpenGL ES + 3.0 and older. Use @ref uniformBlockIndex() and @ref setUniformBlockBinding() + instead. +@requires_webgl20 Uniform buffers are not available in WebGL 1.0. +@requires_gles Explicit uniform block binding is not supported in WebGL. Use + @ref uniformBlockIndex() and @ref setUniformBlockBinding() instead. + @anchor AbstractShaderProgram-texture-units ### Specifying texture binding units @@ -878,6 +929,32 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { return uniformLocationInternal({name, size - 1}); } + #ifndef MAGNUM_TARGET_GLES2 + /** + * @brief Get uniform block index + * @param name Uniform block name + * + * If given uniform block name is not found in the linked shader, a + * warning is printed and `0xffffffffu` is returned. + * @see @ref setUniformBlockBinding(), @fn_gl{GetUniformBlockIndex} + * @requires_gl31 Extension @extension{ARB,uniform_buffer_object} + * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. + * @requires_webgl20 Uniform buffers are not available in WebGL 1.0. + * @deprecated_gl Preferred usage is to specify uniform block binding + * explicitly in the shader instead of using this function. See + * @ref AbstractShaderProgram-uniform-block-binding "class documentation" + * for more information. + */ + UnsignedInt uniformBlockIndex(const std::string& name) { + return uniformBlockIndexInternal({name.data(), name.size()}); + } + + /** @overload */ + template UnsignedInt uniformBlockIndex(const char(&name)[size]) { + return uniformBlockIndexInternal({name, size - 1}); + } + #endif + /** * @brief Set uniform value * @param location Uniform location @@ -1012,6 +1089,27 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { } #endif + #ifndef MAGNUM_TARGET_GLES2 + /** + * @brief Set uniform block binding + * @param index Uniform block index + * @param binding Uniform block binding + * + * @see @ref uniformBlockIndex(), @ref Buffer::maxUniformBindings(), + * @fn_gl{UniformBlockBinding} + * @requires_gl31 Extension @extension{ARB,uniform_buffer_object} + * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. + * @requires_webgl20 Uniform buffers are not available in WebGL 1.0. + * @deprecated_gl Preferred usage is to specify uniform block binding + * explicitly in the shader instead of using this function. See + * @ref AbstractShaderProgram-uniform-block-binding "class documentation" + * for more information. + */ + void setUniformBlockBinding(UnsignedInt index, UnsignedInt binding) { + glUniformBlockBinding(_id, index, binding); + } + #endif + private: #ifndef MAGNUM_TARGET_WEBGL AbstractShaderProgram& setLabelInternal(Containers::ArrayView label); @@ -1021,6 +1119,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { void bindFragmentDataLocationIndexedInternal(UnsignedInt location, UnsignedInt index, Containers::ArrayView name); void bindFragmentDataLocationInternal(UnsignedInt location, Containers::ArrayView name); Int uniformLocationInternal(Containers::ArrayView name); + UnsignedInt uniformBlockIndexInternal(Containers::ArrayView name); #ifndef MAGNUM_BUILD_DEPRECATED void use(); diff --git a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp index 3c1bc5e89..6989508bc 100644 --- a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp @@ -56,6 +56,12 @@ struct AbstractShaderProgramGLTest: AbstractOpenGLTester { void uniformVector(); void uniformMatrix(); void uniformArray(); + + #ifndef MAGNUM_TARGET_GLES2 + void createUniformBlocks(); + void uniformBlockIndexNotFound(); + void uniformBlock(); + #endif }; AbstractShaderProgramGLTest::AbstractShaderProgramGLTest() { @@ -75,7 +81,14 @@ AbstractShaderProgramGLTest::AbstractShaderProgramGLTest() { &AbstractShaderProgramGLTest::uniform, &AbstractShaderProgramGLTest::uniformVector, &AbstractShaderProgramGLTest::uniformMatrix, - &AbstractShaderProgramGLTest::uniformArray}); + &AbstractShaderProgramGLTest::uniformArray, + + #ifndef MAGNUM_TARGET_GLES2 + &AbstractShaderProgramGLTest::createUniformBlocks, + &AbstractShaderProgramGLTest::uniformBlockIndexNotFound, + &AbstractShaderProgramGLTest::uniformBlock + #endif + }); } namespace { @@ -148,6 +161,9 @@ namespace { #endif using AbstractShaderProgram::link; using AbstractShaderProgram::uniformLocation; + #ifndef MAGNUM_TARGET_GLES2 + using AbstractShaderProgram::uniformBlockIndex; + #endif }; } @@ -473,6 +489,147 @@ void AbstractShaderProgramGLTest::uniformArray() { MAGNUM_VERIFY_NO_ERROR(); } +#ifndef MAGNUM_TARGET_GLES2 +void AbstractShaderProgramGLTest::createUniformBlocks() { + Utility::Resource rs("AbstractShaderProgramGLTest"); + + Shader vert( + #ifndef MAGNUM_TARGET_GLES + Version::GL310 + #else + Version::GLES300 + #endif + , Shader::Type::Vertex); + vert.addSource(rs.get("UniformBlockShader.vert")); + const bool vertCompiled = vert.compile(); + + Shader frag( + #ifndef MAGNUM_TARGET_GLES + Version::GL310 + #else + Version::GLES300 + #endif + , Shader::Type::Fragment); + frag.addSource(rs.get("UniformBlockShader.frag")); + const bool fragCompiled = frag.compile(); + + MAGNUM_VERIFY_NO_ERROR(); + CORRADE_VERIFY(vertCompiled); + CORRADE_VERIFY(fragCompiled); + + MyPublicShader program; + program.attachShaders({vert, frag}); + + MAGNUM_VERIFY_NO_ERROR(); + + const bool linked = program.link(); + const bool valid = program.validate().first; + + MAGNUM_VERIFY_NO_ERROR(); + CORRADE_VERIFY(linked); + { + #ifdef CORRADE_TARGET_APPLE + CORRADE_EXPECT_FAIL("OSX drivers need insane amount of state to validate properly."); + #endif + CORRADE_VERIFY(valid); + } + + const Int matricesUniformBlock = program.uniformBlockIndex("matrices"); + const Int materialUniformBlock = program.uniformBlockIndex("material"); + + MAGNUM_VERIFY_NO_ERROR(); + CORRADE_VERIFY(matricesUniformBlock >= 0); + CORRADE_VERIFY(materialUniformBlock >= 0); +} + +void AbstractShaderProgramGLTest::uniformBlockIndexNotFound() { + MyPublicShader program; + + Shader vert( + #ifndef MAGNUM_TARGET_GLES + Version::GL310 + #else + Version::GLES200 + #endif + , Shader::Type::Vertex); + Shader frag( + #ifndef MAGNUM_TARGET_GLES + Version::GL310 + #else + Version::GLES200 + #endif + , Shader::Type::Fragment); + vert.addSource("void main() { gl_Position = vec4(0.0); }"); + frag.addSource("out vec4 color;\n" + "void main() { color = vec4(1.0); }"); + + CORRADE_VERIFY(Shader::compile({vert, frag})); + program.attachShaders({vert, frag}); + CORRADE_VERIFY(program.link()); + + std::ostringstream out; + Warning::setOutput(&out); + program.uniformBlockIndex("nonexistent"); + program.uniformBlockIndex(std::string{"another"}); + CORRADE_COMPARE(out.str(), + "AbstractShaderProgram: index of uniform block 'nonexistent' cannot be retrieved\n" + "AbstractShaderProgram: index of uniform block 'another' cannot be retrieved\n"); +} + +namespace { + struct UniformBlockShader: AbstractShaderProgram { + explicit UniformBlockShader(); + + using AbstractShaderProgram::setUniformBlockBinding; + + Int matricesUniformBlock, + materialUniformBlock; + }; +} + +#ifndef DOXYGEN_GENERATING_OUTPUT +UniformBlockShader::UniformBlockShader() { + Utility::Resource rs("AbstractShaderProgramGLTest"); + + Shader vert( + #ifndef MAGNUM_TARGET_GLES + Version::GL310 + #else + Version::GLES300 + #endif + , Shader::Type::Vertex); + Shader frag( + #ifndef MAGNUM_TARGET_GLES + Version::GL310 + #else + Version::GLES300 + #endif + , Shader::Type::Fragment); + vert.addSource(rs.get("UniformBlockShader.vert")); + frag.addSource(rs.get("UniformBlockShader.frag")); + + Shader::compile({vert, frag}); + attachShaders({vert, frag}); + + link(); + + matricesUniformBlock = uniformBlockIndex("matrices"); + materialUniformBlock = uniformBlockIndex("material"); +} +#endif + +void AbstractShaderProgramGLTest::uniformBlock() { + UniformBlockShader shader; + + MAGNUM_VERIFY_NO_ERROR(); + + shader.setUniformBlockBinding(shader.matricesUniformBlock, 0); + shader.setUniformBlockBinding(shader.materialUniformBlock, 1); + + MAGNUM_VERIFY_NO_ERROR(); +} +#endif + }} MAGNUM_GL_TEST_MAIN(Magnum::Test::AbstractShaderProgramGLTest) diff --git a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/UniformBlockShader.frag b/src/Magnum/Test/AbstractShaderProgramGLTestFiles/UniformBlockShader.frag new file mode 100644 index 000000000..e850f3bc3 --- /dev/null +++ b/src/Magnum/Test/AbstractShaderProgramGLTestFiles/UniformBlockShader.frag @@ -0,0 +1,11 @@ +layout(std140) uniform material { + lowp vec4 color; + lowp vec4 additions[3]; + lowp float multiplier; +}; + +out lowp vec4 fragColor; + +void main() { + fragColor = color*multiplier + additions[0] + additions[1] + additions[2]; +} diff --git a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/UniformBlockShader.vert b/src/Magnum/Test/AbstractShaderProgramGLTestFiles/UniformBlockShader.vert new file mode 100644 index 000000000..3e0232d5f --- /dev/null +++ b/src/Magnum/Test/AbstractShaderProgramGLTestFiles/UniformBlockShader.vert @@ -0,0 +1,10 @@ +in mediump vec4 position; + +layout(std140) uniform matrices { + mediump mat4 transformation; + mediump mat4 projection; +}; + +void main() { + gl_Position = projection*transformation*position; +} diff --git a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/resources.conf b/src/Magnum/Test/AbstractShaderProgramGLTestFiles/resources.conf index 80d20b68e..4bcbfb585 100644 --- a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/resources.conf +++ b/src/Magnum/Test/AbstractShaderProgramGLTestFiles/resources.conf @@ -8,3 +8,9 @@ filename=MyShader.vert [file] filename=MyShaderFragmentOutputs.frag + +[file] +filename=UniformBlockShader.frag + +[file] +filename=UniformBlockShader.vert From 5b6875ca4a70055bcf93cf97c554e6d52088c012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 8 Jan 2016 23:41:30 +0100 Subject: [PATCH 073/258] Implemented glMemoryBarrier() from ARB_shader_image_load_store. And also the ByRegion variant from ES3.1. --- doc/opengl-mapping.dox | 2 +- doc/opengl-support.dox | 2 +- src/Magnum/Renderer.h | 119 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 120 insertions(+), 3 deletions(-) diff --git a/doc/opengl-mapping.dox b/doc/opengl-mapping.dox index 90d45f817..5c8ce87df 100644 --- a/doc/opengl-mapping.dox +++ b/doc/opengl-mapping.dox @@ -264,7 +264,7 @@ OpenGL function | Matching API @fn_gl_extension{MakeTextureHandleNonResident,ARB,bindless_texture} | | @fn_gl{MapBuffer}, \n `glMapNamedBuffer()`, \n @fn_gl_extension{MapNamedBuffer,EXT,direct_state_access}, \n @fn_gl{MapBufferRange}, \n `glMapNamedBufferRange()`, \n @fn_gl_extension{MapNamedBufferRange,EXT,direct_state_access}, \n @fn_gl{UnmapBuffer}, \n `glUnmapNamedBuffer()`, \n @fn_gl_extension{UnmapNamedBuffer,EXT,direct_state_access} | @ref Buffer::map(), @ref Buffer::unmap() @fn_gl_extension{MapBufferSubData,CHROMIUM,map_sub}, @fn_gl_extension{UnmapBufferSubData,CHROMIUM,map_sub} | @ref Buffer::mapSub(), @ref Buffer::unmapSub() -@fn_gl{MemoryBarrier}, \n `glMemoryBarrierByRegion()` | | +@fn_gl{MemoryBarrier}, \n `glMemoryBarrierByRegion()` | @ref Renderer::setMemoryBarrier(), \n @ref Renderer::setMemoryBarrierByRegion() @fn_gl{MinSampleShading} | | @fn_gl{MultiDrawArrays}, \n @fn_gl{MultiDrawElements}, \n @fn_gl{MultiDrawElementsBaseVertex} | @ref MeshView::draw(AbstractShaderProgram&, std::initializer_list>) @fn_gl_extension{MultiDrawArraysIndirectCount,ARB,indirect_parameters}, \n @fn_gl_extension{MultiDrawElementsIndirectCount,ARB,indirect_parameters} | | diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index cfa0c079e..1128287ac 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -216,7 +216,7 @@ GLSL 4.40 | done Extension | Status ------------------------------------------- | ------ GLSL 4.50 | done -@extension{ARB,ES3_1_compatibility} | | +@extension{ARB,ES3_1_compatibility} | done @extension{ARB,clip_control} | | @extension{ARB,conditional_render_inverted} | done @extension{ARB,cull_distance} | | diff --git a/src/Magnum/Renderer.h b/src/Magnum/Renderer.h index e7bddd740..b93098cb6 100644 --- a/src/Magnum/Renderer.h +++ b/src/Magnum/Renderer.h @@ -1207,7 +1207,7 @@ class MAGNUM_EXPORT Renderer { /*@}*/ #endif - /** @{ @name Renderer management */ + /** @{ @name Renderer synchronization */ /** * @brief Flush the pipeline @@ -1224,6 +1224,123 @@ class MAGNUM_EXPORT Renderer { */ static void finish() { glFinish(); } + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + /** + * @brief Memory barrier + * + * @see @ref MemoryBarriers, @ref setMemoryBarrier(), + * @ref setMemoryBarrierByRegion() + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_gles31 Shader image load/store is not available in OpenGL + * ES 3.0 and older. + * @requires_gles Shader image load/store is not available in WebGL. + */ + enum class MemoryBarrier: GLbitfield { + /** Vertex data */ + VertexAttributeArray = GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT, + + /** Vertex indices */ + ElementArray = GL_ELEMENT_ARRAY_BARRIER_BIT, + + /** Uniforms */ + Uniform = GL_UNIFORM_BARRIER_BIT, + + /** Texture fetches */ + TextureFetch = GL_TEXTURE_FETCH_BARRIER_BIT, + + /** Shader image access */ + ShaderImageAccess = GL_SHADER_IMAGE_ACCESS_BARRIER_BIT, + + /** Indirect command data */ + Command = GL_COMMAND_BARRIER_BIT, + + /** Pixel buffer data */ + PixelBuffer = GL_PIXEL_BUFFER_BARRIER_BIT, + + /** Texture updates */ + TextureUpdate = GL_TEXTURE_UPDATE_BARRIER_BIT, + + /** Buffer updates */ + BufferUpdate = GL_BUFFER_UPDATE_BARRIER_BIT, + + /** Framebuffer operations */ + Framebuffer = GL_FRAMEBUFFER_BARRIER_BIT, + + /** Transform feedback data */ + TransformFeedback = GL_TRANSFORM_FEEDBACK_BARRIER_BIT, + + /** Atomic counters */ + AtomicCounter = GL_ATOMIC_COUNTER_BARRIER_BIT, + + /** + * Shader storage data + * @requires_gl43 Extension @extension{ARB,shader_storage_buffer_object} + * @requires_gles31 Shader storage is not available in OpenGL ES + * 3.0 and older. + * @requires_gles Shader storage is not available in WebGL. + */ + ShaderStorage = GL_ATOMIC_COUNTER_BARRIER_BIT + }; + + /** + * @brief Memory barriers + * + * @see @ref setMemoryBarrier(), @ref setMemoryBarrierByRegion() + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_gles31 Shader image load/store is not available in OpenGL + * ES 3.0 and older. + * @requires_gles Shader image load/store is not available in WebGL. + */ + typedef Containers::EnumSet MemoryBarriers; + + /** + * @brief Set memory barrier + * + * Calling the function ensures that operations on particular data + * after the barrier will reflect all data modifications before the + * barrier. + * @see @ref setMemoryBarrierByRegion(), @fn_gl{MemoryBarrier} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_gles31 Shader load/store is not available in OpenGL ES 3.0 and older. + * @requires_gles Shader load/store is not available in WebGL. + */ + void setMemoryBarrier(MemoryBarriers barriers) { + glMemoryBarrier(barriers); + } + + /** + * @brief Set memory barrier by region + * + * Behaves as @ref setMemoryBarrier(), except that the region is + * narrowed around area affected by particular fragment shader, thus + * only the fragment shader-related barries are supported: + * + * - @ref MemoryBarrier::AtomicCounter + * - @ref MemoryBarrier::Framebuffer + * - @ref MemoryBarrier::ShaderImageAccess + * - @ref MemoryBarrier::ShaderStorage + * - @ref MemoryBarrier::TextureFetch + * - @ref MemoryBarrier::Uniform + * + * @see @fn_gl{MemoryBarrierByRegion} + * @requires_gl45 Extension @extension{ARB,ES3_1_compatibility} + * @requires_gles31 Shader load/store is not available in OpenGL ES 3.0 + * and older. + * @requires_gles Shader load/store is not available in WebGL. + */ + void setMemoryBarrierByRegion(MemoryBarriers barriers) { + glMemoryBarrierByRegion(barriers); + } + #endif + + /*@}*/ + + /** @{ @name Renderer management */ + /** * @brief Error status * From f71bd7a2b8691a90b280b03bbdacfcf4ea34651d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 8 Jan 2016 23:42:56 +0100 Subject: [PATCH 074/258] Implemented ARB_texture_barrier. --- doc/opengl-mapping.dox | 2 +- doc/opengl-support.dox | 2 +- src/Magnum/Renderer.h | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/doc/opengl-mapping.dox b/doc/opengl-mapping.dox index 5c8ce87df..deba97934 100644 --- a/doc/opengl-mapping.dox +++ b/doc/opengl-mapping.dox @@ -339,7 +339,7 @@ OpenGL function | Matching API @fn_gl{TexStorage1D}, \n `glTextureStorage1D()`, \n @fn_gl_extension{TextureStorage1D,EXT,direct_state_access}, \n @fn_gl{TexStorage2D}, \n `glTextureStorage2D()`, \n @fn_gl_extension{TextureStorage2D,EXT,direct_state_access}, \n @fn_gl{TexStorage3D}, \n `glTextureStorage3D()`, \n @fn_gl_extension{TextureStorage3D,EXT,direct_state_access} | @ref Texture::setStorage(), \n @ref TextureArray::setStorage(), \n @ref CubeMapTexture::setStorage(), \n @ref CubeMapTextureArray::setStorage(), \n @ref RectangleTexture::setStorage() @fn_gl{TexStorage2DMultisample}, \n `glTextureStorage2DMultisample()`, \n @fn_gl_extension{TextureStorage2DMultisample,EXT,direct_state_access}, \n @fn_gl{TexStorage3DMultisample}, \n `glTextureStorage3DMultisample()`, \n @fn_gl_extension{TextureStorage3DMultisample,EXT,direct_state_access} | @ref MultisampleTexture::setStorage() @fn_gl{TexSubImage1D}, \n `glTextureSubImage1D()`, \n @fn_gl_extension{TextureSubImage1D,EXT,direct_state_access}, \n @fn_gl{TexSubImage2D}, \n `glTextureSubImage2D()`, \n @fn_gl_extension{TextureSubImage2D,EXT,direct_state_access}, \n @fn_gl{TexSubImage3D}, \n `glTextureSubImage3D()`, \n @fn_gl_extension{TextureSubImage3D,EXT,direct_state_access} | @ref Texture::setSubImage(), \n @ref TextureArray::setSubImage(), \n @ref CubeMapTexture::setSubImage(), \n @ref CubeMapTextureArray::setSubImage(), \n @ref RectangleTexture::setSubImage() -@fn_gl{TextureBarrier} | | +@fn_gl{TextureBarrier} | @ref Renderer::setTextureBarrier() @fn_gl{TextureView} | | @fn_gl{TransformFeedbackBufferBase}, \n @fn_gl{TransformFeedbackBufferRange} | @ref TransformFeedback::attachBuffer(), \n @ref TransformFeedback::attachBuffers() @fn_gl{TransformFeedbackVaryings} | @ref AbstractShaderProgram::setTransformFeedbackOutputs() diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index 1128287ac..867845919 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -224,7 +224,7 @@ GLSL 4.50 | done @extension{ARB,direct_state_access} | done for implemented functionality (except VAOs) @extension{ARB,get_texture_sub_image} | done @extension{ARB,shader_texture_image_samples} | done (shading language only) -@extension{ARB,texture_barrier} | | +@extension{ARB,texture_barrier} | done @extension{KHR,context_flush_control} | | @extension{KHR,robustness} | | diff --git a/src/Magnum/Renderer.h b/src/Magnum/Renderer.h index b93098cb6..1eae7b2a9 100644 --- a/src/Magnum/Renderer.h +++ b/src/Magnum/Renderer.h @@ -1337,6 +1337,22 @@ class MAGNUM_EXPORT Renderer { } #endif + #ifndef MAGNUM_TARGET_GLES + /** + * @brief Set texture barrier + * + * Calling the function ensures that texel fetches in drawing + * operations after the barrier will reflect texel writes before the + * barrier. + * @see @fn_gl{TextureBarrier} + * @requires_gl45 Extension @extension{ARB,texture_barrier} + * @requires_gl Texture barrier is not available in OpenGL ES or WebGL. + */ + void setTextureBarrier() { + glTextureBarrier(); + } + #endif + /*@}*/ /** @{ @name Renderer management */ From 62064d523d7e2c6c6dda7b97f28e7f2cb22662be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 9 Jan 2016 00:23:36 +0100 Subject: [PATCH 075/258] ARB_shader_storage_buffer_object seems to be done now. That binding function is not needed as I would deprecate it anyway. --- doc/opengl-support.dox | 2 +- src/Magnum/AbstractShaderProgram.h | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index 867845919..290e3888b 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -185,7 +185,7 @@ GLSL 4.30 | done @extension{ARB,program_interface_query} | | @extension{ARB,robust_buffer_access_behavior} | done (nothing to do) @extension{ARB,shader_image_size} | done (shading language only) -@extension{ARB,shader_storage_buffer_object} | only limit queries +@extension{ARB,shader_storage_buffer_object} | missing (unneeded) block binding @extension{ARB,stencil_texturing} | done @extension{ARB,texture_buffer_range} | done @extension{ARB,texture_query_levels} | done (shading language only) diff --git a/src/Magnum/AbstractShaderProgram.h b/src/Magnum/AbstractShaderProgram.h index ac0552193..6d75f1783 100644 --- a/src/Magnum/AbstractShaderProgram.h +++ b/src/Magnum/AbstractShaderProgram.h @@ -289,6 +289,27 @@ setUniformBlockBinding(uniformBlockIndex("material"), 1); @requires_gles Explicit uniform block binding is not supported in WebGL. Use @ref uniformBlockIndex() and @ref setUniformBlockBinding() instead. +@anchor AbstractShaderProgram-shader-storage-block-binding +### Shader storage block bindings + +The workflow is to specify shader storage block binding directly in the shader +code, e.g.: +@code +// GLSL 4.30 or GLSL ES 3.10 +layout(std430, binding = 0) buffer vertices { + vec3 position; + vec3 color; +}; +layout(std430, binding = 1) buffer normals { + vec3 normal; +}; +@endcode + +@see @ref Buffer::maxShaderStorageBindings() +@requires_gl43 Extension @extension{ARB,shader_storage_buffer_object} +@requires_gles31 Shader storage is not available in OpenGL ES 3.0 and older. +@requires_gles Shader storage is not available in WebGL. + @anchor AbstractShaderProgram-texture-units ### Specifying texture binding units From 926c9532c615ca8435156baa948e91311b7be9d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 9 Jan 2016 00:30:17 +0100 Subject: [PATCH 076/258] Oops. --- src/Magnum/Renderer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Renderer.h b/src/Magnum/Renderer.h index 1eae7b2a9..264836f02 100644 --- a/src/Magnum/Renderer.h +++ b/src/Magnum/Renderer.h @@ -1309,7 +1309,7 @@ class MAGNUM_EXPORT Renderer { * @requires_gles Shader load/store is not available in WebGL. */ void setMemoryBarrier(MemoryBarriers barriers) { - glMemoryBarrier(barriers); + glMemoryBarrier(GLbitfield(barriers)); } /** @@ -1333,7 +1333,7 @@ class MAGNUM_EXPORT Renderer { * @requires_gles Shader load/store is not available in WebGL. */ void setMemoryBarrierByRegion(MemoryBarriers barriers) { - glMemoryBarrierByRegion(barriers); + glMemoryBarrierByRegion(GLbitfield(barriers)); } #endif From 305f066003e153f606dee8f306c8dcee7329e3fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 9 Jan 2016 14:02:29 +0100 Subject: [PATCH 077/258] Platform: another chaotic limit position. I need to sort this out. --- src/Magnum/Platform/magnum-info.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index 76e9e60de..c3c8428af 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -445,6 +445,8 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat _h(ARB::shader_storage_buffer_object) #endif + _l(Buffer::shaderStorageOffsetAlignment()) + _l(Buffer::maxShaderStorageBindings()) _l(Shader::maxShaderStorageBlocks(Shader::Type::Vertex)) _l(Shader::maxShaderStorageBlocks(Shader::Type::TessellationControl)) _l(Shader::maxShaderStorageBlocks(Shader::Type::TessellationEvaluation)) @@ -591,8 +593,6 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat _h(EXT::tessellation_shader) #endif - _l(Buffer::shaderStorageOffsetAlignment()) - _l(Buffer::maxShaderStorageBindings()) _l(Shader::maxTessellationControlInputComponents()) _l(Shader::maxTessellationControlOutputComponents()) _l(Shader::maxTessellationControlTotalOutputComponents()) From 3f0737fa980d3f2c180e87cfe53634b71de8ef63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 9 Jan 2016 14:05:01 +0100 Subject: [PATCH 078/258] Added missing ARB_compute_shader limit queries. --- doc/opengl-mapping.dox | 4 +- src/Magnum/AbstractShaderProgram.cpp | 38 +++++++++++++++++++ src/Magnum/AbstractShaderProgram.h | 26 ++++++++++++- .../Implementation/ShaderProgramState.h | 3 ++ src/Magnum/Platform/magnum-info.cpp | 4 +- 5 files changed, 71 insertions(+), 4 deletions(-) diff --git a/doc/opengl-mapping.dox b/doc/opengl-mapping.dox index deba97934..78b4f62ea 100644 --- a/doc/opengl-mapping.dox +++ b/doc/opengl-mapping.dox @@ -431,9 +431,9 @@ OpenGL function | Matching API @def_gl{MAX_COMPUTE_SHARED_MEMORY_SIZE} | @ref AbstractShaderProgram::maxComputeSharedMemorySize() @def_gl_extension{MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS,ARB,compute_variable_group_size} | | @def_gl_extension{MAX_COMPUTE_VARIABLE_GROUP_SIZE,ARB,compute_variable_group_size} | | -@def_gl{MAX_COMPUTE_WORK_GROUP_COUNT} | | +@def_gl{MAX_COMPUTE_WORK_GROUP_COUNT} | @ref AbstractShaderProgram::maxComputeWorkGroupCount() @def_gl{MAX_COMPUTE_WORK_GROUP_INVOCATIONS} | @ref AbstractShaderProgram::maxComputeWorkGroupInvocations() -@def_gl{MAX_COMPUTE_WORK_GROUP_SIZE} | | +@def_gl{MAX_COMPUTE_WORK_GROUP_SIZE} | @ref AbstractShaderProgram::maxComputeWorkGroupSize() @def_gl{MAX_CULL_DISTANCES} | | @def_gl{MAX_DEBUG_LOGGED_MESSAGES} | @ref DebugOutput::maxLoggedMessages() @def_gl{MAX_DEBUG_MESSAGE_LENGTH} | @ref DebugOutput::maxMessageLength() diff --git a/src/Magnum/AbstractShaderProgram.cpp b/src/Magnum/AbstractShaderProgram.cpp index 933c1b47e..4ff1b1cd2 100644 --- a/src/Magnum/AbstractShaderProgram.cpp +++ b/src/Magnum/AbstractShaderProgram.cpp @@ -108,6 +108,44 @@ Int AbstractShaderProgram::maxComputeWorkGroupInvocations() { return value; } +Vector3i AbstractShaderProgram::maxComputeWorkGroupCount() { + #ifndef MAGNUM_TARGET_GLES + if(!Context::current().isExtensionSupported()) + #else + if(!Context::current().isVersionSupported(Version::GLES310)) + #endif + return {}; + + Vector3i& value = Context::current().state().shaderProgram->maxComputeWorkGroupCount; + + if(value.isZero()) { + glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 0, &value.x()); + glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 1, &value.y()); + glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 2, &value.z()); + } + + return value; +} + +Vector3i AbstractShaderProgram::maxComputeWorkGroupSize() { + #ifndef MAGNUM_TARGET_GLES + if(!Context::current().isExtensionSupported()) + #else + if(!Context::current().isVersionSupported(Version::GLES310)) + #endif + return {}; + + Vector3i& value = Context::current().state().shaderProgram->maxComputeWorkGroupSize; + + if(value.isZero()) { + glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 0, &value.x()); + glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 1, &value.y()); + glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 2, &value.z()); + } + + return value; +} + Int AbstractShaderProgram::maxImageUnits() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/AbstractShaderProgram.h b/src/Magnum/AbstractShaderProgram.h index 6d75f1783..4769aa735 100644 --- a/src/Magnum/AbstractShaderProgram.h +++ b/src/Magnum/AbstractShaderProgram.h @@ -539,7 +539,31 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { */ static Int maxComputeWorkGroupInvocations(); - /** @todo MAX_COMPUTE_WORK_GROUP_COUNT, MAX_COMPUTE_WORK_GROUP_SIZE */ + /** + * @brief Max supported compute work group count + * + * The result is cached, repeated queries don't result in repeated + * OpenGL calls. If neither extension @extension{ARB,compute_shader} + * (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns zero + * vector. + * @see @fn_gl{Get} with @def_gl{MAX_COMPUTE_WORK_GROUP_COUNT} + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles Compute shaders are not available in WebGL. + */ + static Vector3i maxComputeWorkGroupCount(); + + /** + * @brief Max supported compute work group size + * + * The result is cached, repeated queries don't result in repeated + * OpenGL calls. If neither extension @extension{ARB,compute_shader} + * (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns zero + * vector. + * @see @fn_gl{Get} with @def_gl{MAX_COMPUTE_WORK_GROUP_SIZE} + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles Compute shaders are not available in WebGL. + */ + static Vector3i maxComputeWorkGroupSize(); /** * @brief Max supported image unit count diff --git a/src/Magnum/Implementation/ShaderProgramState.h b/src/Magnum/Implementation/ShaderProgramState.h index 9c0ceba56..cc3c3cb7d 100644 --- a/src/Magnum/Implementation/ShaderProgramState.h +++ b/src/Magnum/Implementation/ShaderProgramState.h @@ -30,6 +30,7 @@ #include "Magnum/Magnum.h" #include "Magnum/OpenGL.h" +#include "Magnum/Math/Vector3.h" #ifdef _MSC_VER /* Otherwise the member function pointers will have different size based on @@ -101,6 +102,8 @@ struct ShaderProgramState { maxImageUnits, maxCombinedShaderOutputResources, maxUniformLocations; + Vector3i maxComputeWorkGroupCount, + maxComputeWorkGroupSize; #endif GLint minTexelOffset, maxTexelOffset, diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index c3c8428af..f75c13093 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -310,7 +310,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat /* Limits and implementation-defined values */ #define _h(val) Debug() << "\n " << Extensions::GL::val::string() + std::string(":"); #define _l(val) Debug() << " " << #val << (sizeof(#val) > 64 ? "\n" + std::string(68, ' ') : std::string(64 - sizeof(#val), ' ')) << val; - #define _lvec(val) Debug() << " " << #val << (sizeof(#val) > 48 ? "\n" + std::string(52, ' ') : std::string(48 - sizeof(#val), ' ')) << val; + #define _lvec(val) Debug() << " " << #val << (sizeof(#val) > 42 ? "\n" + std::string(46, ' ') : std::string(42 - sizeof(#val), ' ')) << val; Debug() << "Limits and implementation-defined values:"; _lvec(AbstractFramebuffer::maxViewportSize()) @@ -374,6 +374,8 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat _l(AbstractShaderProgram::maxComputeSharedMemorySize()) _l(AbstractShaderProgram::maxComputeWorkGroupInvocations()) + _lvec(AbstractShaderProgram::maxComputeWorkGroupCount()) + _lvec(AbstractShaderProgram::maxComputeWorkGroupSize()) } #ifndef MAGNUM_TARGET_GLES From 97bd725bf52963b45f7a7dd36bee0658d5942ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 9 Jan 2016 14:05:20 +0100 Subject: [PATCH 079/258] doc: clarify how much of ARB_uniform_buffer_object is supported. --- doc/opengl-support.dox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index 290e3888b..decd80180 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -80,7 +80,7 @@ GLSL 1.40 | done @extension{ARB,texture_rectangle} | done @extension{ARB,draw_instanced} | done @extension{ARB,texture_buffer_object} | done -@extension{ARB,uniform_buffer_object} | done +@extension{ARB,uniform_buffer_object} | done except for data layout queries @extension{ARB,copy_buffer} | done @extension{EXT,texture_snorm} | done @extension{NV,primitive_restart} | | From ce075752e935c79b7b5a61c14ae66533e884351d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 9 Jan 2016 14:18:56 +0100 Subject: [PATCH 080/258] MeshTools: removed unneeded enable_if. --- src/Magnum/MeshTools/Interleave.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Magnum/MeshTools/Interleave.h b/src/Magnum/MeshTools/Interleave.h index ff03bb6d2..825dfc436 100644 --- a/src/Magnum/MeshTools/Interleave.h +++ b/src/Magnum/MeshTools/Interleave.h @@ -133,11 +133,8 @@ would be 21 bytes, causing possible performance loss. will be `std::vector` or `std::array`. @see @ref interleaveInto() -@todo remove `std::enable_if` when deprecated overloads are removed */ -/* enable_if to avoid clash with overloaded function below */ -template typename std::enable_if::value, Containers::Array>::type - interleave(const T& first, const U&... next) +template Containers::Array interleave(const T& first, const U&... next) { /* Compute buffer size and stride */ const std::size_t attributeCount = Implementation::AttributeCount{}(first, next...); From 98e7717ae0b62add882259885600a4c15cf9b76b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 10 Jan 2016 18:01:14 +0100 Subject: [PATCH 081/258] Proper dependency order of CMake options. Don't hide anything by default, hide them only if they are a dependency of something else. --- CMakeLists.txt | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f125a949..e881c6fb5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,15 +48,34 @@ endif() cmake_dependent_option(TARGET_GLES2 "Build for OpenGL ES 2 / WebGL 1.0" ON "TARGET_GLES" OFF) cmake_dependent_option(TARGET_DESKTOP_GLES "Build for OpenGL ES on desktop" OFF "TARGET_GLES" OFF) +# Magnum Info (currently only using GLX, CGL, WGL/EGL on Windows or on NaCl) +if(CORRADE_TARGET_UNIX OR CORRADE_TARGET_NACL OR CORRADE_TARGET_WINDOWS) + option(WITH_MAGNUMINFO "Build magnum-info utility" OFF) +endif() + +# Utilities (currently only using GLX, CGL or WGL) +if(CORRADE_TARGET_UNIX OR CORRADE_TARGET_WINDOWS) + cmake_dependent_option(WITH_FONTCONVERTER "Build magnum-fontconverter utility" OFF "NOT TARGET_GLES" OFF) + cmake_dependent_option(WITH_DISTANCEFIELDCONVERTER "Build magnum-distancefieldconverter utility" OFF "NOT TARGET_GLES" OFF) +endif() + +# Plugins +option(WITH_WAVAUDIOIMPORTER "Build WavAudioImporter plugin" OFF) +option(WITH_MAGNUMFONT "Build MagnumFont plugin" OFF) +cmake_dependent_option(WITH_MAGNUMFONTCONVERTER "Build MagnumFontConverter plugin" OFF "NOT TARGET_GLES" OFF) +option(WITH_OBJIMPORTER "Build ObjImporter plugin" OFF) +cmake_dependent_option(WITH_TGAIMAGECONVERTER "Build TgaImageConverter plugin" OFF "NOT WITH_MAGNUMFONTCONVERTER" ON) +cmake_dependent_option(WITH_TGAIMPORTER "Build TgaImporter plugin" OFF "NOT WITH_MAGNUMFONT" ON) + # Parts of the library -option(WITH_AUDIO "Build Audio library" OFF) +cmake_dependent_option(WITH_AUDIO "Build Audio library" OFF "NOT WITH_WAVAUDIOIMPORTER" ON) option(WITH_DEBUGTOOLS "Build DebugTools library" ON) cmake_dependent_option(WITH_MESHTOOLS "Build MeshTools library" ON "NOT WITH_DEBUGTOOLS;NOT WITH_OBJIMPORTER" ON) cmake_dependent_option(WITH_PRIMITIVES "Builf Primitives library" ON "NOT WITH_DEBUGTOOLS" ON) +cmake_dependent_option(WITH_SHAPES "Build Shapes library" ON "NOT WITH_DEBUGTOOLS" ON) cmake_dependent_option(WITH_SCENEGRAPH "Build SceneGraph library" ON "NOT WITH_DEBUGTOOLS;NOT WITH_SHAPES" ON) cmake_dependent_option(WITH_SHADERS "Build Shaders library" ON "NOT WITH_DEBUGTOOLS" ON) -cmake_dependent_option(WITH_SHAPES "Build Shapes library" ON "NOT WITH_DEBUGTOOLS" ON) -option(WITH_TEXT "Build Text library" ON) +cmake_dependent_option(WITH_TEXT "Build Text library" ON "NOT WITH_MAGNUMFONT;NOT WITH_MAGNUMFONTCONVERTER" ON) cmake_dependent_option(WITH_TEXTURETOOLS "Build TextureTools library" ON "NOT WITH_TEXT;NOT WITH_DISTANCEFIELDCONVERTER" ON) # EGL context, available everywhere except on platforms which don't support extension loading @@ -101,25 +120,6 @@ if(NOT CORRADE_TARGET_NACL AND NOT CORRADE_TARGET_ANDROID) option(WITH_SDL2APPLICATION "Build Sdl2Application library" OFF) endif() -# Magnum Info (currently only using GLX, CGL, WGL/EGL on Windows or on NaCl) -if(CORRADE_TARGET_UNIX OR CORRADE_TARGET_NACL OR CORRADE_TARGET_WINDOWS) - option(WITH_MAGNUMINFO "Build magnum-info utility" OFF) -endif() - -# Utilities (currently only using GLX, CGL or WGL) -if(CORRADE_TARGET_UNIX OR CORRADE_TARGET_WINDOWS) - cmake_dependent_option(WITH_FONTCONVERTER "Build magnum-fontconverter utility" OFF "NOT TARGET_GLES" OFF) - cmake_dependent_option(WITH_DISTANCEFIELDCONVERTER "Build magnum-distancefieldconverter utility" OFF "NOT TARGET_GLES" OFF) -endif() - -# Plugins -cmake_dependent_option(WITH_MAGNUMFONT "Build MagnumFont plugin" OFF "WITH_TEXT" OFF) -cmake_dependent_option(WITH_MAGNUMFONTCONVERTER "Build MagnumFontConverter plugin" OFF "NOT MAGNUM_TARGET_GLES;WITH_TEXT" OFF) -option(WITH_OBJIMPORTER "Build ObjImporter plugin" OFF) -cmake_dependent_option(WITH_TGAIMAGECONVERTER "Build TgaImageConverter plugin" OFF "NOT WITH_MAGNUMFONTCONVERTER" ON) -cmake_dependent_option(WITH_TGAIMPORTER "Build TgaImporter plugin" OFF "NOT WITH_MAGNUMFONT" ON) -cmake_dependent_option(WITH_WAVAUDIOIMPORTER "Build WavAudioImporter plugin" OFF "WITH_AUDIO" OFF) - option(BUILD_DEPRECATED "Include deprecated API in the build" ON) if(BUILD_DEPRECATED) set(MAGNUM_BUILD_DEPRECATED 1) From a981593bd029a62c559a2e14cf5ad562061ca3ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 10 Jan 2016 18:20:35 +0100 Subject: [PATCH 082/258] DebugTools: don't force dependency on SceneGraph and Shapes. --- CMakeLists.txt | 4 +- src/Magnum/DebugTools/CMakeLists.txt | 89 +++++++++++++++++----------- 2 files changed, 56 insertions(+), 37 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e881c6fb5..6abc4fa79 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,8 +72,8 @@ cmake_dependent_option(WITH_AUDIO "Build Audio library" OFF "NOT WITH_WAVAUDIOIM option(WITH_DEBUGTOOLS "Build DebugTools library" ON) cmake_dependent_option(WITH_MESHTOOLS "Build MeshTools library" ON "NOT WITH_DEBUGTOOLS;NOT WITH_OBJIMPORTER" ON) cmake_dependent_option(WITH_PRIMITIVES "Builf Primitives library" ON "NOT WITH_DEBUGTOOLS" ON) -cmake_dependent_option(WITH_SHAPES "Build Shapes library" ON "NOT WITH_DEBUGTOOLS" ON) -cmake_dependent_option(WITH_SCENEGRAPH "Build SceneGraph library" ON "NOT WITH_DEBUGTOOLS;NOT WITH_SHAPES" ON) +option(WITH_SHAPES "Build Shapes library" ON) +cmake_dependent_option(WITH_SCENEGRAPH "Build SceneGraph library" ON "NOT WITH_SHAPES" ON) cmake_dependent_option(WITH_SHADERS "Build Shaders library" ON "NOT WITH_DEBUGTOOLS" ON) cmake_dependent_option(WITH_TEXT "Build Text library" ON "NOT WITH_MAGNUMFONT;NOT WITH_MAGNUMFONTCONVERTER" ON) cmake_dependent_option(WITH_TEXTURETOOLS "Build TextureTools library" ON "NOT WITH_TEXT;NOT WITH_DISTANCEFIELDCONVERTER" ON) diff --git a/src/Magnum/DebugTools/CMakeLists.txt b/src/Magnum/DebugTools/CMakeLists.txt index 51cfe5f5b..3a3a6046e 100644 --- a/src/Magnum/DebugTools/CMakeLists.txt +++ b/src/Magnum/DebugTools/CMakeLists.txt @@ -24,47 +24,62 @@ # set(MagnumDebugTools_SRCS - ForceRenderer.cpp - ObjectRenderer.cpp Profiler.cpp - ResourceManager.cpp - ShapeRenderer.cpp - - Implementation/AbstractBoxRenderer.cpp - Implementation/AbstractShapeRenderer.cpp - Implementation/AxisAlignedBoxRenderer.cpp - Implementation/BoxRenderer.cpp - Implementation/CapsuleRenderer.cpp - Implementation/CylinderRenderer.cpp - Implementation/LineSegmentRenderer.cpp - Implementation/PointRenderer.cpp - Implementation/SphereRenderer.cpp) + ResourceManager.cpp) set(MagnumDebugTools_HEADERS - ForceRenderer.h DebugTools.h - ObjectRenderer.h Profiler.h ResourceManager.h - ShapeRenderer.h - visibility.h) # Header files to display in project view of IDEs only -set(MagnumDebugTools_PRIVATE_HEADERS - Implementation/AbstractBoxRenderer.h - Implementation/AbstractShapeRenderer.h - Implementation/AxisAlignedBoxRenderer.h - Implementation/BoxRenderer.h - Implementation/CapsuleRenderer.h - Implementation/CapsuleRendererTransformation.h - Implementation/CylinderRenderer.h - Implementation/CylinderRendererTransformation.h - Implementation/ForceRendererTransformation.h - Implementation/LineSegmentRenderer.h - Implementation/LineSegmentRendererTransformation.h - Implementation/PointRenderer.h - Implementation/SphereRenderer.h) +set(MagnumDebugTools_PRIVATE_HEADERS ) + +if(WITH_SCENEGRAPH) + list(APPEND MagnumDebugTools_SRCS + ForceRenderer.cpp + ObjectRenderer.cpp) + + list(APPEND MagnumDebugTools_HEADERS + ForceRenderer.h + ObjectRenderer.h) + + list(APPEND MagnumDebugTools_PRIVATE_HEADERS + Implementation/ForceRendererTransformation.h) +endif() + +if(WITH_SHAPES) + list(APPEND MagnumDebugTools_SRCS + ShapeRenderer.cpp + + Implementation/AbstractBoxRenderer.cpp + Implementation/AbstractShapeRenderer.cpp + Implementation/AxisAlignedBoxRenderer.cpp + Implementation/BoxRenderer.cpp + Implementation/CapsuleRenderer.cpp + Implementation/CylinderRenderer.cpp + Implementation/LineSegmentRenderer.cpp + Implementation/PointRenderer.cpp + Implementation/SphereRenderer.cpp) + + list(APPEND MagnumDebugTools_HEADERS + ShapeRenderer.h) + + list(APPEND MagnumDebugTools_PRIVATE_HEADERS + Implementation/AbstractBoxRenderer.h + Implementation/AbstractShapeRenderer.h + Implementation/AxisAlignedBoxRenderer.h + Implementation/BoxRenderer.h + Implementation/CapsuleRenderer.h + Implementation/CapsuleRendererTransformation.h + Implementation/CylinderRenderer.h + Implementation/CylinderRendererTransformation.h + Implementation/LineSegmentRenderer.h + Implementation/LineSegmentRendererTransformation.h + Implementation/PointRenderer.h + Implementation/SphereRenderer.h) +endif() # DebugTools library add_library(MagnumDebugTools ${SHARED_OR_STATIC} @@ -80,9 +95,13 @@ target_link_libraries(MagnumDebugTools Magnum MagnumMeshTools MagnumPrimitives - MagnumSceneGraph - MagnumShaders - MagnumShapes) + MagnumShaders) +if(WITH_SCENEGRAPH) + target_link_libraries(MagnumDebugTools MagnumSceneGraph) +endif() +if(WITH_SHAPES) + target_link_libraries(MagnumDebugTools MagnumShapes) +endif() install(TARGETS MagnumDebugTools RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} From a1cae889dfa1350306dc3e2ed5f0011ae6947cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 10 Jan 2016 19:55:06 +0100 Subject: [PATCH 083/258] Use Containers::Array instead of std::vector for non-resizable storage. --- src/Magnum/Implementation/TextureState.cpp | 4 ++-- src/Magnum/Implementation/TextureState.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Magnum/Implementation/TextureState.cpp b/src/Magnum/Implementation/TextureState.cpp index 98e4fd30d..bc813149c 100644 --- a/src/Magnum/Implementation/TextureState.cpp +++ b/src/Magnum/Implementation/TextureState.cpp @@ -383,10 +383,10 @@ TextureState::TextureState(Context& context, std::vector& extension compressedBlockDataSizeImplementation = &AbstractTexture::compressedBlockDataSizeImplementationDefault; #endif - /* Resize bindings array to hold all possible texture units */ + /* Allocate texture bindings array to hold all possible texture units */ glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextureUnits); CORRADE_INTERNAL_ASSERT(maxTextureUnits > 0); - bindings.resize(maxTextureUnits); + bindings = Containers::Array>{Containers::ValueInit, std::size_t(maxTextureUnits)}; } TextureState::~TextureState() = default; diff --git a/src/Magnum/Implementation/TextureState.h b/src/Magnum/Implementation/TextureState.h index f34a234b7..10c0fcfc0 100644 --- a/src/Magnum/Implementation/TextureState.h +++ b/src/Magnum/Implementation/TextureState.h @@ -139,7 +139,7 @@ struct TextureState { GLint bufferOffsetAlignment; #endif - std::vector> bindings; + Containers::Array> bindings; }; }} From d9b25c605790b076c6f8cded7dabaffe8f2f366f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 10 Jan 2016 23:00:49 +0100 Subject: [PATCH 084/258] Implemented ARB_shader_image_load_store. --- doc/opengl-mapping.dox | 2 +- doc/opengl-support.dox | 4 +- src/Magnum/AbstractShaderProgram.h | 13 +- src/Magnum/AbstractTexture.cpp | 56 ++++ src/Magnum/AbstractTexture.h | 92 ++++- src/Magnum/BufferTexture.h | 22 ++ src/Magnum/CMakeLists.txt | 1 + src/Magnum/CubeMapTexture.h | 49 +++ src/Magnum/CubeMapTextureArray.h | 47 +++ src/Magnum/ImageFormat.h | 315 ++++++++++++++++++ src/Magnum/Implementation/TextureState.cpp | 17 + src/Magnum/Implementation/TextureState.h | 4 + src/Magnum/Magnum.h | 5 + src/Magnum/MultisampleTexture.h | 76 +++++ src/Magnum/RectangleTexture.h | 19 ++ src/Magnum/Test/BufferTextureGLTest.cpp | 42 +++ src/Magnum/Test/CubeMapTextureArrayGLTest.cpp | 40 +++ src/Magnum/Test/CubeMapTextureGLTest.cpp | 44 +++ src/Magnum/Test/MultisampleTextureGLTest.cpp | 78 +++++ src/Magnum/Test/RectangleTextureGLTest.cpp | 28 ++ src/Magnum/Test/TextureArrayGLTest.cpp | 78 +++++ src/Magnum/Test/TextureGLTest.cpp | 109 ++++++ src/Magnum/Texture.h | 84 +++++ src/Magnum/TextureArray.h | 49 +++ 24 files changed, 1256 insertions(+), 18 deletions(-) create mode 100644 src/Magnum/ImageFormat.h diff --git a/doc/opengl-mapping.dox b/doc/opengl-mapping.dox index 78b4f62ea..998984a54 100644 --- a/doc/opengl-mapping.dox +++ b/doc/opengl-mapping.dox @@ -60,7 +60,7 @@ OpenGL function | Matching API @fn_gl{BindFragDataLocation} | @ref AbstractShaderProgram::bindFragmentDataLocation() @fn_gl{BindFragDataLocationIndexed} | @ref AbstractShaderProgram::bindFragmentDataLocationIndexed() @fn_gl{BindFramebuffer} | @ref Framebuffer::bind() -@fn_gl{BindImageTexture}, \n @fn_gl{BindImageTextures} | | +@fn_gl{BindImageTexture}, \n @fn_gl{BindImageTextures} | @ref AbstractTexture::unbindImage(), \n @ref AbstractTexture::unbindImages(), \n @ref AbstractTexture::bindImages(), \n @ref Texture::bindImage(), \n @ref Texture::bindImageLayered(), \n @ref TextureArray::bindImage(), \n @ref TextureArray::bindImageLayered(), \n @ref CubeMapTexture::bindImage(), \n @ref CubeMapTexture::bindImageLayered(), \n @ref CubeMapTextureArray::bindImage(), \n @ref CubeMapTextureArray::bindImageLayered(), \n @ref MultisampleTexture::bindImage(), \n @ref MultisampleTexture::bindImageLayered(), \n @ref RectangleTexture::bindImage(), \n @ref BufferTexture::bindImage() @fn_gl{BindProgramPipeline} | | @fn_gl{BindRenderbuffer} | not needed, handled internally in @ref Renderbuffer @fn_gl{BindSampler}, \n @fn_gl{BindSamplers} | | diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index decd80180..a82eb683e 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -161,7 +161,7 @@ GLSL 4.20 | done @extension{ARB,internalformat_query} | | @extension{ARB,map_buffer_alignment} | done @extension{ARB,shader_atomic_counters} | done -@extension{ARB,shader_image_load_store} | | +@extension{ARB,shader_image_load_store} | done @extension{ARB,shading_language_packing} | done (shading language only) @extension{ARB,texture_storage} | done @@ -205,7 +205,7 @@ GLSL 4.40 | done @extension{ARB,buffer_storage} | | @extension{ARB,clear_texture} | | @extension{ARB,enhanced_layouts} | done (shading language only) -@extension{ARB,multi_bind} | only texture and buffer binding +@extension{ARB,multi_bind} | missing sampler and vertex buffer binding @extension{ARB,query_buffer_object} | | @extension{ARB,texture_mirror_clamp_to_edge} | done @extension{ARB,texture_stencil8} | done diff --git a/src/Magnum/AbstractShaderProgram.h b/src/Magnum/AbstractShaderProgram.h index 4769aa735..9bad054c3 100644 --- a/src/Magnum/AbstractShaderProgram.h +++ b/src/Magnum/AbstractShaderProgram.h @@ -99,9 +99,10 @@ MyShader& setNormalMatrix(const Matrix3x3& matrix) { return *this; } @endcode -- **Texture setting functions** in which you bind the textures - to particular texture units using @ref Texture::bind() "*Texture::bind()" - and equivalents, for example: +- **Texture and texture image setting functions** in which you bind the + textures/images to particular texture/image units using + @ref Texture::bind() "*Texture::bind()" / + @ref Texture::bindImage() "*Texture::bindImage()" and similar, for example: @code MyShader& setDiffuseTexture(Texture2D& texture) { texture.bind(0); @@ -311,9 +312,9 @@ layout(std430, binding = 1) buffer normals { @requires_gles Shader storage is not available in WebGL. @anchor AbstractShaderProgram-texture-units -### Specifying texture binding units +### Specifying texture and image binding units -The preferred workflow is to specify texture binding unit directly in the +The preferred workflow is to specify texture/image binding unit directly in the shader code, e.g.: @code // GLSL 4.20, GLSL ES 3.10 or @@ -335,7 +336,7 @@ setUniform(uniformLocation("diffuseTexture"), 0); setUniform(uniformLocation("specularTexture"), 1); @endcode -@see @ref Shader::maxTextureImageUnits() +@see @ref Shader::maxTextureImageUnits(), @ref maxImageUnits() @requires_gl42 Extension @extension{ARB,shading_language_420pack} for explicit texture binding unit instead of using @ref setUniform(Int, const T&) "setUniform(Int, Int)". diff --git a/src/Magnum/AbstractTexture.cpp b/src/Magnum/AbstractTexture.cpp index 16cdd7c81..8e1acf5be 100644 --- a/src/Magnum/AbstractTexture.cpp +++ b/src/Magnum/AbstractTexture.cpp @@ -269,6 +269,62 @@ AbstractTexture& AbstractTexture::setLabelInternal(const Containers::ArrayView(textureState.imageBindings[imageUnit]) == 0) return; + + /* Update state tracker, bind the texture to the unit */ + std::get<0>(textureState.imageBindings[imageUnit]) = 0; + glBindImageTexture(imageUnit, 0, 0, false, 0, GL_READ_ONLY, GL_R8); +} + +#ifndef MAGNUM_TARGET_GLES +/** @todoc const Containers::ArrayView makes Doxygen grumpy */ +void AbstractTexture::bindImagesInternal(const Int firstImageUnit, Containers::ArrayView textures) { + Implementation::TextureState& textureState = *Context::current().state().texture; + + /* Create array of IDs and also update bindings in state tracker */ + Containers::Array ids{textures ? textures.size() : 0}; + bool different = false; + for(std::size_t i = 0; i != textures.size(); ++i) { + const std::tuple state = textures && textures[i] ? + std::tuple(textures[i]->_id, 0, true, 0, GL_READ_WRITE) : + std::tuple(0, 0, false, 0, GL_READ_ONLY); + + if(textures) { + if(textures[i]) { + textures[i]->createIfNotAlready(); + } + ids[i] = std::get<0>(state); + } + + if(textureState.imageBindings[firstImageUnit + i] != state) { + different = true; + textureState.imageBindings[firstImageUnit + i] = state; + } + } + + /* Avoid doing the binding if there is nothing different */ + if(different) glBindImageTextures(firstImageUnit, textures.size(), ids); +} +#endif + +void AbstractTexture::bindImageInternal(const Int imageUnit, const Int level, const bool layered, const Int layer, const ImageAccess access, const ImageFormat format) { + Implementation::TextureState& textureState = *Context::current().state().texture; + const std::tuple state{_id, level, layered, layer, GLenum(access)}; + + /* If already bound in given texture unit, nothing to do */ + if(textureState.imageBindings[imageUnit] == state) return; + + /* Update state tracker, bind the texture to the unit */ + textureState.imageBindings[imageUnit] = state; + glBindImageTexture(imageUnit, _id, level, layered, layer, GLenum(access), GLenum(format)); +} +#endif + void AbstractTexture::bind(Int textureUnit) { Implementation::TextureState& textureState = *Context::current().state().texture; diff --git a/src/Magnum/AbstractTexture.h b/src/Magnum/AbstractTexture.h index eea1ea3d4..72072a38d 100644 --- a/src/Magnum/AbstractTexture.h +++ b/src/Magnum/AbstractTexture.h @@ -69,13 +69,13 @@ documentation for details. @anchor AbstractTexture-performance-optimization ## Performance optimizations and security -The engine tracks currently bound textures in all available texture units to -avoid unnecessary calls to @fn_gl{ActiveTexture} and @fn_gl{BindTexture}. -Texture configuration functions use dedicated highest available texture unit -to not affect active bindings in user units. Texture limits and -implementation-defined values (such as @ref maxColorSamples()) are cached, so -repeated queries don't result in repeated @fn_gl{Get} calls. See also -@ref Context::resetState() and @ref Context::State::Textures. +The engine tracks currently bound textures and images in all available texture +units to avoid unnecessary calls to @fn_gl{ActiveTexture}, @fn_gl{BindTexture} +and @fn_gl{BindImageTexture}. Texture configuration functions use dedicated +highest available texture unit to not affect active bindings in user units. +Texture limits and implementation-defined values (such as @ref maxColorSamples()) +are cached, so repeated queries don't result in repeated @fn_gl{Get} calls. See +also @ref Context::resetState() and @ref Context::State::Textures. If @extension{ARB,direct_state_access} (part of OpenGL 4.5) is available, @ref bind(Int) and @ref unbind(Int) use @fn_gl{BindTextureUnit}. Otherwise, if @@ -209,13 +209,14 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { /** * @brief Unbind textures in given range of texture units * - * Unbinds all texture in the range @f$ [ firstTextureUnit ; firstTextureUnit + count ) @f$. + * Unbinds all textures in the range @f$ [ firstTextureUnit ; firstTextureUnit + count ) @f$. * If @extension{ARB,multi_bind} (part of OpenGL 4.4) is not available, * the feature is emulated with sequence of @ref unbind(Int) calls. * @note This function is meant to be used only internally from * @ref AbstractShaderProgram subclasses. See its documentation * for more information. - * @see @ref Shader::maxCombinedTextureImageUnits(), @fn_gl{BindTextures} + * @see @ref bind(), @ref Shader::maxCombinedTextureImageUnits(), + * @fn_gl{BindTextures} */ static void unbind(Int firstTextureUnit, std::size_t count); @@ -234,6 +235,71 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { */ static void bind(Int firstTextureUnit, std::initializer_list textures); + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + /** + * @brief Unbind any image from given image unit + * + * @note This function is meant to be used only internally from + * @ref AbstractShaderProgram subclasses. See its documentation + * for more information. + * @see @ref Texture::bindImage() "*Texture::bindImage()", + * @ref Texture::bindImageLayered() "*Texture::bindImageLayered()", + * @ref unbindImages(), @ref bindImages(), + * @ref AbstractShaderProgram::maxImageUnits(), + * @fn_gl{BindImageTexture} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_gles31 Shader image load/store is not available in OpenGL + * ES 3.0 and older. + * @requires_gles Shader image load/store is not available in WebGL. + */ + static void unbindImage(Int imageUnit); + #endif + + #ifndef MAGNUM_TARGET_GLES + /** + * @brief Unbind images in given range of image units + * + * Unbinds all texture in the range @f$ [ firstImageUnit ; firstImageUnit + count ) @f$. + * @note This function is meant to be used only internally from + * @ref AbstractShaderProgram subclasses. See its documentation + * for more information. + * @see @ref Texture::bindImage() "*Texture::bindImage()", + * @ref Texture::bindImageLayered() "*Texture::bindImageLayered()", + * @ref unbindImage(), @ref bindImages(), + * @ref AbstractShaderProgram::maxImageUnits(), + * @fn_gl{BindImageTextures} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_gl44 Extension @extension{ARB,multi_bind} + * @requires_gl Multi bind is not available in OpenGL ES and WebGL. + */ + static void unbindImages(Int firstImageUnit, std::size_t count) { + bindImagesInternal(firstImageUnit, {nullptr, count}); + } + + /** + * @brief Bind textures to given range of texture units + * + * Binds first level of given texture in the list to @p firstImageUnit, + * second to `firstTextureUnit + 1` etc. 3D, cube map and array + * textures are bound as layered targets. If any texture is `nullptr`, + * given image unit is unbound. + * @note This function is meant to be used only internally from + * @ref AbstractShaderProgram subclasses. See its documentation + * for more information. + * @see @ref Texture::bindImage() "*Texture::bindImage()", + * @ref Texture::bindImageLayered() "*Texture::bindImageLayered()", + * @ref unbindImages(), @ref unbindImage(), + * @ref AbstractShaderProgram::maxImageUnits(), + * @fn_gl{BindImageTextures} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_gl44 Extension @extension{ARB,multi_bind} + * @requires_gl Multi bind is not available in OpenGL ES and WebGL. + */ + static void bindImages(Int firstImageUnit, std::initializer_list textures) { + bindImagesInternal(firstImageUnit, {textures.begin(), textures.size()}); + } + #endif + /** @brief Copying is not allowed */ AbstractTexture(const AbstractTexture&) = delete; @@ -342,6 +408,10 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { static Int compressedBlockDataSize(GLenum target, TextureFormat format); #endif + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + static void bindImagesInternal(Int firstImageUnit, Containers::ArrayView textures); + #endif + explicit AbstractTexture(GLenum target); explicit AbstractTexture(NoCreateT, GLenum target) noexcept: _target{target}, _id{0}, _flags{ObjectFlag::DeleteOnDestruction} {} explicit AbstractTexture(GLuint id, GLenum target, ObjectFlags flags) noexcept: _target{target}, _id{id}, _flags{flags} {} @@ -352,6 +422,10 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { void MAGNUM_LOCAL createIfNotAlready(); + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + void bindImageInternal(Int imageUnit, Int level, bool layered, Int layer, ImageAccess access, ImageFormat format); + #endif + /* Unlike bind() this also sets the texture binding unit as active */ void MAGNUM_LOCAL bindInternal(); diff --git a/src/Magnum/BufferTexture.h b/src/Magnum/BufferTexture.h index 41980de01..21fa4b645 100644 --- a/src/Magnum/BufferTexture.h +++ b/src/Magnum/BufferTexture.h @@ -157,6 +157,28 @@ class MAGNUM_EXPORT BufferTexture: public AbstractTexture { AbstractTexture{NoCreate, GL_TEXTURE_BUFFER_EXT} {} #endif + /** + * @brief Bind texture to given image unit + * @param imageUnit Image unit + * @param access Image access + * @param format Image format + * + * @note This function is meant to be used only internally from + * @ref AbstractShaderProgram subclasses. See its documentation + * for more information. + * @see @ref bindImages(Int, std::initializer_list), + * @ref unbindImage(), @ref unbindImages(), + * @ref AbstractShaderProgram::maxImageUnits(), + * @fn_gl{BindImageTexture} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_gles31 Shader image load/store is not available in OpenGL + * ES 3.0 and older. + * @requires_gles Shader image load/store is not available in WebGL. + */ + void bindImage(Int imageUnit, ImageAccess access, ImageFormat format) { + bindImageInternal(imageUnit, 0, false, 0, access, format); + } + /** * @brief Set texture buffer * @param internalFormat Internal format diff --git a/src/Magnum/CMakeLists.txt b/src/Magnum/CMakeLists.txt index 95e8f6f2f..e8afacd08 100644 --- a/src/Magnum/CMakeLists.txt +++ b/src/Magnum/CMakeLists.txt @@ -187,6 +187,7 @@ if(NOT TARGET_WEBGL) BufferTexture.h BufferTextureFormat.h CubeMapTextureArray.h + ImageFormat.h MultisampleTexture.h) endif() diff --git a/src/Magnum/CubeMapTexture.h b/src/Magnum/CubeMapTexture.h index 2ee70927a..ef1935657 100644 --- a/src/Magnum/CubeMapTexture.h +++ b/src/Magnum/CubeMapTexture.h @@ -166,6 +166,55 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { */ explicit CubeMapTexture(NoCreateT) noexcept: AbstractTexture{NoCreate, GL_TEXTURE_CUBE_MAP} {} + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + /** + * @brief Bind level of given cube map texture coordinate to given image unit + * @param imageUnit Image unit + * @param level Texture level + * @param coordinate Cube map coordinate + * @param access Image access + * @param format Image format + * + * @note This function is meant to be used only internally from + * @ref AbstractShaderProgram subclasses. See its documentation + * for more information. + * @see @ref bindImages(Int, std::initializer_list), + * @ref bindImageLayered(), @ref unbindImage(), @ref unbindImages(), + * @ref AbstractShaderProgram::maxImageUnits(), + * @fn_gl{BindImageTexture} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_gles31 Shader image load/store is not available in OpenGL + * ES 3.0 and older. + * @requires_gles Shader image load/store is not available in WebGL. + */ + void bindImage(Int imageUnit, Int level, Coordinate coordinate, ImageAccess access, ImageFormat format) { + bindImageInternal(imageUnit, level, false, GLenum(coordinate) - GL_TEXTURE_CUBE_MAP_POSITIVE_X, access, format); + } + + /** + * @brief Bind level of layered cube map texture to given image unit + * @param imageUnit Image unit + * @param level Texture level + * @param access Image access + * @param format Image format + * + * @note This function is meant to be used only internally from + * @ref AbstractShaderProgram subclasses. See its documentation + * for more information. + * @see @ref bindImages(Int, std::initializer_list), + * @ref bindImage(), @ref unbindImage(), @ref unbindImages(), + * @ref AbstractShaderProgram::maxImageUnits(), + * @fn_gl{BindImageTexture} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_gles31 Shader image load/store is not available in OpenGL + * ES 3.0 and older. + * @requires_gles Shader image load/store is not available in WebGL. + */ + void bindImageLayered(Int imageUnit, Int level, ImageAccess access, ImageFormat format) { + bindImageInternal(imageUnit, level, true, 0, access, format); + } + #endif + #ifndef MAGNUM_TARGET_GLES2 /** * @copybrief Texture::setBaseLevel() diff --git a/src/Magnum/CubeMapTextureArray.h b/src/Magnum/CubeMapTextureArray.h index a78abb21b..a3e02aefd 100644 --- a/src/Magnum/CubeMapTextureArray.h +++ b/src/Magnum/CubeMapTextureArray.h @@ -173,6 +173,53 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture { AbstractTexture{NoCreate, GL_TEXTURE_CUBE_MAP_ARRAY_EXT} {} #endif + /** + * @brief Bind level of given texture layer to given image unit + * @param imageUnit Image unit + * @param level Texture level + * @param layer Texture layer + * @param access Image access + * @param format Image format + * + * Layer is equivalent to layer * 6 + number of texture face, i.e. +X + * is `0` and so on, in order of (+X, -X, +Y, -Y, +Z, -Z). + * @note This function is meant to be used only internally from + * @ref AbstractShaderProgram subclasses. See its documentation + * for more information. + * @see @ref bindImages(Int, std::initializer_list), + * @ref bindImageLayered(), @ref unbindImage(), @ref unbindImages(), + * @ref AbstractShaderProgram::maxImageUnits(), + * @fn_gl{BindImageTexture} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_gles31 Shader image load/store is not available in OpenGL + * ES 3.0 and older. + */ + void bindImage(Int imageUnit, Int level, Int layer, ImageAccess access, ImageFormat format) { + bindImageInternal(imageUnit, level, false, layer, access, format); + } + + /** + * @brief Bind level of layered texture to given image unit + * @param imageUnit Image unit + * @param level Texture level + * @param access Image access + * @param format Image format + * + * @note This function is meant to be used only internally from + * @ref AbstractShaderProgram subclasses. See its documentation + * for more information. + * @see @ref bindImages(Int, std::initializer_list), + * @ref bindImage(), @ref unbindImage(), @ref unbindImages(), + * @ref AbstractShaderProgram::maxImageUnits(), + * @fn_gl{BindImageTexture} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_gles31 Shader image load/store is not available in OpenGL + * ES 3.0 and older. + */ + void bindImageLayered(Int imageUnit, Int level, ImageAccess access, ImageFormat format) { + bindImageInternal(imageUnit, level, true, 0, access, format); + } + /** * @copybrief Texture::setBaseLevel() * @return Reference to self (for method chaining) diff --git a/src/Magnum/ImageFormat.h b/src/Magnum/ImageFormat.h new file mode 100644 index 000000000..dd8b0f5a6 --- /dev/null +++ b/src/Magnum/ImageFormat.h @@ -0,0 +1,315 @@ +#ifndef Magnum_ImageFormat_h +#define Magnum_ImageFormat_h +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + 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. +*/ + +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +/** @file + * @brief Enum @ref Magnum::ImageAccess, @ref Magnum::ImageFormat + */ +#endif + +#include + +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +namespace Magnum { + +/** +@brief Image access + +@see @ref Texture::bindImage() "*Texture::bindImage()", + @ref Texture::bindImageLayered() "*Texture::bindImageLayered()" +@requires_gl42 Extension @extension{ARB,shader_image_load_store} +@requires_gles31 Shader image load/store is not available in OpenGL ES 3.0 and + older. +@requires_gles Shader image load/store is not available in WebGL. +*/ +enum class ImageAccess: GLenum { + ReadOnly = GL_READ_ONLY, + WriteOnly = GL_WRITE_ONLY, + ReadWrite = GL_READ_WRITE +}; + +/** +@brief Image format + +@see @ref Texture::bindImage() "*Texture::bindImage()", + @ref Texture::bindImageLayered() "*Texture::bindImageLayered()" +@requires_gl42 Extension @extension{ARB,shader_image_load_store} +@requires_gles31 Shader image load/store is not available in OpenGL ES 3.0 and + older. +@requires_gles Shader image load/store is not available in WebGL. +*/ +enum class ImageFormat: GLenum { + #ifndef MAGNUM_TARGET_GLES + /** + * Red component, normalized unsigned byte. + * @requires_gl Only four-component byte image formats are available in + * OpenGL ES. + */ + R8 = GL_R8, + + /** + * Red and green component, each normalized unsigned byte. + * @requires_gl Only four-component byte image formats are available in + * OpenGL ES. + */ + RG8 = GL_RG8, + #endif + + /** RGBA, each component normalized unsigned byte. */ + RGBA8 = GL_RGBA8, + + #ifndef MAGNUM_TARGET_GLES + /** + * Red component, normalized signed byte. + * @requires_gl Only four-component byte image formats are available in + * OpenGL ES. + */ + R8Snorm = GL_R8_SNORM, + + /** + * Red and green component, each normalized signed byte. + * @requires_gl Only four-component byte image formats are available in + * OpenGL ES. + */ + RG8Snorm = GL_RG8_SNORM, + #endif + + /** RGBA, each component normalized unsigned byte. */ + RGBA8Snorm = GL_RGBA8_SNORM, + + #ifndef MAGNUM_TARGET_GLES + /** + * Red component, normalized unsigned short. + * @requires_gl Only byte-size normalized image formats are available in + * OpenGL ES. + */ + R16 = GL_R16, + + /** + * Red and green component, each normalized unsigned short. + * @requires_gl Only byte-size normalized image formats are available in + * OpenGL ES. + */ + RG16 = GL_RG16, + + /** + * RGBA, each component normalized unsigned short. + * @requires_gl Only byte-size normalized image formats are available in + * OpenGL ES. + */ + RGBA16 = GL_RGBA16, + + /** + * Red component, normalized signed short. + * @requires_gl Only byte-size normalized image formats are available in + * OpenGL ES. + */ + R16Snorm = GL_R16_SNORM, + + /** + * Red and green component, each normalized signed short. + * @requires_gl Only byte-size normalized image formats are available in + * OpenGL ES. + */ + RG16Snorm = GL_RG16_SNORM, + + /** + * RGBA, each component normalized unsigned short. + * @requires_gl Only byte-size normalized image formats are available in + * OpenGL ES. + */ + RGBA16Snorm = GL_RGBA16_SNORM, + #endif + + #ifndef MAGNUM_TARGET_GLES + /** + * Red component, non-normalized unsigned byte. + * @requires_gl Only four-component byte image formats are available in + * OpenGL ES. + */ + R8UI = GL_R8UI, + + /** + * Red and green component, each non-normalized unsigned byte. + * @requires_gl Only four-component byte image formats are available in + * OpenGL ES. + */ + RG8UI = GL_RG8UI, + #endif + + /** RGBA, each component non-normalized unsigned byte. */ + RGBA8UI = GL_RGBA8UI, + + #ifndef MAGNUM_TARGET_GLES + /** + * Red component, non-normalized signed byte. + * @requires_gl Only four-component byte image formats are available in + * OpenGL ES. + */ + R8I = GL_R8I, + + /** + * Red and green component, each non-normalized signed byte. + * @requires_gl Only four-component byte image formats are available in + * OpenGL ES. + */ + RG8I = GL_RG8I, + #endif + + /** RGBA, each component non-normalized signed byte. */ + RGBA8I = GL_RGBA8I, + + #ifndef MAGNUM_TARGET_GLES + /** + * Red component, non-normalized unsigned short. + * @requires_gl Only four-component short image formats are available in + * OpenGL ES. + */ + R16UI = GL_R16UI, + + /** + * Red and green component, each non-normalized unsigned short. + * @requires_gl Only four-component short image formats are available in + * OpenGL ES. + */ + RG16UI = GL_RG16UI, + #endif + + /** RGBA, each component non-normalized unsigned short. */ + RGBA16UI = GL_RGBA16UI, + + #ifndef MAGNUM_TARGET_GLES + /** + * Red component, non-normalized signed short. + * @requires_gl Only four-component short image formats are available in + * OpenGL ES. + */ + R16I = GL_R16I, + + /** + * Red and green component, each non-normalized signed short. + * @requires_gl Only four-component short image formats are available in + * OpenGL ES. + */ + RG16I = GL_RG16I, + #endif + + /** RGBA, each component non-normalized signed short. */ + RGBA16I = GL_RGBA16I, + + /** Red component, non-normalized unsigned int. */ + R32UI = GL_R32UI, + + #ifndef MAGNUM_TARGET_GLES + /** + * Red and green component, each non-normalized unsigned int. + * @requires_gl Only one- or four-component int image formats are available + * in OpenGL ES. + */ + RG32UI = GL_RG32UI, + #endif + + /** RGBA, each component non-normalized unsigned int. */ + RGBA32UI = GL_RGBA32UI, + + /** Red component, non-normalized signed int. */ + R32I = GL_R32I, + + #ifndef MAGNUM_TARGET_GLES + /** + * Red and green component, each non-normalized signed int. + * @requires_gl Only one- or four-component int image formats are available + * in OpenGL ES. + */ + RG32I = GL_RG32I, + #endif + + /** RGBA, each component non-normalized signed int. */ + RGBA32I = GL_RGBA32I, + + #ifndef MAGNUM_TARGET_GLES + /** + * Red component, half float. + * @requires_gl Only four-component half float image formats are available + * in OpenGL ES. + */ + R16F = GL_R16F, + + /** + * Red and green component, each half float. + * @requires_gl Only four-component half float image formats are available + * in OpenGL ES. + */ + RG16F = GL_RG16F, + #endif + + /** RGBA, each component half float. */ + RGBA16F = GL_RGBA16F, + + /** Red component, float. */ + R32F = GL_R32F, + + #ifndef MAGNUM_TARGET_GLES + /** + * Red and green component, each float. + * @requires_gl Only one- or four-component float image formats are + * available in OpenGL ES. + */ + RG32F = GL_RG32F, + #endif + + /** RGBA, each component float. */ + RGBA32F = GL_RGBA32F, + + #ifndef MAGNUM_TARGET_GLES + /** + * RGB, float, red and green component 11bit, blue 10bit. + * @requires_gl Packed image formats are not available in OpenGL ES. + */ + R11FG11FB10F = GL_R11F_G11F_B10F, + + /** + * RGBA, normalized unsigned, each RGB component 10bit, alpha 2bit. + * @requires_gl Packed image formats are not available in OpenGL ES. + */ + RGB10A2 = GL_RGB10_A2, + + /** + * RGBA, non-normalized unsigned, each RGB component 10bit, alpha 2bit. + * @requires_gl33 Extension @extension{ARB,texture_rgb10_a2ui} + * @requires_gl Packed image formats are not available in OpenGL ES. + */ + RGB10A2UI = GL_RGB10_A2UI, + #endif +}; + +} +#else +#error this header is not available in OpenGL ES 2.0 and WebGL build +#endif + +#endif diff --git a/src/Magnum/Implementation/TextureState.cpp b/src/Magnum/Implementation/TextureState.cpp index bc813149c..663e70771 100644 --- a/src/Magnum/Implementation/TextureState.cpp +++ b/src/Magnum/Implementation/TextureState.cpp @@ -387,12 +387,29 @@ TextureState::TextureState(Context& context, std::vector& extension glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextureUnits); CORRADE_INTERNAL_ASSERT(maxTextureUnits > 0); bindings = Containers::Array>{Containers::ValueInit, std::size_t(maxTextureUnits)}; + + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + /* Allocate image bindings array to hold all possible image units */ + #ifndef MAGNUM_TARGET_GLES + if(context.isExtensionSupported()) + #else + if(context.isVersionSupported(Version::GLES310)) + #endif + { + GLint maxImageUnits; + glGetIntegerv(GL_MAX_IMAGE_UNITS, &maxImageUnits); + imageBindings = Containers::Array>{Containers::ValueInit, std::size_t(maxImageUnits)}; + } + #endif } TextureState::~TextureState() = default; void TextureState::reset() { std::fill_n(bindings.begin(), bindings.size(), std::pair{{}, State::DisengagedBinding}); + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + std::fill_n(imageBindings.begin(), imageBindings.size(), std::tuple{State::DisengagedBinding, 0, false, 0, 0}); + #endif } }} diff --git a/src/Magnum/Implementation/TextureState.h b/src/Magnum/Implementation/TextureState.h index 10c0fcfc0..d6e637ec2 100644 --- a/src/Magnum/Implementation/TextureState.h +++ b/src/Magnum/Implementation/TextureState.h @@ -27,6 +27,7 @@ #include #include +#include #include "Magnum/CubeMapTexture.h" @@ -140,6 +141,9 @@ struct TextureState { #endif Containers::Array> bindings; + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + Containers::Array> imageBindings; + #endif }; }} diff --git a/src/Magnum/Magnum.h b/src/Magnum/Magnum.h index 2648e0f7f..fdd7e1ab0 100644 --- a/src/Magnum/Magnum.h +++ b/src/Magnum/Magnum.h @@ -486,6 +486,11 @@ class CubeMapTextureArray; class Extension; class Framebuffer; +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +enum class ImageFormat: GLenum; +enum class ImageAccess: GLenum; +#endif + template class Image; typedef Image<1> Image1D; typedef Image<2> Image2D; diff --git a/src/Magnum/MultisampleTexture.h b/src/Magnum/MultisampleTexture.h index d9d42e3d8..6375a9da4 100644 --- a/src/Magnum/MultisampleTexture.h +++ b/src/Magnum/MultisampleTexture.h @@ -160,6 +160,82 @@ template class MultisampleTexture: public AbstractTextur */ explicit MultisampleTexture(NoCreateT) noexcept: AbstractTexture{NoCreate, Implementation::multisampleTextureTarget()} {} + /** + * @brief Bind texture to given image unit + * @param imageUnit Image unit + * @param access Image access + * @param format Image format + * + * Available only on 2D multisample textures. + * @note This function is meant to be used only internally from + * @ref AbstractShaderProgram subclasses. See its documentation + * for more information. + * @see @ref bindImages(Int, std::initializer_list), + * @ref bindImageLayered(), @ref unbindImage(), @ref unbindImages(), + * @ref AbstractShaderProgram::maxImageUnits(), + * @fn_gl{BindImageTexture} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + */ + #ifndef DOXYGEN_GENERATING_OUTPUT + template::type> + #endif + void bindImage(Int imageUnit, ImageAccess access, ImageFormat format) { + bindImageInternal(imageUnit, 0, false, 0, access, format); + } + + /** + * @brief Bind texture layer to given image unit + * @param imageUnit Image unit + * @param layer Texture layer + * @param access Image access + * @param format Image format + * + * Available only on 2D multisample texture arrays. + * @note This function is meant to be used only internally from + * @ref AbstractShaderProgram subclasses. See its documentation + * for more information. + * @see @ref bindImages(Int, std::initializer_list), + * @ref bindImageLayered(), @ref unbindImage(), @ref unbindImages(), + * @ref AbstractShaderProgram::maxImageUnits(), + * @fn_gl{BindImageTexture} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_es_extension Extension @es_extension{ANDROID,extension_pack_es31a}/ + * @es_extension{OES,texture_storage_multisample_2d_array} for + * multisample 2D array textures. + */ + #ifndef DOXYGEN_GENERATING_OUTPUT + template::type> + #endif + void bindImage(Int imageUnit, Int layer, ImageAccess access, ImageFormat format) { + bindImageInternal(imageUnit, 0, false, layer, access, format); + } + + /** + * @brief Bind layered texture to given image unit + * @param imageUnit Image unit + * @param access Image access + * @param format Image format + * + * Available only on 2D multisample texture arrays. + * @note This function is meant to be used only internally from + * @ref AbstractShaderProgram subclasses. See its documentation + * for more information. + * @see @ref bindImages(Int, std::initializer_list), + * @ref bindImage(), @ref unbindImages(), @ref unbindImage(), + * @ref AbstractShaderProgram::maxImageUnits(), + * @fn_gl{BindImageTexture} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_es_extension Extension @es_extension{ANDROID,extension_pack_es31a}/ + * @es_extension{OES,texture_storage_multisample_2d_array} for + * multisample 2D array textures. + */ + #ifndef DOXYGEN_GENERATING_OUTPUT + template::type> + #endif + void bindImageLayered(Int imageUnit, ImageAccess access, ImageFormat format) { + bindImageInternal(imageUnit, 0, true, 0, access, format); + } + /** * @brief Set storage * @param samples Sample count diff --git a/src/Magnum/RectangleTexture.h b/src/Magnum/RectangleTexture.h index 11db9875e..94544818d 100644 --- a/src/Magnum/RectangleTexture.h +++ b/src/Magnum/RectangleTexture.h @@ -139,6 +139,25 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture { */ explicit RectangleTexture(NoCreateT) noexcept: AbstractTexture{NoCreate, GL_TEXTURE_RECTANGLE} {} + /** + * @brief Bind texture to given image unit + * @param imageUnit Image unit + * @param access Image access + * @param format Image format + * + * @note This function is meant to be used only internally from + * @ref AbstractShaderProgram subclasses. See its documentation + * for more information. + * @see @ref bindImages(Int, std::initializer_list), + * @ref unbindImage(), @ref unbindImages(), + * @ref AbstractShaderProgram::maxImageUnits(), + * @fn_gl{BindImageTexture} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + */ + void bindImage(Int imageUnit, ImageAccess access, ImageFormat format) { + bindImageInternal(imageUnit, 0, false, 0, access, format); + } + /** * @copybrief Texture::setMinificationFilter() * @return Reference to self (for method chaining) diff --git a/src/Magnum/Test/BufferTextureGLTest.cpp b/src/Magnum/Test/BufferTextureGLTest.cpp index 16d7484a8..c4eda943d 100644 --- a/src/Magnum/Test/BufferTextureGLTest.cpp +++ b/src/Magnum/Test/BufferTextureGLTest.cpp @@ -28,6 +28,7 @@ #include "Magnum/Buffer.h" #include "Magnum/BufferTexture.h" #include "Magnum/BufferTextureFormat.h" +#include "Magnum/ImageFormat.h" #include "Magnum/Test/AbstractOpenGLTester.h" namespace Magnum { namespace Test { @@ -40,6 +41,8 @@ struct BufferTextureGLTest: AbstractOpenGLTester { void wrap(); void bind(); + void bindImage(); + void setBuffer(); void setBufferOffset(); }; @@ -50,6 +53,8 @@ BufferTextureGLTest::BufferTextureGLTest() { &BufferTextureGLTest::wrap, &BufferTextureGLTest::bind, + &BufferTextureGLTest::bindImage, + &BufferTextureGLTest::setBuffer, &BufferTextureGLTest::setBufferOffset}); } @@ -134,6 +139,43 @@ void BufferTextureGLTest::bind() { MAGNUM_VERIFY_NO_ERROR(); } +void BufferTextureGLTest::bindImage() { + #ifndef MAGNUM_TARGET_GLES + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + #else + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_buffer::string() + std::string(" is not supported.")); + if(!Context::current().isVersionSupported(Version::GLES310)) + CORRADE_SKIP("OpenGL ES 3.1 is not supported."); + #endif + + Buffer buffer; + buffer.setData({nullptr, 32}, BufferUsage::StaticDraw); + + BufferTexture texture; + texture.setBuffer(BufferTextureFormat::RGBA8, buffer) + .bindImage(2, ImageAccess::ReadWrite, ImageFormat::RGBA8); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::unbindImage(2); + + MAGNUM_VERIFY_NO_ERROR(); + + #ifndef MAGNUM_TARGET_GLES + AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::unbindImages(1, 3); + + MAGNUM_VERIFY_NO_ERROR(); + #endif +} + void BufferTextureGLTest::setBuffer() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp b/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp index e449cc465..589a799c9 100644 --- a/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp @@ -28,6 +28,7 @@ #include "Magnum/BufferImage.h" #include "Magnum/CubeMapTextureArray.h" #include "Magnum/Image.h" +#include "Magnum/ImageFormat.h" #include "Magnum/PixelFormat.h" #include "Magnum/TextureFormat.h" #include "Magnum/Math/Color.h" @@ -44,6 +45,7 @@ struct CubeMapTextureArrayGLTest: AbstractOpenGLTester { void wrap(); void bind(); + void bindImage(); void sampling(); void samplingSRGBDecode(); @@ -89,6 +91,7 @@ CubeMapTextureArrayGLTest::CubeMapTextureArrayGLTest() { &CubeMapTextureArrayGLTest::wrap, &CubeMapTextureArrayGLTest::bind, + &CubeMapTextureArrayGLTest::bindImage, &CubeMapTextureArrayGLTest::sampling, &CubeMapTextureArrayGLTest::samplingSRGBDecode, @@ -226,6 +229,43 @@ void CubeMapTextureArrayGLTest::bind() { MAGNUM_VERIFY_NO_ERROR(); } +void CubeMapTextureArrayGLTest::bindImage() { + #ifndef MAGNUM_TARGET_GLES + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + #else + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isVersionSupported(Version::GLES310)) + CORRADE_SKIP("OpenGL ES 3.1 is not supported."); + #endif + + CubeMapTextureArray texture; + texture.setStorage(1, TextureFormat::RGBA8, {32, 32, 12}) + .bindImage(2, 0, 1, ImageAccess::ReadWrite, ImageFormat::RGBA8); + + MAGNUM_VERIFY_NO_ERROR(); + + texture.bindImageLayered(3, 0, ImageAccess::ReadWrite, ImageFormat::RGBA8); + + AbstractTexture::unbindImage(2); + AbstractTexture::unbindImage(3); + + MAGNUM_VERIFY_NO_ERROR(); + + #ifndef MAGNUM_TARGET_GLES + AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::unbindImages(1, 3); + + MAGNUM_VERIFY_NO_ERROR(); + #endif +} + void CubeMapTextureArrayGLTest::sampling() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/Test/CubeMapTextureGLTest.cpp b/src/Magnum/Test/CubeMapTextureGLTest.cpp index 6b3b68fac..b142621b8 100644 --- a/src/Magnum/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureGLTest.cpp @@ -31,6 +31,9 @@ #endif #include "Magnum/CubeMapTexture.h" #include "Magnum/Image.h" +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +#include "Magnum/ImageFormat.h" +#endif #include "Magnum/PixelFormat.h" #include "Magnum/TextureFormat.h" #include "Magnum/Math/Color.h" @@ -47,6 +50,9 @@ struct CubeMapTextureGLTest: AbstractOpenGLTester { void wrap(); void bind(); + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + void bindImage(); + #endif void sampling(); void samplingSRGBDecode(); @@ -116,6 +122,9 @@ CubeMapTextureGLTest::CubeMapTextureGLTest() { &CubeMapTextureGLTest::wrap, &CubeMapTextureGLTest::bind, + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + &CubeMapTextureGLTest::bindImage, + #endif &CubeMapTextureGLTest::sampling, &CubeMapTextureGLTest::samplingSRGBDecode, @@ -268,6 +277,41 @@ void CubeMapTextureGLTest::bind() { MAGNUM_VERIFY_NO_ERROR(); } +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +void CubeMapTextureGLTest::bindImage() { + #ifndef MAGNUM_TARGET_GLES + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + #else + if(!Context::current().isVersionSupported(Version::GLES310)) + CORRADE_SKIP("OpenGL ES 3.1 is not supported."); + #endif + + CubeMapTexture texture; + texture.setStorage(1, TextureFormat::RGBA8, Vector2i{32}) + .bindImage(2, 0, CubeMapTexture::Coordinate::NegativeX, ImageAccess::ReadWrite, ImageFormat::RGBA8); + + MAGNUM_VERIFY_NO_ERROR(); + + texture.bindImageLayered(3, 0, ImageAccess::ReadWrite, ImageFormat::RGBA8); + + AbstractTexture::unbindImage(2); + AbstractTexture::unbindImage(3); + + MAGNUM_VERIFY_NO_ERROR(); + + #ifndef MAGNUM_TARGET_GLES + AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::unbindImages(1, 3); + + MAGNUM_VERIFY_NO_ERROR(); + #endif +} +#endif + void CubeMapTextureGLTest::sampling() { CubeMapTexture texture; texture.setMinificationFilter(Sampler::Filter::Linear, Sampler::Mipmap::Linear) diff --git a/src/Magnum/Test/MultisampleTextureGLTest.cpp b/src/Magnum/Test/MultisampleTextureGLTest.cpp index 1439c2306..131b0397e 100644 --- a/src/Magnum/Test/MultisampleTextureGLTest.cpp +++ b/src/Magnum/Test/MultisampleTextureGLTest.cpp @@ -26,6 +26,7 @@ #include #include "Magnum/MultisampleTexture.h" +#include "Magnum/ImageFormat.h" #include "Magnum/TextureFormat.h" #include "Magnum/Math/Vector3.h" #include "Magnum/Test/AbstractOpenGLTester.h" @@ -47,6 +48,9 @@ struct MultisampleTextureGLTest: AbstractOpenGLTester { void bind2D(); void bind2DArray(); + void bindImage2D(); + void bindImage2DArray(); + void storage2D(); void storage2DArray(); @@ -70,6 +74,9 @@ MultisampleTextureGLTest::MultisampleTextureGLTest() { &MultisampleTextureGLTest::bind2D, &MultisampleTextureGLTest::bind2DArray, + &MultisampleTextureGLTest::bindImage2D, + &MultisampleTextureGLTest::bindImage2DArray, + &MultisampleTextureGLTest::storage2D, &MultisampleTextureGLTest::storage2DArray, @@ -240,6 +247,77 @@ void MultisampleTextureGLTest::bind2DArray() { MAGNUM_VERIFY_NO_ERROR(); } +void MultisampleTextureGLTest::bindImage2D() { + #ifndef MAGNUM_TARGET_GLES + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + #else + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); + if(!Context::current().isVersionSupported(Version::GLES310)) + CORRADE_SKIP("OpenGL ES 3.1 is not supported."); + #endif + + MultisampleTexture2D texture; + texture.setStorage(4, TextureFormat::RGBA8, Vector2i{32}) + .bindImage(2, ImageAccess::ReadWrite, ImageFormat::RGBA8); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::unbindImage(2); + + MAGNUM_VERIFY_NO_ERROR(); + + #ifndef MAGNUM_TARGET_GLES + AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::unbindImages(1, 3); + + MAGNUM_VERIFY_NO_ERROR(); + #endif +} + +void MultisampleTextureGLTest::bindImage2DArray() { + #ifndef MAGNUM_TARGET_GLES + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + #else + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); + if(!Context::current().isVersionSupported(Version::GLES310)) + CORRADE_SKIP("OpenGL ES 3.1 is not supported."); + #endif + + MultisampleTexture2DArray texture; + texture.setStorage(4, TextureFormat::RGBA8, {32, 32, 4}) + .bindImage(2, 1, ImageAccess::ReadWrite, ImageFormat::RGBA8); + + MAGNUM_VERIFY_NO_ERROR(); + + texture.bindImageLayered(3, ImageAccess::ReadWrite, ImageFormat::RGBA8); + + AbstractTexture::unbindImage(2); + AbstractTexture::unbindImage(3); + + MAGNUM_VERIFY_NO_ERROR(); + + #ifndef MAGNUM_TARGET_GLES + AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::unbindImages(1, 3); + + MAGNUM_VERIFY_NO_ERROR(); + #endif +} + void MultisampleTextureGLTest::storage2D() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/Test/RectangleTextureGLTest.cpp b/src/Magnum/Test/RectangleTextureGLTest.cpp index 51ecff200..453197b12 100644 --- a/src/Magnum/Test/RectangleTextureGLTest.cpp +++ b/src/Magnum/Test/RectangleTextureGLTest.cpp @@ -29,6 +29,7 @@ #include "Magnum/configure.h" #include "Magnum/BufferImage.h" #include "Magnum/Image.h" +#include "Magnum/ImageFormat.h" #include "Magnum/PixelFormat.h" #include "Magnum/RectangleTexture.h" #include "Magnum/TextureFormat.h" @@ -46,6 +47,7 @@ struct RectangleTextureGLTest: AbstractOpenGLTester { void wrap(); void bind(); + void bindImage(); void sampling(); void samplingSRGBDecode(); @@ -78,6 +80,7 @@ RectangleTextureGLTest::RectangleTextureGLTest() { &RectangleTextureGLTest::wrap, &RectangleTextureGLTest::bind, + &RectangleTextureGLTest::bindImage, &RectangleTextureGLTest::sampling, &RectangleTextureGLTest::samplingSRGBDecode, @@ -177,6 +180,31 @@ void RectangleTextureGLTest::bind() { MAGNUM_VERIFY_NO_ERROR(); } +void RectangleTextureGLTest::bindImage() { + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + + RectangleTexture texture; + texture.setStorage(TextureFormat::RGBA8, Vector2i{32}) + .bindImage(2, ImageAccess::ReadWrite, ImageFormat::RGBA8); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::unbindImage(2); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::unbindImages(1, 3); + + MAGNUM_VERIFY_NO_ERROR(); +} + void RectangleTextureGLTest::sampling() { if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); diff --git a/src/Magnum/Test/TextureArrayGLTest.cpp b/src/Magnum/Test/TextureArrayGLTest.cpp index b9e170ba9..99785898b 100644 --- a/src/Magnum/Test/TextureArrayGLTest.cpp +++ b/src/Magnum/Test/TextureArrayGLTest.cpp @@ -28,6 +28,7 @@ #include "Magnum/configure.h" #include "Magnum/BufferImage.h" #include "Magnum/Image.h" +#include "Magnum/ImageFormat.h" #include "Magnum/PixelFormat.h" #include "Magnum/TextureArray.h" #include "Magnum/TextureFormat.h" @@ -57,6 +58,13 @@ struct TextureArrayGLTest: AbstractOpenGLTester { #endif void bind2D(); + #ifndef MAGNUM_TARGET_WEBGL + #ifndef MAGNUM_TARGET_GLES + void bindImage1D(); + #endif + void bindImage2D(); + #endif + #ifndef MAGNUM_TARGET_GLES void sampling1D(); #endif @@ -172,6 +180,13 @@ TextureArrayGLTest::TextureArrayGLTest() { #endif &TextureArrayGLTest::bind2D, + #ifndef MAGNUM_TARGET_WEBGL + #ifndef MAGNUM_TARGET_GLES + &TextureArrayGLTest::bindImage1D, + #endif + &TextureArrayGLTest::bindImage2D, + #endif + #ifndef MAGNUM_TARGET_GLES &TextureArrayGLTest::sampling1D, #endif @@ -424,6 +439,69 @@ void TextureArrayGLTest::bind2D() { MAGNUM_VERIFY_NO_ERROR(); } +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +#ifndef MAGNUM_TARGET_GLES +void TextureArrayGLTest::bindImage1D() { + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + + Texture1DArray texture; + texture.setStorage(1, TextureFormat::RGBA8, {32, 4}) + .bindImage(2, 0, 1, ImageAccess::ReadWrite, ImageFormat::RGBA8); + + MAGNUM_VERIFY_NO_ERROR(); + + texture.bindImageLayered(3, 0, ImageAccess::ReadWrite, ImageFormat::RGBA8); + + AbstractTexture::unbindImage(2); + AbstractTexture::unbindImage(3); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::unbindImages(1, 3); + + MAGNUM_VERIFY_NO_ERROR(); +} +#endif + +void TextureArrayGLTest::bindImage2D() { + #ifndef MAGNUM_TARGET_GLES + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + #else + if(!Context::current().isVersionSupported(Version::GLES310)) + CORRADE_SKIP("OpenGL ES 3.1 is not supported."); + #endif + + Texture2DArray texture; + texture.setStorage(1, TextureFormat::RGBA8, {32, 32, 4}) + .bindImage(2, 0, 1, ImageAccess::ReadWrite, ImageFormat::RGBA8); + + MAGNUM_VERIFY_NO_ERROR(); + + texture.bindImageLayered(3, 0, ImageAccess::ReadWrite, ImageFormat::RGBA8); + + AbstractTexture::unbindImage(2); + AbstractTexture::unbindImage(3); + + MAGNUM_VERIFY_NO_ERROR(); + + #ifndef MAGNUM_TARGET_GLES + AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::unbindImages(1, 3); + + MAGNUM_VERIFY_NO_ERROR(); + #endif +} +#endif + #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::sampling1D() { if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/Test/TextureGLTest.cpp b/src/Magnum/Test/TextureGLTest.cpp index c74e5eacb..3cc63e669 100644 --- a/src/Magnum/Test/TextureGLTest.cpp +++ b/src/Magnum/Test/TextureGLTest.cpp @@ -30,6 +30,9 @@ #include "Magnum/BufferImage.h" #endif #include "Magnum/Image.h" +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +#include "Magnum/ImageFormat.h" +#endif #include "Magnum/PixelFormat.h" #include "Magnum/Texture.h" #include "Magnum/TextureFormat.h" @@ -63,6 +66,14 @@ struct TextureGLTest: AbstractOpenGLTester { void bind2D(); void bind3D(); + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + #ifndef MAGNUM_TARGET_GLES + void bindImage1D(); + #endif + void bindImage2D(); + void bindImage3D(); + #endif + #ifndef MAGNUM_TARGET_GLES void sampling1D(); #endif @@ -218,6 +229,14 @@ TextureGLTest::TextureGLTest() { &TextureGLTest::bind2D, &TextureGLTest::bind3D, + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + #ifndef MAGNUM_TARGET_GLES + &TextureGLTest::bindImage1D, + #endif + &TextureGLTest::bindImage2D, + &TextureGLTest::bindImage3D, + #endif + #ifndef MAGNUM_TARGET_GLES &TextureGLTest::sampling1D, #endif @@ -573,6 +592,96 @@ void TextureGLTest::bind3D() { MAGNUM_VERIFY_NO_ERROR(); } +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +#ifndef MAGNUM_TARGET_GLES +void TextureGLTest::bindImage1D() { + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + + Texture1D texture; + texture.setStorage(1, TextureFormat::RGBA8, 32) + .bindImage(2, 0, ImageAccess::ReadWrite, ImageFormat::RGBA8); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::unbindImage(2); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::unbindImages(1, 3); + + MAGNUM_VERIFY_NO_ERROR(); +} +#endif + +void TextureGLTest::bindImage2D() { + #ifndef MAGNUM_TARGET_GLES + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + #else + if(!Context::current().isVersionSupported(Version::GLES310)) + CORRADE_SKIP("OpenGL ES 3.1 is not supported."); + #endif + + Texture2D texture; + texture.setStorage(1, TextureFormat::RGBA8, Vector2i{32}) + .bindImage(2, 0, ImageAccess::ReadWrite, ImageFormat::RGBA8); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::unbindImage(2); + + MAGNUM_VERIFY_NO_ERROR(); + + #ifndef MAGNUM_TARGET_GLES + AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::unbindImages(1, 3); + + MAGNUM_VERIFY_NO_ERROR(); + #endif +} + +void TextureGLTest::bindImage3D() { + #ifndef MAGNUM_TARGET_GLES + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + #else + if(!Context::current().isVersionSupported(Version::GLES310)) + CORRADE_SKIP("OpenGL ES 3.1 is not supported."); + #endif + + Texture3D texture; + texture.setStorage(1, TextureFormat::RGBA8, {32, 32, 4}) + .bindImage(2, 0, 1, ImageAccess::ReadWrite, ImageFormat::RGBA8); + + MAGNUM_VERIFY_NO_ERROR(); + + texture.bindImageLayered(3, 0, ImageAccess::ReadWrite, ImageFormat::RGBA8); + + AbstractTexture::unbindImage(2); + AbstractTexture::unbindImage(3); + + MAGNUM_VERIFY_NO_ERROR(); + + #ifndef MAGNUM_TARGET_GLES + AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); + + MAGNUM_VERIFY_NO_ERROR(); + + AbstractTexture::unbindImages(1, 3); + + MAGNUM_VERIFY_NO_ERROR(); + #endif +} +#endif + #ifndef MAGNUM_TARGET_GLES void TextureGLTest::sampling1D() { Texture1D texture; diff --git a/src/Magnum/Texture.h b/src/Magnum/Texture.h index c99773547..6718681bd 100644 --- a/src/Magnum/Texture.h +++ b/src/Magnum/Texture.h @@ -194,6 +194,90 @@ template class Texture: public AbstractTexture { */ explicit Texture(NoCreateT) noexcept: AbstractTexture{NoCreate, Implementation::textureTarget()} {} + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + /** + * @brief Bind level of texture to given image unit + * @param imageUnit Image unit + * @param level Texture level + * @param access Image access + * @param format Image format + * + * Available only on 1D and 2D textures. + * @note This function is meant to be used only internally from + * @ref AbstractShaderProgram subclasses. See its documentation + * for more information. + * @see @ref bindImages(Int, std::initializer_list), + * @ref bindImageLayered(), @ref unbindImage(), @ref unbindImages(), + * @ref AbstractShaderProgram::maxImageUnits(), + * @fn_gl{BindImageTexture} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_gles31 Shader image load/store is not available in OpenGL + * ES 3.0 and older. + * @requires_gles Shader image load/store is not available in WebGL. + */ + #ifndef DOXYGEN_GENERATING_OUTPUT + template::type> + #endif + void bindImage(Int imageUnit, Int level, ImageAccess access, ImageFormat format) { + bindImageInternal(imageUnit, level, false, 0, access, format); + } + + /** + * @brief Bind level of given texture layer to given image unit + * @param imageUnit Image unit + * @param level Texture level + * @param layer Texture layer + * @param access Image access + * @param format Image format + * + * Available only on 3D textures. + * @note This function is meant to be used only internally from + * @ref AbstractShaderProgram subclasses. See its documentation + * for more information. + * @see @ref bindImages(Int, std::initializer_list), + * @ref bindImageLayered(), @ref unbindImage(), @ref unbindImages(), + * @ref AbstractShaderProgram::maxImageUnits(), + * @fn_gl{BindImageTexture} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_gles31 Shader image load/store is not available in OpenGL + * ES 3.0 and older. + * @requires_gles Shader image load/store is not available in WebGL. + */ + #ifndef DOXYGEN_GENERATING_OUTPUT + template::type> + #endif + void bindImage(Int imageUnit, Int level, Int layer, ImageAccess access, ImageFormat format) { + bindImageInternal(imageUnit, level, false, layer, access, format); + } + + /** + * @brief Bind level of layered texture to given image unit + * @param imageUnit Image unit + * @param level Texture level + * @param access Image access + * @param format Image format + * + * Available only on 3D textures. + * @note This function is meant to be used only internally from + * @ref AbstractShaderProgram subclasses. See its documentation + * for more information. + * @see @ref bindImages(Int, std::initializer_list), + * @ref bindImage(), @ref unbindImage(), @ref unbindImages(), + * @ref AbstractShaderProgram::maxImageUnits(), + * @fn_gl{BindImageTexture} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_gles31 Shader image load/store is not available in OpenGL + * ES 3.0 and older. + * @requires_gles Shader image load/store is not available in WebGL. + */ + #ifndef DOXYGEN_GENERATING_OUTPUT + template::type> + #endif + void bindImageLayered(Int imageUnit, Int level, ImageAccess access, ImageFormat format) { + bindImageInternal(imageUnit, level, true, 0, access, format); + } + #endif + #ifndef MAGNUM_TARGET_GLES2 /** * @brief Set base mip level diff --git a/src/Magnum/TextureArray.h b/src/Magnum/TextureArray.h index d0f7498f2..7cf37eb20 100644 --- a/src/Magnum/TextureArray.h +++ b/src/Magnum/TextureArray.h @@ -177,6 +177,55 @@ template class TextureArray: public AbstractTexture { */ explicit TextureArray(NoCreateT) noexcept: AbstractTexture{NoCreate, Implementation::textureArrayTarget()} {} + #ifndef MAGNUM_TARGET_WEBGL + /** + * @brief Bind level of given texture layer to given image unit + * @param imageUnit Image unit + * @param level Texture level + * @param layer Texture layer + * @param access Image access + * @param format Image format + * + * @note This function is meant to be used only internally from + * @ref AbstractShaderProgram subclasses. See its documentation + * for more information. + * @see @ref bindImages(Int, std::initializer_list), + * @ref bindImageLayered(), @ref unbindImage(), @ref unbindImages(), + * @ref AbstractShaderProgram::maxImageUnits(), + * @fn_gl{BindImageTexture} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_gles31 Shader image load/store is not available in OpenGL + * ES 3.0 and older. + * @requires_gles Shader image load/store is not available in WebGL. + */ + void bindImage(Int imageUnit, Int level, Int layer, ImageAccess access, ImageFormat format) { + bindImageInternal(imageUnit, level, false, layer, access, format); + } + + /** + * @brief Bind level of layered texture to given image unit + * @param imageUnit Image unit + * @param level Texture level + * @param access Image access + * @param format Image format + * + * @note This function is meant to be used only internally from + * @ref AbstractShaderProgram subclasses. See its documentation + * for more information. + * @see @ref bindImages(Int, std::initializer_list), + * @ref bindImage(), @ref unbindImage(), @ref unbindImages(), + * @ref AbstractShaderProgram::maxImageUnits(), + * @fn_gl{BindImageTexture} + * @requires_gl42 Extension @extension{ARB,shader_image_load_store} + * @requires_gles31 Shader image load/store is not available in OpenGL + * ES 3.0 and older. + * @requires_gles Shader image load/store is not available in WebGL. + */ + void bindImageLayered(Int imageUnit, Int level, ImageAccess access, ImageFormat format) { + bindImageInternal(imageUnit, level, true, 0, access, format); + } + #endif + /** * @copybrief Texture::setBaseLevel() * @return Reference to self (for method chaining) From bcd8a81ba5e58745e6839efb7b8fab13367e9a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 11 Jan 2016 00:33:13 +0100 Subject: [PATCH 085/258] Implemented ARB_compute_shader. The test fails somehow, but too tired to fix anything now. --- doc/opengl-mapping.dox | 2 +- doc/opengl-support.dox | 2 +- src/Magnum/AbstractShaderProgram.cpp | 7 ++ src/Magnum/AbstractShaderProgram.h | 22 +++++ .../Test/AbstractShaderProgramGLTest.cpp | 91 ++++++++++++++++++- .../ComputeShader.comp | 7 ++ .../resources.conf | 3 + 7 files changed, 131 insertions(+), 3 deletions(-) create mode 100644 src/Magnum/Test/AbstractShaderProgramGLTestFiles/ComputeShader.comp diff --git a/doc/opengl-mapping.dox b/doc/opengl-mapping.dox index 998984a54..4a061aedb 100644 --- a/doc/opengl-mapping.dox +++ b/doc/opengl-mapping.dox @@ -121,7 +121,7 @@ OpenGL function | Matching API @fn_gl{DepthRangeArray} | | @fn_gl{DepthRangeIndexed} | | @fn_gl{DetachShader} | | -@fn_gl{DispatchCompute} | | +@fn_gl{DispatchCompute} | @ref AbstractShaderProgram::DispatchCompute() @fn_gl_extension{DispatchComputeGroupSize,ARB,compute_variable_group_size} | | @fn_gl{DispatchComputeIndirect} | | @fn_gl{DrawArrays}, \n @fn_gl{DrawArraysInstanced}, \n @fn_gl{DrawArraysInstancedBaseInstance}, \n @fn_gl{DrawElements}, \n @fn_gl{DrawRangeElements}, \n @fn_gl{DrawElementsBaseVertex}, \n @fn_gl{DrawRangeElementsBaseVertex}, \n @fn_gl{DrawElementsInstanced}, \n @fn_gl{DrawElementsInstancedBaseInstance}, \n @fn_gl{DrawElementsInstancedBaseVertex}, \n @fn_gl{DrawElementsInstancedBaseVertexBaseInstance} | @ref Mesh::draw(), \n @ref MeshView::draw() diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index a82eb683e..5b6e6713e 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -173,7 +173,7 @@ GLSL 4.30 | done @extension{ARB,arrays_of_arrays} | done (shading language only) @extension{ARB,ES3_compatibility} | only conservative sample query and compression formats @extension{ARB,clear_buffer_object} | | -@extension{ARB,compute_shader} | | +@extension{ARB,compute_shader} | done except for indirect dispatch @extension{ARB,copy_image} | | @extension{KHR,debug} | missing log retrieval, sync, pipeline and sampler label @extension{ARB,explicit_uniform_location} | done diff --git a/src/Magnum/AbstractShaderProgram.cpp b/src/Magnum/AbstractShaderProgram.cpp index 4ff1b1cd2..b1b41ce8f 100644 --- a/src/Magnum/AbstractShaderProgram.cpp +++ b/src/Magnum/AbstractShaderProgram.cpp @@ -332,6 +332,13 @@ std::pair AbstractShaderProgram::validate() { return {success, std::move(message)}; } +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +void AbstractShaderProgram::dispatchCompute(const Vector3ui& workgroupCount) { + use(); + glDispatchCompute(workgroupCount.x(), workgroupCount.y(), workgroupCount.z()); +} +#endif + void AbstractShaderProgram::use() { /* Use only if the program isn't already in use */ GLuint& current = Context::current().state().shaderProgram->current; diff --git a/src/Magnum/AbstractShaderProgram.h b/src/Magnum/AbstractShaderProgram.h index 9bad054c3..4efb1b7e1 100644 --- a/src/Magnum/AbstractShaderProgram.h +++ b/src/Magnum/AbstractShaderProgram.h @@ -413,6 +413,13 @@ shader.setTransformation(transformation) mesh.draw(shader); @endcode +@anchor AbstractShaderProgram-compute-workflow +## Compute workflow + +Add just the @ref Shader::Type::Compute shader and implement uniform/texture +setting functions as needed. After setting up required parameters call +@ref dispatchCompute(). + @anchor AbstractShaderProgram-types ## Mapping between GLSL and Magnum types @@ -756,6 +763,21 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { */ std::pair validate(); + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + /** + * @brief Dispatch compute + * @param workgroupCount Workgroup count in given dimension + * + * Valid only on programs with compute shader attached. + * @see @fn_gl{DispatchCompute} + * @requires_gl43 Extension @extension{ARB,compute_shader} + * @requires_gles31 Compute shaders are not available in OpenGL ES 3.0 + * and older. + * @requires_gles Compute shaders are not available in WebGL. + */ + void dispatchCompute(const Vector3ui& workgroupCount); + #endif + #ifdef MAGNUM_BUILD_DEPRECATED /** * @brief Use shader for rendering diff --git a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp index 6989508bc..d7ef8831a 100644 --- a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp @@ -29,9 +29,16 @@ #include "Magnum/AbstractShaderProgram.h" #include "Magnum/Context.h" #include "Magnum/Extensions.h" +#include "Magnum/Image.h" +#include "Magnum/ImageView.h" +#include "Magnum/ImageFormat.h" +#include "Magnum/PixelFormat.h" #include "Magnum/Shader.h" +#include "Magnum/Texture.h" +#include "Magnum/TextureFormat.h" #include "Magnum/Math/Matrix.h" #include "Magnum/Math/Vector4.h" +#include "Magnum/Math/Color.h" #include "Magnum/Test/AbstractOpenGLTester.h" namespace Magnum { namespace Test { @@ -62,6 +69,8 @@ struct AbstractShaderProgramGLTest: AbstractOpenGLTester { void uniformBlockIndexNotFound(); void uniformBlock(); #endif + + void compute(); }; AbstractShaderProgramGLTest::AbstractShaderProgramGLTest() { @@ -86,7 +95,9 @@ AbstractShaderProgramGLTest::AbstractShaderProgramGLTest() { #ifndef MAGNUM_TARGET_GLES2 &AbstractShaderProgramGLTest::createUniformBlocks, &AbstractShaderProgramGLTest::uniformBlockIndexNotFound, - &AbstractShaderProgramGLTest::uniformBlock + &AbstractShaderProgramGLTest::uniformBlock, + + &AbstractShaderProgramGLTest::compute #endif }); } @@ -628,6 +639,84 @@ void AbstractShaderProgramGLTest::uniformBlock() { MAGNUM_VERIFY_NO_ERROR(); } + +void AbstractShaderProgramGLTest::compute() { + #ifndef MAGNUM_TARGET_GLES + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::compute_shader::string() + std::string(" is not supported.")); + #else + if(!Context::current().isVersionSupported(Version::GLES310)) + CORRADE_SKIP("OpenGL ES 3.1 is not supported."); + #endif + + struct ComputeShader: AbstractShaderProgram { + explicit ComputeShader() { + Utility::Resource rs("AbstractShaderProgramGLTest"); + + Shader compute( + #ifndef MAGNUM_TARGET_GLES + Version::GL430, + #else + Version::GLES310, + #endif + Shader::Type::Compute); + compute.addSource(rs.get("ComputeShader.comp")); + CORRADE_INTERNAL_ASSERT(compute.compile()); + + attachShader(compute); + link(); + } + + ComputeShader& setImages(Texture2D& input, Texture2D& output) { + input.bindImage(0, 0, ImageAccess::ReadOnly, ImageFormat::RGBA8UI); + output.bindImage(1, 0, ImageAccess::WriteOnly, ImageFormat::RGBA8UI); + return *this; + } + } shader; + + MAGNUM_VERIFY_NO_ERROR(); + + const Color4ub inData[] = { + { 10, 20, 30, 40}, + { 50, 60, 70, 80}, + { 90, 100, 110, 120}, + {130, 140, 150, 160} + }; + + #ifndef MAGNUM_TARGET_GLES + const Color4ub outData[] = { + { 15, 30, 45, 60}, + { 75, 90, 105, 120}, + {135, 150, 165, 180}, + {195, 210, 225, 240} + }; + #endif + + Texture2D in; + in.setStorage(1, TextureFormat::RGBA8UI, {2, 2}) + .setSubImage(0, {}, ImageView2D{PixelFormat::RGBAInteger, PixelType::UnsignedByte, {2, 2}, inData}); + + Texture2D out; + out.setStorage(1, TextureFormat::RGBA8UI, {2, 2}); + + MAGNUM_VERIFY_NO_ERROR(); + + shader.setImages(in, out) + .dispatchCompute({1, 1, 1}); + + MAGNUM_VERIFY_NO_ERROR(); + + /** @todo Test on ES */ + #ifndef MAGNUM_TARGET_GLES + const auto data = out.image(0, {PixelFormat::RGBAInteger, PixelType::UnsignedByte}).data(); + + MAGNUM_VERIFY_NO_ERROR(); + + CORRADE_COMPARE( + (Corrade::Containers::ArrayView{reinterpret_cast(data.data()), 4}), + (Corrade::Containers::ArrayView{outData})); + #endif +} #endif }} diff --git a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/ComputeShader.comp b/src/Magnum/Test/AbstractShaderProgramGLTestFiles/ComputeShader.comp new file mode 100644 index 000000000..8328717c1 --- /dev/null +++ b/src/Magnum/Test/AbstractShaderProgramGLTestFiles/ComputeShader.comp @@ -0,0 +1,7 @@ +layout(local_size_x = 2, local_size_y = 2) in; +layout(binding = 0, rgba8ui) uniform mediump uimage2D inData; +layout(binding = 1, rgba8ui) uniform mediump uimage2D outData; + +void main() { + imageStore(outData, ivec2(gl_GlobalInvocationID.xy), imageLoad(inData, ivec2(gl_GlobalInvocationID.xy))*3u/2u); +} diff --git a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/resources.conf b/src/Magnum/Test/AbstractShaderProgramGLTestFiles/resources.conf index 4bcbfb585..16f02a005 100644 --- a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/resources.conf +++ b/src/Magnum/Test/AbstractShaderProgramGLTestFiles/resources.conf @@ -14,3 +14,6 @@ filename=UniformBlockShader.frag [file] filename=UniformBlockShader.vert + +[file] +filename=ComputeShader.comp From 740fdf35fe4ed35ea4594eb43e5b22ec5e80c547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 11 Jan 2016 00:48:29 +0100 Subject: [PATCH 086/258] Fix AbstractShaderProgram GL test on ES3. --- src/Magnum/Test/AbstractShaderProgramGLTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp index d7ef8831a..649042a9e 100644 --- a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp @@ -560,18 +560,18 @@ void AbstractShaderProgramGLTest::uniformBlockIndexNotFound() { #ifndef MAGNUM_TARGET_GLES Version::GL310 #else - Version::GLES200 + Version::GLES300 #endif , Shader::Type::Vertex); Shader frag( #ifndef MAGNUM_TARGET_GLES Version::GL310 #else - Version::GLES200 + Version::GLES300 #endif , Shader::Type::Fragment); vert.addSource("void main() { gl_Position = vec4(0.0); }"); - frag.addSource("out vec4 color;\n" + frag.addSource("out lowp vec4 color;\n" "void main() { color = vec4(1.0); }"); CORRADE_VERIFY(Shader::compile({vert, frag})); From de62466eb4490dc61b1e58d31e9ec9f65b3c1547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 11 Jan 2016 01:01:15 +0100 Subject: [PATCH 087/258] Actually usable barriers in Renderer. --- src/Magnum/Renderer.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Magnum/Renderer.h b/src/Magnum/Renderer.h index 264836f02..056c432e6 100644 --- a/src/Magnum/Renderer.h +++ b/src/Magnum/Renderer.h @@ -1308,7 +1308,7 @@ class MAGNUM_EXPORT Renderer { * @requires_gles31 Shader load/store is not available in OpenGL ES 3.0 and older. * @requires_gles Shader load/store is not available in WebGL. */ - void setMemoryBarrier(MemoryBarriers barriers) { + static void setMemoryBarrier(MemoryBarriers barriers) { glMemoryBarrier(GLbitfield(barriers)); } @@ -1332,7 +1332,7 @@ class MAGNUM_EXPORT Renderer { * and older. * @requires_gles Shader load/store is not available in WebGL. */ - void setMemoryBarrierByRegion(MemoryBarriers barriers) { + static void setMemoryBarrierByRegion(MemoryBarriers barriers) { glMemoryBarrierByRegion(GLbitfield(barriers)); } #endif @@ -1348,7 +1348,7 @@ class MAGNUM_EXPORT Renderer { * @requires_gl45 Extension @extension{ARB,texture_barrier} * @requires_gl Texture barrier is not available in OpenGL ES or WebGL. */ - void setTextureBarrier() { + static void setTextureBarrier() { glTextureBarrier(); } #endif @@ -1568,6 +1568,8 @@ class MAGNUM_EXPORT Renderer { #endif }; +CORRADE_ENUMSET_OPERATORS(Renderer::MemoryBarriers) + /** @debugoperatorclassenum{Magnum::Renderer,Magnum::Renderer::Error} */ MAGNUM_EXPORT Debug& operator<<(Debug& debug, Renderer::Error value); From 30fc1411bb74484c44dabe87fce2e1be59011c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Jan 2016 00:14:09 +0100 Subject: [PATCH 088/258] Adapted to Corrade changes. --- src/Magnum/Math/Test/ComplexTest.cpp | 6 +-- src/Magnum/Math/Test/DualComplexTest.cpp | 4 +- src/Magnum/Math/Test/DualQuaternionTest.cpp | 8 +-- src/Magnum/Math/Test/Matrix3Test.cpp | 10 ++-- src/Magnum/Math/Test/Matrix4Test.cpp | 12 ++--- src/Magnum/Math/Test/MatrixTest.cpp | 2 +- src/Magnum/Math/Test/QuaternionTest.cpp | 14 +++--- src/Magnum/Math/Test/VectorTest.cpp | 4 +- .../Test/CombineIndexedArraysTest.cpp | 2 +- .../MeshTools/Test/CompressIndicesTest.cpp | 2 +- src/Magnum/MeshTools/Test/FlipNormalsTest.cpp | 2 +- .../Test/GenerateFlatNormalsTest.cpp | 2 +- src/Magnum/MeshTools/Test/InterleaveTest.cpp | 2 +- src/Magnum/MeshTools/Test/SubdivideTest.cpp | 2 +- .../Test/DualComplexTransformationTest.cpp | 4 +- .../Test/DualQuaternionTransformationTest.cpp | 6 +-- src/Magnum/SceneGraph/Test/ObjectTest.cpp | 4 +- .../Test/RigidMatrixTransformation2DTest.cpp | 6 +-- .../Test/RigidMatrixTransformation3DTest.cpp | 6 +-- .../Test/TranslationTransformationTest.cpp | 2 +- .../Test/AbstractShaderProgramGLTest.cpp | 4 +- src/Magnum/Test/DebugOutputGLTest.cpp | 4 +- src/Magnum/Test/ResourceManagerTest.cpp | 6 +-- src/Magnum/TextureTools/Test/AtlasTest.cpp | 2 +- src/MagnumPlugins/ObjImporter/Test/Test.cpp | 50 +++++++++---------- .../Test/TgaImageConverterTest.cpp | 4 +- .../TgaImporter/Test/TgaImporterTest.cpp | 10 ++-- .../WavAudioImporter/Test/WavImporterTest.cpp | 8 +-- 28 files changed, 94 insertions(+), 94 deletions(-) diff --git a/src/Magnum/Math/Test/ComplexTest.cpp b/src/Magnum/Math/Test/ComplexTest.cpp index 7da891290..4232cf1f6 100644 --- a/src/Magnum/Math/Test/ComplexTest.cpp +++ b/src/Magnum/Math/Test/ComplexTest.cpp @@ -302,7 +302,7 @@ void ComplexTest::inverted() { void ComplexTest::invertedNormalized() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Complex a(-0.6f, 0.8f); Complex b(-0.6f, -0.8f); @@ -318,7 +318,7 @@ void ComplexTest::invertedNormalized() { void ComplexTest::angle() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Math::angle(Complex(1.5f, -2.0f).normalized(), {-4.0f, 3.5f}); CORRADE_COMPARE(o.str(), "Math::angle(): complex numbers must be normalized\n"); @@ -356,7 +356,7 @@ void ComplexTest::matrix() { CORRADE_COMPARE(a.toMatrix(), m); std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Complex::fromMatrix(m*2); CORRADE_COMPARE(o.str(), "Math::Complex::fromMatrix(): the matrix is not orthogonal\n"); diff --git a/src/Magnum/Math/Test/DualComplexTest.cpp b/src/Magnum/Math/Test/DualComplexTest.cpp index 134f2bea3..5d8056d13 100644 --- a/src/Magnum/Math/Test/DualComplexTest.cpp +++ b/src/Magnum/Math/Test/DualComplexTest.cpp @@ -274,7 +274,7 @@ void DualComplexTest::invertedNormalized() { DualComplex b({-0.316228f, -0.9486831f}, {3.320391f, 2.05548f}); std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; DualComplex({-1.0f, -2.5f}, {}).invertedNormalized(); CORRADE_COMPARE(o.str(), "Math::Complex::invertedNormalized(): complex number must be normalized\n"); @@ -322,7 +322,7 @@ void DualComplexTest::matrix() { CORRADE_COMPARE(a.toMatrix(), m); std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; DualComplex::fromMatrix(m*2); CORRADE_COMPARE(o.str(), "Math::DualComplex::fromMatrix(): the matrix doesn't represent rigid transformation\n"); diff --git a/src/Magnum/Math/Test/DualQuaternionTest.cpp b/src/Magnum/Math/Test/DualQuaternionTest.cpp index c4f98c6b5..f057f5bf0 100644 --- a/src/Magnum/Math/Test/DualQuaternionTest.cpp +++ b/src/Magnum/Math/Test/DualQuaternionTest.cpp @@ -294,7 +294,7 @@ void DualQuaternionTest::invertedNormalized() { DualQuaternion b({{-1.0f, -2.0f, -3.0f}, -4.0f}, {{-2.5f, 3.1f, -3.3f}, 2.0f}); std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; CORRADE_COMPARE(a.invertedNormalized(), DualQuaternion()); CORRADE_COMPARE(o.str(), "Math::DualQuaternion::invertedNormalized(): dual quaternion must be normalized\n"); @@ -307,7 +307,7 @@ void DualQuaternionTest::invertedNormalized() { void DualQuaternionTest::rotation() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Vector3 axis(1.0f/Constants::sqrt3()); @@ -357,7 +357,7 @@ void DualQuaternionTest::matrix() { CORRADE_COMPARE((-q).toMatrix(), m); std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; DualQuaternion::fromMatrix(m*2); CORRADE_COMPARE(o.str(), "Math::DualQuaternion::fromMatrix(): the matrix doesn't represent rigid transformation\n"); @@ -389,7 +389,7 @@ void DualQuaternionTest::transformPointNormalized() { Vector3 v(0.0f, -3.6f, 0.7f); std::ostringstream o; - Corrade::Utility::Error::setOutput(&o); + Error redirectError{&o}; (a*Dual(2)).transformPointNormalized(v); CORRADE_COMPARE(o.str(), "Math::DualQuaternion::transformPointNormalized(): dual quaternion must be normalized\n"); diff --git a/src/Magnum/Math/Test/Matrix3Test.cpp b/src/Magnum/Math/Test/Matrix3Test.cpp index 9d8249f27..153c46c1d 100644 --- a/src/Magnum/Math/Test/Matrix3Test.cpp +++ b/src/Magnum/Math/Test/Matrix3Test.cpp @@ -258,7 +258,7 @@ void Matrix3Test::rotation() { void Matrix3Test::reflection() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Vector2 normal(-1.0f, 2.0f); @@ -332,7 +332,7 @@ void Matrix3Test::rotationScalingPart() { void Matrix3Test::rotationNormalizedPart() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Matrix3 a({1.0f, 0.0f, 8.0f}, {1.0f, 0.1f, 7.0f}, @@ -368,7 +368,7 @@ void Matrix3Test::rotationPart() { /* Fails on non-uniform scaling */ std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Matrix2x2 rotationScaling2 = (rotation*Matrix3::scaling(Vector2::yScale(3.5f))).rotation(); CORRADE_COMPARE(o.str(), "Math::Matrix3::rotation(): the matrix doesn't have uniform scaling\n"); CORRADE_COMPARE(rotationScaling2, Matrix2x2()); @@ -382,7 +382,7 @@ void Matrix3Test::uniformScalingPart() { /* Fails on non-uniform scaling */ std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; const Float nonUniformScaling = (rotation*Matrix3::scaling(Vector2::yScale(3.0f))).uniformScaling(); CORRADE_COMPARE(o.str(), "Math::Matrix3::uniformScaling(): the matrix doesn't have uniform scaling\n"); CORRADE_COMPARE(nonUniformScaling, 0.0f); @@ -419,7 +419,7 @@ void Matrix3Test::invertedRigid() { Matrix3::rotation(Deg(74.0f)); std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; (2*actual).invertedRigid(); CORRADE_COMPARE(o.str(), "Math::Matrix3::invertedRigid(): the matrix doesn't represent rigid transformation\n"); diff --git a/src/Magnum/Math/Test/Matrix4Test.cpp b/src/Magnum/Math/Test/Matrix4Test.cpp index 9ebd4b2ac..c6951bcfc 100644 --- a/src/Magnum/Math/Test/Matrix4Test.cpp +++ b/src/Magnum/Math/Test/Matrix4Test.cpp @@ -287,7 +287,7 @@ void Matrix4Test::scaling() { void Matrix4Test::rotation() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; CORRADE_COMPARE(Matrix4::rotation(Deg(-74.0f), {-1.0f, 2.0f, 2.0f}), Matrix4()); CORRADE_COMPARE(o.str(), "Math::Matrix4::rotation(): axis must be normalized\n"); @@ -328,7 +328,7 @@ void Matrix4Test::rotationZ() { void Matrix4Test::reflection() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Vector3 normal(-1.0f, 2.0f, 2.0f); @@ -434,7 +434,7 @@ void Matrix4Test::rotationScalingPart() { void Matrix4Test::rotationNormalizedPart() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Matrix4 a({0.0f, 0.0f, 1.0f, 4.0f}, {1.0f, 0.0f, 0.0f, 3.0f}, @@ -473,7 +473,7 @@ void Matrix4Test::rotationPart() { /* Fails on non-uniform scaling */ std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Matrix3x3 rotationScaling2 = (rotation*Matrix4::scaling(Vector3::yScale(3.5f))).rotation(); CORRADE_COMPARE(o.str(), "Math::Matrix4::rotation(): the matrix doesn't have uniform scaling\n"); CORRADE_COMPARE(rotationScaling2, Matrix3x3()); @@ -487,7 +487,7 @@ void Matrix4Test::uniformScalingPart() { /* Fails on non-uniform scaling */ std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; const Float nonUniformScaling = (rotation*Matrix4::scaling(Vector3::yScale(3.0f))).uniformScaling(); CORRADE_COMPARE(o.str(), "Math::Matrix4::uniformScaling(): the matrix doesn't have uniform scaling\n"); CORRADE_COMPARE(nonUniformScaling, 0.0f); @@ -530,7 +530,7 @@ void Matrix4Test::invertedRigid() { Matrix4::rotation(Deg(74.0f), Vector3(-1.0f, 0.5f, 2.0f).normalized()); std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; (2*actual).invertedRigid(); CORRADE_COMPARE(o.str(), "Math::Matrix4::invertedRigid(): the matrix doesn't represent rigid transformation\n"); diff --git a/src/Magnum/Math/Test/MatrixTest.cpp b/src/Magnum/Math/Test/MatrixTest.cpp index 810307ecc..68a1506d5 100644 --- a/src/Magnum/Math/Test/MatrixTest.cpp +++ b/src/Magnum/Math/Test/MatrixTest.cpp @@ -283,7 +283,7 @@ void MatrixTest::inverted() { void MatrixTest::invertedOrthogonal() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Matrix3x3 a(Vector3(Constants::sqrt3()/2.0f, 0.5f, 0.0f), Vector3(-0.5f, Constants::sqrt3()/2.0f, 0.0f), diff --git a/src/Magnum/Math/Test/QuaternionTest.cpp b/src/Magnum/Math/Test/QuaternionTest.cpp index b0f428ec3..7350d90ce 100644 --- a/src/Magnum/Math/Test/QuaternionTest.cpp +++ b/src/Magnum/Math/Test/QuaternionTest.cpp @@ -300,7 +300,7 @@ void QuaternionTest::invertedNormalized() { Quaternion a = Quaternion({1.0f, 3.0f, -2.0f}, -4.0f); std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; a.invertedNormalized(); CORRADE_COMPARE(o.str(), "Math::Quaternion::invertedNormalized(): quaternion must be normalized\n"); @@ -313,7 +313,7 @@ void QuaternionTest::invertedNormalized() { void QuaternionTest::rotation() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Vector3 axis(1.0f/Constants::sqrt3()); @@ -340,7 +340,7 @@ void QuaternionTest::rotation() { void QuaternionTest::angle() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Math::angle(Quaternion({1.0f, 2.0f, -3.0f}, -4.0f).normalized(), {{4.0f, -3.0f, 2.0f}, -1.0f}); CORRADE_COMPARE(o.str(), "Math::angle(): quaternions must be normalized\n"); @@ -367,7 +367,7 @@ void QuaternionTest::matrix() { CORRADE_COMPARE((-q).toMatrix(), m); std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Quaternion::fromMatrix(m*2); CORRADE_COMPARE(o.str(), "Math::Quaternion::fromMatrix(): the matrix is not orthogonal\n"); @@ -404,7 +404,7 @@ void QuaternionTest::lerp() { Quaternion b = Quaternion::rotation(Deg(23.0f), Vector3::xAxis()); std::ostringstream o; - Corrade::Utility::Error::setOutput(&o); + Error redirectError{&o}; Math::lerp(a*3.0f, b, 0.35f); CORRADE_COMPARE(o.str(), "Math::lerp(): quaternions must be normalized\n"); @@ -422,7 +422,7 @@ void QuaternionTest::slerp() { Quaternion b = Quaternion::rotation(Deg(23.0f), Vector3::xAxis()); std::ostringstream o; - Corrade::Utility::Error::setOutput(&o); + Error redirectError{&o}; Math::slerp(a*3.0f, b, 0.35f); CORRADE_COMPARE(o.str(), "Math::slerp(): quaternions must be normalized\n"); @@ -455,7 +455,7 @@ void QuaternionTest::transformVectorNormalized() { Vector3 v(5.0f, -3.6f, 0.7f); std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; (a*2).transformVectorNormalized(v); CORRADE_COMPARE(o.str(), "Math::Quaternion::transformVectorNormalized(): quaternion must be normalized\n"); diff --git a/src/Magnum/Math/Test/VectorTest.cpp b/src/Magnum/Math/Test/VectorTest.cpp index f49b54eb4..6966dcd9a 100644 --- a/src/Magnum/Math/Test/VectorTest.cpp +++ b/src/Magnum/Math/Test/VectorTest.cpp @@ -441,7 +441,7 @@ void VectorTest::projected() { void VectorTest::projectedOntoNormalized() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Vector3 vector(1.0f, 2.0f, 3.0f); Vector3 line(1.0f, -1.0f, 0.5f); @@ -456,7 +456,7 @@ void VectorTest::projectedOntoNormalized() { void VectorTest::angle() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Math::angle(Vector3(2.0f, 3.0f, 4.0f).normalized(), {1.0f, -2.0f, 3.0f}); CORRADE_COMPARE(o.str(), "Math::angle(): vectors must be normalized\n"); diff --git a/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp b/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp index d40dfecb4..2c69ead05 100644 --- a/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp +++ b/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp @@ -48,7 +48,7 @@ CombineIndexedArraysTest::CombineIndexedArraysTest() { void CombineIndexedArraysTest::wrongIndexCount() { std::stringstream ss; - Error::setOutput(&ss); + Error redirectError{&ss}; std::vector a{0, 1, 0}; std::vector b{3, 4}; std::vector result = MeshTools::combineIndexArrays({a, b}); diff --git a/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp b/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp index 3a6125287..3c26c46c5 100644 --- a/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp +++ b/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp @@ -120,7 +120,7 @@ void CompressIndicesTest::compressAsShort() { TestSuite::Compare::Container); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; MeshTools::compressIndicesAs({65536}); CORRADE_COMPARE(out.str(), "MeshTools::compressIndicesAs(): type too small to represent value 65536\n"); } diff --git a/src/Magnum/MeshTools/Test/FlipNormalsTest.cpp b/src/Magnum/MeshTools/Test/FlipNormalsTest.cpp index 578836b3f..af2120bb2 100644 --- a/src/Magnum/MeshTools/Test/FlipNormalsTest.cpp +++ b/src/Magnum/MeshTools/Test/FlipNormalsTest.cpp @@ -47,7 +47,7 @@ FlipNormalsTest::FlipNormalsTest() { void FlipNormalsTest::wrongIndexCount() { std::stringstream ss; - Error::setOutput(&ss); + Error redirectError{&ss}; std::vector indices{0, 1}; MeshTools::flipFaceWinding(indices); diff --git a/src/Magnum/MeshTools/Test/GenerateFlatNormalsTest.cpp b/src/Magnum/MeshTools/Test/GenerateFlatNormalsTest.cpp index df1c3ae87..639349362 100644 --- a/src/Magnum/MeshTools/Test/GenerateFlatNormalsTest.cpp +++ b/src/Magnum/MeshTools/Test/GenerateFlatNormalsTest.cpp @@ -45,7 +45,7 @@ GenerateFlatNormalsTest::GenerateFlatNormalsTest() { void GenerateFlatNormalsTest::wrongIndexCount() { std::stringstream ss; - Error::setOutput(&ss); + Error redirectError{&ss}; std::vector indices; std::vector normals; std::tie(indices, normals) = MeshTools::generateFlatNormals({ diff --git a/src/Magnum/MeshTools/Test/InterleaveTest.cpp b/src/Magnum/MeshTools/Test/InterleaveTest.cpp index 9616fd5c4..dcc3ae5a3 100644 --- a/src/Magnum/MeshTools/Test/InterleaveTest.cpp +++ b/src/Magnum/MeshTools/Test/InterleaveTest.cpp @@ -58,7 +58,7 @@ InterleaveTest::InterleaveTest() { void InterleaveTest::attributeCount() { std::stringstream ss; - Error::setOutput(&ss); + Error redirectError{&ss}; CORRADE_COMPARE((Implementation::AttributeCount{}(std::vector{0, 1, 2}, std::vector{0, 1, 2, 3, 4, 5})), std::size_t(0)); CORRADE_COMPARE(ss.str(), "MeshTools::interleave(): attribute arrays don't have the same length, expected 3 but got 6\n"); diff --git a/src/Magnum/MeshTools/Test/SubdivideTest.cpp b/src/Magnum/MeshTools/Test/SubdivideTest.cpp index 5a70aad95..f966a3ea9 100644 --- a/src/Magnum/MeshTools/Test/SubdivideTest.cpp +++ b/src/Magnum/MeshTools/Test/SubdivideTest.cpp @@ -53,7 +53,7 @@ SubdivideTest::SubdivideTest() { void SubdivideTest::wrongIndexCount() { std::stringstream ss; - Error::setOutput(&ss); + Error redirectError{&ss}; std::vector positions; std::vector indices{0, 1}; diff --git a/src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp b/src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp index 0dfacc46b..572229231 100644 --- a/src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp +++ b/src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp @@ -92,7 +92,7 @@ void DualComplexTransformationTest::setTransformation() { /* Can't transform with non-rigid transformation */ std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; o.setTransformation(DualComplex({1.0f, 2.0f}, {})); CORRADE_COMPARE(out.str(), "SceneGraph::DualComplexTransformation::setTransformation(): the dual complex number is not normalized\n"); @@ -124,7 +124,7 @@ void DualComplexTransformationTest::transform() { /* Can't transform with non-rigid transformation */ Object2D o; std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; o.transform(DualComplex({1.0f, 2.0f}, {})); CORRADE_COMPARE(out.str(), "SceneGraph::DualComplexTransformation::transform(): the dual complex number is not normalized\n"); } { diff --git a/src/Magnum/SceneGraph/Test/DualQuaternionTransformationTest.cpp b/src/Magnum/SceneGraph/Test/DualQuaternionTransformationTest.cpp index 35e7101d1..c0298b37d 100644 --- a/src/Magnum/SceneGraph/Test/DualQuaternionTransformationTest.cpp +++ b/src/Magnum/SceneGraph/Test/DualQuaternionTransformationTest.cpp @@ -66,7 +66,7 @@ DualQuaternionTransformationTest::DualQuaternionTransformationTest() { void DualQuaternionTransformationTest::fromMatrix() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Implementation::Transformation::fromMatrix(Matrix4::scaling(Vector3(4.0f))); CORRADE_COMPARE(o.str(), "SceneGraph::DualQuaternionTransformation: the matrix doesn't represent rigid transformation\n"); @@ -97,7 +97,7 @@ void DualQuaternionTransformationTest::setTransformation() { /* Can't transform with non-rigid transformation */ std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; o.setTransformation(DualQuaternion({{1.0f, 2.0f, 3.0f}, 4.0f}, {})); CORRADE_COMPARE(out.str(), "SceneGraph::DualQuaternionTransformation::setTransformation(): the dual quaternion is not normalized\n"); @@ -130,7 +130,7 @@ void DualQuaternionTransformationTest::transform() { /* Can't transform with non-rigid transformation */ Object3D o; std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; o.transform(DualQuaternion({{1.0f, 2.0f, 3.0f}, 4.0f}, {})); CORRADE_COMPARE(out.str(), "SceneGraph::DualQuaternionTransformation::transform(): the dual quaternion is not normalized\n"); } { diff --git a/src/Magnum/SceneGraph/Test/ObjectTest.cpp b/src/Magnum/SceneGraph/Test/ObjectTest.cpp index d084482e9..87447e7fe 100644 --- a/src/Magnum/SceneGraph/Test/ObjectTest.cpp +++ b/src/Magnum/SceneGraph/Test/ObjectTest.cpp @@ -172,7 +172,7 @@ void ObjectTest::setParentKeepTransformation() { /* Old parent and new parent must share the same scene */ std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Scene3D scene; childOne->setParentKeepTransformation(&scene); CORRADE_COMPARE(o.str(), "SceneGraph::Object::setParentKeepTransformation(): both parents must be in the same scene\n"); @@ -278,7 +278,7 @@ void ObjectTest::transformationsRelative() { void ObjectTest::transformationsOrphan() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; /* Transformation of objects not part of the same scene */ Scene3D s; diff --git a/src/Magnum/SceneGraph/Test/RigidMatrixTransformation2DTest.cpp b/src/Magnum/SceneGraph/Test/RigidMatrixTransformation2DTest.cpp index 8fca0cba9..c1914fbfe 100644 --- a/src/Magnum/SceneGraph/Test/RigidMatrixTransformation2DTest.cpp +++ b/src/Magnum/SceneGraph/Test/RigidMatrixTransformation2DTest.cpp @@ -68,7 +68,7 @@ RigidMatrixTransformation2DTest::RigidMatrixTransformation2DTest() { void RigidMatrixTransformation2DTest::fromMatrix() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Implementation::Transformation::fromMatrix(Matrix3::scaling(Vector2(4.0f))); CORRADE_COMPARE(o.str(), "SceneGraph::RigidMatrixTransformation2D: the matrix doesn't represent rigid transformation\n"); @@ -97,7 +97,7 @@ void RigidMatrixTransformation2DTest::setTransformation() { /* Can't transform with non-rigid transformation */ std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; o.setTransformation(Matrix3::scaling(Vector2(3.0f))); CORRADE_COMPARE(out.str(), "SceneGraph::RigidMatrixTransformation2D::setTransformation(): the matrix doesn't represent rigid transformation\n"); @@ -129,7 +129,7 @@ void RigidMatrixTransformation2DTest::transform() { /* Can't transform with non-rigid transformation */ Object2D o; std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; o.transform(Matrix3::scaling(Vector2(3.0f))); CORRADE_COMPARE(out.str(), "SceneGraph::RigidMatrixTransformation2D::transform(): the matrix doesn't represent rigid transformation\n"); } { diff --git a/src/Magnum/SceneGraph/Test/RigidMatrixTransformation3DTest.cpp b/src/Magnum/SceneGraph/Test/RigidMatrixTransformation3DTest.cpp index a89758013..f1c3c8ddb 100644 --- a/src/Magnum/SceneGraph/Test/RigidMatrixTransformation3DTest.cpp +++ b/src/Magnum/SceneGraph/Test/RigidMatrixTransformation3DTest.cpp @@ -68,7 +68,7 @@ RigidMatrixTransformation3DTest::RigidMatrixTransformation3DTest() { void RigidMatrixTransformation3DTest::fromMatrix() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Implementation::Transformation::fromMatrix(Matrix4::scaling(Vector3(4.0f))); CORRADE_COMPARE(o.str(), "SceneGraph::RigidMatrixTransformation3D: the matrix doesn't represent rigid transformation\n"); @@ -97,7 +97,7 @@ void RigidMatrixTransformation3DTest::setTransformation() { /* Can't transform with non-rigid transformation */ std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; o.setTransformation(Matrix4::scaling(Vector3(3.0f))); CORRADE_COMPARE(out.str(), "SceneGraph::RigidMatrixTransformation3D::setTransformation(): the matrix doesn't represent rigid transformation\n"); @@ -130,7 +130,7 @@ void RigidMatrixTransformation3DTest::transform() { /* Can't transform with non-rigid transformation */ Object3D o; std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; o.transform(Matrix4::scaling(Vector3(3.0f))); CORRADE_COMPARE(out.str(), "SceneGraph::RigidMatrixTransformation3D::transform(): the matrix doesn't represent rigid transformation\n"); } { diff --git a/src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp b/src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp index 6d6564ddd..ada40127a 100644 --- a/src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp +++ b/src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp @@ -67,7 +67,7 @@ TranslationTransformationTest::TranslationTransformationTest() { void TranslationTransformationTest::fromMatrix() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; Implementation::Transformation::fromMatrix(Matrix3::scaling(Vector2(4.0f))); CORRADE_COMPARE(o.str(), "SceneGraph::TranslationTransformation: the matrix doesn't represent pure translation\n"); diff --git a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp index 649042a9e..1bc1dd612 100644 --- a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp @@ -387,7 +387,7 @@ void AbstractShaderProgramGLTest::uniformNotFound() { CORRADE_VERIFY(program.link()); std::ostringstream out; - Warning::setOutput(&out); + Warning redirectWarning{&out}; program.uniformLocation("nonexistent"); program.uniformLocation(std::string{"another"}); CORRADE_COMPARE(out.str(), @@ -579,7 +579,7 @@ void AbstractShaderProgramGLTest::uniformBlockIndexNotFound() { CORRADE_VERIFY(program.link()); std::ostringstream out; - Warning::setOutput(&out); + Warning redirectWarning{&out}; program.uniformBlockIndex("nonexistent"); program.uniformBlockIndex(std::string{"another"}); CORRADE_COMPARE(out.str(), diff --git a/src/Magnum/Test/DebugOutputGLTest.cpp b/src/Magnum/Test/DebugOutputGLTest.cpp index 2aa8fd2be..d0d2f10c9 100644 --- a/src/Magnum/Test/DebugOutputGLTest.cpp +++ b/src/Magnum/Test/DebugOutputGLTest.cpp @@ -103,7 +103,7 @@ void DebugOutputGLTest::message() { /* Need to be careful, because the test runner is using debug output too */ std::ostringstream out; - Debug::setOutput(&out); + Debug redirectDebug{&out}; DebugMessage::insert(DebugMessage::Source::Application, DebugMessage::Type::Marker, 1337, DebugOutput::Severity::High, "Hello from OpenGL command stream!"); @@ -145,7 +145,7 @@ void DebugOutputGLTest::group() { /* Need to be careful, because the test runner is using debug output too */ std::ostringstream out; - Debug::setOutput(&out); + Debug redirectDebug{&out}; { DebugGroup g1{DebugGroup::Source::Application, 42, "Automatic debug group"}; DebugGroup g2; diff --git a/src/Magnum/Test/ResourceManagerTest.cpp b/src/Magnum/Test/ResourceManagerTest.cpp index 2585eb35a..d06060046 100644 --- a/src/Magnum/Test/ResourceManagerTest.cpp +++ b/src/Magnum/Test/ResourceManagerTest.cpp @@ -126,7 +126,7 @@ void ResourceManagerTest::stateDisallowed() { ResourceManager rm; std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; rm.set("data", Data(), ResourceDataState::Loading, ResourcePolicy::Resident); CORRADE_COMPARE(out.str(), "ResourceManager::set(): data should be null if and only if state is NotFound or Loading\n"); @@ -156,7 +156,7 @@ void ResourceManagerTest::basic() { /* Cannot change already final resource */ std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; rm.set(answerKey, 43, ResourceDataState::Mutable, ResourcePolicy::Resident); CORRADE_COMPARE(*theAnswer, 42); CORRADE_COMPARE(out.str(), "ResourceManager::set(): cannot change already final resource " + answerKey.hexString() + '\n'); @@ -256,7 +256,7 @@ void ResourceManagerTest::clearWhileReferenced() { /* Should cover also the destruction case */ std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; ResourceManager rm; rm.set("blah", Int()); diff --git a/src/Magnum/TextureTools/Test/AtlasTest.cpp b/src/Magnum/TextureTools/Test/AtlasTest.cpp index 8ba7ce764..1f33bd143 100644 --- a/src/Magnum/TextureTools/Test/AtlasTest.cpp +++ b/src/Magnum/TextureTools/Test/AtlasTest.cpp @@ -82,7 +82,7 @@ void AtlasTest::createEmpty() { void AtlasTest::createTooSmall() { std::ostringstream o; - Error::setOutput(&o); + Error redirectError{&o}; std::vector atlas = TextureTools::atlas({64, 32}, { {8, 16}, diff --git a/src/MagnumPlugins/ObjImporter/Test/Test.cpp b/src/MagnumPlugins/ObjImporter/Test/Test.cpp index d307464be..6583c5662 100644 --- a/src/MagnumPlugins/ObjImporter/Test/Test.cpp +++ b/src/MagnumPlugins/ObjImporter/Test/Test.cpp @@ -206,7 +206,7 @@ void ObjImporterTest::mixedPrimitives() { CORRADE_COMPARE(importer.mesh3DCount(), 1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(0)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): mixed primitive MeshPrimitive::Points and MeshPrimitive::Lines\n"); } @@ -406,7 +406,7 @@ void ObjImporterTest::wrongFloat() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): error while converting numeric data\n"); } @@ -418,7 +418,7 @@ void ObjImporterTest::wrongInteger() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): error while converting numeric data\n"); } @@ -430,7 +430,7 @@ void ObjImporterTest::unmergedIndexOutOfRange() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): index out of range\n"); } @@ -442,7 +442,7 @@ void ObjImporterTest::mergedIndexOutOfRange() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): index out of range\n"); } @@ -454,7 +454,7 @@ void ObjImporterTest::zeroIndex() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): index out of range\n"); } @@ -494,7 +494,7 @@ void ObjImporterTest::unsupportedOptionalPositionCoordinate() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): homogeneous coordinates are not supported\n"); } @@ -506,7 +506,7 @@ void ObjImporterTest::unsupportedOptionalTextureCoordinate() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): 3D texture coordinates are not supported\n"); } @@ -518,7 +518,7 @@ void ObjImporterTest::shortFloatData() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): invalid float array size\n"); } @@ -530,7 +530,7 @@ void ObjImporterTest::longFloatData() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): invalid float array size\n"); } @@ -542,7 +542,7 @@ void ObjImporterTest::longOptionalFloatData() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): invalid float array size\n"); } @@ -554,7 +554,7 @@ void ObjImporterTest::longIndexData() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): invalid index data\n"); } @@ -566,7 +566,7 @@ void ObjImporterTest::wrongPointIndexData() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): wrong index count for point\n"); } @@ -578,7 +578,7 @@ void ObjImporterTest::wrongLineIndexData() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): wrong index count for line\n"); } @@ -590,7 +590,7 @@ void ObjImporterTest::wrongTriangleIndexData() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): wrong index count for triangle\n"); } @@ -602,7 +602,7 @@ void ObjImporterTest::polygonIndexData() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): polygons are not supported\n"); } @@ -614,7 +614,7 @@ void ObjImporterTest::missingPositionData() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): incomplete position data\n"); } @@ -626,7 +626,7 @@ void ObjImporterTest::missingPositionIndices() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): incomplete position data\n"); } @@ -638,7 +638,7 @@ void ObjImporterTest::missingNormalData() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): incomplete normal data\n"); } @@ -650,7 +650,7 @@ void ObjImporterTest::missingNormalIndices() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): incomplete normal data\n"); } @@ -662,7 +662,7 @@ void ObjImporterTest::missingTextureCoordinateData() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): incomplete texture coordinate data\n"); } @@ -674,7 +674,7 @@ void ObjImporterTest::missingTextureCoordinateIndices() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): incomplete texture coordinate data\n"); } @@ -686,7 +686,7 @@ void ObjImporterTest::wrongNormalIndexCount() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): some normal indices are missing\n"); } @@ -698,7 +698,7 @@ void ObjImporterTest::wrongTextureCoordinateIndexCount() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): some texture coordinate indices are missing\n"); } @@ -727,7 +727,7 @@ void ObjImporterTest::unknownKeyword() { CORRADE_VERIFY(id > -1); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; CORRADE_VERIFY(!importer.mesh3D(id)); CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): unknown keyword bleh\n"); } diff --git a/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp b/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp index b71bfaa1e..6e68608f8 100644 --- a/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp +++ b/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp @@ -90,7 +90,7 @@ void TgaImageConverterTest::wrongFormat() { ImageView2D image(PixelFormat::RG, PixelType::UnsignedByte, {}, nullptr); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; const auto data = TgaImageConverter().exportToData(image); CORRADE_VERIFY(!data); @@ -101,7 +101,7 @@ void TgaImageConverterTest::wrongType() { ImageView2D image(PixelFormat::Red, PixelType::Float, {}, nullptr); std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; const auto data = TgaImageConverter().exportToData(image); CORRADE_VERIFY(!data); diff --git a/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp b/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp index 1cc780cc6..be22bff2d 100644 --- a/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp +++ b/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp @@ -77,7 +77,7 @@ void TgaImporterTest::openShort() { CORRADE_VERIFY(importer.openData(data)); std::ostringstream debug; - Error::setOutput(&debug); + Error redirectError{&debug}; CORRADE_VERIFY(!importer.image2D(0)); CORRADE_COMPARE(debug.str(), "Trade::TgaImporter::image2D(): the file is too short: 17 bytes\n"); } @@ -88,7 +88,7 @@ void TgaImporterTest::paletted() { CORRADE_VERIFY(importer.openData(data)); std::ostringstream debug; - Error::setOutput(&debug); + Error redirectError{&debug}; CORRADE_VERIFY(!importer.image2D(0)); CORRADE_COMPARE(debug.str(), "Trade::TgaImporter::image2D(): paletted files are not supported\n"); } @@ -99,7 +99,7 @@ void TgaImporterTest::compressed() { CORRADE_VERIFY(importer.openData(data)); std::ostringstream debug; - Error::setOutput(&debug); + Error redirectError{&debug}; CORRADE_VERIFY(!importer.image2D(0)); CORRADE_COMPARE(debug.str(), "Trade::TgaImporter::image2D(): unsupported (compressed?) image type: 9\n"); } @@ -110,7 +110,7 @@ void TgaImporterTest::colorBits16() { CORRADE_VERIFY(importer.openData(data)); std::ostringstream debug; - Error::setOutput(&debug); + Error redirectError{&debug}; CORRADE_VERIFY(!importer.image2D(0)); CORRADE_COMPARE(debug.str(), "Trade::TgaImporter::image2D(): unsupported color bits-per-pixel: 16\n"); } @@ -195,7 +195,7 @@ void TgaImporterTest::grayscaleBits16() { CORRADE_VERIFY(importer.openData(data)); std::ostringstream debug; - Error::setOutput(&debug); + Error redirectError{&debug}; CORRADE_VERIFY(!importer.image2D(0)); CORRADE_COMPARE(debug.str(), "Trade::TgaImporter::image2D(): unsupported grayscale bits-per-pixel: 16\n"); } diff --git a/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp b/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp index 6d6d03b57..e69b0d54f 100644 --- a/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp +++ b/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp @@ -58,7 +58,7 @@ WavImporterTest::WavImporterTest() { void WavImporterTest::wrongSize() { std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; WavImporter importer; CORRADE_VERIFY(!importer.openData(Containers::Array(43))); @@ -67,7 +67,7 @@ void WavImporterTest::wrongSize() { void WavImporterTest::wrongSignature() { std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; WavImporter importer; CORRADE_VERIFY(!importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "wrongSignature.wav"))); @@ -76,7 +76,7 @@ void WavImporterTest::wrongSignature() { void WavImporterTest::unsupportedFormat() { std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; WavImporter importer; CORRADE_VERIFY(!importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "unsupportedFormat.wav"))); @@ -85,7 +85,7 @@ void WavImporterTest::unsupportedFormat() { void WavImporterTest::unsupportedChannelCount() { std::ostringstream out; - Error::setOutput(&out); + Error redirectError{&out}; WavImporter importer; CORRADE_VERIFY(!importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "unsupportedChannelCount.wav"))); From 91753c1c4257c8b3934e493975e45b5934aedaec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Jan 2016 17:50:54 +0100 Subject: [PATCH 089/258] Fix ES2 build. --- src/Magnum/Renderer.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Magnum/Renderer.h b/src/Magnum/Renderer.h index 056c432e6..28cdde286 100644 --- a/src/Magnum/Renderer.h +++ b/src/Magnum/Renderer.h @@ -1568,7 +1568,9 @@ class MAGNUM_EXPORT Renderer { #endif }; +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) CORRADE_ENUMSET_OPERATORS(Renderer::MemoryBarriers) +#endif /** @debugoperatorclassenum{Magnum::Renderer,Magnum::Renderer::Error} */ MAGNUM_EXPORT Debug& operator<<(Debug& debug, Renderer::Error value); From 9e7c5656c6119bd4c79b02d90b2e2303cc68f8db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Jan 2016 18:02:18 +0100 Subject: [PATCH 090/258] Platform: don't use deprecated API in AndroidApplication. --- src/Magnum/Platform/AndroidApplication.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Magnum/Platform/AndroidApplication.cpp b/src/Magnum/Platform/AndroidApplication.cpp index e1e7b0697..fc72af7ed 100644 --- a/src/Magnum/Platform/AndroidApplication.cpp +++ b/src/Magnum/Platform/AndroidApplication.cpp @@ -40,18 +40,18 @@ struct AndroidApplication::LogOutput { Utility::AndroidLogStreamBuffer debugBuffer, warningBuffer, errorBuffer; std::ostream debugStream, warningStream, errorStream; + Debug redirectDebug; + Warning redirectWarning; + Error redirectError; }; AndroidApplication::LogOutput::LogOutput(): debugBuffer(Utility::AndroidLogStreamBuffer::LogPriority::Info, "magnum"), warningBuffer(Utility::AndroidLogStreamBuffer::LogPriority::Warning, "magnum"), errorBuffer(Utility::AndroidLogStreamBuffer::LogPriority::Error, "magnum"), - debugStream(&debugBuffer), warningStream(&warningBuffer), errorStream(&errorBuffer) -{ - Debug::setOutput(&debugStream); - Warning::setOutput(&warningStream); - Error::setOutput(&errorStream); -} + debugStream(&debugBuffer), warningStream(&warningBuffer), errorStream(&errorBuffer), + redirectDebug{&debugStream}, redirectWarning{&warningStream}, redirectError{&errorStream} +{} #ifndef DOXYGEN_GENERATING_OUTPUT AndroidApplication::AndroidApplication(const Arguments& arguments): AndroidApplication{arguments, Configuration{}} {} From 17e653e4e6a7f5621d75c602b691c8e7bd7a1d81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Jan 2016 18:50:46 +0100 Subject: [PATCH 091/258] package/ci: test both ES2 and ES3 Andoid builds in Jenkins. --- package/ci/jenkins-android.xml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/package/ci/jenkins-android.xml b/package/ci/jenkins-android.xml index d215debc0..1194044d1 100644 --- a/package/ci/jenkins-android.xml +++ b/package/ci/jenkins-android.xml @@ -39,6 +39,13 @@ false Magnum + + gl + + es2 + es3 + + toolchain @@ -61,22 +68,30 @@ git submodule init git submodule update +if [ ${gl} = "es2" ] ; then + gl_flags="-DTARGET_GLES=ON -DTARGET_GLES2=ON" +elif [ ${gl} = "es3" ] ; then + gl_flags="-DTARGET_GLES=ON -DTARGET_GLES2=OFF" +fi + if [ "${compatibility}" = "deprecated" ] ; then deprecated_build_flag=ON else deprecated_build_flag=OFF fi -mkdir -p build-android-${toolchain}-${compatibility} -cd build-android-${toolchain}-${compatibility} +mkdir -p build-android-${gl}-${toolchain}-${compatibility} +cd build-android-${gl}-${toolchain}-${compatibility} cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_MODULE_PATH="${WORKSPACE}/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE=../toolchains/generic/Android-${toolchain}.cmake \ -DCMAKE_FIND_ROOT_PATH=${JENKINS_HOME}/filesystem/android-${toolchain}-${compatibility} \ - -DCMAKE_INSTALL_PREFIX=${JENKINS_HOME}/filesystem/android-${toolchain}-${compatibility} \ + -DCMAKE_PREFIX_PATH=${JENKINS_HOME}/filesystem/android-${toolchain}-${compatibility} \ + -DCMAKE_INSTALL_PREFIX=${JENKINS_HOME}/filesystem/android-${gl}-${toolchain}-${compatibility} \ -DBUILD_DEPRECATED=${deprecated_build_flag} \ + ${gl_flags} \ `#-DWITH_AUDIO=ON` \ -DWITH_ANDROIDAPPLICATION=ON \ -DWITH_EGLCONTEXT=ON \ @@ -108,7 +123,7 @@ ninja install/strip true From 281bcac62413e17067041d35944becd55d383ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Jan 2016 19:36:08 +0100 Subject: [PATCH 092/258] Fix building for Android with standard build systems. In this case, standard doesn't mean that we can expect sane behavior. --- src/Magnum/Extensions.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Magnum/Extensions.h b/src/Magnum/Extensions.h index 78de2c84b..572a6b4af 100644 --- a/src/Magnum/Extensions.h +++ b/src/Magnum/Extensions.h @@ -33,6 +33,14 @@ namespace Magnum { +/* Standard Android build system thinks that it's okay to define unmangled + unprefixed macros. I think that whoever did that needs to be punished, + becuase I am then not able to use that identifier for extension names. + Use CORRADE_TARGET_ANDROID here instead. */ +#ifdef ANDROID +#undef ANDROID +#endif + /** @brief Compile-time information about OpenGL extensions From 51a76ef87fbd33d823027e8984652fd48ca64f8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Jan 2016 20:38:41 +0100 Subject: [PATCH 093/258] Fix comparison in AbstractShaderProgram test. Confirmed by @LB-- that it works on AMD. NVidia is producing garbage. What the hell, NV? --- src/Magnum/Test/AbstractShaderProgramGLTest.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp index 1bc1dd612..008916dc5 100644 --- a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp @@ -25,6 +25,7 @@ #include #include +#include #include "Magnum/AbstractShaderProgram.h" #include "Magnum/Context.h" @@ -712,9 +713,10 @@ void AbstractShaderProgramGLTest::compute() { MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE( + CORRADE_COMPARE_AS( (Corrade::Containers::ArrayView{reinterpret_cast(data.data()), 4}), - (Corrade::Containers::ArrayView{outData})); + (Corrade::Containers::ArrayView{outData}), + TestSuite::Compare::Container); #endif } #endif From 26b51ad614aa3687be3422f87d827d8860e3c3cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Jan 2016 22:03:53 +0100 Subject: [PATCH 094/258] Adapted to Corrade changes. --- src/Magnum/AbstractShaderProgram.cpp | 4 ++-- src/Magnum/Shader.cpp | 4 ++-- src/Magnum/Test/AbstractOpenGLTester.h | 8 +++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Magnum/AbstractShaderProgram.cpp b/src/Magnum/AbstractShaderProgram.cpp index b1b41ce8f..17b85f5b8 100644 --- a/src/Magnum/AbstractShaderProgram.cpp +++ b/src/Magnum/AbstractShaderProgram.cpp @@ -406,7 +406,7 @@ bool AbstractShaderProgram::link(std::initializer_list> shade /* Show error log */ if(!success) { - auto out = Error::noNewlineAtTheEnd(); + Error out{Debug::Flag::NoNewlineAtTheEnd}; out << "Shader::compile(): compilation of" << shaderName(shader._type) << "shader"; if(shaders.size() != 1) { #if !defined(CORRADE_TARGET_NACL_NEWLIB) && !defined(CORRADE_TARGET_ANDROID) @@ -869,7 +869,7 @@ bool Shader::compile(std::initializer_list> shade /* Or just warnings, if any */ } else if(!message.empty() && !Implementation::isShaderCompilationLogEmpty(message)) { - auto out = Warning::noNewlineAtTheEnd(); + Warning out{Debug::Flag::NoNewlineAtTheEnd}; out << "Shader::compile(): compilation of" << shaderName(shader._type) << "shader"; if(shaders.size() != 1) { #if !defined(CORRADE_TARGET_NACL_NEWLIB) && !defined(CORRADE_TARGET_ANDROID) diff --git a/src/Magnum/Test/AbstractOpenGLTester.h b/src/Magnum/Test/AbstractOpenGLTester.h index 94be55706..22b8161a6 100644 --- a/src/Magnum/Test/AbstractOpenGLTester.h +++ b/src/Magnum/Test/AbstractOpenGLTester.h @@ -66,7 +66,7 @@ class AbstractOpenGLTester: public TestSuite::Tester { } _windowlessApplication; }; -AbstractOpenGLTester::AbstractOpenGLTester(): _windowlessApplication{*_windowlessApplicationArguments} { +AbstractOpenGLTester::AbstractOpenGLTester(): TestSuite::Tester{TestSuite::Tester::TesterConfiguration{}.setSkippedArgumentPrefixes({"magnum"})}, _windowlessApplication{*_windowlessApplicationArguments} { /* Try to create debug context, fallback to normal one if not possible. No such thing on OSX. */ #ifndef CORRADE_TARGET_APPLE @@ -96,7 +96,7 @@ std::optional AbstractOpenGLTester:: Magnum::Test::AbstractOpenGLTester::_windowlessApplicationArguments.emplace(argc, argv); \ Class t; \ t.registerTest(__FILE__, #Class); \ - return t.exec(); \ + return t.exec(argc, argv); \ } #else #define MAGNUM_GL_TEST_MAIN(Class) \ @@ -109,7 +109,9 @@ std::optional AbstractOpenGLTester:: Magnum::Test::AbstractOpenGLTester::_windowlessApplicationArguments->window = hWnd; \ Class t; \ t.registerTest(__FILE__, #Class); \ - PostQuitMessage(ret = t.exec()); \ + PostQuitMessage(ret = t.exec( \ + Magnum::Test::AbstractOpenGLTester::_windowlessApplicationArguments->argc, \ + Magnum::Test::AbstractOpenGLTester::_windowlessApplicationArguments->argv)); \ } \ break; \ default: return DefWindowProc(hWnd, message, wParam, lParam); \ From e36f919118b53c9a3ba3c399005c0567c6e68168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 26 Jan 2016 10:52:46 +0100 Subject: [PATCH 095/258] Platform: properly install WindowlessCglApplication headers. --- src/Magnum/Platform/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index 6d0db0adf..54ebc3b58 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -396,7 +396,7 @@ if(WITH_WINDOWLESSCGLAPPLICATION) # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib - install(FILES ${MagnumWindowlessGlxApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) + install(FILES ${MagnumWindowlessCglApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumWindowlessCglApplication RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} From 493ba80839a23e939edf73a59600122018245a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 28 Jan 2016 15:26:27 +0100 Subject: [PATCH 096/258] package: added Homebrew formula. --- doc/building.dox | 7 +++++++ package/homebrew/magnum.rb | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 package/homebrew/magnum.rb diff --git a/doc/building.dox b/doc/building.dox index 3259f5b34..b8ac06c5c 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -330,6 +330,13 @@ This will compile binary and development packages, which will then appear in parent directory. If you need to modify CMake flags (enabling/disabling some features, for example), modify the last entry in `debian/rules`. +@subsection building-packages-brew Homebrew formulas + +OS X Homebrew formulas are in `package/homebrew` directory. Download the `*.rb` +file and install it using the following command: + + brew install --HEAD magnum.rb + @section building-windows-angle Building for ANGLE on Windows Magnum is able to run on ANGLE OpenGL-to-D3D translator. Download the code from diff --git a/package/homebrew/magnum.rb b/package/homebrew/magnum.rb new file mode 100644 index 000000000..e9e0095bc --- /dev/null +++ b/package/homebrew/magnum.rb @@ -0,0 +1,20 @@ +# kate: indent-width 2; + +class Magnum < Formula + desc "C++11/C++14 and OpenGL 2D/3D graphics engine" + homepage "https://github.com/mosra/magnum" + head "git://github.com/mosra/magnum.git" + + depends_on "cmake" + depends_on "corrade" + depends_on "sdl2" + + def install + system "mkdir build" + cd "build" do + system "cmake", "-DCMAKE_BUILD_TYPE=Release", "-DCMAKE_INSTALL_PREFIX=#{prefix}", "-DWITH_AUDIO=ON", "-DWITH_SDL2APPLICATION=ON", "-DWITH_WINDOWLESSCGLAPPLICATION=ON", "-DWITH_CGLCONTEXT=ON", "-DWITH_MAGNUMFONT=ON", "-DWITH_MAGNUMFONTCONVERTER=ON", "-DWITH_OBJIMPORTER=ON", "-DWITH_TGAIMAGECONVERTER=ON", "-DWITH_TGAIMPORTER=ON", "-DWITH_WAVAUDIOIMPORTER=ON", "-DWITH_DISTANCEFIELDCONVERTER=ON", "-DWITH_FONTCONVERTER=ON", "-DWITH_MAGNUMINFO=ON", ".." + system "cmake", "--build", "." + system "cmake", "--build", ".", "--target", "install" + end + end +end From 55a0a1397b97e665c6c01a362b393bc6c813eec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 4 Feb 2016 18:38:23 +0100 Subject: [PATCH 097/258] modules: updated FindCorrade.cmake. --- modules/FindCorrade.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/FindCorrade.cmake b/modules/FindCorrade.cmake index 486684230..2fea9dde8 100644 --- a/modules/FindCorrade.cmake +++ b/modules/FindCorrade.cmake @@ -41,7 +41,8 @@ # CORRADE_BUILD_STATIC - Defined if compiled as static libraries # CORRADE_TARGET_UNIX - Defined if compiled for some Unix flavor # (Linux, BSD, OS X) -# CORRADE_TARGET_APPLE - Defined if compiled for OS X +# CORRADE_TARGET_APPLE - Defined if compiled for Apple platforms +# CORRADE_TARGET_IOS - Defined if compiled for iOS # CORRADE_TARGET_WINDOWS - Defined if compiled for Windows # CORRADE_TARGET_WINDOWS_RT - Defined if compiled for Windows RT # CORRADE_TARGET_NACL - Defined if compiled for Google Chrome @@ -211,6 +212,7 @@ set(_corradeFlags BUILD_STATIC TARGET_UNIX TARGET_APPLE + TARGET_IOS TARGET_WINDOWS TARGET_WINDOWS_RT TARGET_NACL From 60fc994ab65c92bc926e094d99635bd8e24d1cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 4 Feb 2016 18:41:05 +0100 Subject: [PATCH 098/258] modules: updated FindOpenGLES[23].cmake to work on iOS. --- modules/FindOpenGLES2.cmake | 18 ++++++++++++++---- modules/FindOpenGLES3.cmake | 13 ++++++++++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/modules/FindOpenGLES2.cmake b/modules/FindOpenGLES2.cmake index 179a53742..5ddf28328 100644 --- a/modules/FindOpenGLES2.cmake +++ b/modules/FindOpenGLES2.cmake @@ -37,14 +37,24 @@ if(NOT CORRADE_TARGET_EMSCRIPTEN) find_library(OPENGLES2_LIBRARY NAMES GLESv2 - libGLESv2 # ANGLE (CMake doesn't search for lib prefix on Windows) - ppapi_gles2) # NaCl + + # ANGLE (CMake doesn't search for lib prefix on Windows) + libGLESv2 + + # iOS + OpenGLES + + # NaCl + ppapi_gles2) set(OPENGLES2_LIBRARY_NEEDED OPENGLES2_LIBRARY) endif() # Include dir -find_path(OPENGLES2_INCLUDE_DIR - NAMES GLES2/gl2.h) +find_path(OPENGLES2_INCLUDE_DIR NAMES + GLES2/gl2.h + + # iOS + ES2/gl.h) include(FindPackageHandleStandardArgs) find_package_handle_standard_args("OpenGLES2" DEFAULT_MSG diff --git a/modules/FindOpenGLES3.cmake b/modules/FindOpenGLES3.cmake index 2d07aa5b4..a2ecba388 100644 --- a/modules/FindOpenGLES3.cmake +++ b/modules/FindOpenGLES3.cmake @@ -42,13 +42,20 @@ if(NOT CORRADE_TARGET_EMSCRIPTEN) # support is provided in ES2 lib GLESv2 - libGLESv2) # ANGLE (CMake doesn't search for lib prefix on Windows) + # ANGLE (CMake doesn't search for lib prefix on Windows) + libGLESv2 + + # iOS + OpenGLES) set(OPENGLES3_LIBRARY_NEEDED OPENGLES3_LIBRARY) endif() # Include dir -find_path(OPENGLES3_INCLUDE_DIR - NAMES GLES3/gl3.h) +find_path(OPENGLES3_INCLUDE_DIR NAMES + GLES3/gl3.h + + # iOS + ES3/gl.h) include(FindPackageHandleStandardArgs) find_package_handle_standard_args("OpenGLES3" DEFAULT_MSG From 3f4156a846807a62e70bc92f1fb575f74bb42219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 4 Feb 2016 18:44:30 +0100 Subject: [PATCH 099/258] modules: update FindEGL.cmake to work on iOS. It actually finds EAGL, which is slightly completely different from EGL and I currently have no use for it. --- modules/FindEGL.cmake | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/FindEGL.cmake b/modules/FindEGL.cmake index 6f8c99916..66cf99e2e 100644 --- a/modules/FindEGL.cmake +++ b/modules/FindEGL.cmake @@ -35,11 +35,19 @@ # Library find_library(EGL_LIBRARY NAMES EGL - libEGL) # ANGLE (CMake doesn't search for lib prefix on Windows) + + # ANGLE (CMake doesn't search for lib prefix on Windows) + libEGL + + # On iOS a part of OpenGLES + OpenGLES) # Include dir -find_path(EGL_INCLUDE_DIR - NAMES EGL/egl.h) +find_path(EGL_INCLUDE_DIR NAMES + EGL/egl.h + + # iOS + EAGL.h) include(FindPackageHandleStandardArgs) find_package_handle_standard_args("EGL" DEFAULT_MSG From 3e81fbad41265eb6a4aa42cd9d7e336f99df487a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 4 Feb 2016 18:46:54 +0100 Subject: [PATCH 100/258] iOS-specific function pointer loader. It seems that there is no such thing as eglGetProcAddress() and thus we are able to use only functions that are defined in the ES[23]/glext.h header and no others. So, currently, the function loader internally undefs all function name macros that were defined in our flextgl.h header, then includes the Apple's glext.h header and assigns function pointers of those extensions that are defined in the header. Apple also has some minor differences in function signatures (different constness of pointer-to-pointer variables) so I had to reinterpret_cast everything. Might seem to be uglier than including glext.h directly in our code, but I made bad experience when doing so -- I want to depend on my header bugs that are consistent across all platforms instead of depending on whatever changes Apple makes in its headers. I also want to have all functions defined and not only those that are supported on iOS. Phew. Thank you, flextGL, for making it way easier than it appeared to be at first. --- src/Magnum/Platform/CMakeLists.txt | 17 +- src/MagnumExternal/OpenGL/GLES2/README.md | 3 +- .../OpenGL/GLES2/flextGLPlatformIOS.cpp | 419 ++++++++++++++++ .../GLES2/flextGLPlatformIOS.cpp.template | 27 ++ src/MagnumExternal/OpenGL/GLES3/README.md | 3 +- .../OpenGL/GLES3/flextGLPlatformIOS.cpp | 457 ++++++++++++++++++ .../GLES3/flextGLPlatformIOS.cpp.template | 27 ++ 7 files changed, 948 insertions(+), 5 deletions(-) create mode 100644 src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp create mode 100644 src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp.template create mode 100644 src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp create mode 100644 src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp.template diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index 54ebc3b58..7c2731979 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -468,13 +468,24 @@ if(NEED_EGLCONTEXTHANDLER) endif() # Platform-specific sources for context library -set(MagnumContext_SRCS Implementation/OpenGLFunctionLoader.cpp) +set(MagnumContext_SRCS ) +if(NOT CORRADE_TARGET_IOS) + list(APPEND MagnumContext_SRCS Implementation/OpenGLFunctionLoader.cpp) +endif() if(NOT MAGNUM_TARGET_GLES) list(APPEND MagnumContext_SRCS ../../MagnumExternal/OpenGL/GL/flextGLPlatform.cpp) elseif(MAGNUM_TARGET_GLES AND MAGNUM_TARGET_GLES2) - list(APPEND MagnumContext_SRCS ../../MagnumExternal/OpenGL/GLES2/flextGLPlatform.cpp) + if(CORRADE_TARGET_IOS) + list(APPEND MagnumContext_SRCS ../../MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp) + else() + list(APPEND MagnumContext_SRCS ../../MagnumExternal/OpenGL/GLES2/flextGLPlatform.cpp) + endif() elseif(MAGNUM_TARGET_GLES AND NOT MAGNUM_TARGET_GLES2) - list(APPEND MagnumContext_SRCS ../../MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp) + if(CORRADE_TARGET_IOS) + list(APPEND MagnumContext_SRCS ../../MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp) + else() + list(APPEND MagnumContext_SRCS ../../MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp) + endif() endif() # CGL context diff --git a/src/MagnumExternal/OpenGL/GLES2/README.md b/src/MagnumExternal/OpenGL/GLES2/README.md index fb7ce33a1..b4f73b127 100644 --- a/src/MagnumExternal/OpenGL/GLES2/README.md +++ b/src/MagnumExternal/OpenGL/GLES2/README.md @@ -7,7 +7,8 @@ files for generic GLES2 implementations: .../flextGLgen.py -D . -t . extensions.txt -It will generate `flextGL.h` and `flextGL.cpp` files. +It will generate `flextGL.h`, `flextGL.cpp`, `flextGLPlatform.cpp` and +`flextGLPlatformIOS.cpp` files. NaCl and Emscripten don't have the ability to manually load extension pointers, thus they have only header files: diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp new file mode 100644 index 000000000..d94dd06d4 --- /dev/null +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp @@ -0,0 +1,419 @@ +#include "flextGL.h" + +#undef glBlitFramebufferANGLE +#undef glRenderbufferStorageMultisampleANGLE +#undef glDrawArraysInstancedANGLE +#undef glDrawElementsInstancedANGLE +#undef glVertexAttribDivisorANGLE +#undef glRenderbufferStorageMultisampleAPPLE +#undef glResolveMultisampleFramebufferAPPLE +#undef glGetObjectLabelEXT +#undef glLabelObjectEXT +#undef glInsertEventMarkerEXT +#undef glPopGroupMarkerEXT +#undef glPushGroupMarkerEXT +#undef glDiscardFramebufferEXT +#undef glGetQueryObjecti64vEXT +#undef glGetQueryObjectivEXT +#undef glGetQueryObjectui64vEXT +#undef glQueryCounterEXT +#undef glDrawBuffersEXT +#undef glBlendEquationSeparateiEXT +#undef glBlendEquationiEXT +#undef glBlendFuncSeparateiEXT +#undef glBlendFunciEXT +#undef glColorMaskiEXT +#undef glDisableiEXT +#undef glEnableiEXT +#undef glIsEnablediEXT +#undef glDrawArraysInstancedEXT +#undef glDrawElementsInstancedEXT +#undef glVertexAttribDivisorEXT +#undef glFlushMappedBufferRangeEXT +#undef glMapBufferRangeEXT +#undef glMultiDrawArraysEXT +#undef glMultiDrawElementsEXT +#undef glFramebufferTexture2DMultisampleEXT +#undef glRenderbufferStorageMultisampleEXT +#undef glBeginQueryEXT +#undef glDeleteQueriesEXT +#undef glEndQueryEXT +#undef glGenQueriesEXT +#undef glGetQueryObjectuivEXT +#undef glGetQueryivEXT +#undef glIsQueryEXT +#undef glGetGraphicsResetStatusEXT +#undef glGetnUniformfvEXT +#undef glGetnUniformivEXT +#undef glReadnPixelsEXT +#undef glActiveShaderProgramEXT +#undef glBindProgramPipelineEXT +#undef glCreateShaderProgramvEXT +#undef glDeleteProgramPipelinesEXT +#undef glGenProgramPipelinesEXT +#undef glGetProgramPipelineInfoLogEXT +#undef glGetProgramPipelineivEXT +#undef glIsProgramPipelineEXT +#undef glProgramParameteriEXT +#undef glProgramUniform1fEXT +#undef glProgramUniform1fvEXT +#undef glProgramUniform1iEXT +#undef glProgramUniform1ivEXT +#undef glProgramUniform1uiEXT +#undef glProgramUniform1uivEXT +#undef glProgramUniform2fEXT +#undef glProgramUniform2fvEXT +#undef glProgramUniform2iEXT +#undef glProgramUniform2ivEXT +#undef glProgramUniform2uiEXT +#undef glProgramUniform2uivEXT +#undef glProgramUniform3fEXT +#undef glProgramUniform3fvEXT +#undef glProgramUniform3iEXT +#undef glProgramUniform3ivEXT +#undef glProgramUniform3uiEXT +#undef glProgramUniform3uivEXT +#undef glProgramUniform4fEXT +#undef glProgramUniform4fvEXT +#undef glProgramUniform4iEXT +#undef glProgramUniform4ivEXT +#undef glProgramUniform4uiEXT +#undef glProgramUniform4uivEXT +#undef glProgramUniformMatrix2fvEXT +#undef glProgramUniformMatrix2x3fvEXT +#undef glProgramUniformMatrix2x4fvEXT +#undef glProgramUniformMatrix3fvEXT +#undef glProgramUniformMatrix3x2fvEXT +#undef glProgramUniformMatrix3x4fvEXT +#undef glProgramUniformMatrix4fvEXT +#undef glProgramUniformMatrix4x2fvEXT +#undef glProgramUniformMatrix4x3fvEXT +#undef glUseProgramStagesEXT +#undef glValidateProgramPipelineEXT +#undef glGetSamplerParameterIivEXT +#undef glGetSamplerParameterIuivEXT +#undef glGetTexParameterIivEXT +#undef glGetTexParameterIuivEXT +#undef glSamplerParameterIivEXT +#undef glSamplerParameterIuivEXT +#undef glTexParameterIivEXT +#undef glTexParameterIuivEXT +#undef glTexStorage1DEXT +#undef glTexStorage2DEXT +#undef glTexStorage3DEXT +#undef glTextureStorage1DEXT +#undef glTextureStorage2DEXT +#undef glTextureStorage3DEXT +#undef glBlendBarrierKHR +#undef glDebugMessageCallbackKHR +#undef glDebugMessageControlKHR +#undef glDebugMessageInsertKHR +#undef glGetDebugMessageLogKHR +#undef glGetObjectLabelKHR +#undef glGetObjectPtrLabelKHR +#undef glGetPointervKHR +#undef glObjectLabelKHR +#undef glObjectPtrLabelKHR +#undef glPopDebugGroupKHR +#undef glPushDebugGroupKHR +#undef glGetGraphicsResetStatusKHR +#undef glGetnUniformfvKHR +#undef glGetnUniformivKHR +#undef glGetnUniformuivKHR +#undef glReadnPixelsKHR +#undef glDrawBuffersNV +#undef glDrawArraysInstancedNV +#undef glDrawElementsInstancedNV +#undef glBlitFramebufferNV +#undef glRenderbufferStorageMultisampleNV +#undef glVertexAttribDivisorNV +#undef glPolygonModeNV +#undef glReadBufferNV +#undef glGetBufferPointervOES +#undef glMapBufferOES +#undef glUnmapBufferOES +#undef glCompressedTexImage3DOES +#undef glCompressedTexSubImage3DOES +#undef glCopyTexSubImage3DOES +#undef glFramebufferTexture3DOES +#undef glTexImage3DOES +#undef glTexSubImage3DOES +#undef glBindVertexArrayOES +#undef glDeleteVertexArraysOES +#undef glGenVertexArraysOES +#undef glIsVertexArrayOES + +#include + +void flextGLInit() { + + /* GL_ANGLE_framebuffer_blit */ + #if GL_ANGLE_framebuffer_blit + flextglBlitFramebufferANGLE = reinterpret_cast(glBlitFramebufferANGLE); + #endif + + /* GL_ANGLE_framebuffer_multisample */ + #if GL_ANGLE_framebuffer_multisample + flextglRenderbufferStorageMultisampleANGLE = reinterpret_cast(glRenderbufferStorageMultisampleANGLE); + #endif + + /* GL_ANGLE_instanced_arrays */ + #if GL_ANGLE_instanced_arrays + flextglDrawArraysInstancedANGLE = reinterpret_cast(glDrawArraysInstancedANGLE); + flextglDrawElementsInstancedANGLE = reinterpret_cast(glDrawElementsInstancedANGLE); + flextglVertexAttribDivisorANGLE = reinterpret_cast(glVertexAttribDivisorANGLE); + #endif + + /* GL_APPLE_framebuffer_multisample */ + #if GL_APPLE_framebuffer_multisample + flextglRenderbufferStorageMultisampleAPPLE = reinterpret_cast(glRenderbufferStorageMultisampleAPPLE); + flextglResolveMultisampleFramebufferAPPLE = reinterpret_cast(glResolveMultisampleFramebufferAPPLE); + #endif + + /* GL_EXT_debug_label */ + #if GL_EXT_debug_label + flextglGetObjectLabelEXT = reinterpret_cast(glGetObjectLabelEXT); + flextglLabelObjectEXT = reinterpret_cast(glLabelObjectEXT); + #endif + + /* GL_EXT_debug_marker */ + #if GL_EXT_debug_marker + flextglInsertEventMarkerEXT = reinterpret_cast(glInsertEventMarkerEXT); + flextglPopGroupMarkerEXT = reinterpret_cast(glPopGroupMarkerEXT); + flextglPushGroupMarkerEXT = reinterpret_cast(glPushGroupMarkerEXT); + #endif + + /* GL_EXT_discard_framebuffer */ + #if GL_EXT_discard_framebuffer + flextglDiscardFramebufferEXT = reinterpret_cast(glDiscardFramebufferEXT); + #endif + + /* GL_EXT_disjoint_timer_query */ + #if GL_EXT_disjoint_timer_query + flextglGetQueryObjecti64vEXT = reinterpret_cast(glGetQueryObjecti64vEXT); + flextglGetQueryObjectivEXT = reinterpret_cast(glGetQueryObjectivEXT); + flextglGetQueryObjectui64vEXT = reinterpret_cast(glGetQueryObjectui64vEXT); + flextglQueryCounterEXT = reinterpret_cast(glQueryCounterEXT); + #endif + + /* GL_EXT_draw_buffers */ + #if GL_EXT_draw_buffers + flextglDrawBuffersEXT = reinterpret_cast(glDrawBuffersEXT); + #endif + + /* GL_EXT_draw_buffers_indexed */ + #if GL_EXT_draw_buffers_indexed + flextglBlendEquationSeparateiEXT = reinterpret_cast(glBlendEquationSeparateiEXT); + flextglBlendEquationiEXT = reinterpret_cast(glBlendEquationiEXT); + flextglBlendFuncSeparateiEXT = reinterpret_cast(glBlendFuncSeparateiEXT); + flextglBlendFunciEXT = reinterpret_cast(glBlendFunciEXT); + flextglColorMaskiEXT = reinterpret_cast(glColorMaskiEXT); + flextglDisableiEXT = reinterpret_cast(glDisableiEXT); + flextglEnableiEXT = reinterpret_cast(glEnableiEXT); + flextglIsEnablediEXT = reinterpret_cast(glIsEnablediEXT); + #endif + + /* GL_EXT_instanced_arrays */ + #if GL_EXT_instanced_arrays + flextglDrawArraysInstancedEXT = reinterpret_cast(glDrawArraysInstancedEXT); + flextglDrawElementsInstancedEXT = reinterpret_cast(glDrawElementsInstancedEXT); + flextglVertexAttribDivisorEXT = reinterpret_cast(glVertexAttribDivisorEXT); + #endif + + /* GL_EXT_map_buffer_range */ + #if GL_EXT_map_buffer_range + flextglFlushMappedBufferRangeEXT = reinterpret_cast(glFlushMappedBufferRangeEXT); + flextglMapBufferRangeEXT = reinterpret_cast(glMapBufferRangeEXT); + #endif + + /* GL_EXT_multi_draw_arrays */ + #if GL_EXT_multi_draw_arrays + flextglMultiDrawArraysEXT = reinterpret_cast(glMultiDrawArraysEXT); + flextglMultiDrawElementsEXT = reinterpret_cast(glMultiDrawElementsEXT); + #endif + + /* GL_EXT_multisampled_render_to_texture */ + #if GL_EXT_multisampled_render_to_texture + flextglFramebufferTexture2DMultisampleEXT = reinterpret_cast(glFramebufferTexture2DMultisampleEXT); + flextglRenderbufferStorageMultisampleEXT = reinterpret_cast(glRenderbufferStorageMultisampleEXT); + #endif + + /* GL_EXT_occlusion_query_boolean */ + #if GL_EXT_occlusion_query_boolean + flextglBeginQueryEXT = reinterpret_cast(glBeginQueryEXT); + flextglDeleteQueriesEXT = reinterpret_cast(glDeleteQueriesEXT); + flextglEndQueryEXT = reinterpret_cast(glEndQueryEXT); + flextglGenQueriesEXT = reinterpret_cast(glGenQueriesEXT); + flextglGetQueryObjectuivEXT = reinterpret_cast(glGetQueryObjectuivEXT); + flextglGetQueryivEXT = reinterpret_cast(glGetQueryivEXT); + flextglIsQueryEXT = reinterpret_cast(glIsQueryEXT); + #endif + + /* GL_EXT_robustness */ + #if GL_EXT_robustness + flextglGetGraphicsResetStatusEXT = reinterpret_cast(glGetGraphicsResetStatusEXT); + flextglGetnUniformfvEXT = reinterpret_cast(glGetnUniformfvEXT); + flextglGetnUniformivEXT = reinterpret_cast(glGetnUniformivEXT); + flextglReadnPixelsEXT = reinterpret_cast(glReadnPixelsEXT); + #endif + + /* GL_EXT_separate_shader_objects */ + #if GL_EXT_separate_shader_objects + flextglActiveShaderProgramEXT = reinterpret_cast(glActiveShaderProgramEXT); + flextglBindProgramPipelineEXT = reinterpret_cast(glBindProgramPipelineEXT); + flextglCreateShaderProgramvEXT = reinterpret_cast(glCreateShaderProgramvEXT); + flextglDeleteProgramPipelinesEXT = reinterpret_cast(glDeleteProgramPipelinesEXT); + flextglGenProgramPipelinesEXT = reinterpret_cast(glGenProgramPipelinesEXT); + flextglGetProgramPipelineInfoLogEXT = reinterpret_cast(glGetProgramPipelineInfoLogEXT); + flextglGetProgramPipelineivEXT = reinterpret_cast(glGetProgramPipelineivEXT); + flextglIsProgramPipelineEXT = reinterpret_cast(glIsProgramPipelineEXT); + flextglProgramParameteriEXT = reinterpret_cast(glProgramParameteriEXT); + flextglProgramUniform1fEXT = reinterpret_cast(glProgramUniform1fEXT); + flextglProgramUniform1fvEXT = reinterpret_cast(glProgramUniform1fvEXT); + flextglProgramUniform1iEXT = reinterpret_cast(glProgramUniform1iEXT); + flextglProgramUniform1ivEXT = reinterpret_cast(glProgramUniform1ivEXT); + flextglProgramUniform1uiEXT = reinterpret_cast(glProgramUniform1uiEXT); + flextglProgramUniform1uivEXT = reinterpret_cast(glProgramUniform1uivEXT); + flextglProgramUniform2fEXT = reinterpret_cast(glProgramUniform2fEXT); + flextglProgramUniform2fvEXT = reinterpret_cast(glProgramUniform2fvEXT); + flextglProgramUniform2iEXT = reinterpret_cast(glProgramUniform2iEXT); + flextglProgramUniform2ivEXT = reinterpret_cast(glProgramUniform2ivEXT); + flextglProgramUniform2uiEXT = reinterpret_cast(glProgramUniform2uiEXT); + flextglProgramUniform2uivEXT = reinterpret_cast(glProgramUniform2uivEXT); + flextglProgramUniform3fEXT = reinterpret_cast(glProgramUniform3fEXT); + flextglProgramUniform3fvEXT = reinterpret_cast(glProgramUniform3fvEXT); + flextglProgramUniform3iEXT = reinterpret_cast(glProgramUniform3iEXT); + flextglProgramUniform3ivEXT = reinterpret_cast(glProgramUniform3ivEXT); + flextglProgramUniform3uiEXT = reinterpret_cast(glProgramUniform3uiEXT); + flextglProgramUniform3uivEXT = reinterpret_cast(glProgramUniform3uivEXT); + flextglProgramUniform4fEXT = reinterpret_cast(glProgramUniform4fEXT); + flextglProgramUniform4fvEXT = reinterpret_cast(glProgramUniform4fvEXT); + flextglProgramUniform4iEXT = reinterpret_cast(glProgramUniform4iEXT); + flextglProgramUniform4ivEXT = reinterpret_cast(glProgramUniform4ivEXT); + flextglProgramUniform4uiEXT = reinterpret_cast(glProgramUniform4uiEXT); + flextglProgramUniform4uivEXT = reinterpret_cast(glProgramUniform4uivEXT); + flextglProgramUniformMatrix2fvEXT = reinterpret_cast(glProgramUniformMatrix2fvEXT); + flextglProgramUniformMatrix2x3fvEXT = reinterpret_cast(glProgramUniformMatrix2x3fvEXT); + flextglProgramUniformMatrix2x4fvEXT = reinterpret_cast(glProgramUniformMatrix2x4fvEXT); + flextglProgramUniformMatrix3fvEXT = reinterpret_cast(glProgramUniformMatrix3fvEXT); + flextglProgramUniformMatrix3x2fvEXT = reinterpret_cast(glProgramUniformMatrix3x2fvEXT); + flextglProgramUniformMatrix3x4fvEXT = reinterpret_cast(glProgramUniformMatrix3x4fvEXT); + flextglProgramUniformMatrix4fvEXT = reinterpret_cast(glProgramUniformMatrix4fvEXT); + flextglProgramUniformMatrix4x2fvEXT = reinterpret_cast(glProgramUniformMatrix4x2fvEXT); + flextglProgramUniformMatrix4x3fvEXT = reinterpret_cast(glProgramUniformMatrix4x3fvEXT); + flextglUseProgramStagesEXT = reinterpret_cast(glUseProgramStagesEXT); + flextglValidateProgramPipelineEXT = reinterpret_cast(glValidateProgramPipelineEXT); + #endif + + /* GL_EXT_texture_border_clamp */ + #if GL_EXT_texture_border_clamp + flextglGetSamplerParameterIivEXT = reinterpret_cast(glGetSamplerParameterIivEXT); + flextglGetSamplerParameterIuivEXT = reinterpret_cast(glGetSamplerParameterIuivEXT); + flextglGetTexParameterIivEXT = reinterpret_cast(glGetTexParameterIivEXT); + flextglGetTexParameterIuivEXT = reinterpret_cast(glGetTexParameterIuivEXT); + flextglSamplerParameterIivEXT = reinterpret_cast(glSamplerParameterIivEXT); + flextglSamplerParameterIuivEXT = reinterpret_cast(glSamplerParameterIuivEXT); + flextglTexParameterIivEXT = reinterpret_cast(glTexParameterIivEXT); + flextglTexParameterIuivEXT = reinterpret_cast(glTexParameterIuivEXT); + #endif + + /* GL_EXT_texture_storage */ + #if GL_EXT_texture_storage + flextglTexStorage1DEXT = reinterpret_cast(glTexStorage1DEXT); + flextglTexStorage2DEXT = reinterpret_cast(glTexStorage2DEXT); + flextglTexStorage3DEXT = reinterpret_cast(glTexStorage3DEXT); + flextglTextureStorage1DEXT = reinterpret_cast(glTextureStorage1DEXT); + flextglTextureStorage2DEXT = reinterpret_cast(glTextureStorage2DEXT); + flextglTextureStorage3DEXT = reinterpret_cast(glTextureStorage3DEXT); + #endif + + /* GL_KHR_blend_equation_advanced */ + #if GL_KHR_blend_equation_advanced + flextglBlendBarrierKHR = reinterpret_cast(glBlendBarrierKHR); + #endif + + /* GL_KHR_debug */ + #if GL_KHR_debug + flextglDebugMessageCallbackKHR = reinterpret_cast(glDebugMessageCallbackKHR); + flextglDebugMessageControlKHR = reinterpret_cast(glDebugMessageControlKHR); + flextglDebugMessageInsertKHR = reinterpret_cast(glDebugMessageInsertKHR); + flextglGetDebugMessageLogKHR = reinterpret_cast(glGetDebugMessageLogKHR); + flextglGetObjectLabelKHR = reinterpret_cast(glGetObjectLabelKHR); + flextglGetObjectPtrLabelKHR = reinterpret_cast(glGetObjectPtrLabelKHR); + flextglGetPointervKHR = reinterpret_cast(glGetPointervKHR); + flextglObjectLabelKHR = reinterpret_cast(glObjectLabelKHR); + flextglObjectPtrLabelKHR = reinterpret_cast(glObjectPtrLabelKHR); + flextglPopDebugGroupKHR = reinterpret_cast(glPopDebugGroupKHR); + flextglPushDebugGroupKHR = reinterpret_cast(glPushDebugGroupKHR); + #endif + + /* GL_KHR_robustness */ + #if GL_KHR_robustness + flextglGetGraphicsResetStatusKHR = reinterpret_cast(glGetGraphicsResetStatusKHR); + flextglGetnUniformfvKHR = reinterpret_cast(glGetnUniformfvKHR); + flextglGetnUniformivKHR = reinterpret_cast(glGetnUniformivKHR); + flextglGetnUniformuivKHR = reinterpret_cast(glGetnUniformuivKHR); + flextglReadnPixelsKHR = reinterpret_cast(glReadnPixelsKHR); + #endif + + /* GL_NV_draw_buffers */ + #if GL_NV_draw_buffers + flextglDrawBuffersNV = reinterpret_cast(glDrawBuffersNV); + #endif + + /* GL_NV_draw_instanced */ + #if GL_NV_draw_instanced + flextglDrawArraysInstancedNV = reinterpret_cast(glDrawArraysInstancedNV); + flextglDrawElementsInstancedNV = reinterpret_cast(glDrawElementsInstancedNV); + #endif + + /* GL_NV_framebuffer_blit */ + #if GL_NV_framebuffer_blit + flextglBlitFramebufferNV = reinterpret_cast(glBlitFramebufferNV); + #endif + + /* GL_NV_framebuffer_multisample */ + #if GL_NV_framebuffer_multisample + flextglRenderbufferStorageMultisampleNV = reinterpret_cast(glRenderbufferStorageMultisampleNV); + #endif + + /* GL_NV_instanced_arrays */ + #if GL_NV_instanced_arrays + flextglVertexAttribDivisorNV = reinterpret_cast(glVertexAttribDivisorNV); + #endif + + /* GL_NV_polygon_mode */ + #if GL_NV_polygon_mode + flextglPolygonModeNV = reinterpret_cast(glPolygonModeNV); + #endif + + /* GL_NV_read_buffer */ + #if GL_NV_read_buffer + flextglReadBufferNV = reinterpret_cast(glReadBufferNV); + #endif + + /* GL_OES_mapbuffer */ + #if GL_OES_mapbuffer + flextglGetBufferPointervOES = reinterpret_cast(glGetBufferPointervOES); + flextglMapBufferOES = reinterpret_cast(glMapBufferOES); + flextglUnmapBufferOES = reinterpret_cast(glUnmapBufferOES); + #endif + + /* GL_OES_texture_3D */ + #if GL_OES_texture_3D + flextglCompressedTexImage3DOES = reinterpret_cast(glCompressedTexImage3DOES); + flextglCompressedTexSubImage3DOES = reinterpret_cast(glCompressedTexSubImage3DOES); + flextglCopyTexSubImage3DOES = reinterpret_cast(glCopyTexSubImage3DOES); + flextglFramebufferTexture3DOES = reinterpret_cast(glFramebufferTexture3DOES); + flextglTexImage3DOES = reinterpret_cast(glTexImage3DOES); + flextglTexSubImage3DOES = reinterpret_cast(glTexSubImage3DOES); + #endif + + /* GL_OES_vertex_array_object */ + #if GL_OES_vertex_array_object + flextglBindVertexArrayOES = reinterpret_cast(glBindVertexArrayOES); + flextglDeleteVertexArraysOES = reinterpret_cast(glDeleteVertexArraysOES); + flextglGenVertexArraysOES = reinterpret_cast(glGenVertexArraysOES); + flextglIsVertexArrayOES = reinterpret_cast(glIsVertexArrayOES); + #endif +} diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp.template b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp.template new file mode 100644 index 000000000..2d5982016 --- /dev/null +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp.template @@ -0,0 +1,27 @@ +@require(passthru, functions, enums, options, version, extensions) +#include "flextGL.h" + +@for category,funcs in functions: +@if funcs and category not in ['ES_VERSION_2_0']: +@for f in funcs: +#undef gl@f.name +@end +@end +@end + +#include + +void flextGLInit() { + @for category,funcs in functions: + @if funcs and category not in ['ES_VERSION_2_0']: + + /* GL_@category */ + #if GL_@category + @for f in funcs: + flextgl@f.name = reinterpret_cast<@f.returntype\ +(APIENTRY*)(@f.param_type_list_string())>(gl@f.name); + @end + #endif + @end + @end +} diff --git a/src/MagnumExternal/OpenGL/GLES3/README.md b/src/MagnumExternal/OpenGL/GLES3/README.md index 4ab311da7..680618870 100644 --- a/src/MagnumExternal/OpenGL/GLES3/README.md +++ b/src/MagnumExternal/OpenGL/GLES3/README.md @@ -6,7 +6,8 @@ Call `flextGLgen.py` in this directory with the following arguments: .../flextGLgen.py -D . -t . extensions.txt -It will generate `flextGL.h` and `flextGL.cpp` files. +It will generate `flextGL.h`, `flextGL.cpp`, `flextGLPlatform.cpp` and +`flextGLPlatformIOS.cpp` files. Emscripten doesn't have the ability to manually load extension pointers, thus it has only header files: diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp new file mode 100644 index 000000000..ae8d7f1dd --- /dev/null +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp @@ -0,0 +1,457 @@ +#include "flextGL.h" + +#undef glActiveShaderProgram +#undef glBindImageTexture +#undef glBindProgramPipeline +#undef glBindVertexBuffer +#undef glCreateShaderProgramv +#undef glDeleteProgramPipelines +#undef glDispatchCompute +#undef glDispatchComputeIndirect +#undef glDrawArraysIndirect +#undef glDrawElementsIndirect +#undef glFramebufferParameteri +#undef glGenProgramPipelines +#undef glGetBooleani_v +#undef glGetFramebufferParameteriv +#undef glGetMultisamplefv +#undef glGetProgramInterfaceiv +#undef glGetProgramPipelineInfoLog +#undef glGetProgramPipelineiv +#undef glGetProgramResourceIndex +#undef glGetProgramResourceLocation +#undef glGetProgramResourceName +#undef glGetProgramResourceiv +#undef glGetTexLevelParameterfv +#undef glGetTexLevelParameteriv +#undef glIsProgramPipeline +#undef glMemoryBarrier +#undef glMemoryBarrierByRegion +#undef glProgramUniform1f +#undef glProgramUniform1fv +#undef glProgramUniform1i +#undef glProgramUniform1iv +#undef glProgramUniform1ui +#undef glProgramUniform1uiv +#undef glProgramUniform2f +#undef glProgramUniform2fv +#undef glProgramUniform2i +#undef glProgramUniform2iv +#undef glProgramUniform2ui +#undef glProgramUniform2uiv +#undef glProgramUniform3f +#undef glProgramUniform3fv +#undef glProgramUniform3i +#undef glProgramUniform3iv +#undef glProgramUniform3ui +#undef glProgramUniform3uiv +#undef glProgramUniform4f +#undef glProgramUniform4fv +#undef glProgramUniform4i +#undef glProgramUniform4iv +#undef glProgramUniform4ui +#undef glProgramUniform4uiv +#undef glProgramUniformMatrix2fv +#undef glProgramUniformMatrix2x3fv +#undef glProgramUniformMatrix2x4fv +#undef glProgramUniformMatrix3fv +#undef glProgramUniformMatrix3x2fv +#undef glProgramUniformMatrix3x4fv +#undef glProgramUniformMatrix4fv +#undef glProgramUniformMatrix4x2fv +#undef glProgramUniformMatrix4x3fv +#undef glSampleMaski +#undef glTexStorage2DMultisample +#undef glUseProgramStages +#undef glValidateProgramPipeline +#undef glVertexAttribBinding +#undef glVertexAttribFormat +#undef glVertexAttribIFormat +#undef glVertexBindingDivisor +#undef glCopyImageSubDataEXT +#undef glGetObjectLabelEXT +#undef glLabelObjectEXT +#undef glInsertEventMarkerEXT +#undef glPopGroupMarkerEXT +#undef glPushGroupMarkerEXT +#undef glBeginQueryEXT +#undef glDeleteQueriesEXT +#undef glEndQueryEXT +#undef glGenQueriesEXT +#undef glGetQueryObjecti64vEXT +#undef glGetQueryObjectivEXT +#undef glGetQueryObjectui64vEXT +#undef glGetQueryObjectuivEXT +#undef glGetQueryivEXT +#undef glIsQueryEXT +#undef glQueryCounterEXT +#undef glBlendEquationSeparateiEXT +#undef glBlendEquationiEXT +#undef glBlendFuncSeparateiEXT +#undef glBlendFunciEXT +#undef glColorMaskiEXT +#undef glDisableiEXT +#undef glEnableiEXT +#undef glIsEnablediEXT +#undef glFramebufferTextureEXT +#undef glMultiDrawArraysEXT +#undef glMultiDrawElementsEXT +#undef glFramebufferTexture2DMultisampleEXT +#undef glRenderbufferStorageMultisampleEXT +#undef glPrimitiveBoundingBoxEXT +#undef glGetGraphicsResetStatusEXT +#undef glGetnUniformfvEXT +#undef glGetnUniformivEXT +#undef glReadnPixelsEXT +#undef glActiveShaderProgramEXT +#undef glBindProgramPipelineEXT +#undef glCreateShaderProgramvEXT +#undef glDeleteProgramPipelinesEXT +#undef glGenProgramPipelinesEXT +#undef glGetProgramPipelineInfoLogEXT +#undef glGetProgramPipelineivEXT +#undef glIsProgramPipelineEXT +#undef glProgramParameteriEXT +#undef glProgramUniform1fEXT +#undef glProgramUniform1fvEXT +#undef glProgramUniform1iEXT +#undef glProgramUniform1ivEXT +#undef glProgramUniform1uiEXT +#undef glProgramUniform1uivEXT +#undef glProgramUniform2fEXT +#undef glProgramUniform2fvEXT +#undef glProgramUniform2iEXT +#undef glProgramUniform2ivEXT +#undef glProgramUniform2uiEXT +#undef glProgramUniform2uivEXT +#undef glProgramUniform3fEXT +#undef glProgramUniform3fvEXT +#undef glProgramUniform3iEXT +#undef glProgramUniform3ivEXT +#undef glProgramUniform3uiEXT +#undef glProgramUniform3uivEXT +#undef glProgramUniform4fEXT +#undef glProgramUniform4fvEXT +#undef glProgramUniform4iEXT +#undef glProgramUniform4ivEXT +#undef glProgramUniform4uiEXT +#undef glProgramUniform4uivEXT +#undef glProgramUniformMatrix2fvEXT +#undef glProgramUniformMatrix2x3fvEXT +#undef glProgramUniformMatrix2x4fvEXT +#undef glProgramUniformMatrix3fvEXT +#undef glProgramUniformMatrix3x2fvEXT +#undef glProgramUniformMatrix3x4fvEXT +#undef glProgramUniformMatrix4fvEXT +#undef glProgramUniformMatrix4x2fvEXT +#undef glProgramUniformMatrix4x3fvEXT +#undef glUseProgramStagesEXT +#undef glValidateProgramPipelineEXT +#undef glPatchParameteriEXT +#undef glGetSamplerParameterIivEXT +#undef glGetSamplerParameterIuivEXT +#undef glGetTexParameterIivEXT +#undef glGetTexParameterIuivEXT +#undef glSamplerParameterIivEXT +#undef glSamplerParameterIuivEXT +#undef glTexParameterIivEXT +#undef glTexParameterIuivEXT +#undef glTexBufferEXT +#undef glTexBufferRangeEXT +#undef glBlendBarrierKHR +#undef glDebugMessageCallbackKHR +#undef glDebugMessageControlKHR +#undef glDebugMessageInsertKHR +#undef glGetDebugMessageLogKHR +#undef glGetObjectLabelKHR +#undef glGetObjectPtrLabelKHR +#undef glGetPointervKHR +#undef glObjectLabelKHR +#undef glObjectPtrLabelKHR +#undef glPopDebugGroupKHR +#undef glPushDebugGroupKHR +#undef glGetGraphicsResetStatusKHR +#undef glGetnUniformfvKHR +#undef glGetnUniformivKHR +#undef glGetnUniformuivKHR +#undef glReadnPixelsKHR +#undef glPolygonModeNV +#undef glGetBufferPointervOES +#undef glMapBufferOES +#undef glUnmapBufferOES +#undef glMinSampleShadingOES +#undef glTexStorage3DMultisampleOES + +#include + +void flextGLInit() { + + /* GL_ES_VERSION_3_1 */ + #if GL_ES_VERSION_3_1 + flextglActiveShaderProgram = reinterpret_cast(glActiveShaderProgram); + flextglBindImageTexture = reinterpret_cast(glBindImageTexture); + flextglBindProgramPipeline = reinterpret_cast(glBindProgramPipeline); + flextglBindVertexBuffer = reinterpret_cast(glBindVertexBuffer); + flextglCreateShaderProgramv = reinterpret_cast(glCreateShaderProgramv); + flextglDeleteProgramPipelines = reinterpret_cast(glDeleteProgramPipelines); + flextglDispatchCompute = reinterpret_cast(glDispatchCompute); + flextglDispatchComputeIndirect = reinterpret_cast(glDispatchComputeIndirect); + flextglDrawArraysIndirect = reinterpret_cast(glDrawArraysIndirect); + flextglDrawElementsIndirect = reinterpret_cast(glDrawElementsIndirect); + flextglFramebufferParameteri = reinterpret_cast(glFramebufferParameteri); + flextglGenProgramPipelines = reinterpret_cast(glGenProgramPipelines); + flextglGetBooleani_v = reinterpret_cast(glGetBooleani_v); + flextglGetFramebufferParameteriv = reinterpret_cast(glGetFramebufferParameteriv); + flextglGetMultisamplefv = reinterpret_cast(glGetMultisamplefv); + flextglGetProgramInterfaceiv = reinterpret_cast(glGetProgramInterfaceiv); + flextglGetProgramPipelineInfoLog = reinterpret_cast(glGetProgramPipelineInfoLog); + flextglGetProgramPipelineiv = reinterpret_cast(glGetProgramPipelineiv); + flextglGetProgramResourceIndex = reinterpret_cast(glGetProgramResourceIndex); + flextglGetProgramResourceLocation = reinterpret_cast(glGetProgramResourceLocation); + flextglGetProgramResourceName = reinterpret_cast(glGetProgramResourceName); + flextglGetProgramResourceiv = reinterpret_cast(glGetProgramResourceiv); + flextglGetTexLevelParameterfv = reinterpret_cast(glGetTexLevelParameterfv); + flextglGetTexLevelParameteriv = reinterpret_cast(glGetTexLevelParameteriv); + flextglIsProgramPipeline = reinterpret_cast(glIsProgramPipeline); + flextglMemoryBarrier = reinterpret_cast(glMemoryBarrier); + flextglMemoryBarrierByRegion = reinterpret_cast(glMemoryBarrierByRegion); + flextglProgramUniform1f = reinterpret_cast(glProgramUniform1f); + flextglProgramUniform1fv = reinterpret_cast(glProgramUniform1fv); + flextglProgramUniform1i = reinterpret_cast(glProgramUniform1i); + flextglProgramUniform1iv = reinterpret_cast(glProgramUniform1iv); + flextglProgramUniform1ui = reinterpret_cast(glProgramUniform1ui); + flextglProgramUniform1uiv = reinterpret_cast(glProgramUniform1uiv); + flextglProgramUniform2f = reinterpret_cast(glProgramUniform2f); + flextglProgramUniform2fv = reinterpret_cast(glProgramUniform2fv); + flextglProgramUniform2i = reinterpret_cast(glProgramUniform2i); + flextglProgramUniform2iv = reinterpret_cast(glProgramUniform2iv); + flextglProgramUniform2ui = reinterpret_cast(glProgramUniform2ui); + flextglProgramUniform2uiv = reinterpret_cast(glProgramUniform2uiv); + flextglProgramUniform3f = reinterpret_cast(glProgramUniform3f); + flextglProgramUniform3fv = reinterpret_cast(glProgramUniform3fv); + flextglProgramUniform3i = reinterpret_cast(glProgramUniform3i); + flextglProgramUniform3iv = reinterpret_cast(glProgramUniform3iv); + flextglProgramUniform3ui = reinterpret_cast(glProgramUniform3ui); + flextglProgramUniform3uiv = reinterpret_cast(glProgramUniform3uiv); + flextglProgramUniform4f = reinterpret_cast(glProgramUniform4f); + flextglProgramUniform4fv = reinterpret_cast(glProgramUniform4fv); + flextglProgramUniform4i = reinterpret_cast(glProgramUniform4i); + flextglProgramUniform4iv = reinterpret_cast(glProgramUniform4iv); + flextglProgramUniform4ui = reinterpret_cast(glProgramUniform4ui); + flextglProgramUniform4uiv = reinterpret_cast(glProgramUniform4uiv); + flextglProgramUniformMatrix2fv = reinterpret_cast(glProgramUniformMatrix2fv); + flextglProgramUniformMatrix2x3fv = reinterpret_cast(glProgramUniformMatrix2x3fv); + flextglProgramUniformMatrix2x4fv = reinterpret_cast(glProgramUniformMatrix2x4fv); + flextglProgramUniformMatrix3fv = reinterpret_cast(glProgramUniformMatrix3fv); + flextglProgramUniformMatrix3x2fv = reinterpret_cast(glProgramUniformMatrix3x2fv); + flextglProgramUniformMatrix3x4fv = reinterpret_cast(glProgramUniformMatrix3x4fv); + flextglProgramUniformMatrix4fv = reinterpret_cast(glProgramUniformMatrix4fv); + flextglProgramUniformMatrix4x2fv = reinterpret_cast(glProgramUniformMatrix4x2fv); + flextglProgramUniformMatrix4x3fv = reinterpret_cast(glProgramUniformMatrix4x3fv); + flextglSampleMaski = reinterpret_cast(glSampleMaski); + flextglTexStorage2DMultisample = reinterpret_cast(glTexStorage2DMultisample); + flextglUseProgramStages = reinterpret_cast(glUseProgramStages); + flextglValidateProgramPipeline = reinterpret_cast(glValidateProgramPipeline); + flextglVertexAttribBinding = reinterpret_cast(glVertexAttribBinding); + flextglVertexAttribFormat = reinterpret_cast(glVertexAttribFormat); + flextglVertexAttribIFormat = reinterpret_cast(glVertexAttribIFormat); + flextglVertexBindingDivisor = reinterpret_cast(glVertexBindingDivisor); + #endif + + /* GL_EXT_copy_image */ + #if GL_EXT_copy_image + flextglCopyImageSubDataEXT = reinterpret_cast(glCopyImageSubDataEXT); + #endif + + /* GL_EXT_debug_label */ + #if GL_EXT_debug_label + flextglGetObjectLabelEXT = reinterpret_cast(glGetObjectLabelEXT); + flextglLabelObjectEXT = reinterpret_cast(glLabelObjectEXT); + #endif + + /* GL_EXT_debug_marker */ + #if GL_EXT_debug_marker + flextglInsertEventMarkerEXT = reinterpret_cast(glInsertEventMarkerEXT); + flextglPopGroupMarkerEXT = reinterpret_cast(glPopGroupMarkerEXT); + flextglPushGroupMarkerEXT = reinterpret_cast(glPushGroupMarkerEXT); + #endif + + /* GL_EXT_disjoint_timer_query */ + #if GL_EXT_disjoint_timer_query + flextglBeginQueryEXT = reinterpret_cast(glBeginQueryEXT); + flextglDeleteQueriesEXT = reinterpret_cast(glDeleteQueriesEXT); + flextglEndQueryEXT = reinterpret_cast(glEndQueryEXT); + flextglGenQueriesEXT = reinterpret_cast(glGenQueriesEXT); + flextglGetQueryObjecti64vEXT = reinterpret_cast(glGetQueryObjecti64vEXT); + flextglGetQueryObjectivEXT = reinterpret_cast(glGetQueryObjectivEXT); + flextglGetQueryObjectui64vEXT = reinterpret_cast(glGetQueryObjectui64vEXT); + flextglGetQueryObjectuivEXT = reinterpret_cast(glGetQueryObjectuivEXT); + flextglGetQueryivEXT = reinterpret_cast(glGetQueryivEXT); + flextglIsQueryEXT = reinterpret_cast(glIsQueryEXT); + flextglQueryCounterEXT = reinterpret_cast(glQueryCounterEXT); + #endif + + /* GL_EXT_draw_buffers_indexed */ + #if GL_EXT_draw_buffers_indexed + flextglBlendEquationSeparateiEXT = reinterpret_cast(glBlendEquationSeparateiEXT); + flextglBlendEquationiEXT = reinterpret_cast(glBlendEquationiEXT); + flextglBlendFuncSeparateiEXT = reinterpret_cast(glBlendFuncSeparateiEXT); + flextglBlendFunciEXT = reinterpret_cast(glBlendFunciEXT); + flextglColorMaskiEXT = reinterpret_cast(glColorMaskiEXT); + flextglDisableiEXT = reinterpret_cast(glDisableiEXT); + flextglEnableiEXT = reinterpret_cast(glEnableiEXT); + flextglIsEnablediEXT = reinterpret_cast(glIsEnablediEXT); + #endif + + /* GL_EXT_geometry_shader */ + #if GL_EXT_geometry_shader + flextglFramebufferTextureEXT = reinterpret_cast(glFramebufferTextureEXT); + #endif + + /* GL_EXT_multi_draw_arrays */ + #if GL_EXT_multi_draw_arrays + flextglMultiDrawArraysEXT = reinterpret_cast(glMultiDrawArraysEXT); + flextglMultiDrawElementsEXT = reinterpret_cast(glMultiDrawElementsEXT); + #endif + + /* GL_EXT_multisampled_render_to_texture */ + #if GL_EXT_multisampled_render_to_texture + flextglFramebufferTexture2DMultisampleEXT = reinterpret_cast(glFramebufferTexture2DMultisampleEXT); + flextglRenderbufferStorageMultisampleEXT = reinterpret_cast(glRenderbufferStorageMultisampleEXT); + #endif + + /* GL_EXT_primitive_bounding_box */ + #if GL_EXT_primitive_bounding_box + flextglPrimitiveBoundingBoxEXT = reinterpret_cast(glPrimitiveBoundingBoxEXT); + #endif + + /* GL_EXT_robustness */ + #if GL_EXT_robustness + flextglGetGraphicsResetStatusEXT = reinterpret_cast(glGetGraphicsResetStatusEXT); + flextglGetnUniformfvEXT = reinterpret_cast(glGetnUniformfvEXT); + flextglGetnUniformivEXT = reinterpret_cast(glGetnUniformivEXT); + flextglReadnPixelsEXT = reinterpret_cast(glReadnPixelsEXT); + #endif + + /* GL_EXT_separate_shader_objects */ + #if GL_EXT_separate_shader_objects + flextglActiveShaderProgramEXT = reinterpret_cast(glActiveShaderProgramEXT); + flextglBindProgramPipelineEXT = reinterpret_cast(glBindProgramPipelineEXT); + flextglCreateShaderProgramvEXT = reinterpret_cast(glCreateShaderProgramvEXT); + flextglDeleteProgramPipelinesEXT = reinterpret_cast(glDeleteProgramPipelinesEXT); + flextglGenProgramPipelinesEXT = reinterpret_cast(glGenProgramPipelinesEXT); + flextglGetProgramPipelineInfoLogEXT = reinterpret_cast(glGetProgramPipelineInfoLogEXT); + flextglGetProgramPipelineivEXT = reinterpret_cast(glGetProgramPipelineivEXT); + flextglIsProgramPipelineEXT = reinterpret_cast(glIsProgramPipelineEXT); + flextglProgramParameteriEXT = reinterpret_cast(glProgramParameteriEXT); + flextglProgramUniform1fEXT = reinterpret_cast(glProgramUniform1fEXT); + flextglProgramUniform1fvEXT = reinterpret_cast(glProgramUniform1fvEXT); + flextglProgramUniform1iEXT = reinterpret_cast(glProgramUniform1iEXT); + flextglProgramUniform1ivEXT = reinterpret_cast(glProgramUniform1ivEXT); + flextglProgramUniform1uiEXT = reinterpret_cast(glProgramUniform1uiEXT); + flextglProgramUniform1uivEXT = reinterpret_cast(glProgramUniform1uivEXT); + flextglProgramUniform2fEXT = reinterpret_cast(glProgramUniform2fEXT); + flextglProgramUniform2fvEXT = reinterpret_cast(glProgramUniform2fvEXT); + flextglProgramUniform2iEXT = reinterpret_cast(glProgramUniform2iEXT); + flextglProgramUniform2ivEXT = reinterpret_cast(glProgramUniform2ivEXT); + flextglProgramUniform2uiEXT = reinterpret_cast(glProgramUniform2uiEXT); + flextglProgramUniform2uivEXT = reinterpret_cast(glProgramUniform2uivEXT); + flextglProgramUniform3fEXT = reinterpret_cast(glProgramUniform3fEXT); + flextglProgramUniform3fvEXT = reinterpret_cast(glProgramUniform3fvEXT); + flextglProgramUniform3iEXT = reinterpret_cast(glProgramUniform3iEXT); + flextglProgramUniform3ivEXT = reinterpret_cast(glProgramUniform3ivEXT); + flextglProgramUniform3uiEXT = reinterpret_cast(glProgramUniform3uiEXT); + flextglProgramUniform3uivEXT = reinterpret_cast(glProgramUniform3uivEXT); + flextglProgramUniform4fEXT = reinterpret_cast(glProgramUniform4fEXT); + flextglProgramUniform4fvEXT = reinterpret_cast(glProgramUniform4fvEXT); + flextglProgramUniform4iEXT = reinterpret_cast(glProgramUniform4iEXT); + flextglProgramUniform4ivEXT = reinterpret_cast(glProgramUniform4ivEXT); + flextglProgramUniform4uiEXT = reinterpret_cast(glProgramUniform4uiEXT); + flextglProgramUniform4uivEXT = reinterpret_cast(glProgramUniform4uivEXT); + flextglProgramUniformMatrix2fvEXT = reinterpret_cast(glProgramUniformMatrix2fvEXT); + flextglProgramUniformMatrix2x3fvEXT = reinterpret_cast(glProgramUniformMatrix2x3fvEXT); + flextglProgramUniformMatrix2x4fvEXT = reinterpret_cast(glProgramUniformMatrix2x4fvEXT); + flextglProgramUniformMatrix3fvEXT = reinterpret_cast(glProgramUniformMatrix3fvEXT); + flextglProgramUniformMatrix3x2fvEXT = reinterpret_cast(glProgramUniformMatrix3x2fvEXT); + flextglProgramUniformMatrix3x4fvEXT = reinterpret_cast(glProgramUniformMatrix3x4fvEXT); + flextglProgramUniformMatrix4fvEXT = reinterpret_cast(glProgramUniformMatrix4fvEXT); + flextglProgramUniformMatrix4x2fvEXT = reinterpret_cast(glProgramUniformMatrix4x2fvEXT); + flextglProgramUniformMatrix4x3fvEXT = reinterpret_cast(glProgramUniformMatrix4x3fvEXT); + flextglUseProgramStagesEXT = reinterpret_cast(glUseProgramStagesEXT); + flextglValidateProgramPipelineEXT = reinterpret_cast(glValidateProgramPipelineEXT); + #endif + + /* GL_EXT_tessellation_shader */ + #if GL_EXT_tessellation_shader + flextglPatchParameteriEXT = reinterpret_cast(glPatchParameteriEXT); + #endif + + /* GL_EXT_texture_border_clamp */ + #if GL_EXT_texture_border_clamp + flextglGetSamplerParameterIivEXT = reinterpret_cast(glGetSamplerParameterIivEXT); + flextglGetSamplerParameterIuivEXT = reinterpret_cast(glGetSamplerParameterIuivEXT); + flextglGetTexParameterIivEXT = reinterpret_cast(glGetTexParameterIivEXT); + flextglGetTexParameterIuivEXT = reinterpret_cast(glGetTexParameterIuivEXT); + flextglSamplerParameterIivEXT = reinterpret_cast(glSamplerParameterIivEXT); + flextglSamplerParameterIuivEXT = reinterpret_cast(glSamplerParameterIuivEXT); + flextglTexParameterIivEXT = reinterpret_cast(glTexParameterIivEXT); + flextglTexParameterIuivEXT = reinterpret_cast(glTexParameterIuivEXT); + #endif + + /* GL_EXT_texture_buffer */ + #if GL_EXT_texture_buffer + flextglTexBufferEXT = reinterpret_cast(glTexBufferEXT); + flextglTexBufferRangeEXT = reinterpret_cast(glTexBufferRangeEXT); + #endif + + /* GL_KHR_blend_equation_advanced */ + #if GL_KHR_blend_equation_advanced + flextglBlendBarrierKHR = reinterpret_cast(glBlendBarrierKHR); + #endif + + /* GL_KHR_debug */ + #if GL_KHR_debug + flextglDebugMessageCallbackKHR = reinterpret_cast(glDebugMessageCallbackKHR); + flextglDebugMessageControlKHR = reinterpret_cast(glDebugMessageControlKHR); + flextglDebugMessageInsertKHR = reinterpret_cast(glDebugMessageInsertKHR); + flextglGetDebugMessageLogKHR = reinterpret_cast(glGetDebugMessageLogKHR); + flextglGetObjectLabelKHR = reinterpret_cast(glGetObjectLabelKHR); + flextglGetObjectPtrLabelKHR = reinterpret_cast(glGetObjectPtrLabelKHR); + flextglGetPointervKHR = reinterpret_cast(glGetPointervKHR); + flextglObjectLabelKHR = reinterpret_cast(glObjectLabelKHR); + flextglObjectPtrLabelKHR = reinterpret_cast(glObjectPtrLabelKHR); + flextglPopDebugGroupKHR = reinterpret_cast(glPopDebugGroupKHR); + flextglPushDebugGroupKHR = reinterpret_cast(glPushDebugGroupKHR); + #endif + + /* GL_KHR_robustness */ + #if GL_KHR_robustness + flextglGetGraphicsResetStatusKHR = reinterpret_cast(glGetGraphicsResetStatusKHR); + flextglGetnUniformfvKHR = reinterpret_cast(glGetnUniformfvKHR); + flextglGetnUniformivKHR = reinterpret_cast(glGetnUniformivKHR); + flextglGetnUniformuivKHR = reinterpret_cast(glGetnUniformuivKHR); + flextglReadnPixelsKHR = reinterpret_cast(glReadnPixelsKHR); + #endif + + /* GL_NV_polygon_mode */ + #if GL_NV_polygon_mode + flextglPolygonModeNV = reinterpret_cast(glPolygonModeNV); + #endif + + /* GL_OES_mapbuffer */ + #if GL_OES_mapbuffer + flextglGetBufferPointervOES = reinterpret_cast(glGetBufferPointervOES); + flextglMapBufferOES = reinterpret_cast(glMapBufferOES); + flextglUnmapBufferOES = reinterpret_cast(glUnmapBufferOES); + #endif + + /* GL_OES_sample_shading */ + #if GL_OES_sample_shading + flextglMinSampleShadingOES = reinterpret_cast(glMinSampleShadingOES); + #endif + + /* GL_OES_texture_storage_multisample_2d_array */ + #if GL_OES_texture_storage_multisample_2d_array + flextglTexStorage3DMultisampleOES = reinterpret_cast(glTexStorage3DMultisampleOES); + #endif +} diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp.template b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp.template new file mode 100644 index 000000000..98a29513b --- /dev/null +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp.template @@ -0,0 +1,27 @@ +@require(passthru, functions, enums, options, version, extensions) +#include "flextGL.h" + +@for category,funcs in functions: +@if funcs and category not in ['ES_VERSION_2_0', 'ES_VERSION_3_0']: +@for f in funcs: +#undef gl@f.name +@end +@end +@end + +#include + +void flextGLInit() { + @for category,funcs in functions: + @if funcs and category not in ['ES_VERSION_2_0', 'ES_VERSION_3_0']: + + /* GL_@category */ + #if GL_@category + @for f in funcs: + flextgl@f.name = reinterpret_cast<@f.returntype\ +(APIENTRY*)(@f.param_type_list_string())>(gl@f.name); + @end + #endif + @end + @end +} From 8c562fb106c679422cbce94a4f959e770ece028d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 4 Feb 2016 19:12:55 +0100 Subject: [PATCH 101/258] Force OpenGL ES if compiling for iOS. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6abc4fa79..39fba7ac5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,9 +37,9 @@ find_package(Corrade REQUIRED) include(CMakeDependentOption) -# If targeting Android, NaCl, Emscripten or Windows RT, set explicit OpenGL ES -# support -if(NOT CORRADE_TARGET_ANDROID AND NOT CORRADE_TARGET_EMSCRIPTEN AND NOT CORRADE_TARGET_NACL AND NOT CORRADE_TARGET_WINDOWS_RT) +# If targeting iOS, Android, NaCl, Emscripten or Windows RT, set explicit +# OpenGL ES support +if(NOT CORRADE_TARGET_IOS AND NOT CORRADE_TARGET_ANDROID AND NOT CORRADE_TARGET_EMSCRIPTEN AND NOT CORRADE_TARGET_NACL AND NOT CORRADE_TARGET_WINDOWS_RT) option(TARGET_GLES "Build for OpenGL ES / WebGL" OFF) else() set(TARGET_GLES ON) From 526346973a7d7191c61132da9f515309f611170b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 4 Feb 2016 19:13:22 +0100 Subject: [PATCH 102/258] Updated toolchains submodule. --- toolchains | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains b/toolchains index a4683ed56..47f5d2a76 160000 --- a/toolchains +++ b/toolchains @@ -1 +1 @@ -Subproject commit a4683ed5662754a6498e64f30064b9f118f78285 +Subproject commit 47f5d2a7682c119e0c34b9698c83bfcf2c1bba6d From ad27e192f4fe8600f2fe296747bf67337989c5a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 4 Feb 2016 19:29:00 +0100 Subject: [PATCH 103/258] modules: link also all required frameworks when finding SDL2 on iOS. --- modules/FindMagnum.cmake | 4 ++-- modules/FindSDL2.cmake | 30 ++++++++++++++++++++++++++++-- src/Magnum/Platform/CMakeLists.txt | 2 +- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index c3db765d6..0a9e8698c 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -402,8 +402,8 @@ foreach(component ${Magnum_FIND_COMPONENTS}) elseif(${component} STREQUAL Sdl2Application) find_package(SDL2) if(SDL2_FOUND) - set(_MAGNUM_${_COMPONENT}_LIBRARIES ${SDL2_LIBRARY}) - set(_MAGNUM_${_COMPONENT}_INCLUDE_DIRS ${SDL2_INCLUDE_DIR}) + set(_MAGNUM_${_COMPONENT}_LIBRARIES ${SDL2_LIBRARIES}) + set(_MAGNUM_${_COMPONENT}_INCLUDE_DIRS ${SDL2_INCLUDE_DIRS}) else() unset(MAGNUM_${_COMPONENT}_LIBRARY) endif() diff --git a/modules/FindSDL2.cmake b/modules/FindSDL2.cmake index aa95cbf12..e3e0aa5f0 100644 --- a/modules/FindSDL2.cmake +++ b/modules/FindSDL2.cmake @@ -3,8 +3,12 @@ # This module defines: # # SDL2_FOUND - True if SDL2 library is found -# SDL2_LIBRARY - SDL2 dynamic library -# SDL2_INCLUDE_DIR - Include dir +# SDL2_LIBRARIES - SDL2 library and dependent libraries +# SDL2_INCLUDE_DIRS - Root include dir and include dirs of dependencies +# +# Additionally these variables are defined for internal usage: +# SDL2_INCLUDE_DIR - Root include dir (w/o dependencies) +# SDL2_LIBRARY - SDL2 library (w/o dependencies) # # @@ -61,7 +65,29 @@ find_path(SDL2_INCLUDE_DIR NAMES SDL_scancode.h PATH_SUFFIXES ${_SDL2_PATH_SUFFIXES}) +# iOS dependencies +if(CORRADE_TARGET_IOS) + set(_SDL2_FRAMEWORKS + AudioToolbox + CoreGraphics + CoreMotion + Foundation + GameController + QuartzCore + UIKit) + set(_SDL2_FRAMEWORK_LIBRARIES ) + foreach(framework ${_SDL2_FRAMEWORKS}) + find_library(_SDL2_${framework}_LIBRARY ${framework}) + list(APPEND _SDL2_FRAMEWORK_LIBRARIES ${_SDL2_${framework}_LIBRARY}) + list(APPEND _SDL2_FRAMEWORK_LIBRARY_NAMES _SDL2_${framework}_LIBRARY) + endforeach() +endif() + include(FindPackageHandleStandardArgs) find_package_handle_standard_args("SDL2" DEFAULT_MSG ${SDL2_LIBRARY_NEEDED} + ${_SDL2_FRAMEWORK_LIBRARY_NAMES} SDL2_INCLUDE_DIR) + +set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR}) +set(SDL2_LIBRARIES ${SDL2_LIBRARY} ${_SDL2_FRAMEWORK_LIBRARIES}) diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index 7c2731979..bd7c7067c 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -127,7 +127,7 @@ if(WITH_SDL2APPLICATION) message(FATAL_ERROR "SDL2 library, required by Sdl2Application, was not found. Set WITH_SDL2APPLICATION to OFF to skip building it.") endif() - include_directories(${SDL2_INCLUDE_DIR}) + include_directories(${SDL2_INCLUDE_DIRS}) set(MagnumSdl2Application_SRCS Sdl2Application.cpp From 80aaa5bbbc6faf1390aefb07e8109fd51a921ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 5 Feb 2016 15:57:47 +0100 Subject: [PATCH 104/258] Minor cleanup. --- doc/building.dox | 10 +++++----- src/Magnum/Platform/WindowlessWindowsEglApplication.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/building.dox b/doc/building.dox index b8ac06c5c..978ade262 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -162,11 +162,11 @@ By default the engine is built for desktop OpenGL. Using `TARGET_*` CMake parameters you can target other platforms. Note that some features are available for desktop OpenGL only, see @ref requires-gl. - - `TARGET_GLES` - Target OpenGL ES. - - `TARGET_GLES2` - Target OpenGL ES 2.0. Currently enabled by default when - `TARGET_GLES` is set. - - `TARGET_DESKTOP_GLES` - Target OpenGL ES on desktop, i.e. use OpenGL ES - emulation in desktop OpenGL library. Might not be supported in all drivers. +- `TARGET_GLES` -- Target OpenGL ES. +- `TARGET_GLES2` -- Target OpenGL ES 2.0. Currently enabled by default when + `TARGET_GLES` is set. +- `TARGET_DESKTOP_GLES` -- Target OpenGL ES on desktop, i.e. use OpenGL ES + emulation in desktop OpenGL library. Might not be supported in all drivers. The features used can be conveniently detected in depending projects both in CMake and C++ sources, see @ref cmake and @ref Magnum/Magnum.h for more diff --git a/src/Magnum/Platform/WindowlessWindowsEglApplication.h b/src/Magnum/Platform/WindowlessWindowsEglApplication.h index a5e3cd854..11a0690f2 100644 --- a/src/Magnum/Platform/WindowlessWindowsEglApplication.h +++ b/src/Magnum/Platform/WindowlessWindowsEglApplication.h @@ -223,7 +223,7 @@ class WindowlessWindowsEglApplication::Configuration { }; /** @hideinitializer -@brief Entry point for windowless WGL application +@brief Entry point for windowless Windows/EGL application @param className Class name See @ref Magnum::Platform::WindowlessWindowsEglApplication "Platform::WindowlessWindowsEglApplication" From 41b8c050142a08406bb6832d5ed7c0a4789a72da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 5 Feb 2016 16:26:45 +0100 Subject: [PATCH 105/258] Initialize version to (0, 0) to avoid crashes on broken GL contexts. --- src/Magnum/Context.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index 6710438c9..c4d96ce13 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/Context.cpp @@ -461,7 +461,9 @@ bool Context::tryCreate() { /* Load GL function pointers */ if(_functionLoader) _functionLoader(); - GLint majorVersion, minorVersion; + /* Initialize to something predictable to avoid crashes on improperly + created contexts */ + GLint majorVersion = 0, minorVersion = 0; /* Get version on ES 3.0+/WebGL 2.0+ */ #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_GLES2) From ffc993b7894cbfaad9876ddfafcf157ddba1e2b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 5 Feb 2016 16:27:37 +0100 Subject: [PATCH 106/258] Properly handle cases when glGetString() returns nullptr. --- src/Magnum/Context.cpp | 16 ++++++++++++++++ src/Magnum/Context.h | 16 ++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index c4d96ce13..6f9d9f582 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/Context.cpp @@ -680,6 +680,22 @@ bool Context::tryCreate() { return true; } +std::string Context::vendorString() const { + return Utility::String::fromArray(reinterpret_cast(glGetString(GL_VENDOR))); +} + +std::string Context::rendererString() const { + return Utility::String::fromArray(reinterpret_cast(glGetString(GL_RENDERER))); +} + +std::string Context::versionString() const { + return Utility::String::fromArray(reinterpret_cast(glGetString(GL_VERSION))); +} + +std::string Context::shadingLanguageVersionString() const { + return Utility::String::fromArray(reinterpret_cast(glGetString(GL_SHADING_LANGUAGE_VERSION))); +} + std::vector Context::shadingLanguageVersionStrings() const { #ifndef MAGNUM_TARGET_GLES GLint versionCount = 0; diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index 06a2e93d5..cfb3412a4 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -282,9 +282,7 @@ class MAGNUM_EXPORT Context { * OpenGL calls. * @see @ref rendererString(), @fn_gl{GetString} with @def_gl{VENDOR} */ - std::string vendorString() const { - return reinterpret_cast(glGetString(GL_VENDOR)); - } + std::string vendorString() const; /** * @brief Renderer string @@ -293,9 +291,7 @@ class MAGNUM_EXPORT Context { * OpenGL calls. * @see @ref vendorString(), @fn_gl{GetString} with @def_gl{RENDERER} */ - std::string rendererString() const { - return reinterpret_cast(glGetString(GL_RENDERER)); - } + std::string rendererString() const; /** * @brief Version string @@ -305,9 +301,7 @@ class MAGNUM_EXPORT Context { * @see @ref shadingLanguageVersionString(), @ref version(), * @fn_gl{GetString} with @def_gl{VERSION} */ - std::string versionString() const { - return reinterpret_cast(glGetString(GL_VERSION)); - } + std::string versionString() const; /** * @brief Shading language version string @@ -317,9 +311,7 @@ class MAGNUM_EXPORT Context { * @see @ref versionString(), @ref version(), @fn_gl{GetString} with * @def_gl{SHADING_LANGUAGE_VERSION} */ - std::string shadingLanguageVersionString() const { - return reinterpret_cast(glGetString(GL_SHADING_LANGUAGE_VERSION)); - } + std::string shadingLanguageVersionString() const; /** * @brief Shading language version strings From e1343724e19f223371db15c9799ce06fc90b3f82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 5 Feb 2016 16:59:10 +0100 Subject: [PATCH 107/258] Fix building tests on ES2. --- src/Magnum/Test/AbstractShaderProgramGLTest.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp index 008916dc5..2688c737d 100644 --- a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp @@ -32,7 +32,9 @@ #include "Magnum/Extensions.h" #include "Magnum/Image.h" #include "Magnum/ImageView.h" +#ifndef MAGNUM_TARGET_GLES2 #include "Magnum/ImageFormat.h" +#endif #include "Magnum/PixelFormat.h" #include "Magnum/Shader.h" #include "Magnum/Texture.h" From b35d19ce6b890bc64c0d4a1b7eec6de9e54adb20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 5 Feb 2016 17:38:07 +0100 Subject: [PATCH 108/258] Platform: comment cleanup. What does "window context" mean anyway? --- src/Magnum/Platform/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index bd7c7067c..e65a6f5c3 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -444,7 +444,7 @@ endif() if(NEED_EGLCONTEXTHANDLER) find_package(EGL) if(NOT EGL_FOUND) - message(FATAL_ERROR "EGL library, required by some window contexts, was not found. Set WITH_*EGL*APPLICATION to OFF to skip building them.") + message(FATAL_ERROR "EGL library, required by some contexts, was not found. Set WITH_*EGL*APPLICATION to OFF to skip building them.") endif() include_directories(${EGL_INCLUDE_DIR}) @@ -520,7 +520,7 @@ endif() if(NEED_EGLCONTEXT OR WITH_EGLCONTEXT) find_package(EGL) if(NOT EGL_FOUND) - message(FATAL_ERROR "EGL library, required by some window contexts, was not found. Set WITH_*APPLICATION and/or WITH_EGLCONTEXT to OFF to skip building them.") + message(FATAL_ERROR "EGL library, required by some contexts, was not found. Set WITH_*APPLICATION and/or WITH_EGLCONTEXT to OFF to skip building them.") endif() include_directories(${EGL_INCLUDE_DIR}) From aebf071143177c60dbcb394dee41c6e9a2414337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 5 Feb 2016 17:38:50 +0100 Subject: [PATCH 109/258] Platform: make used application printing in magnum-info more foolproof. I don't want to have the same logic duplicated on two places. Also filled in missing values. --- src/Magnum/Platform/magnum-info.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index f75c13093..2a6f8658f 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -168,14 +168,16 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat Debug() << " +---------------------------------------------------------+"; Debug() << ""; - #ifdef CORRADE_TARGET_NACL + #ifdef MAGNUM_WINDOWLESSNACLAPPLICATION_MAIN Debug() << "Used application: Platform::WindowlessNaClApplication"; - #elif defined(CORRADE_TARGET_APPLE) + #elif defined(MAGNUM_WINDOWLESSCGLAPPLICATION_MAIN) Debug() << "Used application: Platform::WindowlessCglApplication"; - #elif defined(CORRADE_TARGET_UNIX) + #elif defined(MAGNUM_WINDOWLESSGLXAPPLICATION_MAIN) Debug() << "Used application: Platform::WindowlessGlxApplication"; - #elif defined(CORRADE_TARGET_WINDOWS) + #elif defined(MAGNUM_WINDOWLESSWGLAPPLICATION_MAIN) Debug() << "Used application: Platform::WindowlessWglApplication"; + #elif defined(MAGNUM_WINDOWLESSWINDOWSEGLAPPLICATION_MAIN) + Debug() << "Used application: Platform::WindowlessWindowsEglApplication"; #else #error no windowless application available on this platform #endif From 76f73f4a61d1515cc93b1be1feea0cb328759f37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 5 Feb 2016 17:41:28 +0100 Subject: [PATCH 110/258] Platform: add missing definitions to magnum-info. --- src/Magnum/Platform/magnum-info.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index 2a6f8658f..2771eac8f 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -197,9 +197,15 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #ifdef CORRADE_TARGET_APPLE Debug() << " CORRADE_TARGET_APPLE"; #endif + #ifdef CORRADE_TARGET_IOS + Debug() << " CORRADE_TARGET_IOS"; + #endif #ifdef CORRADE_TARGET_WINDOWS Debug() << " CORRADE_TARGET_WINDOWS"; #endif + #ifdef CORRADE_TARGET_WINDOWS_RT + Debug() << " CORRADE_TARGET_WINDOWS_RT"; + #endif #ifdef CORRADE_TARGET_NACL Debug() << " CORRADE_TARGET_NACL"; #endif From b5ced6ee138f3ba68bb642ceec771632c17ffff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 5 Feb 2016 17:42:03 +0100 Subject: [PATCH 111/258] Platform: note that WindowlessCglApplication is w/o default FB. --- src/Magnum/Platform/WindowlessCglApplication.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Platform/WindowlessCglApplication.h b/src/Magnum/Platform/WindowlessCglApplication.h index be937fe92..bf0005561 100644 --- a/src/Magnum/Platform/WindowlessCglApplication.h +++ b/src/Magnum/Platform/WindowlessCglApplication.h @@ -46,7 +46,8 @@ namespace Magnum { namespace Platform { /** @brief Windowless CGL application -Application for offscreen rendering using pure CGL. +Application for offscreen rendering using pure CGL. Does not have any default +framebuffer. This application library is available on desktop OpenGL on OS X. It is built if `WITH_WINDOWLESSCGLAPPLICATION` is enabled in CMake. From a3bf0115481ccb21a6dc952bf8673def20ff9521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 5 Feb 2016 22:30:04 +0100 Subject: [PATCH 112/258] modules: updated FindCorrade.cmake. --- modules/FindCorrade.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/FindCorrade.cmake b/modules/FindCorrade.cmake index 2fea9dde8..6850cbac8 100644 --- a/modules/FindCorrade.cmake +++ b/modules/FindCorrade.cmake @@ -126,7 +126,7 @@ # # This file is part of Corrade. # -# Copyright © 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a From 23646e6690068ee268451de3bd7cb103c1298e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 5 Feb 2016 22:36:59 +0100 Subject: [PATCH 113/258] Hell, this project is big. --- CMakeLists.txt | 2 +- CONTRIBUTING.md | 2 +- COPYING | 2 +- doc/best-practices.dox | 2 +- doc/building.dox | 2 +- doc/cmake.dox | 2 +- doc/coding-style.dox | 2 +- doc/compilation-speedup.dox | 2 +- doc/debug-tools.dox | 2 +- doc/features.dox | 2 +- doc/generated/CMakeLists.txt | 2 +- doc/generated/configure.h.cmake | 2 +- doc/generated/hello.cpp | 2 +- doc/generated/shaders.cpp | 2 +- doc/getting-started.dox | 2 +- doc/mainpage.dox | 4 ++-- doc/matrix-vector.dox | 2 +- doc/method-chaining.dox | 2 +- doc/namespaces.dox | 2 +- doc/openal-support.dox | 2 +- doc/openal.dox | 2 +- doc/opengl-mapping.dox | 2 +- doc/opengl-support.dox | 2 +- doc/opengl-wrapping.dox | 2 +- doc/opengl.dox | 2 +- doc/platform.dox | 2 +- doc/plugins.dox | 2 +- doc/portability.dox | 2 +- doc/scenegraph.dox | 2 +- doc/shaders.dox | 2 +- doc/shapes.dox | 2 +- doc/tips.dox | 2 +- doc/transformations.dox | 2 +- doc/troubleshooting.dox | 2 +- doc/types.dox | 2 +- doc/utilities.dox | 2 +- modules/CMakeLists.txt | 2 +- modules/FindEGL.cmake | 2 +- modules/FindMagnum.cmake | 2 +- modules/FindOpenGLES2.cmake | 2 +- modules/FindOpenGLES3.cmake | 2 +- modules/FindSDL2.cmake | 2 +- modules/MagnumConfig.cmake | 2 +- src/CMakeLists.txt | 2 +- src/Magnum/AbstractFramebuffer.cpp | 2 +- src/Magnum/AbstractFramebuffer.h | 2 +- src/Magnum/AbstractObject.cpp | 2 +- src/Magnum/AbstractObject.h | 2 +- src/Magnum/AbstractQuery.cpp | 2 +- src/Magnum/AbstractQuery.h | 2 +- src/Magnum/AbstractResourceLoader.h | 2 +- src/Magnum/AbstractShaderProgram.cpp | 2 +- src/Magnum/AbstractShaderProgram.h | 2 +- src/Magnum/AbstractTexture.cpp | 2 +- src/Magnum/AbstractTexture.h | 2 +- src/Magnum/Array.h | 2 +- src/Magnum/Attribute.cpp | 2 +- src/Magnum/Attribute.h | 2 +- src/Magnum/Audio/AbstractImporter.cpp | 2 +- src/Magnum/Audio/AbstractImporter.h | 2 +- src/Magnum/Audio/Audio.cpp | 2 +- src/Magnum/Audio/Audio.h | 2 +- src/Magnum/Audio/Buffer.cpp | 2 +- src/Magnum/Audio/Buffer.h | 2 +- src/Magnum/Audio/CMakeLists.txt | 2 +- src/Magnum/Audio/Context.cpp | 2 +- src/Magnum/Audio/Context.h | 2 +- src/Magnum/Audio/Extensions.h | 2 +- src/Magnum/Audio/Listener.cpp | 2 +- src/Magnum/Audio/Listener.h | 2 +- src/Magnum/Audio/Playable.h | 2 +- src/Magnum/Audio/PlayableGroup.h | 2 +- src/Magnum/Audio/Renderer.cpp | 2 +- src/Magnum/Audio/Renderer.h | 2 +- src/Magnum/Audio/Source.cpp | 2 +- src/Magnum/Audio/Source.h | 2 +- src/Magnum/Audio/Test/AbstractImporterTest.cpp | 2 +- src/Magnum/Audio/Test/BufferTest.cpp | 2 +- src/Magnum/Audio/Test/CMakeLists.txt | 2 +- src/Magnum/Audio/Test/ContextTest.cpp | 2 +- src/Magnum/Audio/Test/ListenerTest.cpp | 2 +- src/Magnum/Audio/Test/PlayableTest.cpp | 2 +- src/Magnum/Audio/Test/RendererTest.cpp | 2 +- src/Magnum/Audio/Test/SourceTest.cpp | 2 +- src/Magnum/Audio/Test/configure.h.cmake | 2 +- src/Magnum/Audio/visibility.h | 2 +- src/Magnum/Buffer.cpp | 2 +- src/Magnum/Buffer.h | 2 +- src/Magnum/BufferImage.cpp | 2 +- src/Magnum/BufferImage.h | 2 +- src/Magnum/BufferTexture.cpp | 2 +- src/Magnum/BufferTexture.h | 2 +- src/Magnum/BufferTextureFormat.h | 2 +- src/Magnum/CMakeLists.txt | 2 +- src/Magnum/Color.h | 2 +- src/Magnum/ColorFormat.h | 2 +- src/Magnum/Context.cpp | 2 +- src/Magnum/Context.h | 2 +- src/Magnum/CubeMapTexture.cpp | 2 +- src/Magnum/CubeMapTexture.h | 2 +- src/Magnum/CubeMapTextureArray.cpp | 2 +- src/Magnum/CubeMapTextureArray.h | 2 +- src/Magnum/DebugMessage.h | 2 +- src/Magnum/DebugOutput.cpp | 2 +- src/Magnum/DebugOutput.h | 2 +- src/Magnum/DebugTools/CMakeLists.txt | 2 +- src/Magnum/DebugTools/DebugTools.h | 2 +- src/Magnum/DebugTools/ForceRenderer.cpp | 2 +- src/Magnum/DebugTools/ForceRenderer.h | 2 +- src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.cpp | 2 +- src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.h | 2 +- .../DebugTools/Implementation/AbstractShapeRenderer.cpp | 2 +- src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.h | 2 +- .../DebugTools/Implementation/AxisAlignedBoxRenderer.cpp | 2 +- src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.h | 2 +- src/Magnum/DebugTools/Implementation/BoxRenderer.cpp | 2 +- src/Magnum/DebugTools/Implementation/BoxRenderer.h | 2 +- src/Magnum/DebugTools/Implementation/CapsuleRenderer.cpp | 2 +- src/Magnum/DebugTools/Implementation/CapsuleRenderer.h | 2 +- .../DebugTools/Implementation/CapsuleRendererTransformation.h | 2 +- src/Magnum/DebugTools/Implementation/CylinderRenderer.cpp | 2 +- src/Magnum/DebugTools/Implementation/CylinderRenderer.h | 2 +- .../Implementation/CylinderRendererTransformation.h | 2 +- .../DebugTools/Implementation/ForceRendererTransformation.h | 2 +- src/Magnum/DebugTools/Implementation/LineSegmentRenderer.cpp | 2 +- src/Magnum/DebugTools/Implementation/LineSegmentRenderer.h | 2 +- .../Implementation/LineSegmentRendererTransformation.h | 2 +- src/Magnum/DebugTools/Implementation/PointRenderer.cpp | 2 +- src/Magnum/DebugTools/Implementation/PointRenderer.h | 2 +- src/Magnum/DebugTools/Implementation/SphereRenderer.cpp | 2 +- src/Magnum/DebugTools/Implementation/SphereRenderer.h | 2 +- src/Magnum/DebugTools/ObjectRenderer.cpp | 2 +- src/Magnum/DebugTools/ObjectRenderer.h | 2 +- src/Magnum/DebugTools/Profiler.cpp | 2 +- src/Magnum/DebugTools/Profiler.h | 2 +- src/Magnum/DebugTools/ResourceManager.cpp | 2 +- src/Magnum/DebugTools/ResourceManager.h | 2 +- src/Magnum/DebugTools/ShapeRenderer.cpp | 2 +- src/Magnum/DebugTools/ShapeRenderer.h | 2 +- src/Magnum/DebugTools/Test/CMakeLists.txt | 2 +- src/Magnum/DebugTools/Test/CapsuleRendererTest.cpp | 2 +- src/Magnum/DebugTools/Test/CylinderRendererTest.cpp | 2 +- src/Magnum/DebugTools/Test/ForceRendererTest.cpp | 2 +- src/Magnum/DebugTools/Test/LineSegmentRendererTest.cpp | 2 +- src/Magnum/DebugTools/visibility.h | 2 +- src/Magnum/DefaultFramebuffer.cpp | 2 +- src/Magnum/DefaultFramebuffer.h | 2 +- src/Magnum/DimensionTraits.h | 2 +- src/Magnum/Extensions.h | 2 +- src/Magnum/Framebuffer.cpp | 2 +- src/Magnum/Framebuffer.h | 2 +- src/Magnum/Image.cpp | 2 +- src/Magnum/Image.h | 2 +- src/Magnum/ImageFormat.h | 2 +- src/Magnum/ImageReference.h | 2 +- src/Magnum/ImageView.h | 2 +- src/Magnum/Implementation/BufferState.cpp | 2 +- src/Magnum/Implementation/BufferState.h | 2 +- src/Magnum/Implementation/DebugState.cpp | 2 +- src/Magnum/Implementation/DebugState.h | 2 +- src/Magnum/Implementation/FramebufferState.cpp | 2 +- src/Magnum/Implementation/FramebufferState.h | 2 +- src/Magnum/Implementation/MeshState.cpp | 2 +- src/Magnum/Implementation/MeshState.h | 2 +- src/Magnum/Implementation/QueryState.cpp | 2 +- src/Magnum/Implementation/QueryState.h | 2 +- src/Magnum/Implementation/RendererState.cpp | 2 +- src/Magnum/Implementation/RendererState.h | 2 +- src/Magnum/Implementation/ShaderProgramState.cpp | 2 +- src/Magnum/Implementation/ShaderProgramState.h | 2 +- src/Magnum/Implementation/ShaderState.h | 2 +- src/Magnum/Implementation/State.cpp | 2 +- src/Magnum/Implementation/State.h | 2 +- src/Magnum/Implementation/TextureState.cpp | 2 +- src/Magnum/Implementation/TextureState.h | 2 +- src/Magnum/Implementation/TransformFeedbackState.h | 2 +- src/Magnum/Implementation/driverSpecific.cpp | 2 +- src/Magnum/Implementation/maxTextureSize.cpp | 2 +- src/Magnum/Implementation/maxTextureSize.h | 2 +- src/Magnum/Magnum.h | 2 +- src/Magnum/Math/Algorithms/CMakeLists.txt | 2 +- src/Magnum/Math/Algorithms/GaussJordan.h | 2 +- src/Magnum/Math/Algorithms/GramSchmidt.h | 2 +- src/Magnum/Math/Algorithms/Svd.h | 2 +- src/Magnum/Math/Algorithms/Test/CMakeLists.txt | 2 +- src/Magnum/Math/Algorithms/Test/GaussJordanTest.cpp | 2 +- src/Magnum/Math/Algorithms/Test/GramSchmidtTest.cpp | 2 +- src/Magnum/Math/Algorithms/Test/SvdTest.cpp | 2 +- src/Magnum/Math/Angle.h | 2 +- src/Magnum/Math/BoolVector.h | 2 +- src/Magnum/Math/CMakeLists.txt | 2 +- src/Magnum/Math/Color.h | 2 +- src/Magnum/Math/Complex.h | 2 +- src/Magnum/Math/Constants.h | 2 +- src/Magnum/Math/Dual.h | 2 +- src/Magnum/Math/DualComplex.h | 2 +- src/Magnum/Math/DualQuaternion.h | 2 +- src/Magnum/Math/Functions.cpp | 2 +- src/Magnum/Math/Functions.h | 2 +- src/Magnum/Math/Geometry/CMakeLists.txt | 2 +- src/Magnum/Math/Geometry/Distance.h | 2 +- src/Magnum/Math/Geometry/Intersection.h | 2 +- src/Magnum/Math/Geometry/Test/CMakeLists.txt | 2 +- src/Magnum/Math/Geometry/Test/DistanceTest.cpp | 2 +- src/Magnum/Math/Geometry/Test/IntersectionTest.cpp | 2 +- src/Magnum/Math/Math.h | 2 +- src/Magnum/Math/Matrix.h | 2 +- src/Magnum/Math/Matrix3.h | 2 +- src/Magnum/Math/Matrix4.h | 2 +- src/Magnum/Math/Quaternion.h | 2 +- src/Magnum/Math/Range.h | 2 +- src/Magnum/Math/RectangularMatrix.h | 2 +- src/Magnum/Math/Swizzle.h | 2 +- src/Magnum/Math/Tags.h | 2 +- src/Magnum/Math/Test/AngleTest.cpp | 2 +- src/Magnum/Math/Test/BoolVectorTest.cpp | 2 +- src/Magnum/Math/Test/CMakeLists.txt | 2 +- src/Magnum/Math/Test/ColorTest.cpp | 2 +- src/Magnum/Math/Test/ComplexTest.cpp | 2 +- src/Magnum/Math/Test/ConstantsTest.cpp | 2 +- src/Magnum/Math/Test/DualComplexTest.cpp | 2 +- src/Magnum/Math/Test/DualQuaternionTest.cpp | 2 +- src/Magnum/Math/Test/DualTest.cpp | 2 +- src/Magnum/Math/Test/FunctionsTest.cpp | 2 +- src/Magnum/Math/Test/Matrix3Test.cpp | 2 +- src/Magnum/Math/Test/Matrix4Test.cpp | 2 +- src/Magnum/Math/Test/MatrixTest.cpp | 2 +- src/Magnum/Math/Test/QuaternionTest.cpp | 2 +- src/Magnum/Math/Test/RangeTest.cpp | 2 +- src/Magnum/Math/Test/RectangularMatrixTest.cpp | 2 +- src/Magnum/Math/Test/SwizzleTest.cpp | 2 +- src/Magnum/Math/Test/TagsTest.cpp | 2 +- src/Magnum/Math/Test/TypeTraitsTest.cpp | 2 +- src/Magnum/Math/Test/UnitTest.cpp | 2 +- src/Magnum/Math/Test/Vector2Test.cpp | 2 +- src/Magnum/Math/Test/Vector3Test.cpp | 2 +- src/Magnum/Math/Test/Vector4Test.cpp | 2 +- src/Magnum/Math/Test/VectorTest.cpp | 2 +- src/Magnum/Math/TypeTraits.h | 2 +- src/Magnum/Math/Unit.h | 2 +- src/Magnum/Math/Vector.h | 2 +- src/Magnum/Math/Vector2.h | 2 +- src/Magnum/Math/Vector3.h | 2 +- src/Magnum/Math/Vector4.h | 2 +- src/Magnum/Math/dummy.cpp | 2 +- src/Magnum/Math/instantiation.cpp | 2 +- src/Magnum/Mesh.cpp | 2 +- src/Magnum/Mesh.h | 2 +- src/Magnum/MeshTools/CMakeLists.txt | 2 +- src/Magnum/MeshTools/CombineIndexedArrays.cpp | 2 +- src/Magnum/MeshTools/CombineIndexedArrays.h | 2 +- src/Magnum/MeshTools/Compile.cpp | 2 +- src/Magnum/MeshTools/Compile.h | 2 +- src/Magnum/MeshTools/CompressIndices.cpp | 2 +- src/Magnum/MeshTools/CompressIndices.h | 2 +- src/Magnum/MeshTools/Duplicate.h | 2 +- src/Magnum/MeshTools/FlipNormals.cpp | 2 +- src/Magnum/MeshTools/FlipNormals.h | 2 +- src/Magnum/MeshTools/FullScreenTriangle.cpp | 2 +- src/Magnum/MeshTools/FullScreenTriangle.h | 2 +- src/Magnum/MeshTools/GenerateFlatNormals.cpp | 2 +- src/Magnum/MeshTools/GenerateFlatNormals.h | 2 +- src/Magnum/MeshTools/Interleave.h | 2 +- src/Magnum/MeshTools/RemoveDuplicates.h | 2 +- src/Magnum/MeshTools/Subdivide.h | 2 +- src/Magnum/MeshTools/Test/CMakeLists.txt | 2 +- src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp | 2 +- src/Magnum/MeshTools/Test/CompressIndicesTest.cpp | 2 +- src/Magnum/MeshTools/Test/DuplicateTest.cpp | 2 +- src/Magnum/MeshTools/Test/FlipNormalsTest.cpp | 2 +- src/Magnum/MeshTools/Test/GenerateFlatNormalsTest.cpp | 2 +- src/Magnum/MeshTools/Test/InterleaveTest.cpp | 2 +- src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp | 2 +- .../MeshTools/Test/SubdivideRemoveDuplicatesBenchmark.cpp | 2 +- .../MeshTools/Test/SubdivideRemoveDuplicatesBenchmark.h | 2 +- src/Magnum/MeshTools/Test/SubdivideTest.cpp | 2 +- src/Magnum/MeshTools/Test/TipsifyTest.cpp | 2 +- src/Magnum/MeshTools/Test/TransformTest.cpp | 2 +- src/Magnum/MeshTools/Tipsify.cpp | 2 +- src/Magnum/MeshTools/Tipsify.h | 2 +- src/Magnum/MeshTools/Transform.h | 2 +- src/Magnum/MeshTools/visibility.h | 2 +- src/Magnum/MeshView.cpp | 2 +- src/Magnum/MeshView.h | 2 +- src/Magnum/MultisampleTexture.cpp | 2 +- src/Magnum/MultisampleTexture.h | 2 +- src/Magnum/OpenGL.cpp | 2 +- src/Magnum/OpenGL.h | 2 +- src/Magnum/PixelFormat.cpp | 2 +- src/Magnum/PixelFormat.h | 2 +- src/Magnum/PixelStorage.cpp | 2 +- src/Magnum/PixelStorage.h | 2 +- src/Magnum/Platform/AbstractXApplication.cpp | 2 +- src/Magnum/Platform/AbstractXApplication.h | 2 +- src/Magnum/Platform/AndroidApplication.cpp | 2 +- src/Magnum/Platform/AndroidApplication.h | 2 +- src/Magnum/Platform/CMakeLists.txt | 2 +- src/Magnum/Platform/Context.h | 2 +- src/Magnum/Platform/GlutApplication.cpp | 2 +- src/Magnum/Platform/GlutApplication.h | 2 +- src/Magnum/Platform/GlxApplication.cpp | 2 +- src/Magnum/Platform/GlxApplication.h | 2 +- src/Magnum/Platform/Implementation/AbstractContextHandler.h | 2 +- src/Magnum/Platform/Implementation/Egl.cpp | 2 +- src/Magnum/Platform/Implementation/Egl.h | 2 +- src/Magnum/Platform/Implementation/EglContextHandler.cpp | 2 +- src/Magnum/Platform/Implementation/EglContextHandler.h | 2 +- src/Magnum/Platform/Implementation/GlxContextHandler.cpp | 2 +- src/Magnum/Platform/Implementation/GlxContextHandler.h | 2 +- src/Magnum/Platform/Implementation/OpenGLFunctionLoader.cpp | 2 +- src/Magnum/Platform/Implementation/OpenGLFunctionLoader.h | 2 +- src/Magnum/Platform/NaClApplication.cpp | 2 +- src/Magnum/Platform/NaClApplication.h | 2 +- src/Magnum/Platform/Platform.h | 2 +- src/Magnum/Platform/Screen.h | 2 +- src/Magnum/Platform/ScreenedApplication.h | 2 +- src/Magnum/Platform/ScreenedApplication.hpp | 2 +- src/Magnum/Platform/Sdl2Application.cpp | 2 +- src/Magnum/Platform/Sdl2Application.h | 2 +- src/Magnum/Platform/WindowlessCglApplication.cpp | 2 +- src/Magnum/Platform/WindowlessCglApplication.h | 2 +- src/Magnum/Platform/WindowlessGlxApplication.cpp | 2 +- src/Magnum/Platform/WindowlessGlxApplication.h | 2 +- src/Magnum/Platform/WindowlessNaClApplication.cpp | 2 +- src/Magnum/Platform/WindowlessNaClApplication.h | 2 +- src/Magnum/Platform/WindowlessWglApplication.cpp | 2 +- src/Magnum/Platform/WindowlessWglApplication.h | 2 +- src/Magnum/Platform/WindowlessWindowsEglApplication.cpp | 2 +- src/Magnum/Platform/WindowlessWindowsEglApplication.h | 2 +- src/Magnum/Platform/XEglApplication.cpp | 2 +- src/Magnum/Platform/XEglApplication.h | 2 +- src/Magnum/Platform/magnum-info.cpp | 2 +- src/Magnum/PrimitiveQuery.h | 2 +- src/Magnum/Primitives/CMakeLists.txt | 2 +- src/Magnum/Primitives/Capsule.cpp | 2 +- src/Magnum/Primitives/Capsule.h | 2 +- src/Magnum/Primitives/Circle.cpp | 2 +- src/Magnum/Primitives/Circle.h | 2 +- src/Magnum/Primitives/Crosshair.cpp | 2 +- src/Magnum/Primitives/Crosshair.h | 2 +- src/Magnum/Primitives/Cube.cpp | 2 +- src/Magnum/Primitives/Cube.h | 2 +- src/Magnum/Primitives/Cylinder.cpp | 2 +- src/Magnum/Primitives/Cylinder.h | 2 +- src/Magnum/Primitives/Icosphere.cpp | 2 +- src/Magnum/Primitives/Icosphere.h | 2 +- src/Magnum/Primitives/Implementation/Spheroid.cpp | 2 +- src/Magnum/Primitives/Implementation/Spheroid.h | 2 +- src/Magnum/Primitives/Implementation/WireframeSpheroid.cpp | 2 +- src/Magnum/Primitives/Implementation/WireframeSpheroid.h | 2 +- src/Magnum/Primitives/Line.cpp | 2 +- src/Magnum/Primitives/Line.h | 2 +- src/Magnum/Primitives/Plane.cpp | 2 +- src/Magnum/Primitives/Plane.h | 2 +- src/Magnum/Primitives/Square.cpp | 2 +- src/Magnum/Primitives/Square.h | 2 +- src/Magnum/Primitives/Test/CMakeLists.txt | 2 +- src/Magnum/Primitives/Test/CapsuleTest.cpp | 2 +- src/Magnum/Primitives/Test/CircleTest.cpp | 2 +- src/Magnum/Primitives/Test/CylinderTest.cpp | 2 +- src/Magnum/Primitives/Test/IcosphereTest.cpp | 2 +- src/Magnum/Primitives/Test/UVSphereTest.cpp | 2 +- src/Magnum/Primitives/UVSphere.cpp | 2 +- src/Magnum/Primitives/UVSphere.h | 2 +- src/Magnum/Primitives/visibility.h | 2 +- src/Magnum/Query.h | 2 +- src/Magnum/RectangleTexture.cpp | 2 +- src/Magnum/RectangleTexture.h | 2 +- src/Magnum/Renderbuffer.cpp | 2 +- src/Magnum/Renderbuffer.h | 2 +- src/Magnum/RenderbufferFormat.h | 2 +- src/Magnum/Renderer.cpp | 2 +- src/Magnum/Renderer.h | 2 +- src/Magnum/Resource.cpp | 2 +- src/Magnum/Resource.h | 2 +- src/Magnum/ResourceManager.h | 2 +- src/Magnum/ResourceManager.hpp | 2 +- src/Magnum/SampleQuery.h | 2 +- src/Magnum/Sampler.cpp | 2 +- src/Magnum/Sampler.h | 2 +- src/Magnum/SceneGraph/AbstractCamera.h | 2 +- src/Magnum/SceneGraph/AbstractCamera.hpp | 2 +- src/Magnum/SceneGraph/AbstractFeature.h | 2 +- src/Magnum/SceneGraph/AbstractFeature.hpp | 2 +- src/Magnum/SceneGraph/AbstractGroupedFeature.h | 2 +- src/Magnum/SceneGraph/AbstractObject.h | 2 +- src/Magnum/SceneGraph/AbstractTransformation.h | 2 +- src/Magnum/SceneGraph/AbstractTranslation.h | 2 +- src/Magnum/SceneGraph/AbstractTranslationRotation2D.h | 2 +- src/Magnum/SceneGraph/AbstractTranslationRotation3D.h | 2 +- src/Magnum/SceneGraph/AbstractTranslationRotationScaling2D.h | 2 +- src/Magnum/SceneGraph/AbstractTranslationRotationScaling3D.h | 2 +- src/Magnum/SceneGraph/Animable.cpp | 2 +- src/Magnum/SceneGraph/Animable.h | 2 +- src/Magnum/SceneGraph/Animable.hpp | 2 +- src/Magnum/SceneGraph/AnimableGroup.h | 2 +- src/Magnum/SceneGraph/CMakeLists.txt | 2 +- src/Magnum/SceneGraph/Camera.h | 2 +- src/Magnum/SceneGraph/Camera.hpp | 2 +- src/Magnum/SceneGraph/Camera2D.h | 2 +- src/Magnum/SceneGraph/Camera2D.hpp | 2 +- src/Magnum/SceneGraph/Camera3D.h | 2 +- src/Magnum/SceneGraph/Camera3D.hpp | 2 +- src/Magnum/SceneGraph/Drawable.h | 2 +- src/Magnum/SceneGraph/Drawable.hpp | 2 +- src/Magnum/SceneGraph/DualComplexTransformation.h | 2 +- src/Magnum/SceneGraph/DualQuaternionTransformation.h | 2 +- src/Magnum/SceneGraph/FeatureGroup.h | 2 +- src/Magnum/SceneGraph/FeatureGroup.hpp | 2 +- src/Magnum/SceneGraph/MatrixTransformation2D.h | 2 +- src/Magnum/SceneGraph/MatrixTransformation3D.h | 2 +- src/Magnum/SceneGraph/Object.h | 2 +- src/Magnum/SceneGraph/Object.hpp | 2 +- src/Magnum/SceneGraph/RigidMatrixTransformation2D.h | 2 +- src/Magnum/SceneGraph/RigidMatrixTransformation3D.h | 2 +- src/Magnum/SceneGraph/Scene.h | 2 +- src/Magnum/SceneGraph/SceneGraph.h | 2 +- src/Magnum/SceneGraph/Test/AnimableTest.cpp | 2 +- src/Magnum/SceneGraph/Test/CMakeLists.txt | 2 +- src/Magnum/SceneGraph/Test/CameraTest.cpp | 2 +- src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp | 2 +- .../SceneGraph/Test/DualQuaternionTransformationTest.cpp | 2 +- src/Magnum/SceneGraph/Test/MatrixTransformation2DTest.cpp | 2 +- src/Magnum/SceneGraph/Test/MatrixTransformation3DTest.cpp | 2 +- src/Magnum/SceneGraph/Test/ObjectTest.cpp | 2 +- .../SceneGraph/Test/RigidMatrixTransformation2DTest.cpp | 2 +- .../SceneGraph/Test/RigidMatrixTransformation3DTest.cpp | 2 +- src/Magnum/SceneGraph/Test/SceneTest.cpp | 2 +- src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp | 2 +- src/Magnum/SceneGraph/TranslationTransformation.h | 2 +- src/Magnum/SceneGraph/instantiation.cpp | 2 +- src/Magnum/SceneGraph/visibility.h | 2 +- src/Magnum/Shader.cpp | 2 +- src/Magnum/Shader.h | 2 +- src/Magnum/Shaders/AbstractVector.cpp | 2 +- src/Magnum/Shaders/AbstractVector.h | 2 +- src/Magnum/Shaders/AbstractVector2D.vert | 2 +- src/Magnum/Shaders/AbstractVector3D.vert | 2 +- src/Magnum/Shaders/CMakeLists.txt | 2 +- src/Magnum/Shaders/DistanceFieldVector.cpp | 2 +- src/Magnum/Shaders/DistanceFieldVector.frag | 2 +- src/Magnum/Shaders/DistanceFieldVector.h | 2 +- src/Magnum/Shaders/Flat.cpp | 2 +- src/Magnum/Shaders/Flat.frag | 2 +- src/Magnum/Shaders/Flat.h | 2 +- src/Magnum/Shaders/Flat2D.vert | 2 +- src/Magnum/Shaders/Flat3D.vert | 2 +- src/Magnum/Shaders/FullScreenTriangle.glsl | 2 +- src/Magnum/Shaders/Generic.h | 2 +- src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h | 2 +- src/Magnum/Shaders/MeshVisualizer.cpp | 2 +- src/Magnum/Shaders/MeshVisualizer.frag | 2 +- src/Magnum/Shaders/MeshVisualizer.geom | 2 +- src/Magnum/Shaders/MeshVisualizer.h | 2 +- src/Magnum/Shaders/MeshVisualizer.vert | 2 +- src/Magnum/Shaders/Phong.cpp | 2 +- src/Magnum/Shaders/Phong.frag | 2 +- src/Magnum/Shaders/Phong.h | 2 +- src/Magnum/Shaders/Phong.vert | 2 +- src/Magnum/Shaders/Shaders.h | 2 +- src/Magnum/Shaders/Test/CMakeLists.txt | 2 +- src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp | 2 +- src/Magnum/Shaders/Test/FlatGLTest.cpp | 2 +- src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp | 2 +- src/Magnum/Shaders/Test/PhongGLTest.cpp | 2 +- src/Magnum/Shaders/Test/VectorGLTest.cpp | 2 +- src/Magnum/Shaders/Test/VertexColorGLTest.cpp | 2 +- src/Magnum/Shaders/Vector.cpp | 2 +- src/Magnum/Shaders/Vector.frag | 2 +- src/Magnum/Shaders/Vector.h | 2 +- src/Magnum/Shaders/VertexColor.cpp | 2 +- src/Magnum/Shaders/VertexColor.frag | 2 +- src/Magnum/Shaders/VertexColor.h | 2 +- src/Magnum/Shaders/VertexColor2D.vert | 2 +- src/Magnum/Shaders/VertexColor3D.vert | 2 +- src/Magnum/Shaders/compatibility.glsl | 2 +- src/Magnum/Shaders/generic.glsl | 2 +- src/Magnum/Shaders/visibility.h | 2 +- src/Magnum/Shapes/AbstractShape.cpp | 2 +- src/Magnum/Shapes/AbstractShape.h | 2 +- src/Magnum/Shapes/AxisAlignedBox.cpp | 2 +- src/Magnum/Shapes/AxisAlignedBox.h | 2 +- src/Magnum/Shapes/Box.cpp | 2 +- src/Magnum/Shapes/Box.h | 2 +- src/Magnum/Shapes/CMakeLists.txt | 2 +- src/Magnum/Shapes/Capsule.cpp | 2 +- src/Magnum/Shapes/Capsule.h | 2 +- src/Magnum/Shapes/Collision.h | 2 +- src/Magnum/Shapes/Composition.cpp | 2 +- src/Magnum/Shapes/Composition.h | 2 +- src/Magnum/Shapes/Cylinder.cpp | 2 +- src/Magnum/Shapes/Cylinder.h | 2 +- src/Magnum/Shapes/Implementation/CollisionDispatch.cpp | 2 +- src/Magnum/Shapes/Implementation/CollisionDispatch.h | 2 +- src/Magnum/Shapes/Line.cpp | 2 +- src/Magnum/Shapes/Line.h | 2 +- src/Magnum/Shapes/LineSegment.h | 2 +- src/Magnum/Shapes/Plane.cpp | 2 +- src/Magnum/Shapes/Plane.h | 2 +- src/Magnum/Shapes/Point.cpp | 2 +- src/Magnum/Shapes/Point.h | 2 +- src/Magnum/Shapes/Shape.cpp | 2 +- src/Magnum/Shapes/Shape.h | 2 +- src/Magnum/Shapes/ShapeGroup.cpp | 2 +- src/Magnum/Shapes/ShapeGroup.h | 2 +- src/Magnum/Shapes/Shapes.h | 2 +- src/Magnum/Shapes/Sphere.cpp | 2 +- src/Magnum/Shapes/Sphere.h | 2 +- src/Magnum/Shapes/Test/AxisAlignedBoxTest.cpp | 2 +- src/Magnum/Shapes/Test/BoxTest.cpp | 2 +- src/Magnum/Shapes/Test/CMakeLists.txt | 2 +- src/Magnum/Shapes/Test/CapsuleTest.cpp | 2 +- src/Magnum/Shapes/Test/CollisionTest.cpp | 2 +- src/Magnum/Shapes/Test/CompositionTest.cpp | 2 +- src/Magnum/Shapes/Test/CylinderTest.cpp | 2 +- src/Magnum/Shapes/Test/LineTest.cpp | 2 +- src/Magnum/Shapes/Test/PlaneTest.cpp | 2 +- src/Magnum/Shapes/Test/PointTest.cpp | 2 +- src/Magnum/Shapes/Test/ShapeImplementationTest.cpp | 2 +- src/Magnum/Shapes/Test/ShapeTest.cpp | 2 +- src/Magnum/Shapes/Test/ShapeTestBase.h | 2 +- src/Magnum/Shapes/Test/SphereTest.cpp | 2 +- src/Magnum/Shapes/shapeImplementation.cpp | 2 +- src/Magnum/Shapes/shapeImplementation.h | 2 +- src/Magnum/Shapes/visibility.h | 2 +- src/Magnum/Tags.h | 2 +- src/Magnum/Test/AbstractObjectGLTest.cpp | 2 +- src/Magnum/Test/AbstractOpenGLTester.h | 2 +- src/Magnum/Test/AbstractQueryGLTest.cpp | 2 +- src/Magnum/Test/AbstractShaderProgramGLTest.cpp | 2 +- src/Magnum/Test/AbstractShaderProgramTest.cpp | 2 +- src/Magnum/Test/AbstractTextureGLTest.cpp | 2 +- src/Magnum/Test/ArrayTest.cpp | 2 +- src/Magnum/Test/BufferGLTest.cpp | 2 +- src/Magnum/Test/BufferImageGLTest.cpp | 2 +- src/Magnum/Test/BufferTextureGLTest.cpp | 2 +- src/Magnum/Test/CMakeLists.txt | 2 +- src/Magnum/Test/ContextGLTest.cpp | 2 +- src/Magnum/Test/ContextTest.cpp | 2 +- src/Magnum/Test/CubeMapTextureArrayGLTest.cpp | 2 +- src/Magnum/Test/CubeMapTextureGLTest.cpp | 2 +- src/Magnum/Test/DebugOutputGLTest.cpp | 2 +- src/Magnum/Test/DebugOutputTest.cpp | 2 +- src/Magnum/Test/DefaultFramebufferTest.cpp | 2 +- src/Magnum/Test/FormatTest.cpp | 2 +- src/Magnum/Test/FramebufferGLTest.cpp | 2 +- src/Magnum/Test/FramebufferTest.cpp | 2 +- src/Magnum/Test/ImageTest.cpp | 2 +- src/Magnum/Test/ImageViewTest.cpp | 2 +- src/Magnum/Test/MeshGLTest.cpp | 2 +- src/Magnum/Test/MeshTest.cpp | 2 +- src/Magnum/Test/MultisampleTextureGLTest.cpp | 2 +- src/Magnum/Test/PixelStorageGLTest.cpp | 2 +- src/Magnum/Test/PixelStorageTest.cpp | 2 +- src/Magnum/Test/PrimitiveQueryGLTest.cpp | 2 +- src/Magnum/Test/RectangleTextureGLTest.cpp | 2 +- src/Magnum/Test/RenderbufferGLTest.cpp | 2 +- src/Magnum/Test/RendererTest.cpp | 2 +- src/Magnum/Test/ResourceManagerLocalInstanceTest.cpp | 2 +- src/Magnum/Test/ResourceManagerLocalInstanceTestLib.cpp | 2 +- src/Magnum/Test/ResourceManagerLocalInstanceTestLib.h | 2 +- src/Magnum/Test/ResourceManagerTest.cpp | 2 +- src/Magnum/Test/SampleQueryGLTest.cpp | 2 +- src/Magnum/Test/SamplerTest.cpp | 2 +- src/Magnum/Test/ShaderGLTest.cpp | 2 +- src/Magnum/Test/ShaderTest.cpp | 2 +- src/Magnum/Test/TagsTest.cpp | 2 +- src/Magnum/Test/TextureArrayGLTest.cpp | 2 +- src/Magnum/Test/TextureGLTest.cpp | 2 +- src/Magnum/Test/TimeQueryGLTest.cpp | 2 +- src/Magnum/Test/TransformFeedbackGLTest.cpp | 2 +- src/Magnum/Test/VersionTest.cpp | 2 +- src/Magnum/Test/configure.h.cmake | 2 +- src/Magnum/Text/AbstractFont.cpp | 2 +- src/Magnum/Text/AbstractFont.h | 2 +- src/Magnum/Text/AbstractFontConverter.cpp | 2 +- src/Magnum/Text/AbstractFontConverter.h | 2 +- src/Magnum/Text/Alignment.h | 2 +- src/Magnum/Text/CMakeLists.txt | 2 +- src/Magnum/Text/DistanceFieldGlyphCache.cpp | 2 +- src/Magnum/Text/DistanceFieldGlyphCache.h | 2 +- src/Magnum/Text/GlyphCache.cpp | 2 +- src/Magnum/Text/GlyphCache.h | 2 +- src/Magnum/Text/Renderer.cpp | 2 +- src/Magnum/Text/Renderer.h | 2 +- src/Magnum/Text/Test/AbstractFontConverterTest.cpp | 2 +- src/Magnum/Text/Test/AbstractFontTest.cpp | 2 +- src/Magnum/Text/Test/AbstractLayouterTest.cpp | 2 +- src/Magnum/Text/Test/CMakeLists.txt | 2 +- src/Magnum/Text/Test/GlyphCacheGLTest.cpp | 2 +- src/Magnum/Text/Test/RendererGLTest.cpp | 2 +- src/Magnum/Text/Test/configure.h.cmake | 2 +- src/Magnum/Text/Text.h | 2 +- src/Magnum/Text/fontconverter.cpp | 2 +- src/Magnum/Text/fontconverterConfigure.h.cmake | 2 +- src/Magnum/Text/visibility.h | 2 +- src/Magnum/Texture.cpp | 2 +- src/Magnum/Texture.h | 2 +- src/Magnum/TextureArray.cpp | 2 +- src/Magnum/TextureArray.h | 2 +- src/Magnum/TextureFormat.h | 2 +- src/Magnum/TextureTools/Atlas.cpp | 2 +- src/Magnum/TextureTools/Atlas.h | 2 +- src/Magnum/TextureTools/CMakeLists.txt | 2 +- src/Magnum/TextureTools/DistanceField.cpp | 2 +- src/Magnum/TextureTools/DistanceField.h | 2 +- src/Magnum/TextureTools/DistanceFieldShader.frag | 2 +- src/Magnum/TextureTools/DistanceFieldShader.vert | 2 +- src/Magnum/TextureTools/Test/AtlasTest.cpp | 2 +- src/Magnum/TextureTools/Test/CMakeLists.txt | 2 +- src/Magnum/TextureTools/distancefieldconverter.cpp | 2 +- .../TextureTools/distancefieldconverterConfigure.h.cmake | 2 +- src/Magnum/TextureTools/visibility.h | 2 +- src/Magnum/TimeQuery.h | 2 +- src/Magnum/Timeline.cpp | 2 +- src/Magnum/Timeline.h | 2 +- src/Magnum/Trade/AbstractImageConverter.cpp | 2 +- src/Magnum/Trade/AbstractImageConverter.h | 2 +- src/Magnum/Trade/AbstractImporter.cpp | 2 +- src/Magnum/Trade/AbstractImporter.h | 2 +- src/Magnum/Trade/AbstractMaterialData.cpp | 2 +- src/Magnum/Trade/AbstractMaterialData.h | 2 +- src/Magnum/Trade/CMakeLists.txt | 2 +- src/Magnum/Trade/CameraData.h | 2 +- src/Magnum/Trade/ImageData.cpp | 2 +- src/Magnum/Trade/ImageData.h | 2 +- src/Magnum/Trade/LightData.h | 2 +- src/Magnum/Trade/MeshData2D.cpp | 2 +- src/Magnum/Trade/MeshData2D.h | 2 +- src/Magnum/Trade/MeshData3D.cpp | 2 +- src/Magnum/Trade/MeshData3D.h | 2 +- src/Magnum/Trade/MeshObjectData2D.cpp | 2 +- src/Magnum/Trade/MeshObjectData2D.h | 2 +- src/Magnum/Trade/MeshObjectData3D.cpp | 2 +- src/Magnum/Trade/MeshObjectData3D.h | 2 +- src/Magnum/Trade/ObjectData2D.cpp | 2 +- src/Magnum/Trade/ObjectData2D.h | 2 +- src/Magnum/Trade/ObjectData3D.cpp | 2 +- src/Magnum/Trade/ObjectData3D.h | 2 +- src/Magnum/Trade/PhongMaterialData.cpp | 2 +- src/Magnum/Trade/PhongMaterialData.h | 2 +- src/Magnum/Trade/SceneData.cpp | 2 +- src/Magnum/Trade/SceneData.h | 2 +- src/Magnum/Trade/Test/AbstractImageConverterTest.cpp | 2 +- src/Magnum/Trade/Test/AbstractImporterTest.cpp | 2 +- src/Magnum/Trade/Test/AbstractMaterialDataTest.cpp | 2 +- src/Magnum/Trade/Test/CMakeLists.txt | 2 +- src/Magnum/Trade/Test/ImageDataTest.cpp | 2 +- src/Magnum/Trade/Test/ObjectData2DTest.cpp | 2 +- src/Magnum/Trade/Test/ObjectData3DTest.cpp | 2 +- src/Magnum/Trade/Test/TextureDataTest.cpp | 2 +- src/Magnum/Trade/Test/configure.h.cmake | 2 +- src/Magnum/Trade/TextureData.cpp | 2 +- src/Magnum/Trade/TextureData.h | 2 +- src/Magnum/Trade/Trade.h | 2 +- src/Magnum/TransformFeedback.cpp | 2 +- src/Magnum/TransformFeedback.h | 2 +- src/Magnum/Types.h | 2 +- src/Magnum/Version.cpp | 2 +- src/Magnum/Version.h | 2 +- src/Magnum/configure.h.cmake | 2 +- src/Magnum/visibility.h | 2 +- src/MagnumExternal/CMakeLists.txt | 2 +- src/MagnumExternal/OpenAL/CMakeLists.txt | 2 +- src/MagnumExternal/OpenAL/extensions.h | 2 +- src/MagnumExternal/OpenGL/CMakeLists.txt | 2 +- src/MagnumExternal/OpenGL/GL/CMakeLists.txt | 2 +- src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt | 2 +- src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt | 2 +- src/MagnumExternal/OpenGL/KHR/CMakeLists.txt | 2 +- src/MagnumExternal/Optional/CMakeLists.txt | 2 +- src/MagnumPlugins/CMakeLists.txt | 2 +- src/MagnumPlugins/MagnumFont/CMakeLists.txt | 2 +- src/MagnumPlugins/MagnumFont/MagnumFont.cpp | 2 +- src/MagnumPlugins/MagnumFont/MagnumFont.h | 2 +- src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt | 2 +- src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp | 2 +- src/MagnumPlugins/MagnumFont/Test/configure.h.cmake | 2 +- src/MagnumPlugins/MagnumFont/pluginRegistration.cpp | 2 +- src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt | 2 +- src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp | 2 +- src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.h | 2 +- src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt | 2 +- .../MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp | 2 +- src/MagnumPlugins/MagnumFontConverter/Test/configure.h.cmake | 2 +- src/MagnumPlugins/MagnumFontConverter/pluginRegistration.cpp | 2 +- src/MagnumPlugins/ObjImporter/CMakeLists.txt | 2 +- src/MagnumPlugins/ObjImporter/ObjImporter.cpp | 2 +- src/MagnumPlugins/ObjImporter/ObjImporter.h | 2 +- src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt | 2 +- src/MagnumPlugins/ObjImporter/Test/Test.cpp | 2 +- src/MagnumPlugins/ObjImporter/Test/configure.h.cmake | 2 +- src/MagnumPlugins/ObjImporter/pluginRegistration.cpp | 2 +- src/MagnumPlugins/TgaImageConverter/CMakeLists.txt | 2 +- src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt | 2 +- .../TgaImageConverter/Test/TgaImageConverterTest.cpp | 2 +- src/MagnumPlugins/TgaImageConverter/Test/configure.h.cmake | 2 +- src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp | 2 +- src/MagnumPlugins/TgaImageConverter/TgaImageConverter.h | 2 +- src/MagnumPlugins/TgaImageConverter/configure.h.cmake | 2 +- src/MagnumPlugins/TgaImageConverter/pluginRegistration.cpp | 2 +- src/MagnumPlugins/TgaImporter/CMakeLists.txt | 2 +- src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt | 2 +- src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp | 2 +- src/MagnumPlugins/TgaImporter/Test/configure.h.cmake | 2 +- src/MagnumPlugins/TgaImporter/TgaHeader.h | 2 +- src/MagnumPlugins/TgaImporter/TgaImporter.cpp | 2 +- src/MagnumPlugins/TgaImporter/TgaImporter.h | 2 +- src/MagnumPlugins/TgaImporter/configure.h.cmake | 2 +- src/MagnumPlugins/TgaImporter/pluginRegistration.cpp | 2 +- src/MagnumPlugins/WavAudioImporter/CMakeLists.txt | 2 +- src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt | 2 +- src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp | 2 +- src/MagnumPlugins/WavAudioImporter/Test/configure.h.cmake | 2 +- src/MagnumPlugins/WavAudioImporter/WavHeader.h | 2 +- src/MagnumPlugins/WavAudioImporter/WavImporter.cpp | 2 +- src/MagnumPlugins/WavAudioImporter/WavImporter.h | 2 +- src/MagnumPlugins/WavAudioImporter/pluginRegistration.cpp | 2 +- 718 files changed, 719 insertions(+), 719 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 39fba7ac5..da0becfb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 221290ecf..7861d6f08 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,7 +44,7 @@ Code contribution /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Copyright © YEAR YOUR_NAME diff --git a/COPYING b/COPYING index 0d92ab1b3..dc67b8130 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/best-practices.dox b/doc/best-practices.dox index 13793a807..bb705af92 100644 --- a/doc/best-practices.dox +++ b/doc/best-practices.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/building.dox b/doc/building.dox index 978ade262..b1a5cdcec 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/cmake.dox b/doc/cmake.dox index 6253a29d0..726dba2a1 100644 --- a/doc/cmake.dox +++ b/doc/cmake.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/coding-style.dox b/doc/coding-style.dox index 9f64f4bd6..c2d3892c8 100644 --- a/doc/coding-style.dox +++ b/doc/coding-style.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/compilation-speedup.dox b/doc/compilation-speedup.dox index 0b56c2e6f..c0bd06994 100644 --- a/doc/compilation-speedup.dox +++ b/doc/compilation-speedup.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/debug-tools.dox b/doc/debug-tools.dox index f079f2b93..364cd4a51 100644 --- a/doc/debug-tools.dox +++ b/doc/debug-tools.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/features.dox b/doc/features.dox index 5bd2c635e..4cd83cf34 100644 --- a/doc/features.dox +++ b/doc/features.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/generated/CMakeLists.txt b/doc/generated/CMakeLists.txt index a093f58c6..2015eb44d 100644 --- a/doc/generated/CMakeLists.txt +++ b/doc/generated/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/generated/configure.h.cmake b/doc/generated/configure.h.cmake index fcf0164d8..0b39a4535 100644 --- a/doc/generated/configure.h.cmake +++ b/doc/generated/configure.h.cmake @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/generated/hello.cpp b/doc/generated/hello.cpp index 1a21e4eb2..807f3c280 100644 --- a/doc/generated/hello.cpp +++ b/doc/generated/hello.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/generated/shaders.cpp b/doc/generated/shaders.cpp index 1515c664a..edf4cc11f 100644 --- a/doc/generated/shaders.cpp +++ b/doc/generated/shaders.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/getting-started.dox b/doc/getting-started.dox index a28852804..deb6ba4b1 100644 --- a/doc/getting-started.dox +++ b/doc/getting-started.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/mainpage.dox b/doc/mainpage.dox index a20ad1576..0adc3db54 100644 --- a/doc/mainpage.dox +++ b/doc/mainpage.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a @@ -128,7 +128,7 @@ Feel free to get more information or contact the author at: Magnum is licensed under MIT/Expat license: > -> Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +> Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 > Vladimír Vondruš <mosra@centrum.cz> > > Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/matrix-vector.dox b/doc/matrix-vector.dox index baed48801..a35cece4e 100644 --- a/doc/matrix-vector.dox +++ b/doc/matrix-vector.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/method-chaining.dox b/doc/method-chaining.dox index e27750a0d..9f319fb3b 100644 --- a/doc/method-chaining.dox +++ b/doc/method-chaining.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/namespaces.dox b/doc/namespaces.dox index 5cc38addc..2f621ddc4 100644 --- a/doc/namespaces.dox +++ b/doc/namespaces.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/openal-support.dox b/doc/openal-support.dox index f99d146f3..06278b89a 100644 --- a/doc/openal-support.dox +++ b/doc/openal-support.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Copyright © 2015 Jonathan Hale diff --git a/doc/openal.dox b/doc/openal.dox index ab3673cb3..6a1b4635a 100644 --- a/doc/openal.dox +++ b/doc/openal.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/opengl-mapping.dox b/doc/opengl-mapping.dox index 4a061aedb..a833b11b4 100644 --- a/doc/opengl-mapping.dox +++ b/doc/opengl-mapping.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index 5b6e6713e..364420ba3 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/opengl-wrapping.dox b/doc/opengl-wrapping.dox index 27b2b2f0b..89baca38d 100644 --- a/doc/opengl-wrapping.dox +++ b/doc/opengl-wrapping.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/opengl.dox b/doc/opengl.dox index c4feef3f7..6a8053126 100644 --- a/doc/opengl.dox +++ b/doc/opengl.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/platform.dox b/doc/platform.dox index cd5a86bd5..5b257bd89 100644 --- a/doc/platform.dox +++ b/doc/platform.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/plugins.dox b/doc/plugins.dox index eeb7f8c9f..2acc735f5 100644 --- a/doc/plugins.dox +++ b/doc/plugins.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/portability.dox b/doc/portability.dox index c9a2dc1a4..d335bb2d2 100644 --- a/doc/portability.dox +++ b/doc/portability.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/scenegraph.dox b/doc/scenegraph.dox index aa0a316ea..c667e5a3c 100644 --- a/doc/scenegraph.dox +++ b/doc/scenegraph.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/shaders.dox b/doc/shaders.dox index 5b72d3d97..6b15a310f 100644 --- a/doc/shaders.dox +++ b/doc/shaders.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/shapes.dox b/doc/shapes.dox index 4b9c79bba..ac9dc37b3 100644 --- a/doc/shapes.dox +++ b/doc/shapes.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/tips.dox b/doc/tips.dox index 0620d72f8..d8dde0d7f 100644 --- a/doc/tips.dox +++ b/doc/tips.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/transformations.dox b/doc/transformations.dox index 9a20b74c2..857e3e44b 100644 --- a/doc/transformations.dox +++ b/doc/transformations.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/troubleshooting.dox b/doc/troubleshooting.dox index b79119c9b..bb9b69b92 100644 --- a/doc/troubleshooting.dox +++ b/doc/troubleshooting.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/types.dox b/doc/types.dox index e8c937491..0c750a0a2 100644 --- a/doc/types.dox +++ b/doc/types.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/doc/utilities.dox b/doc/utilities.dox index 543adcc5a..8533fa386 100644 --- a/doc/utilities.dox +++ b/doc/utilities.dox @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 596a7fcdf..f06821645 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/modules/FindEGL.cmake b/modules/FindEGL.cmake index 66cf99e2e..8e506ac1b 100644 --- a/modules/FindEGL.cmake +++ b/modules/FindEGL.cmake @@ -10,7 +10,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 0a9e8698c..ff160198e 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -128,7 +128,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/modules/FindOpenGLES2.cmake b/modules/FindOpenGLES2.cmake index 5ddf28328..acba08faf 100644 --- a/modules/FindOpenGLES2.cmake +++ b/modules/FindOpenGLES2.cmake @@ -10,7 +10,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/modules/FindOpenGLES3.cmake b/modules/FindOpenGLES3.cmake index a2ecba388..23f4149ed 100644 --- a/modules/FindOpenGLES3.cmake +++ b/modules/FindOpenGLES3.cmake @@ -10,7 +10,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/modules/FindSDL2.cmake b/modules/FindSDL2.cmake index e3e0aa5f0..11544cb4b 100644 --- a/modules/FindSDL2.cmake +++ b/modules/FindSDL2.cmake @@ -14,7 +14,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/modules/MagnumConfig.cmake b/modules/MagnumConfig.cmake index 9049be70e..1d3452ac6 100644 --- a/modules/MagnumConfig.cmake +++ b/modules/MagnumConfig.cmake @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dcb11ca12..5bd81cde5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/AbstractFramebuffer.cpp b/src/Magnum/AbstractFramebuffer.cpp index fa50b0122..c6e887f5c 100644 --- a/src/Magnum/AbstractFramebuffer.cpp +++ b/src/Magnum/AbstractFramebuffer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/AbstractFramebuffer.h b/src/Magnum/AbstractFramebuffer.h index e0ec07038..d8c9a61fc 100644 --- a/src/Magnum/AbstractFramebuffer.h +++ b/src/Magnum/AbstractFramebuffer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/AbstractObject.cpp b/src/Magnum/AbstractObject.cpp index 2e0f55041..beaff5bca 100644 --- a/src/Magnum/AbstractObject.cpp +++ b/src/Magnum/AbstractObject.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/AbstractObject.h b/src/Magnum/AbstractObject.h index 60fa9cfae..86cd1bb92 100644 --- a/src/Magnum/AbstractObject.h +++ b/src/Magnum/AbstractObject.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/AbstractQuery.cpp b/src/Magnum/AbstractQuery.cpp index b62ab29b8..4f90c7fd8 100644 --- a/src/Magnum/AbstractQuery.cpp +++ b/src/Magnum/AbstractQuery.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/AbstractQuery.h b/src/Magnum/AbstractQuery.h index 2f0427874..ea2b20e86 100644 --- a/src/Magnum/AbstractQuery.h +++ b/src/Magnum/AbstractQuery.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/AbstractResourceLoader.h b/src/Magnum/AbstractResourceLoader.h index c32ab37fa..2a40386b4 100644 --- a/src/Magnum/AbstractResourceLoader.h +++ b/src/Magnum/AbstractResourceLoader.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/AbstractShaderProgram.cpp b/src/Magnum/AbstractShaderProgram.cpp index 17b85f5b8..fc5f2f096 100644 --- a/src/Magnum/AbstractShaderProgram.cpp +++ b/src/Magnum/AbstractShaderProgram.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/AbstractShaderProgram.h b/src/Magnum/AbstractShaderProgram.h index 4efb1b7e1..74538e0b9 100644 --- a/src/Magnum/AbstractShaderProgram.h +++ b/src/Magnum/AbstractShaderProgram.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/AbstractTexture.cpp b/src/Magnum/AbstractTexture.cpp index 8e1acf5be..6c6a1799e 100644 --- a/src/Magnum/AbstractTexture.cpp +++ b/src/Magnum/AbstractTexture.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/AbstractTexture.h b/src/Magnum/AbstractTexture.h index 72072a38d..77694e01f 100644 --- a/src/Magnum/AbstractTexture.h +++ b/src/Magnum/AbstractTexture.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Array.h b/src/Magnum/Array.h index 0644bebef..a96e81eb3 100644 --- a/src/Magnum/Array.h +++ b/src/Magnum/Array.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Attribute.cpp b/src/Magnum/Attribute.cpp index 5341634c3..c3af6c051 100644 --- a/src/Magnum/Attribute.cpp +++ b/src/Magnum/Attribute.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Attribute.h b/src/Magnum/Attribute.h index 950ba2d0d..3645826e8 100644 --- a/src/Magnum/Attribute.h +++ b/src/Magnum/Attribute.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Audio/AbstractImporter.cpp b/src/Magnum/Audio/AbstractImporter.cpp index 7a4e5985f..5391e25f2 100644 --- a/src/Magnum/Audio/AbstractImporter.cpp +++ b/src/Magnum/Audio/AbstractImporter.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Audio/AbstractImporter.h b/src/Magnum/Audio/AbstractImporter.h index 0d4608241..13daf32dd 100644 --- a/src/Magnum/Audio/AbstractImporter.h +++ b/src/Magnum/Audio/AbstractImporter.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Audio/Audio.cpp b/src/Magnum/Audio/Audio.cpp index c901ba5a9..4384c776f 100644 --- a/src/Magnum/Audio/Audio.cpp +++ b/src/Magnum/Audio/Audio.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Audio/Audio.h b/src/Magnum/Audio/Audio.h index 3a148f7f5..05c11d726 100644 --- a/src/Magnum/Audio/Audio.h +++ b/src/Magnum/Audio/Audio.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Audio/Buffer.cpp b/src/Magnum/Audio/Buffer.cpp index 9afc2b962..cc1f00cde 100644 --- a/src/Magnum/Audio/Buffer.cpp +++ b/src/Magnum/Audio/Buffer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Audio/Buffer.h b/src/Magnum/Audio/Buffer.h index 4a45ba390..fec59322f 100644 --- a/src/Magnum/Audio/Buffer.h +++ b/src/Magnum/Audio/Buffer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Audio/CMakeLists.txt b/src/Magnum/Audio/CMakeLists.txt index 1711eb945..4d57b6b0c 100644 --- a/src/Magnum/Audio/CMakeLists.txt +++ b/src/Magnum/Audio/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Audio/Context.cpp b/src/Magnum/Audio/Context.cpp index 58977313e..70a331db2 100644 --- a/src/Magnum/Audio/Context.cpp +++ b/src/Magnum/Audio/Context.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Copyright © 2015 Jonathan Hale diff --git a/src/Magnum/Audio/Context.h b/src/Magnum/Audio/Context.h index e8638154c..29156c348 100644 --- a/src/Magnum/Audio/Context.h +++ b/src/Magnum/Audio/Context.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Copyright © 2015 Jonathan Hale diff --git a/src/Magnum/Audio/Extensions.h b/src/Magnum/Audio/Extensions.h index e1039dc92..2a72f2eb9 100644 --- a/src/Magnum/Audio/Extensions.h +++ b/src/Magnum/Audio/Extensions.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Copyright © 2015 Jonathan Hale diff --git a/src/Magnum/Audio/Listener.cpp b/src/Magnum/Audio/Listener.cpp index 1d5516a76..e2c1f1e7f 100644 --- a/src/Magnum/Audio/Listener.cpp +++ b/src/Magnum/Audio/Listener.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Copyright © 2015 Jonathan Hale diff --git a/src/Magnum/Audio/Listener.h b/src/Magnum/Audio/Listener.h index 8b9970278..d731c9f18 100644 --- a/src/Magnum/Audio/Listener.h +++ b/src/Magnum/Audio/Listener.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Copyright © 2015 Jonathan Hale diff --git a/src/Magnum/Audio/Playable.h b/src/Magnum/Audio/Playable.h index 5bf9ddec7..941522f4e 100644 --- a/src/Magnum/Audio/Playable.h +++ b/src/Magnum/Audio/Playable.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Copyright © 2015 Jonathan Hale diff --git a/src/Magnum/Audio/PlayableGroup.h b/src/Magnum/Audio/PlayableGroup.h index 0d643e63e..1ea0cfe1a 100644 --- a/src/Magnum/Audio/PlayableGroup.h +++ b/src/Magnum/Audio/PlayableGroup.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Copyright © 2015 Jonathan Hale diff --git a/src/Magnum/Audio/Renderer.cpp b/src/Magnum/Audio/Renderer.cpp index 85214cf5d..db5fcee9b 100644 --- a/src/Magnum/Audio/Renderer.cpp +++ b/src/Magnum/Audio/Renderer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Audio/Renderer.h b/src/Magnum/Audio/Renderer.h index 41783b256..74d483f4e 100644 --- a/src/Magnum/Audio/Renderer.h +++ b/src/Magnum/Audio/Renderer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Audio/Source.cpp b/src/Magnum/Audio/Source.cpp index cdc9463cb..7e47c1f5e 100644 --- a/src/Magnum/Audio/Source.cpp +++ b/src/Magnum/Audio/Source.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Audio/Source.h b/src/Magnum/Audio/Source.h index c4d6bb98b..e16feb874 100644 --- a/src/Magnum/Audio/Source.h +++ b/src/Magnum/Audio/Source.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Copyright © 2015 Jonathan Hale diff --git a/src/Magnum/Audio/Test/AbstractImporterTest.cpp b/src/Magnum/Audio/Test/AbstractImporterTest.cpp index 7233e9994..bd0a55880 100644 --- a/src/Magnum/Audio/Test/AbstractImporterTest.cpp +++ b/src/Magnum/Audio/Test/AbstractImporterTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Audio/Test/BufferTest.cpp b/src/Magnum/Audio/Test/BufferTest.cpp index 187fa3d32..c98c6e746 100644 --- a/src/Magnum/Audio/Test/BufferTest.cpp +++ b/src/Magnum/Audio/Test/BufferTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Audio/Test/CMakeLists.txt b/src/Magnum/Audio/Test/CMakeLists.txt index 5385f1bfe..b5aa82e71 100644 --- a/src/Magnum/Audio/Test/CMakeLists.txt +++ b/src/Magnum/Audio/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # Copyright © 2015 Jonathan Hale # diff --git a/src/Magnum/Audio/Test/ContextTest.cpp b/src/Magnum/Audio/Test/ContextTest.cpp index 652488904..bb15c2856 100644 --- a/src/Magnum/Audio/Test/ContextTest.cpp +++ b/src/Magnum/Audio/Test/ContextTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Copyright © 2015 Jonathan Hale diff --git a/src/Magnum/Audio/Test/ListenerTest.cpp b/src/Magnum/Audio/Test/ListenerTest.cpp index c64c1ce61..2e22aa32c 100644 --- a/src/Magnum/Audio/Test/ListenerTest.cpp +++ b/src/Magnum/Audio/Test/ListenerTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Copyright © 2015 Jonathan Hale diff --git a/src/Magnum/Audio/Test/PlayableTest.cpp b/src/Magnum/Audio/Test/PlayableTest.cpp index 9b0fd424a..3a185d18a 100644 --- a/src/Magnum/Audio/Test/PlayableTest.cpp +++ b/src/Magnum/Audio/Test/PlayableTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Copyright © 2015 Jonathan Hale diff --git a/src/Magnum/Audio/Test/RendererTest.cpp b/src/Magnum/Audio/Test/RendererTest.cpp index ff3b23ae6..634865b82 100644 --- a/src/Magnum/Audio/Test/RendererTest.cpp +++ b/src/Magnum/Audio/Test/RendererTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Audio/Test/SourceTest.cpp b/src/Magnum/Audio/Test/SourceTest.cpp index d36193ecb..a6a2e6316 100644 --- a/src/Magnum/Audio/Test/SourceTest.cpp +++ b/src/Magnum/Audio/Test/SourceTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Audio/Test/configure.h.cmake b/src/Magnum/Audio/Test/configure.h.cmake index 0cafe472d..8208c7ca8 100644 --- a/src/Magnum/Audio/Test/configure.h.cmake +++ b/src/Magnum/Audio/Test/configure.h.cmake @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Audio/visibility.h b/src/Magnum/Audio/visibility.h index a7bcc288f..566c8b594 100644 --- a/src/Magnum/Audio/visibility.h +++ b/src/Magnum/Audio/visibility.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Buffer.cpp b/src/Magnum/Buffer.cpp index a81d5de30..00a72cd83 100644 --- a/src/Magnum/Buffer.cpp +++ b/src/Magnum/Buffer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Buffer.h b/src/Magnum/Buffer.h index 12f9cc791..3d070148b 100644 --- a/src/Magnum/Buffer.h +++ b/src/Magnum/Buffer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/BufferImage.cpp b/src/Magnum/BufferImage.cpp index b4f33ea45..24f801863 100644 --- a/src/Magnum/BufferImage.cpp +++ b/src/Magnum/BufferImage.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/BufferImage.h b/src/Magnum/BufferImage.h index fbb11bc3a..7e351e6eb 100644 --- a/src/Magnum/BufferImage.h +++ b/src/Magnum/BufferImage.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/BufferTexture.cpp b/src/Magnum/BufferTexture.cpp index e7b5258a8..8491d5db7 100644 --- a/src/Magnum/BufferTexture.cpp +++ b/src/Magnum/BufferTexture.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/BufferTexture.h b/src/Magnum/BufferTexture.h index 21fa4b645..6c324f5a4 100644 --- a/src/Magnum/BufferTexture.h +++ b/src/Magnum/BufferTexture.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/BufferTextureFormat.h b/src/Magnum/BufferTextureFormat.h index cc04d1889..1ad30a8de 100644 --- a/src/Magnum/BufferTextureFormat.h +++ b/src/Magnum/BufferTextureFormat.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/CMakeLists.txt b/src/Magnum/CMakeLists.txt index e8afacd08..7f2a262e0 100644 --- a/src/Magnum/CMakeLists.txt +++ b/src/Magnum/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Color.h b/src/Magnum/Color.h index 77f768d16..ded07a37c 100644 --- a/src/Magnum/Color.h +++ b/src/Magnum/Color.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/ColorFormat.h b/src/Magnum/ColorFormat.h index cadc3262c..e056300d5 100644 --- a/src/Magnum/ColorFormat.h +++ b/src/Magnum/ColorFormat.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index 6f9d9f582..3eca63356 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/Context.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index cfb3412a4..99a602282 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/CubeMapTexture.cpp b/src/Magnum/CubeMapTexture.cpp index 5bee2d8ef..0be4305a5 100644 --- a/src/Magnum/CubeMapTexture.cpp +++ b/src/Magnum/CubeMapTexture.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/CubeMapTexture.h b/src/Magnum/CubeMapTexture.h index ef1935657..17b32b0c4 100644 --- a/src/Magnum/CubeMapTexture.h +++ b/src/Magnum/CubeMapTexture.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/CubeMapTextureArray.cpp b/src/Magnum/CubeMapTextureArray.cpp index 9aed8ae62..e03863d38 100644 --- a/src/Magnum/CubeMapTextureArray.cpp +++ b/src/Magnum/CubeMapTextureArray.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/CubeMapTextureArray.h b/src/Magnum/CubeMapTextureArray.h index a3e02aefd..fecbb4b19 100644 --- a/src/Magnum/CubeMapTextureArray.h +++ b/src/Magnum/CubeMapTextureArray.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugMessage.h b/src/Magnum/DebugMessage.h index 21926c2b5..3bbdf807f 100644 --- a/src/Magnum/DebugMessage.h +++ b/src/Magnum/DebugMessage.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugOutput.cpp b/src/Magnum/DebugOutput.cpp index 457111eec..f6cfe733e 100644 --- a/src/Magnum/DebugOutput.cpp +++ b/src/Magnum/DebugOutput.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugOutput.h b/src/Magnum/DebugOutput.h index ba06e79c0..aa16b0c77 100644 --- a/src/Magnum/DebugOutput.h +++ b/src/Magnum/DebugOutput.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/CMakeLists.txt b/src/Magnum/DebugTools/CMakeLists.txt index 3a3a6046e..1a4fbd6e9 100644 --- a/src/Magnum/DebugTools/CMakeLists.txt +++ b/src/Magnum/DebugTools/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/DebugTools.h b/src/Magnum/DebugTools/DebugTools.h index 02ac6daed..4d766a453 100644 --- a/src/Magnum/DebugTools/DebugTools.h +++ b/src/Magnum/DebugTools/DebugTools.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/ForceRenderer.cpp b/src/Magnum/DebugTools/ForceRenderer.cpp index 2857e55fb..b8d54f73e 100644 --- a/src/Magnum/DebugTools/ForceRenderer.cpp +++ b/src/Magnum/DebugTools/ForceRenderer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/ForceRenderer.h b/src/Magnum/DebugTools/ForceRenderer.h index e0a8ea369..117e051c9 100644 --- a/src/Magnum/DebugTools/ForceRenderer.h +++ b/src/Magnum/DebugTools/ForceRenderer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.cpp b/src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.cpp index 91dfc687c..b8c706a21 100644 --- a/src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.h b/src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.h index ca2bff5a0..180e8abc0 100644 --- a/src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.h +++ b/src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.cpp b/src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.cpp index e8243d155..2da2fe733 100644 --- a/src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.h b/src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.h index 1300ceead..d2beeb1e2 100644 --- a/src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.h +++ b/src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.cpp b/src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.cpp index 7212a7626..24cf0b190 100644 --- a/src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.h b/src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.h index 83463e88d..965542034 100644 --- a/src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.h +++ b/src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/BoxRenderer.cpp b/src/Magnum/DebugTools/Implementation/BoxRenderer.cpp index 95085395e..a8392e56c 100644 --- a/src/Magnum/DebugTools/Implementation/BoxRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/BoxRenderer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/BoxRenderer.h b/src/Magnum/DebugTools/Implementation/BoxRenderer.h index 4bbce8ab1..6c36fb0fc 100644 --- a/src/Magnum/DebugTools/Implementation/BoxRenderer.h +++ b/src/Magnum/DebugTools/Implementation/BoxRenderer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/CapsuleRenderer.cpp b/src/Magnum/DebugTools/Implementation/CapsuleRenderer.cpp index 3e6cea08a..d0cc41340 100644 --- a/src/Magnum/DebugTools/Implementation/CapsuleRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/CapsuleRenderer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/CapsuleRenderer.h b/src/Magnum/DebugTools/Implementation/CapsuleRenderer.h index ac3651ded..d5679d92c 100644 --- a/src/Magnum/DebugTools/Implementation/CapsuleRenderer.h +++ b/src/Magnum/DebugTools/Implementation/CapsuleRenderer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/CapsuleRendererTransformation.h b/src/Magnum/DebugTools/Implementation/CapsuleRendererTransformation.h index 7064c4069..f559e675c 100644 --- a/src/Magnum/DebugTools/Implementation/CapsuleRendererTransformation.h +++ b/src/Magnum/DebugTools/Implementation/CapsuleRendererTransformation.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/CylinderRenderer.cpp b/src/Magnum/DebugTools/Implementation/CylinderRenderer.cpp index f5d4eb058..afacb8575 100644 --- a/src/Magnum/DebugTools/Implementation/CylinderRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/CylinderRenderer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/CylinderRenderer.h b/src/Magnum/DebugTools/Implementation/CylinderRenderer.h index e8c84b3d7..1a27522e0 100644 --- a/src/Magnum/DebugTools/Implementation/CylinderRenderer.h +++ b/src/Magnum/DebugTools/Implementation/CylinderRenderer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/CylinderRendererTransformation.h b/src/Magnum/DebugTools/Implementation/CylinderRendererTransformation.h index aec563175..0f93b39b1 100644 --- a/src/Magnum/DebugTools/Implementation/CylinderRendererTransformation.h +++ b/src/Magnum/DebugTools/Implementation/CylinderRendererTransformation.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/ForceRendererTransformation.h b/src/Magnum/DebugTools/Implementation/ForceRendererTransformation.h index a446e7f76..df600e784 100644 --- a/src/Magnum/DebugTools/Implementation/ForceRendererTransformation.h +++ b/src/Magnum/DebugTools/Implementation/ForceRendererTransformation.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/LineSegmentRenderer.cpp b/src/Magnum/DebugTools/Implementation/LineSegmentRenderer.cpp index 3d209abad..000de8775 100644 --- a/src/Magnum/DebugTools/Implementation/LineSegmentRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/LineSegmentRenderer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/LineSegmentRenderer.h b/src/Magnum/DebugTools/Implementation/LineSegmentRenderer.h index 80bceb9c5..64507f20f 100644 --- a/src/Magnum/DebugTools/Implementation/LineSegmentRenderer.h +++ b/src/Magnum/DebugTools/Implementation/LineSegmentRenderer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/LineSegmentRendererTransformation.h b/src/Magnum/DebugTools/Implementation/LineSegmentRendererTransformation.h index fbc01eb7c..1ea144a98 100644 --- a/src/Magnum/DebugTools/Implementation/LineSegmentRendererTransformation.h +++ b/src/Magnum/DebugTools/Implementation/LineSegmentRendererTransformation.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/PointRenderer.cpp b/src/Magnum/DebugTools/Implementation/PointRenderer.cpp index f0f87364b..b6f66839b 100644 --- a/src/Magnum/DebugTools/Implementation/PointRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/PointRenderer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/PointRenderer.h b/src/Magnum/DebugTools/Implementation/PointRenderer.h index 310ab94e7..af145f170 100644 --- a/src/Magnum/DebugTools/Implementation/PointRenderer.h +++ b/src/Magnum/DebugTools/Implementation/PointRenderer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/SphereRenderer.cpp b/src/Magnum/DebugTools/Implementation/SphereRenderer.cpp index 91d360e95..2bec5cd75 100644 --- a/src/Magnum/DebugTools/Implementation/SphereRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/SphereRenderer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Implementation/SphereRenderer.h b/src/Magnum/DebugTools/Implementation/SphereRenderer.h index a1c127d43..75d0fe361 100644 --- a/src/Magnum/DebugTools/Implementation/SphereRenderer.h +++ b/src/Magnum/DebugTools/Implementation/SphereRenderer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/ObjectRenderer.cpp b/src/Magnum/DebugTools/ObjectRenderer.cpp index fd92ac06d..7e1381b46 100644 --- a/src/Magnum/DebugTools/ObjectRenderer.cpp +++ b/src/Magnum/DebugTools/ObjectRenderer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/ObjectRenderer.h b/src/Magnum/DebugTools/ObjectRenderer.h index 45d97a53b..cc89c0fb2 100644 --- a/src/Magnum/DebugTools/ObjectRenderer.h +++ b/src/Magnum/DebugTools/ObjectRenderer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Profiler.cpp b/src/Magnum/DebugTools/Profiler.cpp index a80c426ee..93d256c69 100644 --- a/src/Magnum/DebugTools/Profiler.cpp +++ b/src/Magnum/DebugTools/Profiler.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Profiler.h b/src/Magnum/DebugTools/Profiler.h index 4f08c6606..6b0641797 100644 --- a/src/Magnum/DebugTools/Profiler.h +++ b/src/Magnum/DebugTools/Profiler.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/ResourceManager.cpp b/src/Magnum/DebugTools/ResourceManager.cpp index 578634b6d..6b1554a10 100644 --- a/src/Magnum/DebugTools/ResourceManager.cpp +++ b/src/Magnum/DebugTools/ResourceManager.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/ResourceManager.h b/src/Magnum/DebugTools/ResourceManager.h index 08afbf6dd..8d9f45068 100644 --- a/src/Magnum/DebugTools/ResourceManager.h +++ b/src/Magnum/DebugTools/ResourceManager.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/ShapeRenderer.cpp b/src/Magnum/DebugTools/ShapeRenderer.cpp index a815417ba..ecb656eb3 100644 --- a/src/Magnum/DebugTools/ShapeRenderer.cpp +++ b/src/Magnum/DebugTools/ShapeRenderer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/ShapeRenderer.h b/src/Magnum/DebugTools/ShapeRenderer.h index 19d573977..cbddf2168 100644 --- a/src/Magnum/DebugTools/ShapeRenderer.h +++ b/src/Magnum/DebugTools/ShapeRenderer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Test/CMakeLists.txt b/src/Magnum/DebugTools/Test/CMakeLists.txt index 6df4e5ea8..824ab777d 100644 --- a/src/Magnum/DebugTools/Test/CMakeLists.txt +++ b/src/Magnum/DebugTools/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Test/CapsuleRendererTest.cpp b/src/Magnum/DebugTools/Test/CapsuleRendererTest.cpp index 94c4537fe..a1f7fb7b9 100644 --- a/src/Magnum/DebugTools/Test/CapsuleRendererTest.cpp +++ b/src/Magnum/DebugTools/Test/CapsuleRendererTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Test/CylinderRendererTest.cpp b/src/Magnum/DebugTools/Test/CylinderRendererTest.cpp index eebf18980..849968d60 100644 --- a/src/Magnum/DebugTools/Test/CylinderRendererTest.cpp +++ b/src/Magnum/DebugTools/Test/CylinderRendererTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Test/ForceRendererTest.cpp b/src/Magnum/DebugTools/Test/ForceRendererTest.cpp index c07c3a7df..2d4a0c7a3 100644 --- a/src/Magnum/DebugTools/Test/ForceRendererTest.cpp +++ b/src/Magnum/DebugTools/Test/ForceRendererTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/Test/LineSegmentRendererTest.cpp b/src/Magnum/DebugTools/Test/LineSegmentRendererTest.cpp index f3f925b3e..954955292 100644 --- a/src/Magnum/DebugTools/Test/LineSegmentRendererTest.cpp +++ b/src/Magnum/DebugTools/Test/LineSegmentRendererTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DebugTools/visibility.h b/src/Magnum/DebugTools/visibility.h index 8e3c6db69..b10b6cee5 100644 --- a/src/Magnum/DebugTools/visibility.h +++ b/src/Magnum/DebugTools/visibility.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DefaultFramebuffer.cpp b/src/Magnum/DefaultFramebuffer.cpp index 1cfb524f5..c8a148676 100644 --- a/src/Magnum/DefaultFramebuffer.cpp +++ b/src/Magnum/DefaultFramebuffer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DefaultFramebuffer.h b/src/Magnum/DefaultFramebuffer.h index 5467145f9..643cbbe5f 100644 --- a/src/Magnum/DefaultFramebuffer.h +++ b/src/Magnum/DefaultFramebuffer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/DimensionTraits.h b/src/Magnum/DimensionTraits.h index 645e70f1c..7795fedd9 100644 --- a/src/Magnum/DimensionTraits.h +++ b/src/Magnum/DimensionTraits.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Extensions.h b/src/Magnum/Extensions.h index 572a6b4af..fe7d4b14d 100644 --- a/src/Magnum/Extensions.h +++ b/src/Magnum/Extensions.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Framebuffer.cpp b/src/Magnum/Framebuffer.cpp index 719273564..116ea4e9d 100644 --- a/src/Magnum/Framebuffer.cpp +++ b/src/Magnum/Framebuffer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Framebuffer.h b/src/Magnum/Framebuffer.h index 71917a63b..cd5f11373 100644 --- a/src/Magnum/Framebuffer.h +++ b/src/Magnum/Framebuffer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Image.cpp b/src/Magnum/Image.cpp index 2b94fff65..98c9cadf3 100644 --- a/src/Magnum/Image.cpp +++ b/src/Magnum/Image.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Image.h b/src/Magnum/Image.h index 55655962b..f5af9a50b 100644 --- a/src/Magnum/Image.h +++ b/src/Magnum/Image.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/ImageFormat.h b/src/Magnum/ImageFormat.h index dd8b0f5a6..9a5a9d4b9 100644 --- a/src/Magnum/ImageFormat.h +++ b/src/Magnum/ImageFormat.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/ImageReference.h b/src/Magnum/ImageReference.h index f3436652d..f4eec3f1a 100644 --- a/src/Magnum/ImageReference.h +++ b/src/Magnum/ImageReference.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/ImageView.h b/src/Magnum/ImageView.h index 8eebe93d6..cdc5067f4 100644 --- a/src/Magnum/ImageView.h +++ b/src/Magnum/ImageView.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/BufferState.cpp b/src/Magnum/Implementation/BufferState.cpp index 670481cb0..a4181ab19 100644 --- a/src/Magnum/Implementation/BufferState.cpp +++ b/src/Magnum/Implementation/BufferState.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/BufferState.h b/src/Magnum/Implementation/BufferState.h index 78501d8a6..36047a733 100644 --- a/src/Magnum/Implementation/BufferState.h +++ b/src/Magnum/Implementation/BufferState.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/DebugState.cpp b/src/Magnum/Implementation/DebugState.cpp index 772316e93..04fe5615c 100644 --- a/src/Magnum/Implementation/DebugState.cpp +++ b/src/Magnum/Implementation/DebugState.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/DebugState.h b/src/Magnum/Implementation/DebugState.h index 599332190..229473a92 100644 --- a/src/Magnum/Implementation/DebugState.h +++ b/src/Magnum/Implementation/DebugState.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/FramebufferState.cpp b/src/Magnum/Implementation/FramebufferState.cpp index 6b6ef8755..9ba1004f5 100644 --- a/src/Magnum/Implementation/FramebufferState.cpp +++ b/src/Magnum/Implementation/FramebufferState.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/FramebufferState.h b/src/Magnum/Implementation/FramebufferState.h index 55a04251e..278f87d6b 100644 --- a/src/Magnum/Implementation/FramebufferState.h +++ b/src/Magnum/Implementation/FramebufferState.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/MeshState.cpp b/src/Magnum/Implementation/MeshState.cpp index cbb48ea6c..61e2b9ae2 100644 --- a/src/Magnum/Implementation/MeshState.cpp +++ b/src/Magnum/Implementation/MeshState.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/MeshState.h b/src/Magnum/Implementation/MeshState.h index bfae9ef02..1abb2d971 100644 --- a/src/Magnum/Implementation/MeshState.h +++ b/src/Magnum/Implementation/MeshState.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/QueryState.cpp b/src/Magnum/Implementation/QueryState.cpp index 01a0932f1..2e1ca4c14 100644 --- a/src/Magnum/Implementation/QueryState.cpp +++ b/src/Magnum/Implementation/QueryState.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/QueryState.h b/src/Magnum/Implementation/QueryState.h index 377cc697b..0377e07ad 100644 --- a/src/Magnum/Implementation/QueryState.h +++ b/src/Magnum/Implementation/QueryState.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/RendererState.cpp b/src/Magnum/Implementation/RendererState.cpp index d878f7fe7..022bd1614 100644 --- a/src/Magnum/Implementation/RendererState.cpp +++ b/src/Magnum/Implementation/RendererState.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/RendererState.h b/src/Magnum/Implementation/RendererState.h index 8abb59351..3b3eb1ad4 100644 --- a/src/Magnum/Implementation/RendererState.h +++ b/src/Magnum/Implementation/RendererState.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/ShaderProgramState.cpp b/src/Magnum/Implementation/ShaderProgramState.cpp index 1508b40cd..2d16fa201 100644 --- a/src/Magnum/Implementation/ShaderProgramState.cpp +++ b/src/Magnum/Implementation/ShaderProgramState.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/ShaderProgramState.h b/src/Magnum/Implementation/ShaderProgramState.h index cc3c3cb7d..689875174 100644 --- a/src/Magnum/Implementation/ShaderProgramState.h +++ b/src/Magnum/Implementation/ShaderProgramState.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/ShaderState.h b/src/Magnum/Implementation/ShaderState.h index 725f7e239..37e3f978a 100644 --- a/src/Magnum/Implementation/ShaderState.h +++ b/src/Magnum/Implementation/ShaderState.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/State.cpp b/src/Magnum/Implementation/State.cpp index 5779529f1..3b14cbd06 100644 --- a/src/Magnum/Implementation/State.cpp +++ b/src/Magnum/Implementation/State.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/State.h b/src/Magnum/Implementation/State.h index 76a786478..1975ba37c 100644 --- a/src/Magnum/Implementation/State.h +++ b/src/Magnum/Implementation/State.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/TextureState.cpp b/src/Magnum/Implementation/TextureState.cpp index 663e70771..2e424dfb0 100644 --- a/src/Magnum/Implementation/TextureState.cpp +++ b/src/Magnum/Implementation/TextureState.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/TextureState.h b/src/Magnum/Implementation/TextureState.h index d6e637ec2..2d87a29f5 100644 --- a/src/Magnum/Implementation/TextureState.h +++ b/src/Magnum/Implementation/TextureState.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/TransformFeedbackState.h b/src/Magnum/Implementation/TransformFeedbackState.h index 225dcdf0f..93047d51a 100644 --- a/src/Magnum/Implementation/TransformFeedbackState.h +++ b/src/Magnum/Implementation/TransformFeedbackState.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/driverSpecific.cpp b/src/Magnum/Implementation/driverSpecific.cpp index f480b3805..e6840aeda 100644 --- a/src/Magnum/Implementation/driverSpecific.cpp +++ b/src/Magnum/Implementation/driverSpecific.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/maxTextureSize.cpp b/src/Magnum/Implementation/maxTextureSize.cpp index 8da698595..72ef0b763 100644 --- a/src/Magnum/Implementation/maxTextureSize.cpp +++ b/src/Magnum/Implementation/maxTextureSize.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Implementation/maxTextureSize.h b/src/Magnum/Implementation/maxTextureSize.h index 377dfe559..2e1409c24 100644 --- a/src/Magnum/Implementation/maxTextureSize.h +++ b/src/Magnum/Implementation/maxTextureSize.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Magnum.h b/src/Magnum/Magnum.h index fdd7e1ab0..39652c3ac 100644 --- a/src/Magnum/Magnum.h +++ b/src/Magnum/Magnum.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Algorithms/CMakeLists.txt b/src/Magnum/Math/Algorithms/CMakeLists.txt index 05d621b4e..06c46f8bf 100644 --- a/src/Magnum/Math/Algorithms/CMakeLists.txt +++ b/src/Magnum/Math/Algorithms/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Algorithms/GaussJordan.h b/src/Magnum/Math/Algorithms/GaussJordan.h index b00f02d27..ac6ba4a8e 100644 --- a/src/Magnum/Math/Algorithms/GaussJordan.h +++ b/src/Magnum/Math/Algorithms/GaussJordan.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Algorithms/GramSchmidt.h b/src/Magnum/Math/Algorithms/GramSchmidt.h index cc78af8e3..6d50faf2d 100644 --- a/src/Magnum/Math/Algorithms/GramSchmidt.h +++ b/src/Magnum/Math/Algorithms/GramSchmidt.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Algorithms/Svd.h b/src/Magnum/Math/Algorithms/Svd.h index e3b0e3826..514a4f274 100644 --- a/src/Magnum/Math/Algorithms/Svd.h +++ b/src/Magnum/Math/Algorithms/Svd.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Algorithms/Test/CMakeLists.txt b/src/Magnum/Math/Algorithms/Test/CMakeLists.txt index f29ac1e37..5ab52b53b 100644 --- a/src/Magnum/Math/Algorithms/Test/CMakeLists.txt +++ b/src/Magnum/Math/Algorithms/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Algorithms/Test/GaussJordanTest.cpp b/src/Magnum/Math/Algorithms/Test/GaussJordanTest.cpp index c7c6a826c..d7885d1b1 100644 --- a/src/Magnum/Math/Algorithms/Test/GaussJordanTest.cpp +++ b/src/Magnum/Math/Algorithms/Test/GaussJordanTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Algorithms/Test/GramSchmidtTest.cpp b/src/Magnum/Math/Algorithms/Test/GramSchmidtTest.cpp index 92c35a476..677347ff5 100644 --- a/src/Magnum/Math/Algorithms/Test/GramSchmidtTest.cpp +++ b/src/Magnum/Math/Algorithms/Test/GramSchmidtTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Algorithms/Test/SvdTest.cpp b/src/Magnum/Math/Algorithms/Test/SvdTest.cpp index 6cc826c27..1651166d9 100644 --- a/src/Magnum/Math/Algorithms/Test/SvdTest.cpp +++ b/src/Magnum/Math/Algorithms/Test/SvdTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Angle.h b/src/Magnum/Math/Angle.h index d791debfd..b6a0e3a8d 100644 --- a/src/Magnum/Math/Angle.h +++ b/src/Magnum/Math/Angle.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/BoolVector.h b/src/Magnum/Math/BoolVector.h index 5b509a72c..006dbff80 100644 --- a/src/Magnum/Math/BoolVector.h +++ b/src/Magnum/Math/BoolVector.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/CMakeLists.txt b/src/Magnum/Math/CMakeLists.txt index 9e4aa1c40..a39dca0ab 100644 --- a/src/Magnum/Math/CMakeLists.txt +++ b/src/Magnum/Math/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Color.h b/src/Magnum/Math/Color.h index e36c54422..98a96311d 100644 --- a/src/Magnum/Math/Color.h +++ b/src/Magnum/Math/Color.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Complex.h b/src/Magnum/Math/Complex.h index b8ac7987a..9f2d0a614 100644 --- a/src/Magnum/Math/Complex.h +++ b/src/Magnum/Math/Complex.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Constants.h b/src/Magnum/Math/Constants.h index a3f7670f6..dedc89e3d 100644 --- a/src/Magnum/Math/Constants.h +++ b/src/Magnum/Math/Constants.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Dual.h b/src/Magnum/Math/Dual.h index 5000d2fa6..5080c9b2d 100644 --- a/src/Magnum/Math/Dual.h +++ b/src/Magnum/Math/Dual.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/DualComplex.h b/src/Magnum/Math/DualComplex.h index 415f28b63..e3c445839 100644 --- a/src/Magnum/Math/DualComplex.h +++ b/src/Magnum/Math/DualComplex.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/DualQuaternion.h b/src/Magnum/Math/DualQuaternion.h index b20944114..4500613ab 100644 --- a/src/Magnum/Math/DualQuaternion.h +++ b/src/Magnum/Math/DualQuaternion.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Functions.cpp b/src/Magnum/Math/Functions.cpp index df264c893..514e2da7b 100644 --- a/src/Magnum/Math/Functions.cpp +++ b/src/Magnum/Math/Functions.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Functions.h b/src/Magnum/Math/Functions.h index bfa697ec9..cdc137185 100644 --- a/src/Magnum/Math/Functions.h +++ b/src/Magnum/Math/Functions.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Geometry/CMakeLists.txt b/src/Magnum/Math/Geometry/CMakeLists.txt index 48f1d49c7..fc075d2aa 100644 --- a/src/Magnum/Math/Geometry/CMakeLists.txt +++ b/src/Magnum/Math/Geometry/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Geometry/Distance.h b/src/Magnum/Math/Geometry/Distance.h index 7c514990b..4d8a91f2b 100644 --- a/src/Magnum/Math/Geometry/Distance.h +++ b/src/Magnum/Math/Geometry/Distance.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Geometry/Intersection.h b/src/Magnum/Math/Geometry/Intersection.h index 78ba97b9c..8777b4869 100644 --- a/src/Magnum/Math/Geometry/Intersection.h +++ b/src/Magnum/Math/Geometry/Intersection.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Geometry/Test/CMakeLists.txt b/src/Magnum/Math/Geometry/Test/CMakeLists.txt index 913b8624f..6620cd528 100644 --- a/src/Magnum/Math/Geometry/Test/CMakeLists.txt +++ b/src/Magnum/Math/Geometry/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Geometry/Test/DistanceTest.cpp b/src/Magnum/Math/Geometry/Test/DistanceTest.cpp index d5f4779cd..787936aab 100644 --- a/src/Magnum/Math/Geometry/Test/DistanceTest.cpp +++ b/src/Magnum/Math/Geometry/Test/DistanceTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Geometry/Test/IntersectionTest.cpp b/src/Magnum/Math/Geometry/Test/IntersectionTest.cpp index 39036293c..f5df68d1c 100644 --- a/src/Magnum/Math/Geometry/Test/IntersectionTest.cpp +++ b/src/Magnum/Math/Geometry/Test/IntersectionTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Math.h b/src/Magnum/Math/Math.h index 40fff93d0..f9a3d19bf 100644 --- a/src/Magnum/Math/Math.h +++ b/src/Magnum/Math/Math.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Matrix.h b/src/Magnum/Math/Matrix.h index 630240aeb..6be18b9fd 100644 --- a/src/Magnum/Math/Matrix.h +++ b/src/Magnum/Math/Matrix.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Matrix3.h b/src/Magnum/Math/Matrix3.h index 81fcc91b8..0906b4be4 100644 --- a/src/Magnum/Math/Matrix3.h +++ b/src/Magnum/Math/Matrix3.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Matrix4.h b/src/Magnum/Math/Matrix4.h index f06289805..6e30f3156 100644 --- a/src/Magnum/Math/Matrix4.h +++ b/src/Magnum/Math/Matrix4.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Quaternion.h b/src/Magnum/Math/Quaternion.h index 5a1d62a09..470f72268 100644 --- a/src/Magnum/Math/Quaternion.h +++ b/src/Magnum/Math/Quaternion.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Range.h b/src/Magnum/Math/Range.h index ba66e46e8..7b79214fb 100644 --- a/src/Magnum/Math/Range.h +++ b/src/Magnum/Math/Range.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/RectangularMatrix.h b/src/Magnum/Math/RectangularMatrix.h index 3638e06d5..544f30cc3 100644 --- a/src/Magnum/Math/RectangularMatrix.h +++ b/src/Magnum/Math/RectangularMatrix.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Swizzle.h b/src/Magnum/Math/Swizzle.h index 14da89371..2bda078e8 100644 --- a/src/Magnum/Math/Swizzle.h +++ b/src/Magnum/Math/Swizzle.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Tags.h b/src/Magnum/Math/Tags.h index f4f40091d..76e7717f2 100644 --- a/src/Magnum/Math/Tags.h +++ b/src/Magnum/Math/Tags.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/AngleTest.cpp b/src/Magnum/Math/Test/AngleTest.cpp index 70d488d28..764ee8d3c 100644 --- a/src/Magnum/Math/Test/AngleTest.cpp +++ b/src/Magnum/Math/Test/AngleTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/BoolVectorTest.cpp b/src/Magnum/Math/Test/BoolVectorTest.cpp index 1995756fb..4a6d8c78d 100644 --- a/src/Magnum/Math/Test/BoolVectorTest.cpp +++ b/src/Magnum/Math/Test/BoolVectorTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/CMakeLists.txt b/src/Magnum/Math/Test/CMakeLists.txt index 51e0f5e31..5e53b73e9 100644 --- a/src/Magnum/Math/Test/CMakeLists.txt +++ b/src/Magnum/Math/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/ColorTest.cpp b/src/Magnum/Math/Test/ColorTest.cpp index 770602039..5da2518aa 100644 --- a/src/Magnum/Math/Test/ColorTest.cpp +++ b/src/Magnum/Math/Test/ColorTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/ComplexTest.cpp b/src/Magnum/Math/Test/ComplexTest.cpp index 4232cf1f6..c24dff8d4 100644 --- a/src/Magnum/Math/Test/ComplexTest.cpp +++ b/src/Magnum/Math/Test/ComplexTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/ConstantsTest.cpp b/src/Magnum/Math/Test/ConstantsTest.cpp index 98823f9af..578efa578 100644 --- a/src/Magnum/Math/Test/ConstantsTest.cpp +++ b/src/Magnum/Math/Test/ConstantsTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/DualComplexTest.cpp b/src/Magnum/Math/Test/DualComplexTest.cpp index 5d8056d13..892f9d36c 100644 --- a/src/Magnum/Math/Test/DualComplexTest.cpp +++ b/src/Magnum/Math/Test/DualComplexTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/DualQuaternionTest.cpp b/src/Magnum/Math/Test/DualQuaternionTest.cpp index f057f5bf0..6bc0ab916 100644 --- a/src/Magnum/Math/Test/DualQuaternionTest.cpp +++ b/src/Magnum/Math/Test/DualQuaternionTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/DualTest.cpp b/src/Magnum/Math/Test/DualTest.cpp index a2bb6ca76..8eeb4aae8 100644 --- a/src/Magnum/Math/Test/DualTest.cpp +++ b/src/Magnum/Math/Test/DualTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/FunctionsTest.cpp b/src/Magnum/Math/Test/FunctionsTest.cpp index ab7b5e694..7ab9d204a 100644 --- a/src/Magnum/Math/Test/FunctionsTest.cpp +++ b/src/Magnum/Math/Test/FunctionsTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/Matrix3Test.cpp b/src/Magnum/Math/Test/Matrix3Test.cpp index 153c46c1d..be6d680e0 100644 --- a/src/Magnum/Math/Test/Matrix3Test.cpp +++ b/src/Magnum/Math/Test/Matrix3Test.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/Matrix4Test.cpp b/src/Magnum/Math/Test/Matrix4Test.cpp index c6951bcfc..3969e4817 100644 --- a/src/Magnum/Math/Test/Matrix4Test.cpp +++ b/src/Magnum/Math/Test/Matrix4Test.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/MatrixTest.cpp b/src/Magnum/Math/Test/MatrixTest.cpp index 68a1506d5..7a216e220 100644 --- a/src/Magnum/Math/Test/MatrixTest.cpp +++ b/src/Magnum/Math/Test/MatrixTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/QuaternionTest.cpp b/src/Magnum/Math/Test/QuaternionTest.cpp index 7350d90ce..4addf3c40 100644 --- a/src/Magnum/Math/Test/QuaternionTest.cpp +++ b/src/Magnum/Math/Test/QuaternionTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/RangeTest.cpp b/src/Magnum/Math/Test/RangeTest.cpp index 5fcd2c5b3..0973ab36f 100644 --- a/src/Magnum/Math/Test/RangeTest.cpp +++ b/src/Magnum/Math/Test/RangeTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/RectangularMatrixTest.cpp b/src/Magnum/Math/Test/RectangularMatrixTest.cpp index 9a7f7e434..36a496df4 100644 --- a/src/Magnum/Math/Test/RectangularMatrixTest.cpp +++ b/src/Magnum/Math/Test/RectangularMatrixTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/SwizzleTest.cpp b/src/Magnum/Math/Test/SwizzleTest.cpp index 4c051c7ec..0dd274471 100644 --- a/src/Magnum/Math/Test/SwizzleTest.cpp +++ b/src/Magnum/Math/Test/SwizzleTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/TagsTest.cpp b/src/Magnum/Math/Test/TagsTest.cpp index 0896f8cf7..8dea9c328 100644 --- a/src/Magnum/Math/Test/TagsTest.cpp +++ b/src/Magnum/Math/Test/TagsTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/TypeTraitsTest.cpp b/src/Magnum/Math/Test/TypeTraitsTest.cpp index 3acafbe85..df4a08b68 100644 --- a/src/Magnum/Math/Test/TypeTraitsTest.cpp +++ b/src/Magnum/Math/Test/TypeTraitsTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/UnitTest.cpp b/src/Magnum/Math/Test/UnitTest.cpp index 45618351b..256497e90 100644 --- a/src/Magnum/Math/Test/UnitTest.cpp +++ b/src/Magnum/Math/Test/UnitTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/Vector2Test.cpp b/src/Magnum/Math/Test/Vector2Test.cpp index eefcaa9bb..d066d8e21 100644 --- a/src/Magnum/Math/Test/Vector2Test.cpp +++ b/src/Magnum/Math/Test/Vector2Test.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/Vector3Test.cpp b/src/Magnum/Math/Test/Vector3Test.cpp index b22c6c0b7..8d53b8f79 100644 --- a/src/Magnum/Math/Test/Vector3Test.cpp +++ b/src/Magnum/Math/Test/Vector3Test.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/Vector4Test.cpp b/src/Magnum/Math/Test/Vector4Test.cpp index 2691bd915..5eff2562a 100644 --- a/src/Magnum/Math/Test/Vector4Test.cpp +++ b/src/Magnum/Math/Test/Vector4Test.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Test/VectorTest.cpp b/src/Magnum/Math/Test/VectorTest.cpp index 6966dcd9a..5ce3e22a1 100644 --- a/src/Magnum/Math/Test/VectorTest.cpp +++ b/src/Magnum/Math/Test/VectorTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/TypeTraits.h b/src/Magnum/Math/TypeTraits.h index 96d6efd5c..9c22105a9 100644 --- a/src/Magnum/Math/TypeTraits.h +++ b/src/Magnum/Math/TypeTraits.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Unit.h b/src/Magnum/Math/Unit.h index ab9002e65..840df7f47 100644 --- a/src/Magnum/Math/Unit.h +++ b/src/Magnum/Math/Unit.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Vector.h b/src/Magnum/Math/Vector.h index d0f1cdf29..cc10cccc3 100644 --- a/src/Magnum/Math/Vector.h +++ b/src/Magnum/Math/Vector.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Vector2.h b/src/Magnum/Math/Vector2.h index 44196556a..9bd0809ff 100644 --- a/src/Magnum/Math/Vector2.h +++ b/src/Magnum/Math/Vector2.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Vector3.h b/src/Magnum/Math/Vector3.h index e22f34bd6..4302c5322 100644 --- a/src/Magnum/Math/Vector3.h +++ b/src/Magnum/Math/Vector3.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/Vector4.h b/src/Magnum/Math/Vector4.h index 9f52d4eff..baf4c7ee0 100644 --- a/src/Magnum/Math/Vector4.h +++ b/src/Magnum/Math/Vector4.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/dummy.cpp b/src/Magnum/Math/dummy.cpp index 4bb556a95..454fc1bd7 100644 --- a/src/Magnum/Math/dummy.cpp +++ b/src/Magnum/Math/dummy.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Math/instantiation.cpp b/src/Magnum/Math/instantiation.cpp index 0ad1bfa12..005c0fe58 100644 --- a/src/Magnum/Math/instantiation.cpp +++ b/src/Magnum/Math/instantiation.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Mesh.cpp b/src/Magnum/Mesh.cpp index 23ae425ca..96631277f 100644 --- a/src/Magnum/Mesh.cpp +++ b/src/Magnum/Mesh.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Mesh.h b/src/Magnum/Mesh.h index b28d53861..8ae102e73 100644 --- a/src/Magnum/Mesh.h +++ b/src/Magnum/Mesh.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/CMakeLists.txt b/src/Magnum/MeshTools/CMakeLists.txt index 2a0e8f1bc..81e70c520 100644 --- a/src/Magnum/MeshTools/CMakeLists.txt +++ b/src/Magnum/MeshTools/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/CombineIndexedArrays.cpp b/src/Magnum/MeshTools/CombineIndexedArrays.cpp index 569458bc4..f1c17084d 100644 --- a/src/Magnum/MeshTools/CombineIndexedArrays.cpp +++ b/src/Magnum/MeshTools/CombineIndexedArrays.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/CombineIndexedArrays.h b/src/Magnum/MeshTools/CombineIndexedArrays.h index 9c3e92346..c7d07b114 100644 --- a/src/Magnum/MeshTools/CombineIndexedArrays.h +++ b/src/Magnum/MeshTools/CombineIndexedArrays.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Compile.cpp b/src/Magnum/MeshTools/Compile.cpp index 686edc056..86f91c44c 100644 --- a/src/Magnum/MeshTools/Compile.cpp +++ b/src/Magnum/MeshTools/Compile.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Compile.h b/src/Magnum/MeshTools/Compile.h index 408716ab8..f4567e228 100644 --- a/src/Magnum/MeshTools/Compile.h +++ b/src/Magnum/MeshTools/Compile.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/CompressIndices.cpp b/src/Magnum/MeshTools/CompressIndices.cpp index 5050264c5..a6cb88326 100644 --- a/src/Magnum/MeshTools/CompressIndices.cpp +++ b/src/Magnum/MeshTools/CompressIndices.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/CompressIndices.h b/src/Magnum/MeshTools/CompressIndices.h index 420168011..56bdab915 100644 --- a/src/Magnum/MeshTools/CompressIndices.h +++ b/src/Magnum/MeshTools/CompressIndices.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Duplicate.h b/src/Magnum/MeshTools/Duplicate.h index 1632b360e..1c118e0eb 100644 --- a/src/Magnum/MeshTools/Duplicate.h +++ b/src/Magnum/MeshTools/Duplicate.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/FlipNormals.cpp b/src/Magnum/MeshTools/FlipNormals.cpp index b471ffafd..64e9bdba1 100644 --- a/src/Magnum/MeshTools/FlipNormals.cpp +++ b/src/Magnum/MeshTools/FlipNormals.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/FlipNormals.h b/src/Magnum/MeshTools/FlipNormals.h index 15b9595f5..b6b71da20 100644 --- a/src/Magnum/MeshTools/FlipNormals.h +++ b/src/Magnum/MeshTools/FlipNormals.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/FullScreenTriangle.cpp b/src/Magnum/MeshTools/FullScreenTriangle.cpp index dac85334c..27f0baf55 100644 --- a/src/Magnum/MeshTools/FullScreenTriangle.cpp +++ b/src/Magnum/MeshTools/FullScreenTriangle.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/FullScreenTriangle.h b/src/Magnum/MeshTools/FullScreenTriangle.h index 80af496dc..c1a95a681 100644 --- a/src/Magnum/MeshTools/FullScreenTriangle.h +++ b/src/Magnum/MeshTools/FullScreenTriangle.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/GenerateFlatNormals.cpp b/src/Magnum/MeshTools/GenerateFlatNormals.cpp index 242ff0c1c..e3a054c6c 100644 --- a/src/Magnum/MeshTools/GenerateFlatNormals.cpp +++ b/src/Magnum/MeshTools/GenerateFlatNormals.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/GenerateFlatNormals.h b/src/Magnum/MeshTools/GenerateFlatNormals.h index 7b0d0e9a8..08502fcb6 100644 --- a/src/Magnum/MeshTools/GenerateFlatNormals.h +++ b/src/Magnum/MeshTools/GenerateFlatNormals.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Interleave.h b/src/Magnum/MeshTools/Interleave.h index 825dfc436..ffa639103 100644 --- a/src/Magnum/MeshTools/Interleave.h +++ b/src/Magnum/MeshTools/Interleave.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/RemoveDuplicates.h b/src/Magnum/MeshTools/RemoveDuplicates.h index 51e9e5cc5..51abf7e2a 100644 --- a/src/Magnum/MeshTools/RemoveDuplicates.h +++ b/src/Magnum/MeshTools/RemoveDuplicates.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Subdivide.h b/src/Magnum/MeshTools/Subdivide.h index 4243b239b..eca357fea 100644 --- a/src/Magnum/MeshTools/Subdivide.h +++ b/src/Magnum/MeshTools/Subdivide.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Test/CMakeLists.txt b/src/Magnum/MeshTools/Test/CMakeLists.txt index c356e075d..3472f90d4 100644 --- a/src/Magnum/MeshTools/Test/CMakeLists.txt +++ b/src/Magnum/MeshTools/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp b/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp index 2c69ead05..a3a0d5264 100644 --- a/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp +++ b/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp b/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp index 3c26c46c5..f6f0b8e72 100644 --- a/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp +++ b/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Test/DuplicateTest.cpp b/src/Magnum/MeshTools/Test/DuplicateTest.cpp index 4596cbd89..872f403d0 100644 --- a/src/Magnum/MeshTools/Test/DuplicateTest.cpp +++ b/src/Magnum/MeshTools/Test/DuplicateTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Test/FlipNormalsTest.cpp b/src/Magnum/MeshTools/Test/FlipNormalsTest.cpp index af2120bb2..93b34c458 100644 --- a/src/Magnum/MeshTools/Test/FlipNormalsTest.cpp +++ b/src/Magnum/MeshTools/Test/FlipNormalsTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Test/GenerateFlatNormalsTest.cpp b/src/Magnum/MeshTools/Test/GenerateFlatNormalsTest.cpp index 639349362..8d178bff5 100644 --- a/src/Magnum/MeshTools/Test/GenerateFlatNormalsTest.cpp +++ b/src/Magnum/MeshTools/Test/GenerateFlatNormalsTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Test/InterleaveTest.cpp b/src/Magnum/MeshTools/Test/InterleaveTest.cpp index dcc3ae5a3..3e44ce00b 100644 --- a/src/Magnum/MeshTools/Test/InterleaveTest.cpp +++ b/src/Magnum/MeshTools/Test/InterleaveTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp b/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp index 080d2e132..ca46f10f5 100644 --- a/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp +++ b/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Test/SubdivideRemoveDuplicatesBenchmark.cpp b/src/Magnum/MeshTools/Test/SubdivideRemoveDuplicatesBenchmark.cpp index 1080aa8ea..91cf0e786 100644 --- a/src/Magnum/MeshTools/Test/SubdivideRemoveDuplicatesBenchmark.cpp +++ b/src/Magnum/MeshTools/Test/SubdivideRemoveDuplicatesBenchmark.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Test/SubdivideRemoveDuplicatesBenchmark.h b/src/Magnum/MeshTools/Test/SubdivideRemoveDuplicatesBenchmark.h index 25defa16b..1d6fba46c 100644 --- a/src/Magnum/MeshTools/Test/SubdivideRemoveDuplicatesBenchmark.h +++ b/src/Magnum/MeshTools/Test/SubdivideRemoveDuplicatesBenchmark.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Test/SubdivideTest.cpp b/src/Magnum/MeshTools/Test/SubdivideTest.cpp index f966a3ea9..37a8c63b3 100644 --- a/src/Magnum/MeshTools/Test/SubdivideTest.cpp +++ b/src/Magnum/MeshTools/Test/SubdivideTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Test/TipsifyTest.cpp b/src/Magnum/MeshTools/Test/TipsifyTest.cpp index 5b36aa0e9..70171e479 100644 --- a/src/Magnum/MeshTools/Test/TipsifyTest.cpp +++ b/src/Magnum/MeshTools/Test/TipsifyTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Test/TransformTest.cpp b/src/Magnum/MeshTools/Test/TransformTest.cpp index 8af9c8a9f..6610adf27 100644 --- a/src/Magnum/MeshTools/Test/TransformTest.cpp +++ b/src/Magnum/MeshTools/Test/TransformTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Tipsify.cpp b/src/Magnum/MeshTools/Tipsify.cpp index d488de832..eac2cced0 100644 --- a/src/Magnum/MeshTools/Tipsify.cpp +++ b/src/Magnum/MeshTools/Tipsify.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Tipsify.h b/src/Magnum/MeshTools/Tipsify.h index a81761df7..b02d8a731 100644 --- a/src/Magnum/MeshTools/Tipsify.h +++ b/src/Magnum/MeshTools/Tipsify.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/Transform.h b/src/Magnum/MeshTools/Transform.h index ae5b7da2b..04589e5e1 100644 --- a/src/Magnum/MeshTools/Transform.h +++ b/src/Magnum/MeshTools/Transform.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshTools/visibility.h b/src/Magnum/MeshTools/visibility.h index 8cfda51de..b95f341cc 100644 --- a/src/Magnum/MeshTools/visibility.h +++ b/src/Magnum/MeshTools/visibility.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshView.cpp b/src/Magnum/MeshView.cpp index 2ccd072b7..3e5b8d70f 100644 --- a/src/Magnum/MeshView.cpp +++ b/src/Magnum/MeshView.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MeshView.h b/src/Magnum/MeshView.h index b135c95ec..516391fa3 100644 --- a/src/Magnum/MeshView.h +++ b/src/Magnum/MeshView.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MultisampleTexture.cpp b/src/Magnum/MultisampleTexture.cpp index f8cefc265..ac9d6d1a6 100644 --- a/src/Magnum/MultisampleTexture.cpp +++ b/src/Magnum/MultisampleTexture.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/MultisampleTexture.h b/src/Magnum/MultisampleTexture.h index 6375a9da4..52e4e4d30 100644 --- a/src/Magnum/MultisampleTexture.h +++ b/src/Magnum/MultisampleTexture.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/OpenGL.cpp b/src/Magnum/OpenGL.cpp index d2570ce83..d508fe5b2 100644 --- a/src/Magnum/OpenGL.cpp +++ b/src/Magnum/OpenGL.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/OpenGL.h b/src/Magnum/OpenGL.h index fe198c051..e6e792a13 100644 --- a/src/Magnum/OpenGL.h +++ b/src/Magnum/OpenGL.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/PixelFormat.cpp b/src/Magnum/PixelFormat.cpp index 226b6295a..7059b7a38 100644 --- a/src/Magnum/PixelFormat.cpp +++ b/src/Magnum/PixelFormat.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/PixelFormat.h b/src/Magnum/PixelFormat.h index df6a44cd5..8059779e3 100644 --- a/src/Magnum/PixelFormat.h +++ b/src/Magnum/PixelFormat.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/PixelStorage.cpp b/src/Magnum/PixelStorage.cpp index fa357da3b..704875b9b 100644 --- a/src/Magnum/PixelStorage.cpp +++ b/src/Magnum/PixelStorage.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/PixelStorage.h b/src/Magnum/PixelStorage.h index b43dd2a1d..bd8b0420c 100644 --- a/src/Magnum/PixelStorage.h +++ b/src/Magnum/PixelStorage.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/AbstractXApplication.cpp b/src/Magnum/Platform/AbstractXApplication.cpp index e5e8b090e..e360f8ef6 100644 --- a/src/Magnum/Platform/AbstractXApplication.cpp +++ b/src/Magnum/Platform/AbstractXApplication.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/AbstractXApplication.h b/src/Magnum/Platform/AbstractXApplication.h index e327d85b5..1de3e958a 100644 --- a/src/Magnum/Platform/AbstractXApplication.h +++ b/src/Magnum/Platform/AbstractXApplication.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/AndroidApplication.cpp b/src/Magnum/Platform/AndroidApplication.cpp index fc72af7ed..fadd23002 100644 --- a/src/Magnum/Platform/AndroidApplication.cpp +++ b/src/Magnum/Platform/AndroidApplication.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/AndroidApplication.h b/src/Magnum/Platform/AndroidApplication.h index 00b869e47..4e735a98c 100644 --- a/src/Magnum/Platform/AndroidApplication.h +++ b/src/Magnum/Platform/AndroidApplication.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index e65a6f5c3..1264a81c7 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/Context.h b/src/Magnum/Platform/Context.h index e34ea4405..4bb498dcc 100644 --- a/src/Magnum/Platform/Context.h +++ b/src/Magnum/Platform/Context.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/GlutApplication.cpp b/src/Magnum/Platform/GlutApplication.cpp index 7553490ef..6fd1043c6 100644 --- a/src/Magnum/Platform/GlutApplication.cpp +++ b/src/Magnum/Platform/GlutApplication.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/GlutApplication.h b/src/Magnum/Platform/GlutApplication.h index 36f813e22..718f8a153 100644 --- a/src/Magnum/Platform/GlutApplication.h +++ b/src/Magnum/Platform/GlutApplication.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/GlxApplication.cpp b/src/Magnum/Platform/GlxApplication.cpp index 63368617d..d3cb3af1d 100644 --- a/src/Magnum/Platform/GlxApplication.cpp +++ b/src/Magnum/Platform/GlxApplication.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/GlxApplication.h b/src/Magnum/Platform/GlxApplication.h index a97165be6..26b52f975 100644 --- a/src/Magnum/Platform/GlxApplication.h +++ b/src/Magnum/Platform/GlxApplication.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/Implementation/AbstractContextHandler.h b/src/Magnum/Platform/Implementation/AbstractContextHandler.h index fd2ebbc64..cc9a70e13 100644 --- a/src/Magnum/Platform/Implementation/AbstractContextHandler.h +++ b/src/Magnum/Platform/Implementation/AbstractContextHandler.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/Implementation/Egl.cpp b/src/Magnum/Platform/Implementation/Egl.cpp index 8857e1d5a..cbb9b4377 100644 --- a/src/Magnum/Platform/Implementation/Egl.cpp +++ b/src/Magnum/Platform/Implementation/Egl.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/Implementation/Egl.h b/src/Magnum/Platform/Implementation/Egl.h index 1828e4c02..0d4bb743e 100644 --- a/src/Magnum/Platform/Implementation/Egl.h +++ b/src/Magnum/Platform/Implementation/Egl.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/Implementation/EglContextHandler.cpp b/src/Magnum/Platform/Implementation/EglContextHandler.cpp index 42d7d6997..f3f182bdd 100644 --- a/src/Magnum/Platform/Implementation/EglContextHandler.cpp +++ b/src/Magnum/Platform/Implementation/EglContextHandler.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/Implementation/EglContextHandler.h b/src/Magnum/Platform/Implementation/EglContextHandler.h index c61536b68..8d5283997 100644 --- a/src/Magnum/Platform/Implementation/EglContextHandler.h +++ b/src/Magnum/Platform/Implementation/EglContextHandler.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/Implementation/GlxContextHandler.cpp b/src/Magnum/Platform/Implementation/GlxContextHandler.cpp index 6a2265610..9df50d742 100644 --- a/src/Magnum/Platform/Implementation/GlxContextHandler.cpp +++ b/src/Magnum/Platform/Implementation/GlxContextHandler.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/Implementation/GlxContextHandler.h b/src/Magnum/Platform/Implementation/GlxContextHandler.h index d86a5f4bd..fb6a7450b 100644 --- a/src/Magnum/Platform/Implementation/GlxContextHandler.h +++ b/src/Magnum/Platform/Implementation/GlxContextHandler.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.cpp b/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.cpp index c96476fe0..61a2553d8 100644 --- a/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.cpp +++ b/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.h b/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.h index 9b2cb260a..250a66341 100644 --- a/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.h +++ b/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/NaClApplication.cpp b/src/Magnum/Platform/NaClApplication.cpp index 8cc096abc..9dafcd8c9 100644 --- a/src/Magnum/Platform/NaClApplication.cpp +++ b/src/Magnum/Platform/NaClApplication.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/NaClApplication.h b/src/Magnum/Platform/NaClApplication.h index 50435637b..5cd9beae3 100644 --- a/src/Magnum/Platform/NaClApplication.h +++ b/src/Magnum/Platform/NaClApplication.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/Platform.h b/src/Magnum/Platform/Platform.h index ebb547c33..8dea4928e 100644 --- a/src/Magnum/Platform/Platform.h +++ b/src/Magnum/Platform/Platform.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/Screen.h b/src/Magnum/Platform/Screen.h index 703cd0696..8d54f3c0e 100644 --- a/src/Magnum/Platform/Screen.h +++ b/src/Magnum/Platform/Screen.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/ScreenedApplication.h b/src/Magnum/Platform/ScreenedApplication.h index 0db54e05b..ae664823f 100644 --- a/src/Magnum/Platform/ScreenedApplication.h +++ b/src/Magnum/Platform/ScreenedApplication.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/ScreenedApplication.hpp b/src/Magnum/Platform/ScreenedApplication.hpp index da2a7b139..ef4abb1b2 100644 --- a/src/Magnum/Platform/ScreenedApplication.hpp +++ b/src/Magnum/Platform/ScreenedApplication.hpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 98c9fcc9e..8665ee508 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index a4dd01d3c..be4ad3934 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/WindowlessCglApplication.cpp b/src/Magnum/Platform/WindowlessCglApplication.cpp index 9e1474984..49140e99b 100644 --- a/src/Magnum/Platform/WindowlessCglApplication.cpp +++ b/src/Magnum/Platform/WindowlessCglApplication.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Copyright © 2013 Copyright © 2014 Travis Watkins diff --git a/src/Magnum/Platform/WindowlessCglApplication.h b/src/Magnum/Platform/WindowlessCglApplication.h index bf0005561..374fa864c 100644 --- a/src/Magnum/Platform/WindowlessCglApplication.h +++ b/src/Magnum/Platform/WindowlessCglApplication.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Copyright © 2013 Copyright © 2014 Travis Watkins diff --git a/src/Magnum/Platform/WindowlessGlxApplication.cpp b/src/Magnum/Platform/WindowlessGlxApplication.cpp index a17ec3168..0e1379eee 100644 --- a/src/Magnum/Platform/WindowlessGlxApplication.cpp +++ b/src/Magnum/Platform/WindowlessGlxApplication.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/WindowlessGlxApplication.h b/src/Magnum/Platform/WindowlessGlxApplication.h index d803bda5b..963f02742 100644 --- a/src/Magnum/Platform/WindowlessGlxApplication.h +++ b/src/Magnum/Platform/WindowlessGlxApplication.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/WindowlessNaClApplication.cpp b/src/Magnum/Platform/WindowlessNaClApplication.cpp index 9e34589c6..fd4194d33 100644 --- a/src/Magnum/Platform/WindowlessNaClApplication.cpp +++ b/src/Magnum/Platform/WindowlessNaClApplication.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/WindowlessNaClApplication.h b/src/Magnum/Platform/WindowlessNaClApplication.h index cbdcd0600..1156a16dd 100644 --- a/src/Magnum/Platform/WindowlessNaClApplication.h +++ b/src/Magnum/Platform/WindowlessNaClApplication.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/WindowlessWglApplication.cpp b/src/Magnum/Platform/WindowlessWglApplication.cpp index eb10cb980..e2b99aa62 100644 --- a/src/Magnum/Platform/WindowlessWglApplication.cpp +++ b/src/Magnum/Platform/WindowlessWglApplication.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/WindowlessWglApplication.h b/src/Magnum/Platform/WindowlessWglApplication.h index e52611421..610e670b1 100644 --- a/src/Magnum/Platform/WindowlessWglApplication.h +++ b/src/Magnum/Platform/WindowlessWglApplication.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/WindowlessWindowsEglApplication.cpp b/src/Magnum/Platform/WindowlessWindowsEglApplication.cpp index 666fdaeb7..432274a8f 100644 --- a/src/Magnum/Platform/WindowlessWindowsEglApplication.cpp +++ b/src/Magnum/Platform/WindowlessWindowsEglApplication.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/WindowlessWindowsEglApplication.h b/src/Magnum/Platform/WindowlessWindowsEglApplication.h index 11a0690f2..78dd221ae 100644 --- a/src/Magnum/Platform/WindowlessWindowsEglApplication.h +++ b/src/Magnum/Platform/WindowlessWindowsEglApplication.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/XEglApplication.cpp b/src/Magnum/Platform/XEglApplication.cpp index 3f4818512..f250c9452 100644 --- a/src/Magnum/Platform/XEglApplication.cpp +++ b/src/Magnum/Platform/XEglApplication.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/XEglApplication.h b/src/Magnum/Platform/XEglApplication.h index 83d9bad0b..d96c4fbab 100644 --- a/src/Magnum/Platform/XEglApplication.h +++ b/src/Magnum/Platform/XEglApplication.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index 2771eac8f..bef644ed0 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/PrimitiveQuery.h b/src/Magnum/PrimitiveQuery.h index f06724eea..0e84eba61 100644 --- a/src/Magnum/PrimitiveQuery.h +++ b/src/Magnum/PrimitiveQuery.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/CMakeLists.txt b/src/Magnum/Primitives/CMakeLists.txt index c4aa1d895..a83344a2d 100644 --- a/src/Magnum/Primitives/CMakeLists.txt +++ b/src/Magnum/Primitives/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Capsule.cpp b/src/Magnum/Primitives/Capsule.cpp index 17077f80f..54f8d4984 100644 --- a/src/Magnum/Primitives/Capsule.cpp +++ b/src/Magnum/Primitives/Capsule.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Capsule.h b/src/Magnum/Primitives/Capsule.h index 5558a2191..26c01f0fb 100644 --- a/src/Magnum/Primitives/Capsule.h +++ b/src/Magnum/Primitives/Capsule.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Circle.cpp b/src/Magnum/Primitives/Circle.cpp index e561d16d0..862d69522 100644 --- a/src/Magnum/Primitives/Circle.cpp +++ b/src/Magnum/Primitives/Circle.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Circle.h b/src/Magnum/Primitives/Circle.h index 67038c8f7..c0574b5e5 100644 --- a/src/Magnum/Primitives/Circle.h +++ b/src/Magnum/Primitives/Circle.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Crosshair.cpp b/src/Magnum/Primitives/Crosshair.cpp index bb5d4d547..916a25aee 100644 --- a/src/Magnum/Primitives/Crosshair.cpp +++ b/src/Magnum/Primitives/Crosshair.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Crosshair.h b/src/Magnum/Primitives/Crosshair.h index 91de70d5b..345a6b88d 100644 --- a/src/Magnum/Primitives/Crosshair.h +++ b/src/Magnum/Primitives/Crosshair.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Cube.cpp b/src/Magnum/Primitives/Cube.cpp index 28611ac02..1e03ab33d 100644 --- a/src/Magnum/Primitives/Cube.cpp +++ b/src/Magnum/Primitives/Cube.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Cube.h b/src/Magnum/Primitives/Cube.h index 568eb887f..7da2dbd68 100644 --- a/src/Magnum/Primitives/Cube.h +++ b/src/Magnum/Primitives/Cube.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Cylinder.cpp b/src/Magnum/Primitives/Cylinder.cpp index b656132c4..62b11c221 100644 --- a/src/Magnum/Primitives/Cylinder.cpp +++ b/src/Magnum/Primitives/Cylinder.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Cylinder.h b/src/Magnum/Primitives/Cylinder.h index 52c963b35..71bade368 100644 --- a/src/Magnum/Primitives/Cylinder.h +++ b/src/Magnum/Primitives/Cylinder.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Icosphere.cpp b/src/Magnum/Primitives/Icosphere.cpp index 5f26b8764..a4c785c2c 100644 --- a/src/Magnum/Primitives/Icosphere.cpp +++ b/src/Magnum/Primitives/Icosphere.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Icosphere.h b/src/Magnum/Primitives/Icosphere.h index 15af7153c..d4be14e96 100644 --- a/src/Magnum/Primitives/Icosphere.h +++ b/src/Magnum/Primitives/Icosphere.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Implementation/Spheroid.cpp b/src/Magnum/Primitives/Implementation/Spheroid.cpp index fe7c964b2..beb376554 100644 --- a/src/Magnum/Primitives/Implementation/Spheroid.cpp +++ b/src/Magnum/Primitives/Implementation/Spheroid.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Implementation/Spheroid.h b/src/Magnum/Primitives/Implementation/Spheroid.h index 0a1b5d6ff..91bc5e408 100644 --- a/src/Magnum/Primitives/Implementation/Spheroid.h +++ b/src/Magnum/Primitives/Implementation/Spheroid.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Implementation/WireframeSpheroid.cpp b/src/Magnum/Primitives/Implementation/WireframeSpheroid.cpp index e0815d1da..296be2ff3 100644 --- a/src/Magnum/Primitives/Implementation/WireframeSpheroid.cpp +++ b/src/Magnum/Primitives/Implementation/WireframeSpheroid.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Implementation/WireframeSpheroid.h b/src/Magnum/Primitives/Implementation/WireframeSpheroid.h index 090451b78..500ba47b2 100644 --- a/src/Magnum/Primitives/Implementation/WireframeSpheroid.h +++ b/src/Magnum/Primitives/Implementation/WireframeSpheroid.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Line.cpp b/src/Magnum/Primitives/Line.cpp index e346fa437..f7637a95e 100644 --- a/src/Magnum/Primitives/Line.cpp +++ b/src/Magnum/Primitives/Line.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Line.h b/src/Magnum/Primitives/Line.h index f928aac98..306fe6362 100644 --- a/src/Magnum/Primitives/Line.h +++ b/src/Magnum/Primitives/Line.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Plane.cpp b/src/Magnum/Primitives/Plane.cpp index bd7bc34fd..d947ba4a5 100644 --- a/src/Magnum/Primitives/Plane.cpp +++ b/src/Magnum/Primitives/Plane.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Plane.h b/src/Magnum/Primitives/Plane.h index 60840d147..c8b8e9bed 100644 --- a/src/Magnum/Primitives/Plane.h +++ b/src/Magnum/Primitives/Plane.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Square.cpp b/src/Magnum/Primitives/Square.cpp index 8a1da86bd..7e29212ae 100644 --- a/src/Magnum/Primitives/Square.cpp +++ b/src/Magnum/Primitives/Square.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Square.h b/src/Magnum/Primitives/Square.h index 257fa560f..15964d0f6 100644 --- a/src/Magnum/Primitives/Square.h +++ b/src/Magnum/Primitives/Square.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Test/CMakeLists.txt b/src/Magnum/Primitives/Test/CMakeLists.txt index 466de17bd..8e1f8857a 100644 --- a/src/Magnum/Primitives/Test/CMakeLists.txt +++ b/src/Magnum/Primitives/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Test/CapsuleTest.cpp b/src/Magnum/Primitives/Test/CapsuleTest.cpp index 34595ac19..8986cfc71 100644 --- a/src/Magnum/Primitives/Test/CapsuleTest.cpp +++ b/src/Magnum/Primitives/Test/CapsuleTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Test/CircleTest.cpp b/src/Magnum/Primitives/Test/CircleTest.cpp index f90598aed..f94fea571 100644 --- a/src/Magnum/Primitives/Test/CircleTest.cpp +++ b/src/Magnum/Primitives/Test/CircleTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Test/CylinderTest.cpp b/src/Magnum/Primitives/Test/CylinderTest.cpp index 6a95fe870..7a1070482 100644 --- a/src/Magnum/Primitives/Test/CylinderTest.cpp +++ b/src/Magnum/Primitives/Test/CylinderTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Test/IcosphereTest.cpp b/src/Magnum/Primitives/Test/IcosphereTest.cpp index e9fa0e617..a87d66c1a 100644 --- a/src/Magnum/Primitives/Test/IcosphereTest.cpp +++ b/src/Magnum/Primitives/Test/IcosphereTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/Test/UVSphereTest.cpp b/src/Magnum/Primitives/Test/UVSphereTest.cpp index ac827677c..d795ea8bd 100644 --- a/src/Magnum/Primitives/Test/UVSphereTest.cpp +++ b/src/Magnum/Primitives/Test/UVSphereTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/UVSphere.cpp b/src/Magnum/Primitives/UVSphere.cpp index b5cf66fca..943a4cde5 100644 --- a/src/Magnum/Primitives/UVSphere.cpp +++ b/src/Magnum/Primitives/UVSphere.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/UVSphere.h b/src/Magnum/Primitives/UVSphere.h index 309322d7f..c88012f89 100644 --- a/src/Magnum/Primitives/UVSphere.h +++ b/src/Magnum/Primitives/UVSphere.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Primitives/visibility.h b/src/Magnum/Primitives/visibility.h index 490479881..72de4fd4b 100644 --- a/src/Magnum/Primitives/visibility.h +++ b/src/Magnum/Primitives/visibility.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Query.h b/src/Magnum/Query.h index 09861256b..4cf79a22d 100644 --- a/src/Magnum/Query.h +++ b/src/Magnum/Query.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/RectangleTexture.cpp b/src/Magnum/RectangleTexture.cpp index e4dbd54f3..1d5916e36 100644 --- a/src/Magnum/RectangleTexture.cpp +++ b/src/Magnum/RectangleTexture.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/RectangleTexture.h b/src/Magnum/RectangleTexture.h index 94544818d..c7c5f377f 100644 --- a/src/Magnum/RectangleTexture.h +++ b/src/Magnum/RectangleTexture.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Renderbuffer.cpp b/src/Magnum/Renderbuffer.cpp index 81ecc492c..6a090d29e 100644 --- a/src/Magnum/Renderbuffer.cpp +++ b/src/Magnum/Renderbuffer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Renderbuffer.h b/src/Magnum/Renderbuffer.h index eac272558..0569f1046 100644 --- a/src/Magnum/Renderbuffer.h +++ b/src/Magnum/Renderbuffer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/RenderbufferFormat.h b/src/Magnum/RenderbufferFormat.h index 5e1c5e4bd..dc3088e4e 100644 --- a/src/Magnum/RenderbufferFormat.h +++ b/src/Magnum/RenderbufferFormat.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Renderer.cpp b/src/Magnum/Renderer.cpp index 8480d9854..fba5e0ec1 100644 --- a/src/Magnum/Renderer.cpp +++ b/src/Magnum/Renderer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Renderer.h b/src/Magnum/Renderer.h index 28cdde286..4b1f25d8d 100644 --- a/src/Magnum/Renderer.h +++ b/src/Magnum/Renderer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Resource.cpp b/src/Magnum/Resource.cpp index 2fc5c9d11..8106b18ed 100644 --- a/src/Magnum/Resource.cpp +++ b/src/Magnum/Resource.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Resource.h b/src/Magnum/Resource.h index 7738c8d2a..febe51204 100644 --- a/src/Magnum/Resource.h +++ b/src/Magnum/Resource.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/ResourceManager.h b/src/Magnum/ResourceManager.h index 43e95be60..732b11536 100644 --- a/src/Magnum/ResourceManager.h +++ b/src/Magnum/ResourceManager.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/ResourceManager.hpp b/src/Magnum/ResourceManager.hpp index 16b7f2127..d0fc54225 100644 --- a/src/Magnum/ResourceManager.hpp +++ b/src/Magnum/ResourceManager.hpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SampleQuery.h b/src/Magnum/SampleQuery.h index adb80dc55..00432c687 100644 --- a/src/Magnum/SampleQuery.h +++ b/src/Magnum/SampleQuery.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Sampler.cpp b/src/Magnum/Sampler.cpp index 208d95386..e2a8fee14 100644 --- a/src/Magnum/Sampler.cpp +++ b/src/Magnum/Sampler.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Sampler.h b/src/Magnum/Sampler.h index 3e71bc240..a8386d723 100644 --- a/src/Magnum/Sampler.h +++ b/src/Magnum/Sampler.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/AbstractCamera.h b/src/Magnum/SceneGraph/AbstractCamera.h index 75c685393..698ece77a 100644 --- a/src/Magnum/SceneGraph/AbstractCamera.h +++ b/src/Magnum/SceneGraph/AbstractCamera.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/AbstractCamera.hpp b/src/Magnum/SceneGraph/AbstractCamera.hpp index 4a22b3028..8907dbf60 100644 --- a/src/Magnum/SceneGraph/AbstractCamera.hpp +++ b/src/Magnum/SceneGraph/AbstractCamera.hpp @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/AbstractFeature.h b/src/Magnum/SceneGraph/AbstractFeature.h index 5c9a7c48d..03633d50d 100644 --- a/src/Magnum/SceneGraph/AbstractFeature.h +++ b/src/Magnum/SceneGraph/AbstractFeature.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/AbstractFeature.hpp b/src/Magnum/SceneGraph/AbstractFeature.hpp index 0794121cf..00ad7fee4 100644 --- a/src/Magnum/SceneGraph/AbstractFeature.hpp +++ b/src/Magnum/SceneGraph/AbstractFeature.hpp @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/AbstractGroupedFeature.h b/src/Magnum/SceneGraph/AbstractGroupedFeature.h index 99ef67113..3a728751a 100644 --- a/src/Magnum/SceneGraph/AbstractGroupedFeature.h +++ b/src/Magnum/SceneGraph/AbstractGroupedFeature.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/AbstractObject.h b/src/Magnum/SceneGraph/AbstractObject.h index 305543e5a..4f0c60adf 100644 --- a/src/Magnum/SceneGraph/AbstractObject.h +++ b/src/Magnum/SceneGraph/AbstractObject.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/AbstractTransformation.h b/src/Magnum/SceneGraph/AbstractTransformation.h index 9b910445c..029634cd1 100644 --- a/src/Magnum/SceneGraph/AbstractTransformation.h +++ b/src/Magnum/SceneGraph/AbstractTransformation.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/AbstractTranslation.h b/src/Magnum/SceneGraph/AbstractTranslation.h index 5ba25e5f8..834a3dfb4 100644 --- a/src/Magnum/SceneGraph/AbstractTranslation.h +++ b/src/Magnum/SceneGraph/AbstractTranslation.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/AbstractTranslationRotation2D.h b/src/Magnum/SceneGraph/AbstractTranslationRotation2D.h index 4111d0cc8..f5a7bf747 100644 --- a/src/Magnum/SceneGraph/AbstractTranslationRotation2D.h +++ b/src/Magnum/SceneGraph/AbstractTranslationRotation2D.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/AbstractTranslationRotation3D.h b/src/Magnum/SceneGraph/AbstractTranslationRotation3D.h index 395861ac4..72a3bdef3 100644 --- a/src/Magnum/SceneGraph/AbstractTranslationRotation3D.h +++ b/src/Magnum/SceneGraph/AbstractTranslationRotation3D.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/AbstractTranslationRotationScaling2D.h b/src/Magnum/SceneGraph/AbstractTranslationRotationScaling2D.h index fc2341825..e7a04425e 100644 --- a/src/Magnum/SceneGraph/AbstractTranslationRotationScaling2D.h +++ b/src/Magnum/SceneGraph/AbstractTranslationRotationScaling2D.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/AbstractTranslationRotationScaling3D.h b/src/Magnum/SceneGraph/AbstractTranslationRotationScaling3D.h index 885013e98..f8078b880 100644 --- a/src/Magnum/SceneGraph/AbstractTranslationRotationScaling3D.h +++ b/src/Magnum/SceneGraph/AbstractTranslationRotationScaling3D.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Animable.cpp b/src/Magnum/SceneGraph/Animable.cpp index 7e537e387..4ea4ce845 100644 --- a/src/Magnum/SceneGraph/Animable.cpp +++ b/src/Magnum/SceneGraph/Animable.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Animable.h b/src/Magnum/SceneGraph/Animable.h index 4e1df2a3c..123bb31e0 100644 --- a/src/Magnum/SceneGraph/Animable.h +++ b/src/Magnum/SceneGraph/Animable.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Animable.hpp b/src/Magnum/SceneGraph/Animable.hpp index f714d32a6..dc9b71031 100644 --- a/src/Magnum/SceneGraph/Animable.hpp +++ b/src/Magnum/SceneGraph/Animable.hpp @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/AnimableGroup.h b/src/Magnum/SceneGraph/AnimableGroup.h index b3a29d650..30a8af94e 100644 --- a/src/Magnum/SceneGraph/AnimableGroup.h +++ b/src/Magnum/SceneGraph/AnimableGroup.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/CMakeLists.txt b/src/Magnum/SceneGraph/CMakeLists.txt index bb5dfddfe..8240cd655 100644 --- a/src/Magnum/SceneGraph/CMakeLists.txt +++ b/src/Magnum/SceneGraph/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Camera.h b/src/Magnum/SceneGraph/Camera.h index 0935bb817..13edca414 100644 --- a/src/Magnum/SceneGraph/Camera.h +++ b/src/Magnum/SceneGraph/Camera.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Camera.hpp b/src/Magnum/SceneGraph/Camera.hpp index 1a7e64acc..a176ada83 100644 --- a/src/Magnum/SceneGraph/Camera.hpp +++ b/src/Magnum/SceneGraph/Camera.hpp @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Camera2D.h b/src/Magnum/SceneGraph/Camera2D.h index d4cb8f191..8cd3fefd1 100644 --- a/src/Magnum/SceneGraph/Camera2D.h +++ b/src/Magnum/SceneGraph/Camera2D.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Camera2D.hpp b/src/Magnum/SceneGraph/Camera2D.hpp index aaf908964..81c7eae67 100644 --- a/src/Magnum/SceneGraph/Camera2D.hpp +++ b/src/Magnum/SceneGraph/Camera2D.hpp @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Camera3D.h b/src/Magnum/SceneGraph/Camera3D.h index 11703ff70..44ffac7c2 100644 --- a/src/Magnum/SceneGraph/Camera3D.h +++ b/src/Magnum/SceneGraph/Camera3D.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Camera3D.hpp b/src/Magnum/SceneGraph/Camera3D.hpp index 4449e49c6..ef1aebc91 100644 --- a/src/Magnum/SceneGraph/Camera3D.hpp +++ b/src/Magnum/SceneGraph/Camera3D.hpp @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Drawable.h b/src/Magnum/SceneGraph/Drawable.h index 3f1d8ff0f..cb4755f85 100644 --- a/src/Magnum/SceneGraph/Drawable.h +++ b/src/Magnum/SceneGraph/Drawable.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Drawable.hpp b/src/Magnum/SceneGraph/Drawable.hpp index 1800c80c5..2ba02f574 100644 --- a/src/Magnum/SceneGraph/Drawable.hpp +++ b/src/Magnum/SceneGraph/Drawable.hpp @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/DualComplexTransformation.h b/src/Magnum/SceneGraph/DualComplexTransformation.h index 6ead059a0..1df8a21d1 100644 --- a/src/Magnum/SceneGraph/DualComplexTransformation.h +++ b/src/Magnum/SceneGraph/DualComplexTransformation.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/DualQuaternionTransformation.h b/src/Magnum/SceneGraph/DualQuaternionTransformation.h index 44f2c2397..364a87569 100644 --- a/src/Magnum/SceneGraph/DualQuaternionTransformation.h +++ b/src/Magnum/SceneGraph/DualQuaternionTransformation.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/FeatureGroup.h b/src/Magnum/SceneGraph/FeatureGroup.h index 49bbfea73..ee162003e 100644 --- a/src/Magnum/SceneGraph/FeatureGroup.h +++ b/src/Magnum/SceneGraph/FeatureGroup.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/FeatureGroup.hpp b/src/Magnum/SceneGraph/FeatureGroup.hpp index 8b5f86a5f..ebbe86e85 100644 --- a/src/Magnum/SceneGraph/FeatureGroup.hpp +++ b/src/Magnum/SceneGraph/FeatureGroup.hpp @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/MatrixTransformation2D.h b/src/Magnum/SceneGraph/MatrixTransformation2D.h index 79fce8b85..680c35f6a 100644 --- a/src/Magnum/SceneGraph/MatrixTransformation2D.h +++ b/src/Magnum/SceneGraph/MatrixTransformation2D.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/MatrixTransformation3D.h b/src/Magnum/SceneGraph/MatrixTransformation3D.h index 1528372d4..6dca54140 100644 --- a/src/Magnum/SceneGraph/MatrixTransformation3D.h +++ b/src/Magnum/SceneGraph/MatrixTransformation3D.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Object.h b/src/Magnum/SceneGraph/Object.h index 26913b822..dbc4497ee 100644 --- a/src/Magnum/SceneGraph/Object.h +++ b/src/Magnum/SceneGraph/Object.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Object.hpp b/src/Magnum/SceneGraph/Object.hpp index 74bea0352..e3ceaeaa4 100644 --- a/src/Magnum/SceneGraph/Object.hpp +++ b/src/Magnum/SceneGraph/Object.hpp @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/RigidMatrixTransformation2D.h b/src/Magnum/SceneGraph/RigidMatrixTransformation2D.h index b0f7f1e60..81a55b41a 100644 --- a/src/Magnum/SceneGraph/RigidMatrixTransformation2D.h +++ b/src/Magnum/SceneGraph/RigidMatrixTransformation2D.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/RigidMatrixTransformation3D.h b/src/Magnum/SceneGraph/RigidMatrixTransformation3D.h index 443299fc6..4d73c01e1 100644 --- a/src/Magnum/SceneGraph/RigidMatrixTransformation3D.h +++ b/src/Magnum/SceneGraph/RigidMatrixTransformation3D.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Scene.h b/src/Magnum/SceneGraph/Scene.h index b6475e285..8232078fe 100644 --- a/src/Magnum/SceneGraph/Scene.h +++ b/src/Magnum/SceneGraph/Scene.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/SceneGraph.h b/src/Magnum/SceneGraph/SceneGraph.h index 262747542..7b4e292b2 100644 --- a/src/Magnum/SceneGraph/SceneGraph.h +++ b/src/Magnum/SceneGraph/SceneGraph.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Test/AnimableTest.cpp b/src/Magnum/SceneGraph/Test/AnimableTest.cpp index 5b207d60d..844cc2090 100644 --- a/src/Magnum/SceneGraph/Test/AnimableTest.cpp +++ b/src/Magnum/SceneGraph/Test/AnimableTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Test/CMakeLists.txt b/src/Magnum/SceneGraph/Test/CMakeLists.txt index fa2e0934f..aa7b7241a 100644 --- a/src/Magnum/SceneGraph/Test/CMakeLists.txt +++ b/src/Magnum/SceneGraph/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Test/CameraTest.cpp b/src/Magnum/SceneGraph/Test/CameraTest.cpp index 7d0ea7ea4..5a42218e6 100644 --- a/src/Magnum/SceneGraph/Test/CameraTest.cpp +++ b/src/Magnum/SceneGraph/Test/CameraTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp b/src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp index 572229231..7bdcbc9f5 100644 --- a/src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp +++ b/src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Test/DualQuaternionTransformationTest.cpp b/src/Magnum/SceneGraph/Test/DualQuaternionTransformationTest.cpp index c0298b37d..fb931d98a 100644 --- a/src/Magnum/SceneGraph/Test/DualQuaternionTransformationTest.cpp +++ b/src/Magnum/SceneGraph/Test/DualQuaternionTransformationTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Test/MatrixTransformation2DTest.cpp b/src/Magnum/SceneGraph/Test/MatrixTransformation2DTest.cpp index fd0ebae72..11a83204f 100644 --- a/src/Magnum/SceneGraph/Test/MatrixTransformation2DTest.cpp +++ b/src/Magnum/SceneGraph/Test/MatrixTransformation2DTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Test/MatrixTransformation3DTest.cpp b/src/Magnum/SceneGraph/Test/MatrixTransformation3DTest.cpp index 0ccd9c71d..fef5c236e 100644 --- a/src/Magnum/SceneGraph/Test/MatrixTransformation3DTest.cpp +++ b/src/Magnum/SceneGraph/Test/MatrixTransformation3DTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Test/ObjectTest.cpp b/src/Magnum/SceneGraph/Test/ObjectTest.cpp index 87447e7fe..329e2eee6 100644 --- a/src/Magnum/SceneGraph/Test/ObjectTest.cpp +++ b/src/Magnum/SceneGraph/Test/ObjectTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Test/RigidMatrixTransformation2DTest.cpp b/src/Magnum/SceneGraph/Test/RigidMatrixTransformation2DTest.cpp index c1914fbfe..5896807d1 100644 --- a/src/Magnum/SceneGraph/Test/RigidMatrixTransformation2DTest.cpp +++ b/src/Magnum/SceneGraph/Test/RigidMatrixTransformation2DTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Test/RigidMatrixTransformation3DTest.cpp b/src/Magnum/SceneGraph/Test/RigidMatrixTransformation3DTest.cpp index f1c3c8ddb..8306fd3ac 100644 --- a/src/Magnum/SceneGraph/Test/RigidMatrixTransformation3DTest.cpp +++ b/src/Magnum/SceneGraph/Test/RigidMatrixTransformation3DTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Test/SceneTest.cpp b/src/Magnum/SceneGraph/Test/SceneTest.cpp index e646f1ff8..c6f1aa2f6 100644 --- a/src/Magnum/SceneGraph/Test/SceneTest.cpp +++ b/src/Magnum/SceneGraph/Test/SceneTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp b/src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp index ada40127a..e14887ca4 100644 --- a/src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp +++ b/src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/TranslationTransformation.h b/src/Magnum/SceneGraph/TranslationTransformation.h index fee2f699d..c0b140391 100644 --- a/src/Magnum/SceneGraph/TranslationTransformation.h +++ b/src/Magnum/SceneGraph/TranslationTransformation.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/instantiation.cpp b/src/Magnum/SceneGraph/instantiation.cpp index 44afe9799..61ee0e200 100644 --- a/src/Magnum/SceneGraph/instantiation.cpp +++ b/src/Magnum/SceneGraph/instantiation.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/SceneGraph/visibility.h b/src/Magnum/SceneGraph/visibility.h index ffe2e0cef..b7f026ef4 100644 --- a/src/Magnum/SceneGraph/visibility.h +++ b/src/Magnum/SceneGraph/visibility.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shader.cpp b/src/Magnum/Shader.cpp index 1d5a3f45b..694b60e36 100644 --- a/src/Magnum/Shader.cpp +++ b/src/Magnum/Shader.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shader.h b/src/Magnum/Shader.h index 146debd7f..67347eaa7 100644 --- a/src/Magnum/Shader.h +++ b/src/Magnum/Shader.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/AbstractVector.cpp b/src/Magnum/Shaders/AbstractVector.cpp index 6ff6104bc..43fa726a7 100644 --- a/src/Magnum/Shaders/AbstractVector.cpp +++ b/src/Magnum/Shaders/AbstractVector.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/AbstractVector.h b/src/Magnum/Shaders/AbstractVector.h index d643f2148..bb5f796d5 100644 --- a/src/Magnum/Shaders/AbstractVector.h +++ b/src/Magnum/Shaders/AbstractVector.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/AbstractVector2D.vert b/src/Magnum/Shaders/AbstractVector2D.vert index abf05e9f1..1253bcc6e 100644 --- a/src/Magnum/Shaders/AbstractVector2D.vert +++ b/src/Magnum/Shaders/AbstractVector2D.vert @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/AbstractVector3D.vert b/src/Magnum/Shaders/AbstractVector3D.vert index e30d1b3ee..9e9855c45 100644 --- a/src/Magnum/Shaders/AbstractVector3D.vert +++ b/src/Magnum/Shaders/AbstractVector3D.vert @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/CMakeLists.txt b/src/Magnum/Shaders/CMakeLists.txt index 5c90a1a2b..9db9aad8f 100644 --- a/src/Magnum/Shaders/CMakeLists.txt +++ b/src/Magnum/Shaders/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/DistanceFieldVector.cpp b/src/Magnum/Shaders/DistanceFieldVector.cpp index c45541ce2..2e308eb20 100644 --- a/src/Magnum/Shaders/DistanceFieldVector.cpp +++ b/src/Magnum/Shaders/DistanceFieldVector.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/DistanceFieldVector.frag b/src/Magnum/Shaders/DistanceFieldVector.frag index 02da7fa75..cf18ad2b9 100644 --- a/src/Magnum/Shaders/DistanceFieldVector.frag +++ b/src/Magnum/Shaders/DistanceFieldVector.frag @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/DistanceFieldVector.h b/src/Magnum/Shaders/DistanceFieldVector.h index e66b73269..3b9298fff 100644 --- a/src/Magnum/Shaders/DistanceFieldVector.h +++ b/src/Magnum/Shaders/DistanceFieldVector.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Flat.cpp b/src/Magnum/Shaders/Flat.cpp index 0a791fa0e..4249a174c 100644 --- a/src/Magnum/Shaders/Flat.cpp +++ b/src/Magnum/Shaders/Flat.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Flat.frag b/src/Magnum/Shaders/Flat.frag index 847a7c129..daf4115e8 100644 --- a/src/Magnum/Shaders/Flat.frag +++ b/src/Magnum/Shaders/Flat.frag @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Flat.h b/src/Magnum/Shaders/Flat.h index bf8c1a85c..917c315e7 100644 --- a/src/Magnum/Shaders/Flat.h +++ b/src/Magnum/Shaders/Flat.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Flat2D.vert b/src/Magnum/Shaders/Flat2D.vert index dd9156847..554a099b7 100644 --- a/src/Magnum/Shaders/Flat2D.vert +++ b/src/Magnum/Shaders/Flat2D.vert @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Flat3D.vert b/src/Magnum/Shaders/Flat3D.vert index 0e02a0867..aac07a63e 100644 --- a/src/Magnum/Shaders/Flat3D.vert +++ b/src/Magnum/Shaders/Flat3D.vert @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/FullScreenTriangle.glsl b/src/Magnum/Shaders/FullScreenTriangle.glsl index 45ed802f7..632c322b3 100644 --- a/src/Magnum/Shaders/FullScreenTriangle.glsl +++ b/src/Magnum/Shaders/FullScreenTriangle.glsl @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Generic.h b/src/Magnum/Shaders/Generic.h index 185f61a5b..d084465b1 100644 --- a/src/Magnum/Shaders/Generic.h +++ b/src/Magnum/Shaders/Generic.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h b/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h index f6eaaad67..5c7f08fbb 100644 --- a/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h +++ b/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/MeshVisualizer.cpp b/src/Magnum/Shaders/MeshVisualizer.cpp index aad6727df..5f9979901 100644 --- a/src/Magnum/Shaders/MeshVisualizer.cpp +++ b/src/Magnum/Shaders/MeshVisualizer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/MeshVisualizer.frag b/src/Magnum/Shaders/MeshVisualizer.frag index bc9bf5460..2f62bdc99 100644 --- a/src/Magnum/Shaders/MeshVisualizer.frag +++ b/src/Magnum/Shaders/MeshVisualizer.frag @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/MeshVisualizer.geom b/src/Magnum/Shaders/MeshVisualizer.geom index 1d22a3a31..f7e20d159 100644 --- a/src/Magnum/Shaders/MeshVisualizer.geom +++ b/src/Magnum/Shaders/MeshVisualizer.geom @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/MeshVisualizer.h b/src/Magnum/Shaders/MeshVisualizer.h index 6c2f2ee1f..8283bf4d8 100644 --- a/src/Magnum/Shaders/MeshVisualizer.h +++ b/src/Magnum/Shaders/MeshVisualizer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/MeshVisualizer.vert b/src/Magnum/Shaders/MeshVisualizer.vert index 4495b7108..dde8b0c9d 100644 --- a/src/Magnum/Shaders/MeshVisualizer.vert +++ b/src/Magnum/Shaders/MeshVisualizer.vert @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Phong.cpp b/src/Magnum/Shaders/Phong.cpp index 4e7519575..bf0c5d2b9 100644 --- a/src/Magnum/Shaders/Phong.cpp +++ b/src/Magnum/Shaders/Phong.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Phong.frag b/src/Magnum/Shaders/Phong.frag index cfd49b846..84f6ced8b 100644 --- a/src/Magnum/Shaders/Phong.frag +++ b/src/Magnum/Shaders/Phong.frag @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Phong.h b/src/Magnum/Shaders/Phong.h index 9276cf5f4..d147e69ca 100644 --- a/src/Magnum/Shaders/Phong.h +++ b/src/Magnum/Shaders/Phong.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Phong.vert b/src/Magnum/Shaders/Phong.vert index 0a3321583..37f962499 100644 --- a/src/Magnum/Shaders/Phong.vert +++ b/src/Magnum/Shaders/Phong.vert @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Shaders.h b/src/Magnum/Shaders/Shaders.h index d213b3844..b354cd086 100644 --- a/src/Magnum/Shaders/Shaders.h +++ b/src/Magnum/Shaders/Shaders.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Test/CMakeLists.txt b/src/Magnum/Shaders/Test/CMakeLists.txt index bcabd8117..360936f2d 100644 --- a/src/Magnum/Shaders/Test/CMakeLists.txt +++ b/src/Magnum/Shaders/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp b/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp index 838a60d18..5d2893f0c 100644 --- a/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp +++ b/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Test/FlatGLTest.cpp b/src/Magnum/Shaders/Test/FlatGLTest.cpp index 8310d4a26..276a7f0df 100644 --- a/src/Magnum/Shaders/Test/FlatGLTest.cpp +++ b/src/Magnum/Shaders/Test/FlatGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp index d6d203d41..806b4ddee 100644 --- a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp +++ b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Test/PhongGLTest.cpp b/src/Magnum/Shaders/Test/PhongGLTest.cpp index 1cbb15dca..6bfd000b8 100644 --- a/src/Magnum/Shaders/Test/PhongGLTest.cpp +++ b/src/Magnum/Shaders/Test/PhongGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Test/VectorGLTest.cpp b/src/Magnum/Shaders/Test/VectorGLTest.cpp index 1303ed85f..718af5f38 100644 --- a/src/Magnum/Shaders/Test/VectorGLTest.cpp +++ b/src/Magnum/Shaders/Test/VectorGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Test/VertexColorGLTest.cpp b/src/Magnum/Shaders/Test/VertexColorGLTest.cpp index 9d7958d9c..4298f2124 100644 --- a/src/Magnum/Shaders/Test/VertexColorGLTest.cpp +++ b/src/Magnum/Shaders/Test/VertexColorGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Vector.cpp b/src/Magnum/Shaders/Vector.cpp index 3acad1def..641e59b57 100644 --- a/src/Magnum/Shaders/Vector.cpp +++ b/src/Magnum/Shaders/Vector.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Vector.frag b/src/Magnum/Shaders/Vector.frag index 6e354d8c8..279052930 100644 --- a/src/Magnum/Shaders/Vector.frag +++ b/src/Magnum/Shaders/Vector.frag @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/Vector.h b/src/Magnum/Shaders/Vector.h index b3640132c..fb511bc79 100644 --- a/src/Magnum/Shaders/Vector.h +++ b/src/Magnum/Shaders/Vector.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/VertexColor.cpp b/src/Magnum/Shaders/VertexColor.cpp index d8dd0396b..f64b5a249 100644 --- a/src/Magnum/Shaders/VertexColor.cpp +++ b/src/Magnum/Shaders/VertexColor.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/VertexColor.frag b/src/Magnum/Shaders/VertexColor.frag index 9456d219b..9e281bebf 100644 --- a/src/Magnum/Shaders/VertexColor.frag +++ b/src/Magnum/Shaders/VertexColor.frag @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/VertexColor.h b/src/Magnum/Shaders/VertexColor.h index 15f78a509..19e5a17dd 100644 --- a/src/Magnum/Shaders/VertexColor.h +++ b/src/Magnum/Shaders/VertexColor.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/VertexColor2D.vert b/src/Magnum/Shaders/VertexColor2D.vert index ea9134fea..c803f83a9 100644 --- a/src/Magnum/Shaders/VertexColor2D.vert +++ b/src/Magnum/Shaders/VertexColor2D.vert @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/VertexColor3D.vert b/src/Magnum/Shaders/VertexColor3D.vert index faae0e333..5542ef6dd 100644 --- a/src/Magnum/Shaders/VertexColor3D.vert +++ b/src/Magnum/Shaders/VertexColor3D.vert @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/compatibility.glsl b/src/Magnum/Shaders/compatibility.glsl index 7fd075b63..53a6a7f00 100644 --- a/src/Magnum/Shaders/compatibility.glsl +++ b/src/Magnum/Shaders/compatibility.glsl @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/generic.glsl b/src/Magnum/Shaders/generic.glsl index 066359be8..d3fa8c6f9 100644 --- a/src/Magnum/Shaders/generic.glsl +++ b/src/Magnum/Shaders/generic.glsl @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shaders/visibility.h b/src/Magnum/Shaders/visibility.h index 0c14bdb36..540080220 100644 --- a/src/Magnum/Shaders/visibility.h +++ b/src/Magnum/Shaders/visibility.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/AbstractShape.cpp b/src/Magnum/Shapes/AbstractShape.cpp index 322c53aac..fe4fc8d5c 100644 --- a/src/Magnum/Shapes/AbstractShape.cpp +++ b/src/Magnum/Shapes/AbstractShape.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/AbstractShape.h b/src/Magnum/Shapes/AbstractShape.h index efc24fafd..25dd40106 100644 --- a/src/Magnum/Shapes/AbstractShape.h +++ b/src/Magnum/Shapes/AbstractShape.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/AxisAlignedBox.cpp b/src/Magnum/Shapes/AxisAlignedBox.cpp index 648d551b7..9d0547a9a 100644 --- a/src/Magnum/Shapes/AxisAlignedBox.cpp +++ b/src/Magnum/Shapes/AxisAlignedBox.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/AxisAlignedBox.h b/src/Magnum/Shapes/AxisAlignedBox.h index 99754b98b..aa9d8419b 100644 --- a/src/Magnum/Shapes/AxisAlignedBox.h +++ b/src/Magnum/Shapes/AxisAlignedBox.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Box.cpp b/src/Magnum/Shapes/Box.cpp index a0f5de4a8..6548b18c6 100644 --- a/src/Magnum/Shapes/Box.cpp +++ b/src/Magnum/Shapes/Box.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Box.h b/src/Magnum/Shapes/Box.h index 6cf57169c..fc7733750 100644 --- a/src/Magnum/Shapes/Box.h +++ b/src/Magnum/Shapes/Box.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/CMakeLists.txt b/src/Magnum/Shapes/CMakeLists.txt index 00b444ef5..5bcaeb535 100644 --- a/src/Magnum/Shapes/CMakeLists.txt +++ b/src/Magnum/Shapes/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Capsule.cpp b/src/Magnum/Shapes/Capsule.cpp index 27a98ab4c..19cc8017a 100644 --- a/src/Magnum/Shapes/Capsule.cpp +++ b/src/Magnum/Shapes/Capsule.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Capsule.h b/src/Magnum/Shapes/Capsule.h index d624c4563..417863af4 100644 --- a/src/Magnum/Shapes/Capsule.h +++ b/src/Magnum/Shapes/Capsule.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Collision.h b/src/Magnum/Shapes/Collision.h index 4fba549b6..fcd716375 100644 --- a/src/Magnum/Shapes/Collision.h +++ b/src/Magnum/Shapes/Collision.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Composition.cpp b/src/Magnum/Shapes/Composition.cpp index a31a1abd5..1b096310d 100644 --- a/src/Magnum/Shapes/Composition.cpp +++ b/src/Magnum/Shapes/Composition.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Composition.h b/src/Magnum/Shapes/Composition.h index a54d5e1b8..a04899c87 100644 --- a/src/Magnum/Shapes/Composition.h +++ b/src/Magnum/Shapes/Composition.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Cylinder.cpp b/src/Magnum/Shapes/Cylinder.cpp index a09fc8095..a0391705d 100644 --- a/src/Magnum/Shapes/Cylinder.cpp +++ b/src/Magnum/Shapes/Cylinder.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Cylinder.h b/src/Magnum/Shapes/Cylinder.h index 71c590628..36048a252 100644 --- a/src/Magnum/Shapes/Cylinder.h +++ b/src/Magnum/Shapes/Cylinder.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Implementation/CollisionDispatch.cpp b/src/Magnum/Shapes/Implementation/CollisionDispatch.cpp index ce07063d8..5493e7fd8 100644 --- a/src/Magnum/Shapes/Implementation/CollisionDispatch.cpp +++ b/src/Magnum/Shapes/Implementation/CollisionDispatch.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Implementation/CollisionDispatch.h b/src/Magnum/Shapes/Implementation/CollisionDispatch.h index 938645d38..6d3a2c673 100644 --- a/src/Magnum/Shapes/Implementation/CollisionDispatch.h +++ b/src/Magnum/Shapes/Implementation/CollisionDispatch.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Line.cpp b/src/Magnum/Shapes/Line.cpp index ae3e29fdc..771e5766b 100644 --- a/src/Magnum/Shapes/Line.cpp +++ b/src/Magnum/Shapes/Line.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Line.h b/src/Magnum/Shapes/Line.h index 0d745a0be..ea1ea8cd5 100644 --- a/src/Magnum/Shapes/Line.h +++ b/src/Magnum/Shapes/Line.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/LineSegment.h b/src/Magnum/Shapes/LineSegment.h index 5d08a4031..3d4e3d8df 100644 --- a/src/Magnum/Shapes/LineSegment.h +++ b/src/Magnum/Shapes/LineSegment.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Plane.cpp b/src/Magnum/Shapes/Plane.cpp index aaa86a064..b6c6f72c5 100644 --- a/src/Magnum/Shapes/Plane.cpp +++ b/src/Magnum/Shapes/Plane.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Plane.h b/src/Magnum/Shapes/Plane.h index 9a314a668..7b5de22b0 100644 --- a/src/Magnum/Shapes/Plane.h +++ b/src/Magnum/Shapes/Plane.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Point.cpp b/src/Magnum/Shapes/Point.cpp index 3e31a60d4..8b8cf86d2 100644 --- a/src/Magnum/Shapes/Point.cpp +++ b/src/Magnum/Shapes/Point.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Point.h b/src/Magnum/Shapes/Point.h index 6fcbb1a33..4f23a2821 100644 --- a/src/Magnum/Shapes/Point.h +++ b/src/Magnum/Shapes/Point.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Shape.cpp b/src/Magnum/Shapes/Shape.cpp index 7402770d5..f330484ef 100644 --- a/src/Magnum/Shapes/Shape.cpp +++ b/src/Magnum/Shapes/Shape.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Shape.h b/src/Magnum/Shapes/Shape.h index fd002a62c..8e1cac37f 100644 --- a/src/Magnum/Shapes/Shape.h +++ b/src/Magnum/Shapes/Shape.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/ShapeGroup.cpp b/src/Magnum/Shapes/ShapeGroup.cpp index 429f2cbe7..02e30e4bc 100644 --- a/src/Magnum/Shapes/ShapeGroup.cpp +++ b/src/Magnum/Shapes/ShapeGroup.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/ShapeGroup.h b/src/Magnum/Shapes/ShapeGroup.h index fba38afe7..45a90d38a 100644 --- a/src/Magnum/Shapes/ShapeGroup.h +++ b/src/Magnum/Shapes/ShapeGroup.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Shapes.h b/src/Magnum/Shapes/Shapes.h index 1f6f3d3e4..72f20a4c3 100644 --- a/src/Magnum/Shapes/Shapes.h +++ b/src/Magnum/Shapes/Shapes.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Sphere.cpp b/src/Magnum/Shapes/Sphere.cpp index b4dce201e..09b0a51ef 100644 --- a/src/Magnum/Shapes/Sphere.cpp +++ b/src/Magnum/Shapes/Sphere.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Sphere.h b/src/Magnum/Shapes/Sphere.h index 38d232517..c8e04d71d 100644 --- a/src/Magnum/Shapes/Sphere.h +++ b/src/Magnum/Shapes/Sphere.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Test/AxisAlignedBoxTest.cpp b/src/Magnum/Shapes/Test/AxisAlignedBoxTest.cpp index b649dfa62..05a91c89c 100644 --- a/src/Magnum/Shapes/Test/AxisAlignedBoxTest.cpp +++ b/src/Magnum/Shapes/Test/AxisAlignedBoxTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Test/BoxTest.cpp b/src/Magnum/Shapes/Test/BoxTest.cpp index 19dd194eb..e04ecea11 100644 --- a/src/Magnum/Shapes/Test/BoxTest.cpp +++ b/src/Magnum/Shapes/Test/BoxTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Test/CMakeLists.txt b/src/Magnum/Shapes/Test/CMakeLists.txt index 7d9d5b624..58593f06f 100644 --- a/src/Magnum/Shapes/Test/CMakeLists.txt +++ b/src/Magnum/Shapes/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Test/CapsuleTest.cpp b/src/Magnum/Shapes/Test/CapsuleTest.cpp index 845e1f89a..daa8491e5 100644 --- a/src/Magnum/Shapes/Test/CapsuleTest.cpp +++ b/src/Magnum/Shapes/Test/CapsuleTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Test/CollisionTest.cpp b/src/Magnum/Shapes/Test/CollisionTest.cpp index 06345ecf6..eaa4a643b 100644 --- a/src/Magnum/Shapes/Test/CollisionTest.cpp +++ b/src/Magnum/Shapes/Test/CollisionTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Test/CompositionTest.cpp b/src/Magnum/Shapes/Test/CompositionTest.cpp index 970f5d257..536acbd3c 100644 --- a/src/Magnum/Shapes/Test/CompositionTest.cpp +++ b/src/Magnum/Shapes/Test/CompositionTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Test/CylinderTest.cpp b/src/Magnum/Shapes/Test/CylinderTest.cpp index d1ad03026..a7331cd57 100644 --- a/src/Magnum/Shapes/Test/CylinderTest.cpp +++ b/src/Magnum/Shapes/Test/CylinderTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Test/LineTest.cpp b/src/Magnum/Shapes/Test/LineTest.cpp index 9006ff14f..6c0e6964a 100644 --- a/src/Magnum/Shapes/Test/LineTest.cpp +++ b/src/Magnum/Shapes/Test/LineTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Test/PlaneTest.cpp b/src/Magnum/Shapes/Test/PlaneTest.cpp index c251384cb..b56593145 100644 --- a/src/Magnum/Shapes/Test/PlaneTest.cpp +++ b/src/Magnum/Shapes/Test/PlaneTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Test/PointTest.cpp b/src/Magnum/Shapes/Test/PointTest.cpp index 8e0fd27e6..21f41a9eb 100644 --- a/src/Magnum/Shapes/Test/PointTest.cpp +++ b/src/Magnum/Shapes/Test/PointTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Test/ShapeImplementationTest.cpp b/src/Magnum/Shapes/Test/ShapeImplementationTest.cpp index 6b3c62599..6f7d9f16c 100644 --- a/src/Magnum/Shapes/Test/ShapeImplementationTest.cpp +++ b/src/Magnum/Shapes/Test/ShapeImplementationTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Test/ShapeTest.cpp b/src/Magnum/Shapes/Test/ShapeTest.cpp index 0830dacc0..670ec17b4 100644 --- a/src/Magnum/Shapes/Test/ShapeTest.cpp +++ b/src/Magnum/Shapes/Test/ShapeTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Test/ShapeTestBase.h b/src/Magnum/Shapes/Test/ShapeTestBase.h index 9f82326d8..6dcca03c3 100644 --- a/src/Magnum/Shapes/Test/ShapeTestBase.h +++ b/src/Magnum/Shapes/Test/ShapeTestBase.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/Test/SphereTest.cpp b/src/Magnum/Shapes/Test/SphereTest.cpp index 7096b95d4..0a373fc86 100644 --- a/src/Magnum/Shapes/Test/SphereTest.cpp +++ b/src/Magnum/Shapes/Test/SphereTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/shapeImplementation.cpp b/src/Magnum/Shapes/shapeImplementation.cpp index ef70c149b..b2fc534df 100644 --- a/src/Magnum/Shapes/shapeImplementation.cpp +++ b/src/Magnum/Shapes/shapeImplementation.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/shapeImplementation.h b/src/Magnum/Shapes/shapeImplementation.h index 170172188..a9bf886a7 100644 --- a/src/Magnum/Shapes/shapeImplementation.h +++ b/src/Magnum/Shapes/shapeImplementation.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Shapes/visibility.h b/src/Magnum/Shapes/visibility.h index d54216f78..97ad061ee 100644 --- a/src/Magnum/Shapes/visibility.h +++ b/src/Magnum/Shapes/visibility.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Tags.h b/src/Magnum/Tags.h index 5f38d72b0..04963fa66 100644 --- a/src/Magnum/Tags.h +++ b/src/Magnum/Tags.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/AbstractObjectGLTest.cpp b/src/Magnum/Test/AbstractObjectGLTest.cpp index eb010b8dd..b8dc3db89 100644 --- a/src/Magnum/Test/AbstractObjectGLTest.cpp +++ b/src/Magnum/Test/AbstractObjectGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/AbstractOpenGLTester.h b/src/Magnum/Test/AbstractOpenGLTester.h index 22b8161a6..54a1f5ef3 100644 --- a/src/Magnum/Test/AbstractOpenGLTester.h +++ b/src/Magnum/Test/AbstractOpenGLTester.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/AbstractQueryGLTest.cpp b/src/Magnum/Test/AbstractQueryGLTest.cpp index 2e9ad073b..03cfbc764 100644 --- a/src/Magnum/Test/AbstractQueryGLTest.cpp +++ b/src/Magnum/Test/AbstractQueryGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp index 2688c737d..5edeb0b12 100644 --- a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/AbstractShaderProgramTest.cpp b/src/Magnum/Test/AbstractShaderProgramTest.cpp index bdcd6bd0a..089b0f573 100644 --- a/src/Magnum/Test/AbstractShaderProgramTest.cpp +++ b/src/Magnum/Test/AbstractShaderProgramTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/AbstractTextureGLTest.cpp b/src/Magnum/Test/AbstractTextureGLTest.cpp index 88e031eb6..5b593b288 100644 --- a/src/Magnum/Test/AbstractTextureGLTest.cpp +++ b/src/Magnum/Test/AbstractTextureGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/ArrayTest.cpp b/src/Magnum/Test/ArrayTest.cpp index 70a88c4e8..dffe19ccc 100644 --- a/src/Magnum/Test/ArrayTest.cpp +++ b/src/Magnum/Test/ArrayTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/BufferGLTest.cpp b/src/Magnum/Test/BufferGLTest.cpp index 3a8da1ba2..858e57f43 100644 --- a/src/Magnum/Test/BufferGLTest.cpp +++ b/src/Magnum/Test/BufferGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/BufferImageGLTest.cpp b/src/Magnum/Test/BufferImageGLTest.cpp index 1aeb7629e..e424552fc 100644 --- a/src/Magnum/Test/BufferImageGLTest.cpp +++ b/src/Magnum/Test/BufferImageGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/BufferTextureGLTest.cpp b/src/Magnum/Test/BufferTextureGLTest.cpp index c4eda943d..fc2a7946b 100644 --- a/src/Magnum/Test/BufferTextureGLTest.cpp +++ b/src/Magnum/Test/BufferTextureGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/CMakeLists.txt b/src/Magnum/Test/CMakeLists.txt index c84e74c97..36e0c535a 100644 --- a/src/Magnum/Test/CMakeLists.txt +++ b/src/Magnum/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/ContextGLTest.cpp b/src/Magnum/Test/ContextGLTest.cpp index abb025023..cef1210a0 100644 --- a/src/Magnum/Test/ContextGLTest.cpp +++ b/src/Magnum/Test/ContextGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/ContextTest.cpp b/src/Magnum/Test/ContextTest.cpp index fab4650df..67d9346bf 100644 --- a/src/Magnum/Test/ContextTest.cpp +++ b/src/Magnum/Test/ContextTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp b/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp index 589a799c9..b7d44ea01 100644 --- a/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/CubeMapTextureGLTest.cpp b/src/Magnum/Test/CubeMapTextureGLTest.cpp index b142621b8..08b3ad83e 100644 --- a/src/Magnum/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/DebugOutputGLTest.cpp b/src/Magnum/Test/DebugOutputGLTest.cpp index d0d2f10c9..9af68e779 100644 --- a/src/Magnum/Test/DebugOutputGLTest.cpp +++ b/src/Magnum/Test/DebugOutputGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/DebugOutputTest.cpp b/src/Magnum/Test/DebugOutputTest.cpp index 26df23359..2d33a04c9 100644 --- a/src/Magnum/Test/DebugOutputTest.cpp +++ b/src/Magnum/Test/DebugOutputTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/DefaultFramebufferTest.cpp b/src/Magnum/Test/DefaultFramebufferTest.cpp index 6121a2f1d..254d5b14c 100644 --- a/src/Magnum/Test/DefaultFramebufferTest.cpp +++ b/src/Magnum/Test/DefaultFramebufferTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/FormatTest.cpp b/src/Magnum/Test/FormatTest.cpp index f29d2c772..0e58cd210 100644 --- a/src/Magnum/Test/FormatTest.cpp +++ b/src/Magnum/Test/FormatTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/FramebufferGLTest.cpp b/src/Magnum/Test/FramebufferGLTest.cpp index c8cd7b7a1..bf882a5df 100644 --- a/src/Magnum/Test/FramebufferGLTest.cpp +++ b/src/Magnum/Test/FramebufferGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/FramebufferTest.cpp b/src/Magnum/Test/FramebufferTest.cpp index de85126d9..2229721f5 100644 --- a/src/Magnum/Test/FramebufferTest.cpp +++ b/src/Magnum/Test/FramebufferTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/ImageTest.cpp b/src/Magnum/Test/ImageTest.cpp index f6f85cc4b..224855a2f 100644 --- a/src/Magnum/Test/ImageTest.cpp +++ b/src/Magnum/Test/ImageTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/ImageViewTest.cpp b/src/Magnum/Test/ImageViewTest.cpp index 4ef3cffd2..47074ae7f 100644 --- a/src/Magnum/Test/ImageViewTest.cpp +++ b/src/Magnum/Test/ImageViewTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/MeshGLTest.cpp b/src/Magnum/Test/MeshGLTest.cpp index 1cff747f6..41b4543cc 100644 --- a/src/Magnum/Test/MeshGLTest.cpp +++ b/src/Magnum/Test/MeshGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/MeshTest.cpp b/src/Magnum/Test/MeshTest.cpp index 1994bf894..c4c382a05 100644 --- a/src/Magnum/Test/MeshTest.cpp +++ b/src/Magnum/Test/MeshTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/MultisampleTextureGLTest.cpp b/src/Magnum/Test/MultisampleTextureGLTest.cpp index 131b0397e..979d9bb61 100644 --- a/src/Magnum/Test/MultisampleTextureGLTest.cpp +++ b/src/Magnum/Test/MultisampleTextureGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/PixelStorageGLTest.cpp b/src/Magnum/Test/PixelStorageGLTest.cpp index 472862ab5..abbb6e699 100644 --- a/src/Magnum/Test/PixelStorageGLTest.cpp +++ b/src/Magnum/Test/PixelStorageGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/PixelStorageTest.cpp b/src/Magnum/Test/PixelStorageTest.cpp index 120923b7d..41f96a356 100644 --- a/src/Magnum/Test/PixelStorageTest.cpp +++ b/src/Magnum/Test/PixelStorageTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/PrimitiveQueryGLTest.cpp b/src/Magnum/Test/PrimitiveQueryGLTest.cpp index 93d3f1016..3c63d9527 100644 --- a/src/Magnum/Test/PrimitiveQueryGLTest.cpp +++ b/src/Magnum/Test/PrimitiveQueryGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/RectangleTextureGLTest.cpp b/src/Magnum/Test/RectangleTextureGLTest.cpp index 453197b12..8e0d4cfc9 100644 --- a/src/Magnum/Test/RectangleTextureGLTest.cpp +++ b/src/Magnum/Test/RectangleTextureGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/RenderbufferGLTest.cpp b/src/Magnum/Test/RenderbufferGLTest.cpp index 254883253..ad6fd4afd 100644 --- a/src/Magnum/Test/RenderbufferGLTest.cpp +++ b/src/Magnum/Test/RenderbufferGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/RendererTest.cpp b/src/Magnum/Test/RendererTest.cpp index 12e071232..5aaa689c5 100644 --- a/src/Magnum/Test/RendererTest.cpp +++ b/src/Magnum/Test/RendererTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/ResourceManagerLocalInstanceTest.cpp b/src/Magnum/Test/ResourceManagerLocalInstanceTest.cpp index 8efa7f191..61a372177 100644 --- a/src/Magnum/Test/ResourceManagerLocalInstanceTest.cpp +++ b/src/Magnum/Test/ResourceManagerLocalInstanceTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/ResourceManagerLocalInstanceTestLib.cpp b/src/Magnum/Test/ResourceManagerLocalInstanceTestLib.cpp index 08b85ce1b..bdc3db3cb 100644 --- a/src/Magnum/Test/ResourceManagerLocalInstanceTestLib.cpp +++ b/src/Magnum/Test/ResourceManagerLocalInstanceTestLib.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/ResourceManagerLocalInstanceTestLib.h b/src/Magnum/Test/ResourceManagerLocalInstanceTestLib.h index 8b13a6a38..b1595c175 100644 --- a/src/Magnum/Test/ResourceManagerLocalInstanceTestLib.h +++ b/src/Magnum/Test/ResourceManagerLocalInstanceTestLib.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/ResourceManagerTest.cpp b/src/Magnum/Test/ResourceManagerTest.cpp index d06060046..d746901cf 100644 --- a/src/Magnum/Test/ResourceManagerTest.cpp +++ b/src/Magnum/Test/ResourceManagerTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/SampleQueryGLTest.cpp b/src/Magnum/Test/SampleQueryGLTest.cpp index 786e16bb4..37bfcab2b 100644 --- a/src/Magnum/Test/SampleQueryGLTest.cpp +++ b/src/Magnum/Test/SampleQueryGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/SamplerTest.cpp b/src/Magnum/Test/SamplerTest.cpp index 89b210752..621edffde 100644 --- a/src/Magnum/Test/SamplerTest.cpp +++ b/src/Magnum/Test/SamplerTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/ShaderGLTest.cpp b/src/Magnum/Test/ShaderGLTest.cpp index 205d9ce86..be28f5345 100644 --- a/src/Magnum/Test/ShaderGLTest.cpp +++ b/src/Magnum/Test/ShaderGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/ShaderTest.cpp b/src/Magnum/Test/ShaderTest.cpp index fbe2e845f..6a1f928e1 100644 --- a/src/Magnum/Test/ShaderTest.cpp +++ b/src/Magnum/Test/ShaderTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/TagsTest.cpp b/src/Magnum/Test/TagsTest.cpp index 48f903c84..7d0e543ee 100644 --- a/src/Magnum/Test/TagsTest.cpp +++ b/src/Magnum/Test/TagsTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/TextureArrayGLTest.cpp b/src/Magnum/Test/TextureArrayGLTest.cpp index 99785898b..131d03d36 100644 --- a/src/Magnum/Test/TextureArrayGLTest.cpp +++ b/src/Magnum/Test/TextureArrayGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/TextureGLTest.cpp b/src/Magnum/Test/TextureGLTest.cpp index 3cc63e669..de6c3b3a5 100644 --- a/src/Magnum/Test/TextureGLTest.cpp +++ b/src/Magnum/Test/TextureGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/TimeQueryGLTest.cpp b/src/Magnum/Test/TimeQueryGLTest.cpp index e650aeabd..4860ccc16 100644 --- a/src/Magnum/Test/TimeQueryGLTest.cpp +++ b/src/Magnum/Test/TimeQueryGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/TransformFeedbackGLTest.cpp b/src/Magnum/Test/TransformFeedbackGLTest.cpp index a59cbe7db..396ef680e 100644 --- a/src/Magnum/Test/TransformFeedbackGLTest.cpp +++ b/src/Magnum/Test/TransformFeedbackGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/VersionTest.cpp b/src/Magnum/Test/VersionTest.cpp index a27596c67..0f691c6d5 100644 --- a/src/Magnum/Test/VersionTest.cpp +++ b/src/Magnum/Test/VersionTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Test/configure.h.cmake b/src/Magnum/Test/configure.h.cmake index af1f028a6..96fcde21b 100644 --- a/src/Magnum/Test/configure.h.cmake +++ b/src/Magnum/Test/configure.h.cmake @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/AbstractFont.cpp b/src/Magnum/Text/AbstractFont.cpp index 1eabeeba8..19e1893c8 100644 --- a/src/Magnum/Text/AbstractFont.cpp +++ b/src/Magnum/Text/AbstractFont.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/AbstractFont.h b/src/Magnum/Text/AbstractFont.h index ce9ed573f..55ad1487d 100644 --- a/src/Magnum/Text/AbstractFont.h +++ b/src/Magnum/Text/AbstractFont.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/AbstractFontConverter.cpp b/src/Magnum/Text/AbstractFontConverter.cpp index b744bd8eb..f47462665 100644 --- a/src/Magnum/Text/AbstractFontConverter.cpp +++ b/src/Magnum/Text/AbstractFontConverter.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/AbstractFontConverter.h b/src/Magnum/Text/AbstractFontConverter.h index f9e715916..912aa7fca 100644 --- a/src/Magnum/Text/AbstractFontConverter.h +++ b/src/Magnum/Text/AbstractFontConverter.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/Alignment.h b/src/Magnum/Text/Alignment.h index c2e0b1365..c6c76a5ec 100644 --- a/src/Magnum/Text/Alignment.h +++ b/src/Magnum/Text/Alignment.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/CMakeLists.txt b/src/Magnum/Text/CMakeLists.txt index 0efac50ba..3d0a26061 100644 --- a/src/Magnum/Text/CMakeLists.txt +++ b/src/Magnum/Text/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/DistanceFieldGlyphCache.cpp b/src/Magnum/Text/DistanceFieldGlyphCache.cpp index 97a19e929..89b21d2ea 100644 --- a/src/Magnum/Text/DistanceFieldGlyphCache.cpp +++ b/src/Magnum/Text/DistanceFieldGlyphCache.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/DistanceFieldGlyphCache.h b/src/Magnum/Text/DistanceFieldGlyphCache.h index 580bc77d5..aeecb36c1 100644 --- a/src/Magnum/Text/DistanceFieldGlyphCache.h +++ b/src/Magnum/Text/DistanceFieldGlyphCache.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/GlyphCache.cpp b/src/Magnum/Text/GlyphCache.cpp index 97713094a..72a676cad 100644 --- a/src/Magnum/Text/GlyphCache.cpp +++ b/src/Magnum/Text/GlyphCache.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/GlyphCache.h b/src/Magnum/Text/GlyphCache.h index 08848d83e..27b321a4a 100644 --- a/src/Magnum/Text/GlyphCache.h +++ b/src/Magnum/Text/GlyphCache.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/Renderer.cpp b/src/Magnum/Text/Renderer.cpp index 19bbcdee6..fe1cce3b7 100644 --- a/src/Magnum/Text/Renderer.cpp +++ b/src/Magnum/Text/Renderer.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/Renderer.h b/src/Magnum/Text/Renderer.h index a1e49c0db..a9dc65d57 100644 --- a/src/Magnum/Text/Renderer.h +++ b/src/Magnum/Text/Renderer.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/Test/AbstractFontConverterTest.cpp b/src/Magnum/Text/Test/AbstractFontConverterTest.cpp index ec2e29d44..3cca1727e 100644 --- a/src/Magnum/Text/Test/AbstractFontConverterTest.cpp +++ b/src/Magnum/Text/Test/AbstractFontConverterTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/Test/AbstractFontTest.cpp b/src/Magnum/Text/Test/AbstractFontTest.cpp index 0d8632eab..8601212b2 100644 --- a/src/Magnum/Text/Test/AbstractFontTest.cpp +++ b/src/Magnum/Text/Test/AbstractFontTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/Test/AbstractLayouterTest.cpp b/src/Magnum/Text/Test/AbstractLayouterTest.cpp index 9f0d3450a..7410e4d24 100644 --- a/src/Magnum/Text/Test/AbstractLayouterTest.cpp +++ b/src/Magnum/Text/Test/AbstractLayouterTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/Test/CMakeLists.txt b/src/Magnum/Text/Test/CMakeLists.txt index c90206ac7..580d3d9b2 100644 --- a/src/Magnum/Text/Test/CMakeLists.txt +++ b/src/Magnum/Text/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/Test/GlyphCacheGLTest.cpp b/src/Magnum/Text/Test/GlyphCacheGLTest.cpp index b860849ec..682d1f20c 100644 --- a/src/Magnum/Text/Test/GlyphCacheGLTest.cpp +++ b/src/Magnum/Text/Test/GlyphCacheGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/Test/RendererGLTest.cpp b/src/Magnum/Text/Test/RendererGLTest.cpp index 803068a55..73dac9db4 100644 --- a/src/Magnum/Text/Test/RendererGLTest.cpp +++ b/src/Magnum/Text/Test/RendererGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/Test/configure.h.cmake b/src/Magnum/Text/Test/configure.h.cmake index 0221eb5ec..96f3e6a59 100644 --- a/src/Magnum/Text/Test/configure.h.cmake +++ b/src/Magnum/Text/Test/configure.h.cmake @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/Text.h b/src/Magnum/Text/Text.h index 5d1a31a44..4bfde1277 100644 --- a/src/Magnum/Text/Text.h +++ b/src/Magnum/Text/Text.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/fontconverter.cpp b/src/Magnum/Text/fontconverter.cpp index 4cb1a0eae..cc5007139 100644 --- a/src/Magnum/Text/fontconverter.cpp +++ b/src/Magnum/Text/fontconverter.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/fontconverterConfigure.h.cmake b/src/Magnum/Text/fontconverterConfigure.h.cmake index 1464161ef..895e33c28 100644 --- a/src/Magnum/Text/fontconverterConfigure.h.cmake +++ b/src/Magnum/Text/fontconverterConfigure.h.cmake @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Text/visibility.h b/src/Magnum/Text/visibility.h index 61677ce2e..3ce04bd44 100644 --- a/src/Magnum/Text/visibility.h +++ b/src/Magnum/Text/visibility.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Texture.cpp b/src/Magnum/Texture.cpp index 01c4f5b7c..28a11f493 100644 --- a/src/Magnum/Texture.cpp +++ b/src/Magnum/Texture.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Texture.h b/src/Magnum/Texture.h index 6718681bd..d33498c42 100644 --- a/src/Magnum/Texture.h +++ b/src/Magnum/Texture.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TextureArray.cpp b/src/Magnum/TextureArray.cpp index 134575138..8818c633a 100644 --- a/src/Magnum/TextureArray.cpp +++ b/src/Magnum/TextureArray.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TextureArray.h b/src/Magnum/TextureArray.h index 7cf37eb20..5e9d364a6 100644 --- a/src/Magnum/TextureArray.h +++ b/src/Magnum/TextureArray.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TextureFormat.h b/src/Magnum/TextureFormat.h index 32de31dbc..b0c9f9929 100644 --- a/src/Magnum/TextureFormat.h +++ b/src/Magnum/TextureFormat.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TextureTools/Atlas.cpp b/src/Magnum/TextureTools/Atlas.cpp index 449bb21a2..7994e6f7a 100644 --- a/src/Magnum/TextureTools/Atlas.cpp +++ b/src/Magnum/TextureTools/Atlas.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TextureTools/Atlas.h b/src/Magnum/TextureTools/Atlas.h index a1c409b8f..4b8ecf28d 100644 --- a/src/Magnum/TextureTools/Atlas.h +++ b/src/Magnum/TextureTools/Atlas.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TextureTools/CMakeLists.txt b/src/Magnum/TextureTools/CMakeLists.txt index acbcf7afa..ae14fb1ce 100644 --- a/src/Magnum/TextureTools/CMakeLists.txt +++ b/src/Magnum/TextureTools/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TextureTools/DistanceField.cpp b/src/Magnum/TextureTools/DistanceField.cpp index 5810f973b..5d97417c3 100644 --- a/src/Magnum/TextureTools/DistanceField.cpp +++ b/src/Magnum/TextureTools/DistanceField.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TextureTools/DistanceField.h b/src/Magnum/TextureTools/DistanceField.h index 2df3fd9ea..da512c3a5 100644 --- a/src/Magnum/TextureTools/DistanceField.h +++ b/src/Magnum/TextureTools/DistanceField.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TextureTools/DistanceFieldShader.frag b/src/Magnum/TextureTools/DistanceFieldShader.frag index 4088e55d5..14be6d217 100644 --- a/src/Magnum/TextureTools/DistanceFieldShader.frag +++ b/src/Magnum/TextureTools/DistanceFieldShader.frag @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TextureTools/DistanceFieldShader.vert b/src/Magnum/TextureTools/DistanceFieldShader.vert index bb8637604..85ddd7bbf 100644 --- a/src/Magnum/TextureTools/DistanceFieldShader.vert +++ b/src/Magnum/TextureTools/DistanceFieldShader.vert @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TextureTools/Test/AtlasTest.cpp b/src/Magnum/TextureTools/Test/AtlasTest.cpp index 1f33bd143..82c96b8a0 100644 --- a/src/Magnum/TextureTools/Test/AtlasTest.cpp +++ b/src/Magnum/TextureTools/Test/AtlasTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TextureTools/Test/CMakeLists.txt b/src/Magnum/TextureTools/Test/CMakeLists.txt index 1c42d070d..bcbb445e0 100644 --- a/src/Magnum/TextureTools/Test/CMakeLists.txt +++ b/src/Magnum/TextureTools/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TextureTools/distancefieldconverter.cpp b/src/Magnum/TextureTools/distancefieldconverter.cpp index 681631e5b..2c55c73b9 100644 --- a/src/Magnum/TextureTools/distancefieldconverter.cpp +++ b/src/Magnum/TextureTools/distancefieldconverter.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TextureTools/distancefieldconverterConfigure.h.cmake b/src/Magnum/TextureTools/distancefieldconverterConfigure.h.cmake index 1464161ef..895e33c28 100644 --- a/src/Magnum/TextureTools/distancefieldconverterConfigure.h.cmake +++ b/src/Magnum/TextureTools/distancefieldconverterConfigure.h.cmake @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TextureTools/visibility.h b/src/Magnum/TextureTools/visibility.h index 8d9aec05a..8fae5b679 100644 --- a/src/Magnum/TextureTools/visibility.h +++ b/src/Magnum/TextureTools/visibility.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TimeQuery.h b/src/Magnum/TimeQuery.h index 309e33aee..4d5b7e068 100644 --- a/src/Magnum/TimeQuery.h +++ b/src/Magnum/TimeQuery.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Timeline.cpp b/src/Magnum/Timeline.cpp index 3122e468a..a05790bc5 100644 --- a/src/Magnum/Timeline.cpp +++ b/src/Magnum/Timeline.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Timeline.h b/src/Magnum/Timeline.h index 9db373caa..d35442a6f 100644 --- a/src/Magnum/Timeline.h +++ b/src/Magnum/Timeline.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/AbstractImageConverter.cpp b/src/Magnum/Trade/AbstractImageConverter.cpp index c3341a78a..d3589bf7d 100644 --- a/src/Magnum/Trade/AbstractImageConverter.cpp +++ b/src/Magnum/Trade/AbstractImageConverter.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/AbstractImageConverter.h b/src/Magnum/Trade/AbstractImageConverter.h index 8879d272a..b5215f60d 100644 --- a/src/Magnum/Trade/AbstractImageConverter.h +++ b/src/Magnum/Trade/AbstractImageConverter.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/AbstractImporter.cpp b/src/Magnum/Trade/AbstractImporter.cpp index 808748006..21e76c3ac 100644 --- a/src/Magnum/Trade/AbstractImporter.cpp +++ b/src/Magnum/Trade/AbstractImporter.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/AbstractImporter.h b/src/Magnum/Trade/AbstractImporter.h index 8011a799b..f0bf089e3 100644 --- a/src/Magnum/Trade/AbstractImporter.h +++ b/src/Magnum/Trade/AbstractImporter.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/AbstractMaterialData.cpp b/src/Magnum/Trade/AbstractMaterialData.cpp index ba2cf200e..c60d10001 100644 --- a/src/Magnum/Trade/AbstractMaterialData.cpp +++ b/src/Magnum/Trade/AbstractMaterialData.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/AbstractMaterialData.h b/src/Magnum/Trade/AbstractMaterialData.h index 0ac57ab4d..894d10ea2 100644 --- a/src/Magnum/Trade/AbstractMaterialData.h +++ b/src/Magnum/Trade/AbstractMaterialData.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/CMakeLists.txt b/src/Magnum/Trade/CMakeLists.txt index 0e20dd89c..59f0b8d44 100644 --- a/src/Magnum/Trade/CMakeLists.txt +++ b/src/Magnum/Trade/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/CameraData.h b/src/Magnum/Trade/CameraData.h index 045fc36da..e56f45eaa 100644 --- a/src/Magnum/Trade/CameraData.h +++ b/src/Magnum/Trade/CameraData.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/ImageData.cpp b/src/Magnum/Trade/ImageData.cpp index 16303a39a..e4d1f3a87 100644 --- a/src/Magnum/Trade/ImageData.cpp +++ b/src/Magnum/Trade/ImageData.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/ImageData.h b/src/Magnum/Trade/ImageData.h index 1071fed2a..7ff2e5561 100644 --- a/src/Magnum/Trade/ImageData.h +++ b/src/Magnum/Trade/ImageData.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/LightData.h b/src/Magnum/Trade/LightData.h index e9a6057c9..3a8163f6d 100644 --- a/src/Magnum/Trade/LightData.h +++ b/src/Magnum/Trade/LightData.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/MeshData2D.cpp b/src/Magnum/Trade/MeshData2D.cpp index 1fab7b45a..0793d63a3 100644 --- a/src/Magnum/Trade/MeshData2D.cpp +++ b/src/Magnum/Trade/MeshData2D.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/MeshData2D.h b/src/Magnum/Trade/MeshData2D.h index a58f5685f..69946251f 100644 --- a/src/Magnum/Trade/MeshData2D.h +++ b/src/Magnum/Trade/MeshData2D.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/MeshData3D.cpp b/src/Magnum/Trade/MeshData3D.cpp index 76b3f04dd..393584993 100644 --- a/src/Magnum/Trade/MeshData3D.cpp +++ b/src/Magnum/Trade/MeshData3D.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/MeshData3D.h b/src/Magnum/Trade/MeshData3D.h index 64a5ca02d..060f78bdd 100644 --- a/src/Magnum/Trade/MeshData3D.h +++ b/src/Magnum/Trade/MeshData3D.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/MeshObjectData2D.cpp b/src/Magnum/Trade/MeshObjectData2D.cpp index c3e94271f..5dcb9c03c 100644 --- a/src/Magnum/Trade/MeshObjectData2D.cpp +++ b/src/Magnum/Trade/MeshObjectData2D.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/MeshObjectData2D.h b/src/Magnum/Trade/MeshObjectData2D.h index 39c349593..26dad47c5 100644 --- a/src/Magnum/Trade/MeshObjectData2D.h +++ b/src/Magnum/Trade/MeshObjectData2D.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/MeshObjectData3D.cpp b/src/Magnum/Trade/MeshObjectData3D.cpp index 76f51d2bc..135f4ee0f 100644 --- a/src/Magnum/Trade/MeshObjectData3D.cpp +++ b/src/Magnum/Trade/MeshObjectData3D.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/MeshObjectData3D.h b/src/Magnum/Trade/MeshObjectData3D.h index d536e208b..305b74d36 100644 --- a/src/Magnum/Trade/MeshObjectData3D.h +++ b/src/Magnum/Trade/MeshObjectData3D.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/ObjectData2D.cpp b/src/Magnum/Trade/ObjectData2D.cpp index a11327c66..4ea19c029 100644 --- a/src/Magnum/Trade/ObjectData2D.cpp +++ b/src/Magnum/Trade/ObjectData2D.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/ObjectData2D.h b/src/Magnum/Trade/ObjectData2D.h index d2b952e0d..01b3cd2b2 100644 --- a/src/Magnum/Trade/ObjectData2D.h +++ b/src/Magnum/Trade/ObjectData2D.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/ObjectData3D.cpp b/src/Magnum/Trade/ObjectData3D.cpp index 3afcb99fa..c0e0cfc94 100644 --- a/src/Magnum/Trade/ObjectData3D.cpp +++ b/src/Magnum/Trade/ObjectData3D.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/ObjectData3D.h b/src/Magnum/Trade/ObjectData3D.h index 05f71dbf2..382615bc1 100644 --- a/src/Magnum/Trade/ObjectData3D.h +++ b/src/Magnum/Trade/ObjectData3D.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/PhongMaterialData.cpp b/src/Magnum/Trade/PhongMaterialData.cpp index 06d2d948e..ff427d677 100644 --- a/src/Magnum/Trade/PhongMaterialData.cpp +++ b/src/Magnum/Trade/PhongMaterialData.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/PhongMaterialData.h b/src/Magnum/Trade/PhongMaterialData.h index 2e0451056..dee266602 100644 --- a/src/Magnum/Trade/PhongMaterialData.h +++ b/src/Magnum/Trade/PhongMaterialData.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/SceneData.cpp b/src/Magnum/Trade/SceneData.cpp index b66b55a55..f00726a0b 100644 --- a/src/Magnum/Trade/SceneData.cpp +++ b/src/Magnum/Trade/SceneData.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/SceneData.h b/src/Magnum/Trade/SceneData.h index 799c3c051..0c12bb7f0 100644 --- a/src/Magnum/Trade/SceneData.h +++ b/src/Magnum/Trade/SceneData.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/Test/AbstractImageConverterTest.cpp b/src/Magnum/Trade/Test/AbstractImageConverterTest.cpp index 439e1c621..fc2b86f2e 100644 --- a/src/Magnum/Trade/Test/AbstractImageConverterTest.cpp +++ b/src/Magnum/Trade/Test/AbstractImageConverterTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/Test/AbstractImporterTest.cpp b/src/Magnum/Trade/Test/AbstractImporterTest.cpp index 332720801..099e71d51 100644 --- a/src/Magnum/Trade/Test/AbstractImporterTest.cpp +++ b/src/Magnum/Trade/Test/AbstractImporterTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/Test/AbstractMaterialDataTest.cpp b/src/Magnum/Trade/Test/AbstractMaterialDataTest.cpp index a5c8890b9..7d4054031 100644 --- a/src/Magnum/Trade/Test/AbstractMaterialDataTest.cpp +++ b/src/Magnum/Trade/Test/AbstractMaterialDataTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/Test/CMakeLists.txt b/src/Magnum/Trade/Test/CMakeLists.txt index 73aca1c1b..5e2a1ed27 100644 --- a/src/Magnum/Trade/Test/CMakeLists.txt +++ b/src/Magnum/Trade/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/Test/ImageDataTest.cpp b/src/Magnum/Trade/Test/ImageDataTest.cpp index d27e424fa..f56132e60 100644 --- a/src/Magnum/Trade/Test/ImageDataTest.cpp +++ b/src/Magnum/Trade/Test/ImageDataTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/Test/ObjectData2DTest.cpp b/src/Magnum/Trade/Test/ObjectData2DTest.cpp index b914ee27e..fa65e8e78 100644 --- a/src/Magnum/Trade/Test/ObjectData2DTest.cpp +++ b/src/Magnum/Trade/Test/ObjectData2DTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/Test/ObjectData3DTest.cpp b/src/Magnum/Trade/Test/ObjectData3DTest.cpp index f11624aa7..4f5a0d674 100644 --- a/src/Magnum/Trade/Test/ObjectData3DTest.cpp +++ b/src/Magnum/Trade/Test/ObjectData3DTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/Test/TextureDataTest.cpp b/src/Magnum/Trade/Test/TextureDataTest.cpp index 1e27b528b..30c0050c1 100644 --- a/src/Magnum/Trade/Test/TextureDataTest.cpp +++ b/src/Magnum/Trade/Test/TextureDataTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/Test/configure.h.cmake b/src/Magnum/Trade/Test/configure.h.cmake index 51b292ac3..d39dc3cdf 100644 --- a/src/Magnum/Trade/Test/configure.h.cmake +++ b/src/Magnum/Trade/Test/configure.h.cmake @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/TextureData.cpp b/src/Magnum/Trade/TextureData.cpp index 4120e99ac..d0be1a163 100644 --- a/src/Magnum/Trade/TextureData.cpp +++ b/src/Magnum/Trade/TextureData.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/TextureData.h b/src/Magnum/Trade/TextureData.h index 0b83c07b8..23cfe3071 100644 --- a/src/Magnum/Trade/TextureData.h +++ b/src/Magnum/Trade/TextureData.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Trade/Trade.h b/src/Magnum/Trade/Trade.h index 0371ddce8..85d791a2b 100644 --- a/src/Magnum/Trade/Trade.h +++ b/src/Magnum/Trade/Trade.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TransformFeedback.cpp b/src/Magnum/TransformFeedback.cpp index fbc9762b3..1ec6160c0 100644 --- a/src/Magnum/TransformFeedback.cpp +++ b/src/Magnum/TransformFeedback.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/TransformFeedback.h b/src/Magnum/TransformFeedback.h index 8c398f967..602d3ba2a 100644 --- a/src/Magnum/TransformFeedback.h +++ b/src/Magnum/TransformFeedback.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Types.h b/src/Magnum/Types.h index 7da8730a8..0b73e006e 100644 --- a/src/Magnum/Types.h +++ b/src/Magnum/Types.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Version.cpp b/src/Magnum/Version.cpp index ca4ff2696..be628069d 100644 --- a/src/Magnum/Version.cpp +++ b/src/Magnum/Version.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/Version.h b/src/Magnum/Version.h index 37515ae12..f7bbf990c 100644 --- a/src/Magnum/Version.h +++ b/src/Magnum/Version.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/configure.h.cmake b/src/Magnum/configure.h.cmake index 2f7d74c0a..0a4e7da66 100644 --- a/src/Magnum/configure.h.cmake +++ b/src/Magnum/configure.h.cmake @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Magnum/visibility.h b/src/Magnum/visibility.h index 771f6ea34..eac214616 100644 --- a/src/Magnum/visibility.h +++ b/src/Magnum/visibility.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumExternal/CMakeLists.txt b/src/MagnumExternal/CMakeLists.txt index 550c057bc..63db16444 100644 --- a/src/MagnumExternal/CMakeLists.txt +++ b/src/MagnumExternal/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumExternal/OpenAL/CMakeLists.txt b/src/MagnumExternal/OpenAL/CMakeLists.txt index 2076113e4..0da1c4b3f 100644 --- a/src/MagnumExternal/OpenAL/CMakeLists.txt +++ b/src/MagnumExternal/OpenAL/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # Copyright © 2015 Jonathan Hale # diff --git a/src/MagnumExternal/OpenAL/extensions.h b/src/MagnumExternal/OpenAL/extensions.h index bae6dd256..c0c60c30a 100644 --- a/src/MagnumExternal/OpenAL/extensions.h +++ b/src/MagnumExternal/OpenAL/extensions.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Copyright © 2015 Jonathan Hale diff --git a/src/MagnumExternal/OpenGL/CMakeLists.txt b/src/MagnumExternal/OpenGL/CMakeLists.txt index 2a95c3225..85c1067c7 100644 --- a/src/MagnumExternal/OpenGL/CMakeLists.txt +++ b/src/MagnumExternal/OpenGL/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumExternal/OpenGL/GL/CMakeLists.txt b/src/MagnumExternal/OpenGL/GL/CMakeLists.txt index 0009c0fb1..fea1eb959 100644 --- a/src/MagnumExternal/OpenGL/GL/CMakeLists.txt +++ b/src/MagnumExternal/OpenGL/GL/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt b/src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt index b9482f594..b2db05953 100644 --- a/src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt +++ b/src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt b/src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt index 26f645a83..f08212d95 100644 --- a/src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt +++ b/src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumExternal/OpenGL/KHR/CMakeLists.txt b/src/MagnumExternal/OpenGL/KHR/CMakeLists.txt index d4c06d3c7..b237f4be6 100644 --- a/src/MagnumExternal/OpenGL/KHR/CMakeLists.txt +++ b/src/MagnumExternal/OpenGL/KHR/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumExternal/Optional/CMakeLists.txt b/src/MagnumExternal/Optional/CMakeLists.txt index c92bd42e0..06c3b1955 100644 --- a/src/MagnumExternal/Optional/CMakeLists.txt +++ b/src/MagnumExternal/Optional/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/CMakeLists.txt b/src/MagnumPlugins/CMakeLists.txt index c5c617fc3..13b85f2f9 100644 --- a/src/MagnumPlugins/CMakeLists.txt +++ b/src/MagnumPlugins/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/MagnumFont/CMakeLists.txt b/src/MagnumPlugins/MagnumFont/CMakeLists.txt index bd367aef3..1ed54ac21 100644 --- a/src/MagnumPlugins/MagnumFont/CMakeLists.txt +++ b/src/MagnumPlugins/MagnumFont/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/MagnumFont/MagnumFont.cpp b/src/MagnumPlugins/MagnumFont/MagnumFont.cpp index 2295cbd00..b9e1648fe 100644 --- a/src/MagnumPlugins/MagnumFont/MagnumFont.cpp +++ b/src/MagnumPlugins/MagnumFont/MagnumFont.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/MagnumFont/MagnumFont.h b/src/MagnumPlugins/MagnumFont/MagnumFont.h index 957c81de5..bab42fd40 100644 --- a/src/MagnumPlugins/MagnumFont/MagnumFont.h +++ b/src/MagnumPlugins/MagnumFont/MagnumFont.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt b/src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt index f73da3d62..ea9242741 100644 --- a/src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt +++ b/src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp b/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp index 3a3818fca..3e6183d99 100644 --- a/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp +++ b/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/MagnumFont/Test/configure.h.cmake b/src/MagnumPlugins/MagnumFont/Test/configure.h.cmake index 9284dbef6..e84b90d3d 100644 --- a/src/MagnumPlugins/MagnumFont/Test/configure.h.cmake +++ b/src/MagnumPlugins/MagnumFont/Test/configure.h.cmake @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/MagnumFont/pluginRegistration.cpp b/src/MagnumPlugins/MagnumFont/pluginRegistration.cpp index 5d121821d..34c1b92c6 100644 --- a/src/MagnumPlugins/MagnumFont/pluginRegistration.cpp +++ b/src/MagnumPlugins/MagnumFont/pluginRegistration.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt b/src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt index 184a4d386..2d5a7fd43 100644 --- a/src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt +++ b/src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp index a961e754e..8ec23908f 100644 --- a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp +++ b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.h b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.h index b98957ec1..6aa6603f5 100644 --- a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.h +++ b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt b/src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt index 6e97d3ad3..5ff4773ec 100644 --- a/src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp b/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp index 7db3ff572..d98c69f32 100644 --- a/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp +++ b/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/MagnumFontConverter/Test/configure.h.cmake b/src/MagnumPlugins/MagnumFontConverter/Test/configure.h.cmake index 84061f8ce..37e4d1df6 100644 --- a/src/MagnumPlugins/MagnumFontConverter/Test/configure.h.cmake +++ b/src/MagnumPlugins/MagnumFontConverter/Test/configure.h.cmake @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/MagnumFontConverter/pluginRegistration.cpp b/src/MagnumPlugins/MagnumFontConverter/pluginRegistration.cpp index 01390adf4..b45853467 100644 --- a/src/MagnumPlugins/MagnumFontConverter/pluginRegistration.cpp +++ b/src/MagnumPlugins/MagnumFontConverter/pluginRegistration.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/ObjImporter/CMakeLists.txt b/src/MagnumPlugins/ObjImporter/CMakeLists.txt index a4d8e9d3b..616459c7b 100644 --- a/src/MagnumPlugins/ObjImporter/CMakeLists.txt +++ b/src/MagnumPlugins/ObjImporter/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/ObjImporter/ObjImporter.cpp b/src/MagnumPlugins/ObjImporter/ObjImporter.cpp index 0ca0b581b..125237f54 100644 --- a/src/MagnumPlugins/ObjImporter/ObjImporter.cpp +++ b/src/MagnumPlugins/ObjImporter/ObjImporter.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/ObjImporter/ObjImporter.h b/src/MagnumPlugins/ObjImporter/ObjImporter.h index 14d2a7d78..a6132ba7b 100644 --- a/src/MagnumPlugins/ObjImporter/ObjImporter.h +++ b/src/MagnumPlugins/ObjImporter/ObjImporter.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt b/src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt index ecbd0e1a6..e0a2228a1 100644 --- a/src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/ObjImporter/Test/Test.cpp b/src/MagnumPlugins/ObjImporter/Test/Test.cpp index 6583c5662..df1bc8e21 100644 --- a/src/MagnumPlugins/ObjImporter/Test/Test.cpp +++ b/src/MagnumPlugins/ObjImporter/Test/Test.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/ObjImporter/Test/configure.h.cmake b/src/MagnumPlugins/ObjImporter/Test/configure.h.cmake index c0f82e29a..459564c9c 100644 --- a/src/MagnumPlugins/ObjImporter/Test/configure.h.cmake +++ b/src/MagnumPlugins/ObjImporter/Test/configure.h.cmake @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/ObjImporter/pluginRegistration.cpp b/src/MagnumPlugins/ObjImporter/pluginRegistration.cpp index ba5190e6a..41fef90b1 100644 --- a/src/MagnumPlugins/ObjImporter/pluginRegistration.cpp +++ b/src/MagnumPlugins/ObjImporter/pluginRegistration.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/TgaImageConverter/CMakeLists.txt b/src/MagnumPlugins/TgaImageConverter/CMakeLists.txt index 092b4b850..0a4e62ff8 100644 --- a/src/MagnumPlugins/TgaImageConverter/CMakeLists.txt +++ b/src/MagnumPlugins/TgaImageConverter/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt b/src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt index ac043ba78..bb3f0f0b1 100644 --- a/src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp b/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp index 6e68608f8..52b003d27 100644 --- a/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp +++ b/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/TgaImageConverter/Test/configure.h.cmake b/src/MagnumPlugins/TgaImageConverter/Test/configure.h.cmake index 1489956ed..c2d991989 100644 --- a/src/MagnumPlugins/TgaImageConverter/Test/configure.h.cmake +++ b/src/MagnumPlugins/TgaImageConverter/Test/configure.h.cmake @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp index 752efccfa..af9817c0f 100644 --- a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp +++ b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.h b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.h index 62965f476..308973d4b 100644 --- a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.h +++ b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/TgaImageConverter/configure.h.cmake b/src/MagnumPlugins/TgaImageConverter/configure.h.cmake index d0c23cf82..34bdda52e 100644 --- a/src/MagnumPlugins/TgaImageConverter/configure.h.cmake +++ b/src/MagnumPlugins/TgaImageConverter/configure.h.cmake @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/TgaImageConverter/pluginRegistration.cpp b/src/MagnumPlugins/TgaImageConverter/pluginRegistration.cpp index 341cc233e..f52316869 100644 --- a/src/MagnumPlugins/TgaImageConverter/pluginRegistration.cpp +++ b/src/MagnumPlugins/TgaImageConverter/pluginRegistration.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/TgaImporter/CMakeLists.txt b/src/MagnumPlugins/TgaImporter/CMakeLists.txt index 0be16ad88..e02987036 100644 --- a/src/MagnumPlugins/TgaImporter/CMakeLists.txt +++ b/src/MagnumPlugins/TgaImporter/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt b/src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt index a20229b2a..3405b61a5 100644 --- a/src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp b/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp index be22bff2d..e4e823d05 100644 --- a/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp +++ b/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/TgaImporter/Test/configure.h.cmake b/src/MagnumPlugins/TgaImporter/Test/configure.h.cmake index 20b731aa2..cb625138d 100644 --- a/src/MagnumPlugins/TgaImporter/Test/configure.h.cmake +++ b/src/MagnumPlugins/TgaImporter/Test/configure.h.cmake @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/TgaImporter/TgaHeader.h b/src/MagnumPlugins/TgaImporter/TgaHeader.h index 0ccb681fd..641b2b263 100644 --- a/src/MagnumPlugins/TgaImporter/TgaHeader.h +++ b/src/MagnumPlugins/TgaImporter/TgaHeader.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/TgaImporter/TgaImporter.cpp b/src/MagnumPlugins/TgaImporter/TgaImporter.cpp index e052eceeb..2923e0a86 100644 --- a/src/MagnumPlugins/TgaImporter/TgaImporter.cpp +++ b/src/MagnumPlugins/TgaImporter/TgaImporter.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/TgaImporter/TgaImporter.h b/src/MagnumPlugins/TgaImporter/TgaImporter.h index 14ac168ac..45c2087b6 100644 --- a/src/MagnumPlugins/TgaImporter/TgaImporter.h +++ b/src/MagnumPlugins/TgaImporter/TgaImporter.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/TgaImporter/configure.h.cmake b/src/MagnumPlugins/TgaImporter/configure.h.cmake index aea9ee97c..a890086b2 100644 --- a/src/MagnumPlugins/TgaImporter/configure.h.cmake +++ b/src/MagnumPlugins/TgaImporter/configure.h.cmake @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/TgaImporter/pluginRegistration.cpp b/src/MagnumPlugins/TgaImporter/pluginRegistration.cpp index 03e613f66..a7a112b71 100644 --- a/src/MagnumPlugins/TgaImporter/pluginRegistration.cpp +++ b/src/MagnumPlugins/TgaImporter/pluginRegistration.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/WavAudioImporter/CMakeLists.txt b/src/MagnumPlugins/WavAudioImporter/CMakeLists.txt index db0bd771a..55a2bb1cf 100644 --- a/src/MagnumPlugins/WavAudioImporter/CMakeLists.txt +++ b/src/MagnumPlugins/WavAudioImporter/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt b/src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt index dfdc7c078..0bdd5b631 100644 --- a/src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp b/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp index e69b0d54f..3896c67e2 100644 --- a/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp +++ b/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/WavAudioImporter/Test/configure.h.cmake b/src/MagnumPlugins/WavAudioImporter/Test/configure.h.cmake index ca489a0fe..8bcf9cc77 100644 --- a/src/MagnumPlugins/WavAudioImporter/Test/configure.h.cmake +++ b/src/MagnumPlugins/WavAudioImporter/Test/configure.h.cmake @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/WavAudioImporter/WavHeader.h b/src/MagnumPlugins/WavAudioImporter/WavHeader.h index 9b368a982..4948fea35 100644 --- a/src/MagnumPlugins/WavAudioImporter/WavHeader.h +++ b/src/MagnumPlugins/WavAudioImporter/WavHeader.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/WavAudioImporter/WavImporter.cpp b/src/MagnumPlugins/WavAudioImporter/WavImporter.cpp index dd55be188..aa001e105 100644 --- a/src/MagnumPlugins/WavAudioImporter/WavImporter.cpp +++ b/src/MagnumPlugins/WavAudioImporter/WavImporter.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/WavAudioImporter/WavImporter.h b/src/MagnumPlugins/WavAudioImporter/WavImporter.h index 0a4d233e3..20b272523 100644 --- a/src/MagnumPlugins/WavAudioImporter/WavImporter.h +++ b/src/MagnumPlugins/WavAudioImporter/WavImporter.h @@ -3,7 +3,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MagnumPlugins/WavAudioImporter/pluginRegistration.cpp b/src/MagnumPlugins/WavAudioImporter/pluginRegistration.cpp index 514228b8c..76c942633 100644 --- a/src/MagnumPlugins/WavAudioImporter/pluginRegistration.cpp +++ b/src/MagnumPlugins/WavAudioImporter/pluginRegistration.cpp @@ -1,7 +1,7 @@ /* This file is part of Magnum. - Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a From d60fa66b27567621ba9b7929331cfa6411d13a41 Mon Sep 17 00:00:00 2001 From: Sam Spilsbury Date: Sun, 7 Feb 2016 03:34:44 +0000 Subject: [PATCH 114/258] AbstractFramebuffer: Always use bindImplementationSingle for WebGL WebGL doesn't support anything else. --- src/Magnum/AbstractFramebuffer.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Magnum/AbstractFramebuffer.cpp b/src/Magnum/AbstractFramebuffer.cpp index c6e887f5c..47e61af6e 100644 --- a/src/Magnum/AbstractFramebuffer.cpp +++ b/src/Magnum/AbstractFramebuffer.cpp @@ -105,10 +105,12 @@ void AbstractFramebuffer::bind() { } void AbstractFramebuffer::bindInternal(FramebufferTarget target) { - #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - (this->*Context::current().state().framebuffer->bindImplementation)(target); - #else + #ifndef MAGNUM_TARGET_GLES2 bindImplementationDefault(target); + #elif defined(MAGNUM_TARGET_WEBGL) + bindImplementationSingle(); + #else + (this->*Context::current().state().framebuffer->bindImplementation)(target); #endif } @@ -146,10 +148,12 @@ void AbstractFramebuffer::bindImplementationDefault(FramebufferTarget target) { } FramebufferTarget AbstractFramebuffer::bindInternal() { - #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - return (this->*Context::current().state().framebuffer->bindInternalImplementation)(); - #else + #ifndef MAGNUM_TARGET_GLES2 return bindImplementationDefault(); + #elif defined(MAGNUM_TARGET_WEBGL) + return bindImplementationSingle(); + #else + return (this->*Context::current().state().framebuffer->bindInternalImplementation)(); #endif } From 107d4ce42293b0abdc535e3b1d8330f3bb9eacf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 7 Feb 2016 19:42:08 +0100 Subject: [PATCH 115/258] Fix unused variable warning on Emscripten. --- src/Magnum/AbstractFramebuffer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Magnum/AbstractFramebuffer.cpp b/src/Magnum/AbstractFramebuffer.cpp index 47e61af6e..d5ced3a92 100644 --- a/src/Magnum/AbstractFramebuffer.cpp +++ b/src/Magnum/AbstractFramebuffer.cpp @@ -108,6 +108,7 @@ void AbstractFramebuffer::bindInternal(FramebufferTarget target) { #ifndef MAGNUM_TARGET_GLES2 bindImplementationDefault(target); #elif defined(MAGNUM_TARGET_WEBGL) + static_cast(target); bindImplementationSingle(); #else (this->*Context::current().state().framebuffer->bindImplementation)(target); From 38fc5884de65b5828287deade5de7978f230af16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 7 Feb 2016 19:42:30 +0100 Subject: [PATCH 116/258] package/archlinux: don't compile WavAudioImporter on Emscripten. We don't have OpenAL there. --- package/archlinux/PKGBUILD-emscripten | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package/archlinux/PKGBUILD-emscripten b/package/archlinux/PKGBUILD-emscripten index 1142dc9ed..ba6c218bc 100644 --- a/package/archlinux/PKGBUILD-emscripten +++ b/package/archlinux/PKGBUILD-emscripten @@ -32,8 +32,7 @@ build() { -DWITH_MAGNUMFONT=ON \ -DWITH_OBJIMPORTER=ON \ -DWITH_TGAIMAGECONVERTER=ON \ - -DWITH_TGAIMPORTER=ON \ - -DWITH_WAVAUDIOIMPORTER=ON + -DWITH_TGAIMPORTER=ON make } From f52e156e901f6a3473f1c542c75d7c05d64b0a48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 7 Feb 2016 19:42:54 +0100 Subject: [PATCH 117/258] Platform: print Buffer::minMapAlignment() in magnum-info. --- src/Magnum/Platform/magnum-info.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index bef644ed0..3a48f47b2 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -398,6 +398,14 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat } #endif + #ifndef MAGNUM_TARGET_GLES + if(c.isExtensionSupported()) { + _h(ARB::map_buffer_alignment) + + _l(Buffer::minMapAlignment()) + } + #endif + #ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES if(c.isExtensionSupported()) From da9e86fc777749d76cf5ae0d69ddfd37b798baa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 8 Feb 2016 09:52:36 +0100 Subject: [PATCH 118/258] Math: ability to join two ranges. I had to include Functions.h, there was no other way to do this. I have to schedule include cleanup soon. --- src/Magnum/Math/Range.h | 14 ++++++++++++++ src/Magnum/Math/Test/RangeTest.cpp | 16 ++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/Magnum/Math/Range.h b/src/Magnum/Math/Range.h index 7b79214fb..2a5702321 100644 --- a/src/Magnum/Math/Range.h +++ b/src/Magnum/Math/Range.h @@ -29,6 +29,7 @@ * @brief Class @ref Magnum::Math::Range, @ref Magnum::Math::Range2D, @ref Magnum::Math::Range3D, alias @ref Magnum::Math::Range1D */ +#include "Magnum/Math/Functions.h" #include "Magnum/Math/Vector3.h" namespace Magnum { namespace Math { @@ -523,6 +524,19 @@ template class Range3D: public Range<3, T> { MAGNUM_RANGE_SUBCLASS_IMPLEMENTATION(3, Range3D, Vector3) }; +/** @relates Range +@brief Join two ranges + +Returns a range that contains both input ranges. If one of the ranges is empty, +only the other is returned. Results are undefined if any range has negative +size. +*/ +template inline Range join(const Range& a, const Range& b) { + if(a.min() == a.max()) return b; + if(b.min() == b.max()) return a; + return {min(a.min(), b.min()), max(a.max(), b.max())}; +} + /** @debugoperator{Magnum::Math::Range} */ template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Range& value) { debug << "Range({" << Corrade::Utility::Debug::nospace << value.min()[0]; diff --git a/src/Magnum/Math/Test/RangeTest.cpp b/src/Magnum/Math/Test/RangeTest.cpp index 0973ab36f..f6938ef51 100644 --- a/src/Magnum/Math/Test/RangeTest.cpp +++ b/src/Magnum/Math/Test/RangeTest.cpp @@ -123,6 +123,8 @@ struct RangeTest: Corrade::TestSuite::Tester { void padded(); void scaled(); + void join(); + void subclassTypes(); void subclass(); @@ -157,6 +159,8 @@ RangeTest::RangeTest() { &RangeTest::padded, &RangeTest::scaled, + &RangeTest::join, + &RangeTest::subclassTypes, &RangeTest::subclass, @@ -446,6 +450,18 @@ void RangeTest::scaled() { CORRADE_COMPARE(a.scaled({2, -3}), b); } +void RangeTest::join() { + Range2Di a{{12, 20}, {15, 35}}; + Range2Di b{{10, 25}, {17, 105}}; + Range2Di c{{130, -15}, {130, -15}}; + Range2Di d{{10, 20}, {17, 105}}; + + CORRADE_COMPARE(Math::join(a, b), d); + CORRADE_COMPARE(Math::join(b, a), d); + CORRADE_COMPARE(Math::join(a, c), a); + CORRADE_COMPARE(Math::join(c, a), a); +} + template class BasicRect: public Math::Range<2, T> { public: /* MSVC 2015 can't handle {} here */ From 5fe0d3e8fec8daf8bd56b0a309d18ea3e6d4e379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 8 Feb 2016 09:53:28 +0100 Subject: [PATCH 119/258] Math: doc++ --- src/Magnum/Math/Range.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/Math/Range.h b/src/Magnum/Math/Range.h index 2a5702321..f6c5916bc 100644 --- a/src/Magnum/Math/Range.h +++ b/src/Magnum/Math/Range.h @@ -63,7 +63,7 @@ template class Range { typedef typename Implementation::RangeTraits::Type VectorType; /** - * Create range from minimal coordinates and size + * @brief Create range from minimal coordinates and size * @param min Minimal coordinates * @param size Range size */ From 4658d9fbb24189b8e5ec0f2ce5a418b2b680e9c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 8 Feb 2016 09:53:42 +0100 Subject: [PATCH 120/258] package/archlinux: colored test output. --- package/archlinux/PKGBUILD | 2 +- package/archlinux/PKGBUILD-clang | 2 +- package/archlinux/PKGBUILD-clang-libc++ | 2 +- package/archlinux/PKGBUILD-es2 | 2 +- package/archlinux/PKGBUILD-es2desktop | 2 +- package/archlinux/PKGBUILD-es3 | 2 +- package/archlinux/PKGBUILD-es3desktop | 2 +- package/archlinux/PKGBUILD-gcc47 | 2 +- package/archlinux/PKGBUILD-release | 4 ++-- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package/archlinux/PKGBUILD b/package/archlinux/PKGBUILD index 592d3029a..802d0e050 100644 --- a/package/archlinux/PKGBUILD +++ b/package/archlinux/PKGBUILD @@ -49,7 +49,7 @@ build() { check() { cd "$_rootdir/build" - ctest --output-on-failure -j5 + CORRADE_TEST_COLOR=ON ctest --output-on-failure -j5 } package() { diff --git a/package/archlinux/PKGBUILD-clang b/package/archlinux/PKGBUILD-clang index 57baa3023..2d8bee6a8 100644 --- a/package/archlinux/PKGBUILD-clang +++ b/package/archlinux/PKGBUILD-clang @@ -51,7 +51,7 @@ build() { check() { cd "$_rootdir/build-clang" - ctest --output-on-failure -j5 + CORRADE_TEST_COLOR=ON ctest --output-on-failure -j5 } package() { diff --git a/package/archlinux/PKGBUILD-clang-libc++ b/package/archlinux/PKGBUILD-clang-libc++ index 7e1e1a9db..d8aa8f7e0 100644 --- a/package/archlinux/PKGBUILD-clang-libc++ +++ b/package/archlinux/PKGBUILD-clang-libc++ @@ -54,7 +54,7 @@ build() { check() { cd "$_rootdir/build-clang-libc++" - ctest --output-on-failure -j5 + CORRADE_TEST_COLOR=ON ctest --output-on-failure -j5 } package() { diff --git a/package/archlinux/PKGBUILD-es2 b/package/archlinux/PKGBUILD-es2 index 2eea4e0c4..572e3e47f 100644 --- a/package/archlinux/PKGBUILD-es2 +++ b/package/archlinux/PKGBUILD-es2 @@ -37,7 +37,7 @@ build() { check() { cd "$_rootdir/build-es2" - ctest --output-on-failure -j5 + CORRADE_TEST_COLOR=ON ctest --output-on-failure -j5 } package() { diff --git a/package/archlinux/PKGBUILD-es2desktop b/package/archlinux/PKGBUILD-es2desktop index 552984b26..48db9b46d 100644 --- a/package/archlinux/PKGBUILD-es2desktop +++ b/package/archlinux/PKGBUILD-es2desktop @@ -44,7 +44,7 @@ build() { check() { cd "$_rootdir/build-es2desktop" - ctest --output-on-failure -j5 + CORRADE_TEST_COLOR=ON ctest --output-on-failure -j5 } package() { diff --git a/package/archlinux/PKGBUILD-es3 b/package/archlinux/PKGBUILD-es3 index 587a1f9a7..132ffaa72 100644 --- a/package/archlinux/PKGBUILD-es3 +++ b/package/archlinux/PKGBUILD-es3 @@ -37,7 +37,7 @@ build() { check() { cd "$_rootdir/build-es3" - ctest --output-on-failure -j5 + CORRADE_TEST_COLOR=ON ctest --output-on-failure -j5 } package() { diff --git a/package/archlinux/PKGBUILD-es3desktop b/package/archlinux/PKGBUILD-es3desktop index 9855e7c3a..1978c0f7a 100644 --- a/package/archlinux/PKGBUILD-es3desktop +++ b/package/archlinux/PKGBUILD-es3desktop @@ -44,7 +44,7 @@ build() { check() { cd "$_rootdir/build-es3desktop" - ctest --output-on-failure -j5 + CORRADE_TEST_COLOR=ON ctest --output-on-failure -j5 } package() { diff --git a/package/archlinux/PKGBUILD-gcc47 b/package/archlinux/PKGBUILD-gcc47 index acda7ac47..c77ca4da1 100644 --- a/package/archlinux/PKGBUILD-gcc47 +++ b/package/archlinux/PKGBUILD-gcc47 @@ -56,7 +56,7 @@ build() { check() { cd "$_rootdir/build-gcc47" - ctest --output-on-failure -j5 + CORRADE_TEST_COLOR=ON ctest --output-on-failure -j5 } package() { diff --git a/package/archlinux/PKGBUILD-release b/package/archlinux/PKGBUILD-release index c675243a7..adf57f9b5 100644 --- a/package/archlinux/PKGBUILD-release +++ b/package/archlinux/PKGBUILD-release @@ -71,10 +71,10 @@ build() { check() { cd "$_rootdir/build" - ctest --output-on-failure -j5 + CORRADE_TEST_COLOR=ON ctest --output-on-failure -j5 cd "$_rootdir/build-release" - ctest --output-on-failure -j5 + CORRADE_TEST_COLOR=ON ctest --output-on-failure -j5 } package() { From 2a62e6772e2b64d5657ca7254072a241a7759e4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 9 Feb 2016 16:09:23 +0100 Subject: [PATCH 121/258] Platform: fix viewport initialization on iOS. --- src/Magnum/Platform/Sdl2Application.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 8665ee508..5db35ca28 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -232,6 +232,16 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { return false; } + #ifdef CORRADE_TARGET_IOS + /* iOS has zero initial GL_VIEWPORT size, get drawable size and put it back + in so all other code can assume that the viewport is set to sane values. + Fortunately on iOS we also don't have to load any function pointers so + it's safe to do the glViewport() call as it is linked statically. */ + Vector2i drawableSize; + SDL_GL_GetDrawableSize(_window, &drawableSize.x(), &drawableSize.y()); + glViewport(0, 0, drawableSize.x(), drawableSize.y()); + #endif + #else /* Emscripten-specific initialization */ _glContext = SDL_SetVideoMode(configuration.size().x(), configuration.size().y(), 24, SDL_OPENGL|SDL_HWSURFACE|SDL_DOUBLEBUF); From 19590df462aa90d27c6adfb200191f0a339ce9a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 9 Feb 2016 16:09:57 +0100 Subject: [PATCH 122/258] Platform: added iOS HiDPI and menu bar toggles to Sdl2Application. Except for the documentation the project is now ready for iOS! --- src/Magnum/Platform/Sdl2Application.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index be4ad3934..aabd3f8a0 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -578,6 +578,18 @@ class Sdl2Application::Configuration { enum class WindowFlag: Uint32 { Resizable = SDL_WINDOW_RESIZABLE, /**< Resizable window */ Fullscreen = SDL_WINDOW_FULLSCREEN, /**< Fullscreen window */ + + /** No window decoration. On iOS this hides the menu bar. */ + Borderless = SDL_WINDOW_BORDERLESS, + + #ifndef CORRADE_TARGET_EMSCRIPTEN + /** + * Allow high DPI. + * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". + */ + AllowHighDpi = SDL_WINDOW_ALLOW_HIGHDPI, + #endif + Hidden = SDL_WINDOW_HIDDEN, /**< Hidden window */ Maximized = SDL_WINDOW_MAXIMIZED, /**< Maximized window */ Minimized = SDL_WINDOW_MINIMIZED, /**< Minimized window */ From d6d0fd18901c257b2eda9440c66b122ed6f31e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 8 Feb 2016 21:34:16 +0100 Subject: [PATCH 123/258] Math: test that it's possible to convert Vector<1, T> to T. It's not (but should be). --- src/Magnum/Math/Test/VectorTest.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Math/Test/VectorTest.cpp b/src/Magnum/Math/Test/VectorTest.cpp index 5ce3e22a1..903a35245 100644 --- a/src/Magnum/Math/Test/VectorTest.cpp +++ b/src/Magnum/Math/Test/VectorTest.cpp @@ -214,7 +214,11 @@ void VectorTest::constructOneComponent() { /* Implicit constructor must work */ constexpr Vector1 vec = 1.0f; - CORRADE_COMPARE(vec, Vector1(1)); + CORRADE_COMPARE(vec, Vector1{1.0f}); + + /* Conversion back must also work */ + Float value = vec; + CORRADE_COMPARE(value, 1.0f); } void VectorTest::constructConversion() { From ca0892f0263785456ed4f4f4dd58de0722a5292c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 8 Feb 2016 21:34:41 +0100 Subject: [PATCH 124/258] Math: make it possible to convert Vector<1, T> to T. --- src/Magnum/Math/Vector.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Magnum/Math/Vector.h b/src/Magnum/Math/Vector.h index cc10cccc3..2110cb643 100644 --- a/src/Magnum/Math/Vector.h +++ b/src/Magnum/Math/Vector.h @@ -211,6 +211,11 @@ template class Vector { return Implementation::VectorConverter::to(*this); } + /** @brief Convert single-component vector to scalar value */ + template::type> constexpr /*implicit*/ operator U() const { + return *_data; + } + /** * @brief Raw data * @return One-dimensional array of `size` length. From 1dc9ba8611dcc2cf413f5e7c5fa91eb3cb401120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 10 Feb 2016 17:15:16 +0100 Subject: [PATCH 125/258] package/debian: fix build on machines with custom binary NV drivers. WHAT THE FUCK. THIS IS INSANE. --- package/debian/rules | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package/debian/rules b/package/debian/rules index 2c7d6233b..c20a60cdc 100755 --- a/package/debian/rules +++ b/package/debian/rules @@ -19,3 +19,9 @@ override_dh_auto_configure: -DWITH_DISTANCEFIELDCONVERTER=ON \ -DWITH_FONTCONVERTER=ON \ -DWITH_MAGNUMINFO=ON + +# Extraordinarily coarse way to suppress error about libGL not being in +# dependencies when the user has installed NVidia binary drivers which are not +# in the repositories. Can't I just IGNORE A SIGNLE FILE DAMMIT?! +override_dh_shlibdeps: + dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info From 4caef08ceebe61c19903ea8cc2f3cfe54058bdde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 10 Feb 2016 17:16:14 +0100 Subject: [PATCH 126/258] Doc++ --- src/Magnum/PixelFormat.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magnum/PixelFormat.h b/src/Magnum/PixelFormat.h index 8059779e3..118c1af45 100644 --- a/src/Magnum/PixelFormat.h +++ b/src/Magnum/PixelFormat.h @@ -598,8 +598,8 @@ enum class CompressedPixelFormat: GLenum { * RGTC compressed red channel, normalized unsigned. **Available only for * 2D, 2D array, cube map and cube map array textures.** * @requires_gl30 Extension @extension{EXT,texture_compression_rgtc} - * @requires_gl Generic texture compression is not available in OpenGL ES - * or WebGL. + * @requires_gl RGTC texture compression is not available in OpenGL ES or + * WebGL. */ RedRgtc1 = GL_COMPRESSED_RED_RGTC1, From 5d110ba7b1cfe24e98056a42cbd8a6fae1ad8cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 10 Feb 2016 17:16:31 +0100 Subject: [PATCH 127/258] Math: added Range::contains(). --- src/Magnum/Math/Range.h | 5 +++++ src/Magnum/Math/Test/RangeTest.cpp | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/Magnum/Math/Range.h b/src/Magnum/Math/Range.h index f6c5916bc..4161668e9 100644 --- a/src/Magnum/Math/Range.h +++ b/src/Magnum/Math/Range.h @@ -186,6 +186,11 @@ template class Range { */ Range scaled(const VectorType& scaling) const; + /** @brief Whether given point is contained inside the range */ + constexpr bool contains(const VectorType& a) const { + return (a >= _min).all() && (a < _max).all(); + } + private: VectorType _min, _max; }; diff --git a/src/Magnum/Math/Test/RangeTest.cpp b/src/Magnum/Math/Test/RangeTest.cpp index f6938ef51..a428f77d9 100644 --- a/src/Magnum/Math/Test/RangeTest.cpp +++ b/src/Magnum/Math/Test/RangeTest.cpp @@ -123,6 +123,7 @@ struct RangeTest: Corrade::TestSuite::Tester { void padded(); void scaled(); + void contains(); void join(); void subclassTypes(); @@ -159,6 +160,7 @@ RangeTest::RangeTest() { &RangeTest::padded, &RangeTest::scaled, + &RangeTest::contains, &RangeTest::join, &RangeTest::subclassTypes, @@ -450,6 +452,14 @@ void RangeTest::scaled() { CORRADE_COMPARE(a.scaled({2, -3}), b); } +void RangeTest::contains() { + Range2Di a({34, 23}, {47, 30}); + + CORRADE_VERIFY(a.contains({40, 23})); + CORRADE_VERIFY(!a.contains({33, 23})); + CORRADE_VERIFY(!a.contains({40, 30})); +} + void RangeTest::join() { Range2Di a{{12, 20}, {15, 35}}; Range2Di b{{10, 25}, {17, 105}}; From 18bb3fccfc22203fa1702f98fe8a4580afbc5b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 11 Feb 2016 10:35:11 +0100 Subject: [PATCH 128/258] Platform: fix iOS display orientation events in Sdl2Application. --- src/Magnum/Platform/Sdl2Application.cpp | 12 ++++++++++-- src/Magnum/Platform/Sdl2Application.h | 7 ++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 5db35ca28..a5bef0bd7 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -321,10 +321,18 @@ void Sdl2Application::mainLoop() { switch(event.type) { case SDL_WINDOWEVENT: switch(event.window.event) { - case SDL_WINDOWEVENT_RESIZED: + case SDL_WINDOWEVENT_RESIZED: { + #ifndef CORRADE_TARGET_IOS viewportEvent({event.window.data1, event.window.data2}); + #else + /* On iOS the window event is in points and not pixels, + but we need pixels to call glViewport() properly */ + Vector2i drawableSize; + SDL_GL_GetDrawableSize(_window, &drawableSize.x(), &drawableSize.y()); + viewportEvent(drawableSize); + #endif _flags |= Flag::Redraw; - break; + } break; case SDL_WINDOWEVENT_EXPOSED: _flags |= Flag::Redraw; break; diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index aabd3f8a0..a251f0d28 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -576,7 +576,12 @@ class Sdl2Application::Configuration { * @see @ref WindowFlags, @ref setWindowFlags() */ enum class WindowFlag: Uint32 { - Resizable = SDL_WINDOW_RESIZABLE, /**< Resizable window */ + /** + * Resizable window. On iOS this allows the application to respond + * to display orientation changes. + */ + Resizable = SDL_WINDOW_RESIZABLE, + Fullscreen = SDL_WINDOW_FULLSCREEN, /**< Fullscreen window */ /** No window decoration. On iOS this hides the menu bar. */ From f3d774fa485607bfdf14419b111a65f6cd5528a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 11 Feb 2016 10:48:58 +0100 Subject: [PATCH 129/258] Math: revert ability to convert Vector<1, T> to T. Doesn't solve problem I hoped it would solve (adding pointer and Vector<1, size_t> still doesn't compile), breaks GCC 4.7 build in some crazy way and makes certain previously-working operations (like operator== on Vector<1, int> and int) ambiguous. Not worth pursuing further, I think. This reverts commit ca0892f0263785456ed4f4f4dd58de0722a5292c. This reverts commit d6d0fd18901c257b2eda9440c66b122ed6f31e69. --- src/Magnum/Math/Test/VectorTest.cpp | 6 +----- src/Magnum/Math/Vector.h | 5 ----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/Magnum/Math/Test/VectorTest.cpp b/src/Magnum/Math/Test/VectorTest.cpp index 903a35245..5ce3e22a1 100644 --- a/src/Magnum/Math/Test/VectorTest.cpp +++ b/src/Magnum/Math/Test/VectorTest.cpp @@ -214,11 +214,7 @@ void VectorTest::constructOneComponent() { /* Implicit constructor must work */ constexpr Vector1 vec = 1.0f; - CORRADE_COMPARE(vec, Vector1{1.0f}); - - /* Conversion back must also work */ - Float value = vec; - CORRADE_COMPARE(value, 1.0f); + CORRADE_COMPARE(vec, Vector1(1)); } void VectorTest::constructConversion() { diff --git a/src/Magnum/Math/Vector.h b/src/Magnum/Math/Vector.h index 2110cb643..cc10cccc3 100644 --- a/src/Magnum/Math/Vector.h +++ b/src/Magnum/Math/Vector.h @@ -211,11 +211,6 @@ template class Vector { return Implementation::VectorConverter::to(*this); } - /** @brief Convert single-component vector to scalar value */ - template::type> constexpr /*implicit*/ operator U() const { - return *_data; - } - /** * @brief Raw data * @return One-dimensional array of `size` length. From e70cb8bfdcd99ee0aaa3e8d13b38b259927c336a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 11 Feb 2016 11:41:28 +0100 Subject: [PATCH 130/258] Platform: no point in having SDL2 window title on iOS. --- src/Magnum/Platform/Sdl2Application.cpp | 9 +++++++-- src/Magnum/Platform/Sdl2Application.h | 16 +++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index a5bef0bd7..37310ad73 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -164,7 +164,12 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { } /* Create window */ - if(!(_window = SDL_CreateWindow(configuration.title().data(), + if(!(_window = SDL_CreateWindow( + #ifndef CORRADE_TARGET_IOS + configuration.title().data(), + #else + nullptr, + #endif SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, configuration.size().x(), configuration.size().y(), SDL_WINDOW_OPENGL|windowFlags))) @@ -431,7 +436,7 @@ void Sdl2Application::mouseReleaseEvent(MouseEvent&) {} void Sdl2Application::mouseMoveEvent(MouseMoveEvent&) {} Sdl2Application::Configuration::Configuration(): - #ifndef CORRADE_TARGET_EMSCRIPTEN + #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_IOS) _title("Magnum SDL2 Application"), #endif _size(800, 600), _windowFlags{}, _sampleCount(0) diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index a251f0d28..fefecd3ae 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -617,11 +617,12 @@ class Sdl2Application::Configuration { /*implicit*/ Configuration(); ~Configuration(); - #ifndef CORRADE_TARGET_EMSCRIPTEN + #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_IOS) /** * @brief Window title * - * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". + * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten" + * and @ref CORRADE_TARGET_IOS "iOS". */ std::string title() const { return _title; } #endif @@ -631,11 +632,12 @@ class Sdl2Application::Configuration { * @return Reference to self (for method chaining) * * Default is `"Magnum SDL2 Application"`. - * @note In @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten" this function - * does nothing and is included only for compatibility. You need - * to set the title separately in application's HTML markup. + * @note In @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten" and + * @ref CORRADE_TARGET_IOS "iOS" this function does nothing and is + * included only for compatibility. You need to set the title + * separately in platform-specific configuration file. */ - #ifndef CORRADE_TARGET_EMSCRIPTEN + #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_IOS) Configuration& setTitle(std::string title) { _title = std::move(title); return *this; @@ -756,7 +758,7 @@ class Sdl2Application::Configuration { #endif private: - #ifndef CORRADE_TARGET_EMSCRIPTEN + #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_IOS) std::string _title; #endif Vector2i _size; From a771b60af6ca1e5ade61d92357babdbcbb7a85bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 11 Feb 2016 11:43:15 +0100 Subject: [PATCH 131/258] Platform: use zero window size on iOS and let SDL2 autodetect. Hopefully this feature won't go away in some future version. --- src/Magnum/Platform/Sdl2Application.cpp | 7 ++++++- src/Magnum/Platform/Sdl2Application.h | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 37310ad73..37e0c3b20 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -439,7 +439,12 @@ Sdl2Application::Configuration::Configuration(): #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_IOS) _title("Magnum SDL2 Application"), #endif - _size(800, 600), _windowFlags{}, _sampleCount(0) + #ifndef CORRADE_TARGET_IOS + _size{800, 600}, + #else + _size{}, /* SDL2 detects someting for us */ + #endif + _windowFlags{}, _sampleCount(0) #ifndef CORRADE_TARGET_EMSCRIPTEN , _version(Version::None), _sRGBCapable{false} #endif diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index fefecd3ae..690041b1c 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -653,7 +653,10 @@ class Sdl2Application::Configuration { * @brief Set window size * @return Reference to self (for method chaining) * - * Default is `{800, 600}`. + * Default is `{800, 600}`. On iOS it defaults to a "reasonable" size + * based on whether HiDPI support is enabled using + * @ref WindowFlag::AllowHighDpi, but not necessarily native display + * resolution (you have to set it explicitly). */ Configuration& setSize(const Vector2i& size) { _size = size; From 02b2ce109fa1cd46b139a651c51b0d335de968e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 11 Feb 2016 11:44:12 +0100 Subject: [PATCH 132/258] Platform: doc++ --- src/Magnum/Platform/Sdl2Application.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index 690041b1c..ff6c330bd 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -94,8 +94,8 @@ variable in `toolchains/generic/Emscripten.cmake` to path where Emscripten is installed. Default is `/usr/emscripten`. Then create build directory and run `cmake` and build/install commands in it. -The toolchain needs access to its platform file, so be sure to properly set -**absolute** path to `toolchains/modules/` directory containing `Platform/Emscripten.cmake`. +The toolchain needs access to its platform file, so be sure to properly set **absolute** +path to `toolchains/modules/` directory containing `Platform/Emscripten.cmake`. Set `CMAKE_INSTALL_PREFIX` to have the files installed in proper location (a webserver, e.g. `/srv/http/emscripten`). @@ -578,7 +578,8 @@ class Sdl2Application::Configuration { enum class WindowFlag: Uint32 { /** * Resizable window. On iOS this allows the application to respond - * to display orientation changes. + * to display orientation changes. Implement @ref viewportEvent() + * to react to the resizing events. */ Resizable = SDL_WINDOW_RESIZABLE, From 08c8f5a6350468a1ac20408d69d654c2b7df54e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 11 Feb 2016 11:45:13 +0100 Subject: [PATCH 133/258] Advertise iOS support, document building and usage. --- README.md | 1 + doc/building.dox | 29 ++++++++++ doc/mainpage.dox | 2 +- src/Magnum/Platform/Sdl2Application.h | 82 ++++++++++++++++++++++++++- 4 files changed, 112 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5cf9212e6..0c941e11c 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ Platforms: SDL2 or GLUT toolkit) [![Build Status](https://travis-ci.org/mosra/magnum.svg?branch=master)](https://travis-ci.org/mosra/magnum) * **Windows** natively or using ANGLE (through SDL2 or GLUT toolkit) [![Build status](https://ci.appveyor.com/api/projects/status/5b477m034cfaskse/branch/master?svg=true)](https://ci.appveyor.com/project/mosra/magnum/branch/master) * **OS X** (through SDL2 toolkit) [![Build Status](https://travis-ci.org/mosra/magnum.svg?branch=master)](https://travis-ci.org/mosra/magnum) +* **iOS** (through SDL2 toolkit) * **Android** 2.3 (API Level 9) and higher * **Windows RT** (Store/Phone) using ANGLE (through SDL2 toolkit) * **Google Chrome** (through [Native Client](https://developers.google.com/native-client/), diff --git a/doc/building.dox b/doc/building.dox index b1a5cdcec..f8a66421f 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -522,6 +522,35 @@ information. See @ref Platform::Sdl2Application documentation for more information about building your projects for Emscripten. +@subsection building-cross-ios Crosscompiling for iOS + +You will need OSX and Xcode installed. + +Set `CMAKE_OSX_ROOT` to SDK you want to target and enable all desired +architectures in `CMAKE_OSX_ARCHITECTURES`. The toolchain needs access to its +platform file, so be sure to properly set **absolute** path to `modules/` +directory containing `Platform/iOS.cmake`. Set `CMAKE_INSTALL_PREFIX` to prefix +where you store other iOS dependencies such as Corrade or SDL2. + +OpenGL ES 2.0 is enabled by default, switch to 3.0 by disabling `TARGET_GLES2`. + + mkdir build-ios && cd build-ios + cmake .. \ + -DCMAKE_MODULE_PATH=/absolute/path/to/toolchains/modules/ \ + -DCMAKE_TOOLCHAIN_FILE=../toolchains/generic/iOS.cmake \ + -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk \ + -DCMAKE_OSX_ARCHITECTURES="arm64;armv7;armv7s" \ + -DCMAKE_INSTALL_PREFIX=~/ios-libs \ + -DWITH_SDL2APPLICATION=ON \ + -G Xcode + cmake --build . + +Then you can install the library using `cmake --build . --target install` to +make it available for depending projects. + +See @ref Platform::Sdl2Application documentation for more information about +building your projects for iOS. + @subsection building-cross-android Crosscompiling for Android ARM and x86 You will need [Android NDK](https://developer.android.com/tools/sdk/ndk/index.html) diff --git a/doc/mainpage.dox b/doc/mainpage.dox index 0adc3db54..e1af78bb3 100644 --- a/doc/mainpage.dox +++ b/doc/mainpage.dox @@ -79,7 +79,7 @@ Platforms: - **Linux** and embedded Linux (natively using GLX/EGL and Xlib or through SDL2 or GLUT toolkit) - **Windows** natively or using ANGLE (through SDL2 or GLUT toolkit) -- **OS X** (through SDL2 toolkit) +- **OS X**, **iOS** (through SDL2 toolkit) - **Android** 2.3 (API Level 9) and higher - **Windows RT** (Store/Phone) using ANGLE (through SDL2 toolkit) - **Google Chrome** (through [Native Client](https://developers.google.com/native-client/), diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index ff6c330bd..42c183fd3 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -110,6 +110,37 @@ webserver, e.g. `/srv/http/emscripten`). You can then open `MyApplication.html` in Chrome or Firefox (through webserver, e.g. `http://localhost/emscripten/MyApplication.html`). +## Bootstrap application for iOS + +Fully contained base application using @ref Sdl2Application for both desktop +and iOS build along with pre-filled `*.plist` is available in `base-ios` branch +of [Magnum Bootstrap](https://github.com/mosra/magnum-bootstrap) repository, +download it as [tar.gz](https://github.com/mosra/magnum-bootstrap/archive/base-ios.tar.gz) +or [zip](https://github.com/mosra/magnum-bootstrap/archive/base-ios.zip) file. +After extracting the downloaded archive, you can do the desktop build in +the same way as above. For the iOS build you also need to put the contents of +toolchains repository from https://github.com/mosra/toolchains in `toolchains/` +subdirectory. + +Then create build directory and run `cmake` to generate the Xcode project. Set +`CMAKE_OSX_ROOT` to SDK you want to target and enable all desired architectures +in `CMAKE_OSX_ARCHITECTURES`. The toolchain needs access to its platform file, +so be sure to properly set **absolute** path to `toolchains/modules/` directory +containing `Platform/iOS.cmake`. Set `CMAKE_PREFIX_PATH` to the directory where +you have all the dependencies. + + mkdir build-ios && cd build-ios + cmake .. \ + -DCMAKE_MODULE_PATH=/absolute/path/to/toolchains/modules/ \ + -DCMAKE_TOOLCHAIN_FILE=../toolchains/generic/iOS.cmake \ + -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk \ + -DCMAKE_OSX_ARCHITECTURES="arm64;armv7;armv7s" \ + -DCMAKE_PREFIX_PATH=~/ios-libs \ + -G Xcode + +You can then open the generated project file in Xcode and build/deploy it from +there. + ## Bootstrap application for Windows RT Fully contained base application using @ref Sdl2Application for both desktop @@ -199,6 +230,53 @@ The application redirects all output (thus also @ref Corrade::Utility::Debug "De @ref Corrade::Utility::Warning "Warning" and @ref Corrade::Utility::Error "Error") to JavaScript console. +## Usage with iOS + +A lot of options for iOS build (such as HiDPI/Retina support, supported display +orientation, icons, splash screen...) is specified through the `*.plist` file. +CMake uses its own template that can be configured using various `MACOSX_BUNDLE_*` +variables, but many options are missing from there and you are much better off +rolling your own template and passing **abosolute** path to it to CMake using +the `MACOSX_BUNDLE_INFO_PLIST` property. Below are contents of the `*.plist` +file used in the bootstrap application, requesting OpenGL ES 2.0 and +advertising Retina support: +@code + + + + + CFBundleDevelopmentRegion + en-US + CFBundleExecutable + ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleIdentifier + cz.mosra.magnum.MyApplication + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + My Application + CFBundlePackageType + APPL + + UIRequiredDeviceCapabilities + + opengles-2 + + NSHighResolutionCapable + + + +@endcode + +Some other options can be configured from runtime when creating the SDL2 +application window, see documentation of particular value for details: + +- @ref Configuration::WindowFlag::AllowHighDpi allows creating HiDPI/Retina + drawable +- @ref Configuration::WindowFlag::Borderless hides the menu bar +- @ref Configuration::WindowFlag::Resizable makes the application respond to + device orientation changes + ## Usage with Windows RT For Windows RT you need to provide logo images and splash screen, all @@ -590,7 +668,9 @@ class Sdl2Application::Configuration { #ifndef CORRADE_TARGET_EMSCRIPTEN /** - * Allow high DPI. + * Allow high DPI. On iOS you also have to set the + * `NSHighResolutionCapable` entry in the `*.plist` file to make + * it working. * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". */ AllowHighDpi = SDL_WINDOW_ALLOW_HIGHDPI, From 25a2796833cadebcc3e1eeae4fc4ad73fed5438d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 11 Feb 2016 12:02:45 +0100 Subject: [PATCH 134/258] Fix Doxygen warnings. --- doc/opengl-mapping.dox | 2 +- src/Magnum/Platform/AbstractXApplication.h | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/opengl-mapping.dox b/doc/opengl-mapping.dox index a833b11b4..37dd149b3 100644 --- a/doc/opengl-mapping.dox +++ b/doc/opengl-mapping.dox @@ -121,7 +121,7 @@ OpenGL function | Matching API @fn_gl{DepthRangeArray} | | @fn_gl{DepthRangeIndexed} | | @fn_gl{DetachShader} | | -@fn_gl{DispatchCompute} | @ref AbstractShaderProgram::DispatchCompute() +@fn_gl{DispatchCompute} | @ref AbstractShaderProgram::dispatchCompute() @fn_gl_extension{DispatchComputeGroupSize,ARB,compute_variable_group_size} | | @fn_gl{DispatchComputeIndirect} | | @fn_gl{DrawArrays}, \n @fn_gl{DrawArraysInstanced}, \n @fn_gl{DrawArraysInstancedBaseInstance}, \n @fn_gl{DrawElements}, \n @fn_gl{DrawRangeElements}, \n @fn_gl{DrawElementsBaseVertex}, \n @fn_gl{DrawRangeElementsBaseVertex}, \n @fn_gl{DrawElementsInstanced}, \n @fn_gl{DrawElementsInstancedBaseInstance}, \n @fn_gl{DrawElementsInstancedBaseVertex}, \n @fn_gl{DrawElementsInstancedBaseVertexBaseInstance} | @ref Mesh::draw(), \n @ref MeshView::draw() diff --git a/src/Magnum/Platform/AbstractXApplication.h b/src/Magnum/Platform/AbstractXApplication.h index 1de3e958a..1f160651a 100644 --- a/src/Magnum/Platform/AbstractXApplication.h +++ b/src/Magnum/Platform/AbstractXApplication.h @@ -227,7 +227,12 @@ class AbstractXApplication::Configuration { /** @copydoc Sdl2Application::Configuration::size() */ Vector2i size() const { return _size; } - /** @copydoc Sdl2Application::Configuration::setSize() */ + /** + * @brief Set window size + * @return Reference to self (for method chaining) + * + * Default is `{800, 600}`. + */ Configuration& setSize(const Vector2i& size) { _size = size; return *this; From cf6ef1310a6c8249ae4bc00f9daee34f5b453ce9 Mon Sep 17 00:00:00 2001 From: Squareys Date: Sat, 13 Feb 2016 22:47:11 +0100 Subject: [PATCH 135/258] doc++: Use AnimableGroup3D instead of DrawableGroup3D for Animable3D. Signed-off-by: Squareys --- src/Magnum/SceneGraph/Animable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/SceneGraph/Animable.h b/src/Magnum/SceneGraph/Animable.h index 123bb31e0..3586abd72 100644 --- a/src/Magnum/SceneGraph/Animable.h +++ b/src/Magnum/SceneGraph/Animable.h @@ -78,7 +78,7 @@ typedef SceneGraph::Scene Scene3D; class AnimableObject: public Object3D, SceneGraph::Animable3D { public: - AnimableObject(Object3D* parent = nullptr, SceneGraph::DrawableGroup3D* group = nullptr): Object3D{parent}, SceneGraph::Animable3D{*this, group} { + AnimableObject(Object3D* parent = nullptr, SceneGraph::AnimableGroup3D* group = nullptr): Object3D{parent}, SceneGraph::Animable3D{*this, group} { setDuration(10.0f); // ... } From c11903975ad0984bc2a1ea76c3d28d9612d10503 Mon Sep 17 00:00:00 2001 From: Squareys Date: Sat, 13 Feb 2016 22:52:28 +0100 Subject: [PATCH 136/258] doc++: ResourceManager::instance() now returns a reference. Signed-off-by: Squareys --- doc/debug-tools.dox | 2 +- src/Magnum/DebugTools/ForceRenderer.h | 2 +- src/Magnum/DebugTools/ObjectRenderer.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/debug-tools.dox b/doc/debug-tools.dox index 364cd4a51..daea2867f 100644 --- a/doc/debug-tools.dox +++ b/doc/debug-tools.dox @@ -65,7 +65,7 @@ DebugTools::ResourceManager manager; SceneGraph::DrawableGroup3D debugDrawables; // Create renderer options which will be referenced later by "my" resource key -DebugTools::ResourceManager::instance()->set("my", +DebugTools::ResourceManager::instance().set("my", DebugTools::ObjectRendererOptions().setSize(0.3f)); // Create debug renderer for given object, use "my" options for it. The diff --git a/src/Magnum/DebugTools/ForceRenderer.h b/src/Magnum/DebugTools/ForceRenderer.h index 117e051c9..4b95927ae 100644 --- a/src/Magnum/DebugTools/ForceRenderer.h +++ b/src/Magnum/DebugTools/ForceRenderer.h @@ -90,7 +90,7 @@ See @ref debug-tools-renderers for more information. Example code: @code -DebugTools::ResourceManager::instance()->set("my", DebugTools::ForceRendererOptions() +DebugTools::ResourceManager::instance().set("my", DebugTools::ForceRendererOptions() .setScale(5.0f) .setColor(Color3::fromHSV(120.0_degf, 1.0f, 0.7f)); diff --git a/src/Magnum/DebugTools/ObjectRenderer.h b/src/Magnum/DebugTools/ObjectRenderer.h index cc89c0fb2..2ea6332ad 100644 --- a/src/Magnum/DebugTools/ObjectRenderer.h +++ b/src/Magnum/DebugTools/ObjectRenderer.h @@ -75,7 +75,7 @@ Visualizes object position, rotation and scale using colored axes. See Example code: @code // Create some options -DebugTools::ResourceManager::instance()->set("my", DebugTools::ObjectRendererOptions().setSize(0.3f)); +DebugTools::ResourceManager::instance().set("my", DebugTools::ObjectRendererOptions().setSize(0.3f)); // Create debug renderer for given object, use "my" options for it Object3D* object; From 4d9f4bd25d8098859187ee362893f1008a615f82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 15 Feb 2016 17:47:20 +0100 Subject: [PATCH 137/258] Install Test/AbstractOpenGLTester.h every time. --- src/Magnum/CMakeLists.txt | 5 +++++ src/Magnum/Test/CMakeLists.txt | 8 -------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Magnum/CMakeLists.txt b/src/Magnum/CMakeLists.txt index 7f2a262e0..762ca0941 100644 --- a/src/Magnum/CMakeLists.txt +++ b/src/Magnum/CMakeLists.txt @@ -117,6 +117,9 @@ set(Magnum_HEADERS visibility.h) +set(MagnumTest_HEADERS + Test/AbstractOpenGLTester.h) + # Header files to display in project view of IDEs only set(Magnum_PRIVATE_HEADERS Implementation/BufferState.h @@ -241,6 +244,7 @@ add_library(Magnum ${SHARED_OR_STATIC} ${Magnum_SRCS} ${Magnum_HEADERS} ${Magnum_PRIVATE_HEADERS} + ${MagnumTest_HEADERS} $) set_target_properties(Magnum PROPERTIES DEBUG_POSTFIX "-d") if(NOT BUILD_STATIC) @@ -266,6 +270,7 @@ install(TARGETS Magnum LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) install(FILES ${Magnum_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}) +install(FILES ${MagnumTest_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Test) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/configure.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}) add_subdirectory(Math) diff --git a/src/Magnum/Test/CMakeLists.txt b/src/Magnum/Test/CMakeLists.txt index 36e0c535a..248f64f81 100644 --- a/src/Magnum/Test/CMakeLists.txt +++ b/src/Magnum/Test/CMakeLists.txt @@ -91,11 +91,3 @@ if(BUILD_GL_TESTS) endif() set_target_properties(ResourceManagerTest PROPERTIES COMPILE_FLAGS -DCORRADE_GRACEFUL_ASSERT) - -set(MagnumGLTests_HEADERS AbstractOpenGLTester.h) - -# Add the header to project list of IDEs -add_custom_target(MagnumGLTests SOURCES ${MagnumGLTests_HEADERS}) - -# Install bootstrap header for GL tests to be used in dependent projects -install(FILES ${MagnumGLTests_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Test) From 0658f7a5f8e80b569319ce08afce2a5ff220fe72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 15 Feb 2016 18:17:50 +0100 Subject: [PATCH 138/258] modules: don't unset MAGNUM_*APPLICATION_* vars if they stay the same. Use case: user is calling find_package(Magnum REQUIRED Sdl2Application) in a toplevel dir and in a subdir. The second call would unset the MAGNUM_APPLICATION_LIBRARIES which is not correct, because it still is just that one application. Also, now instead of unsetting the variables are set to -NOTFOUND so they produce an error when used as libraries/include directories for a target. --- modules/FindMagnum.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index ff160198e..0852a0fc8 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -561,17 +561,17 @@ foreach(component ${Magnum_FIND_COMPONENTS}) if(NOT DEFINED MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES AND NOT DEFINED MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS) set(MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES ${MAGNUM_${_COMPONENT}_LIBRARIES}) set(MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS ${MAGNUM_${_COMPONENT}_INCLUDE_DIRS}) - else() - unset(MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES) - unset(MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS) + elseif(NOT MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES STREQUAL MAGNUM_${_COMPONENT}_LIBRARIES AND NOT MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS STREQUAL MAGNUM_${_COMPONENT}_INCLUDE_DIRS) + set(MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES-NOTFOUND) + set(MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS-NOTFOUND) endif() elseif(${component} MATCHES ".+Application") if(NOT DEFINED MAGNUM_APPLICATION_LIBRARIES AND NOT DEFINED MAGNUM_APPLICATION_INCLUDE_DIRS) set(MAGNUM_APPLICATION_LIBRARIES ${MAGNUM_${_COMPONENT}_LIBRARIES}) set(MAGNUM_APPLICATION_INCLUDE_DIRS ${MAGNUM_${_COMPONENT}_INCLUDE_DIRS}) - else() - unset(MAGNUM_APPLICATION_LIBRARIES) - unset(MAGNUM_APPLICATION_INCLUDE_DIRS) + else(NOT MAGNUM_APPLICATION_LIBRARIES STREQUAL MAGNUM_${_COMPONENT}_LIBRARIES AND NOT MAGNUM_APPLICATION_INCLUDE_DIRS STREQUAL MAGNUM_${_COMPONENT}_INCLUDE_DIRS) + set(MAGNUM_APPLICATION_LIBRARIES MAGNUM_APPLICATION_LIBRARIES-NOTFOUND) + set(MAGNUM_APPLICATION_INCLUDE_DIRS MAGNUM_APPLICATION_INCLUDE_DIRS-NOTFOUND) endif() endif() From b42c436df0ef2f6c5596f177e4bdcba0d69bb6de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 15 Feb 2016 21:28:32 +0100 Subject: [PATCH 139/258] doc: suggest static building for iOS. --- doc/building.dox | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/building.dox b/doc/building.dox index f8a66421f..a0fcf663f 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -532,7 +532,11 @@ platform file, so be sure to properly set **absolute** path to `modules/` directory containing `Platform/iOS.cmake`. Set `CMAKE_INSTALL_PREFIX` to prefix where you store other iOS dependencies such as Corrade or SDL2. -OpenGL ES 2.0 is enabled by default, switch to 3.0 by disabling `TARGET_GLES2`. +As every application is in its own sandbox, it doesn't make sense to build +shared libraries (although it is supported). Enable `BUILD_STATIC` to build +static libraries. You might also have problems using dynamic plugins, enable +`BUILD_PLUGINS_STATIC` to build also plugins as static. OpenGL ES 2.0 is +enabled by default, switch to 3.0 by disabling `TARGET_GLES2`. mkdir build-ios && cd build-ios cmake .. \ @@ -541,6 +545,8 @@ OpenGL ES 2.0 is enabled by default, switch to 3.0 by disabling `TARGET_GLES2`. -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk \ -DCMAKE_OSX_ARCHITECTURES="arm64;armv7;armv7s" \ -DCMAKE_INSTALL_PREFIX=~/ios-libs \ + -DBUILD_STATIC=ON -DBUILD_PLUGINS_STATIC=ON \ + -DTARGET_GLES2=OFF \ -DWITH_SDL2APPLICATION=ON \ -G Xcode cmake --build . From 99b402c7710591d42fe9447fd820b069a7e5f9eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 15 Feb 2016 21:29:03 +0100 Subject: [PATCH 140/258] package/debian: stop annoying linters complain about meaningless things. --- package/debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/debian/changelog b/package/debian/changelog index 796c69eba..53cbb5959 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,4 +1,4 @@ -magnum (1.0-1) UNRELEASED; urgency=low +magnum (1.0) UNRELEASED; urgency=low * Latest upstream version From fedf84a871d418c490a1df8b3f00f05909dea051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 15 Feb 2016 21:41:36 +0100 Subject: [PATCH 141/258] Platform: remove unneeded flag fiddling in Sdl2Application. The SDL2 documentation explicitly says the following: SDL_WINDOW_SHOWN is ignored by SDL_CreateWindow(). The SDL_Window is implicitly shown if SDL_WINDOW_HIDDEN is not set. --- src/Magnum/Platform/Sdl2Application.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 37e0c3b20..c8ac7ace5 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -110,11 +110,6 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { SDL_GL_SetAttribute(SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, configuration.isSRGBCapable()); #endif - /* Flags: if not hidden, set as shown */ - Uint32 windowFlags(configuration.windowFlags()); - if(!(configuration.windowFlags() & Configuration::WindowFlag::Hidden)) - windowFlags |= SDL_WINDOW_SHOWN; - /** @todo Remove when Emscripten has proper SDL2 support */ #ifndef CORRADE_TARGET_EMSCRIPTEN /* Set context version, if user-specified */ @@ -172,7 +167,7 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { #endif SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, configuration.size().x(), configuration.size().y(), - SDL_WINDOW_OPENGL|windowFlags))) + SDL_WINDOW_OPENGL|Uint32(configuration.windowFlags())))) { Error() << "Platform::Sdl2Application::tryCreateContext(): cannot create window:" << SDL_GetError(); return false; @@ -218,7 +213,7 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { if(!(_window = SDL_CreateWindow(configuration.title().data(), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, configuration.size().x(), configuration.size().y(), - SDL_WINDOW_OPENGL|windowFlags))) + SDL_WINDOW_OPENGL|Uint32(configuration.windowFlags())))) { Error() << "Platform::Sdl2Application::tryCreateContext(): cannot create window:" << SDL_GetError(); return false; From 4bcb79c3152e1efcf7205fa4c067038d6157b4f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 15 Feb 2016 21:52:17 +0100 Subject: [PATCH 142/258] Platform: properly handle SDL2 context creation failure on Emscripten. --- src/Magnum/Platform/Sdl2Application.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index c8ac7ace5..361a522b1 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -244,7 +244,10 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { #else /* Emscripten-specific initialization */ - _glContext = SDL_SetVideoMode(configuration.size().x(), configuration.size().y(), 24, SDL_OPENGL|SDL_HWSURFACE|SDL_DOUBLEBUF); + if(!(_glContext = SDL_SetVideoMode(configuration.size().x(), configuration.size().y(), 24, SDL_OPENGL|SDL_HWSURFACE|SDL_DOUBLEBUF))) { + Error() << "Platform::Sdl2Application::tryCreateContext(): cannot create context:" << SDL_GetError(); + return false; + } #endif /* Return true if the initialization succeeds */ From a3b84a4bf3b3072699f6ea6c747e2f29d3e4f163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 15 Feb 2016 22:16:03 +0100 Subject: [PATCH 143/258] doc: update Homebrew installation docs. Fucking undocumented moving target. Why is it not possible to install from a file anymore?! Why make things unnecessarily complicated?! --- doc/building.dox | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/building.dox b/doc/building.dox index a0fcf663f..306d1a76b 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -333,9 +333,10 @@ features, for example), modify the last entry in `debian/rules`. @subsection building-packages-brew Homebrew formulas OS X Homebrew formulas are in `package/homebrew` directory. Download the `*.rb` -file and install it using the following command: +file, put it into your Formulas directory and install it using the following +command: - brew install --HEAD magnum.rb + brew install --HEAD magnum @section building-windows-angle Building for ANGLE on Windows From 29081acc94b73e7640c6ea4221bbd0dd609eb3fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 15 Feb 2016 22:31:24 +0100 Subject: [PATCH 144/258] Platform: avoid window blinking with multiple context creation attempts. The window is only shown once we are sure that everything went smoothly. --- src/Magnum/Platform/Sdl2Application.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 361a522b1..0f579fa31 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -158,7 +158,8 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { #endif } - /* Create window */ + /* Create window. Hide it by default so we don't have distracting window + blinking in case we have to destroy it again right away */ if(!(_window = SDL_CreateWindow( #ifndef CORRADE_TARGET_IOS configuration.title().data(), @@ -167,7 +168,7 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { #endif SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, configuration.size().x(), configuration.size().y(), - SDL_WINDOW_OPENGL|Uint32(configuration.windowFlags())))) + SDL_WINDOW_OPENGL|SDL_WINDOW_HIDDEN|Uint32(configuration.windowFlags())))) { Error() << "Platform::Sdl2Application::tryCreateContext(): cannot create window:" << SDL_GetError(); return false; @@ -213,7 +214,7 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { if(!(_window = SDL_CreateWindow(configuration.title().data(), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, configuration.size().x(), configuration.size().y(), - SDL_WINDOW_OPENGL|Uint32(configuration.windowFlags())))) + SDL_WINDOW_OPENGL|SDL_WINDOW_HIDDEN|Uint32(configuration.windowFlags())))) { Error() << "Platform::Sdl2Application::tryCreateContext(): cannot create window:" << SDL_GetError(); return false; @@ -251,7 +252,15 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { #endif /* Return true if the initialization succeeds */ - return _context->tryCreate(); + const bool created = _context->tryCreate(); + + #ifndef CORRADE_TARGET_EMSCRIPTEN + /* Show the window once we are sure that everything is okay */ + if(created && !(configuration.windowFlags() & Configuration::WindowFlag::Hidden)) + SDL_ShowWindow(_window); + #endif + + return created; } void Sdl2Application::swapBuffers() { From 8469beec3bd0f62644e850f014d3691899f2f6fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 15 Feb 2016 22:35:02 +0100 Subject: [PATCH 145/258] Platform: destroy SDL2 window also if Magnum context creation fails. Not sure why I omitted that. --- src/Magnum/Platform/Sdl2Application.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 0f579fa31..be5db2211 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -242,7 +242,6 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { SDL_GL_GetDrawableSize(_window, &drawableSize.x(), &drawableSize.y()); glViewport(0, 0, drawableSize.x(), drawableSize.y()); #endif - #else /* Emscripten-specific initialization */ if(!(_glContext = SDL_SetVideoMode(configuration.size().x(), configuration.size().y(), 24, SDL_OPENGL|SDL_HWSURFACE|SDL_DOUBLEBUF))) { @@ -251,16 +250,22 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { } #endif - /* Return true if the initialization succeeds */ - const bool created = _context->tryCreate(); + /* Destroy everything also when the Magnum context creation fails */ + if(!_context->tryCreate()) { + SDL_GL_DeleteContext(_glContext); + SDL_DestroyWindow(_window); + _window = nullptr; + return false; + } #ifndef CORRADE_TARGET_EMSCRIPTEN /* Show the window once we are sure that everything is okay */ - if(created && !(configuration.windowFlags() & Configuration::WindowFlag::Hidden)) + if(!(configuration.windowFlags() & Configuration::WindowFlag::Hidden)) SDL_ShowWindow(_window); #endif - return created; + /* Return true if the initialization succeeds */ + return true; } void Sdl2Application::swapBuffers() { From 60772f478e99341a777ec5fcc9943fa4705302ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 20 Feb 2016 22:15:11 +0100 Subject: [PATCH 146/258] Use proper CMake variable for Corrade Utility library. --- src/Magnum/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/CMakeLists.txt b/src/Magnum/CMakeLists.txt index 762ca0941..936bad8ab 100644 --- a/src/Magnum/CMakeLists.txt +++ b/src/Magnum/CMakeLists.txt @@ -321,7 +321,7 @@ if(BUILD_TESTS) set_target_properties(MagnumMathTestLib PROPERTIES COMPILE_FLAGS "-DCORRADE_GRACEFUL_ASSERT" DEBUG_POSTFIX "-d") - target_link_libraries(MagnumMathTestLib ${CORRADE_UTILITY_LIBRARY}) + target_link_libraries(MagnumMathTestLib ${CORRADE_UTILITY_LIBRARIES}) # On Windows we need to install first and then run the tests to avoid "DLL # not found" hell, thus we need to install this too From 7949c376c550f1d5905eb9cfab7d2d2e967de31f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 20 Feb 2016 22:16:21 +0100 Subject: [PATCH 147/258] Platform: link also all static libraries to Magnum. So we inherit all include directories, options and everything. --- src/Magnum/Platform/CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index 1264a81c7..87382d32b 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -80,6 +80,7 @@ if(WITH_ANDROIDAPPLICATION) set_target_properties(MagnumAndroidApplication PROPERTIES DEBUG_POSTFIX "-d") # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib + target_link_libraries(MagnumAndroidApplication Magnum) install(FILES ${MagnumAndroidApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumAndroidApplication @@ -109,6 +110,7 @@ if(WITH_GLUTAPPLICATION) set_target_properties(MagnumGlutApplication PROPERTIES DEBUG_POSTFIX "-d") # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib + target_link_libraries(MagnumGlutApplication Magnum) install(FILES ${MagnumGlutApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumGlutApplication @@ -140,6 +142,7 @@ if(WITH_SDL2APPLICATION) set_target_properties(MagnumSdl2Application PROPERTIES DEBUG_POSTFIX "-d") # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib + target_link_libraries(MagnumSdl2Application Magnum) install(FILES ${MagnumSdl2Application_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumSdl2Application @@ -166,6 +169,7 @@ if(WITH_NACLAPPLICATION) set_target_properties(MagnumNaClApplication PROPERTIES DEBUG_POSTFIX "-d") # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib + target_link_libraries(MagnumNaClApplication Magnum) install(FILES ${MagnumNaClApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumNaClApplication @@ -190,6 +194,7 @@ if(WITH_WINDOWLESSNACLAPPLICATION) target_link_libraries(MagnumWindowlessNaClApplication Magnum ppapi_cpp ppapi) # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib + target_link_libraries(MagnumWindowlessNaClApplication Magnum) install(FILES ${MagnumWindowlessNaClApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumWindowlessNaClApplication @@ -238,6 +243,7 @@ if(WITH_GLXAPPLICATION) set_target_properties(MagnumGlxApplication PROPERTIES DEBUG_POSTFIX "-d") # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib + target_link_libraries(MagnumGlxApplication Magnum) install(FILES ${MagnumGlxApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumGlxApplication @@ -268,6 +274,7 @@ if(WITH_XEGLAPPLICATION) set_target_properties(MagnumXEglApplication PROPERTIES DEBUG_POSTFIX "-d") # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib + target_link_libraries(MagnumXEglApplication Magnum) install(FILES ${MagnumXEglApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumXEglApplication @@ -305,6 +312,7 @@ if(WITH_WINDOWLESSGLXAPPLICATION) target_link_libraries(MagnumWindowlessGlxApplication Magnum ${X11_LIBRARIES}) # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib + target_link_libraries(MagnumWindowlessGlxApplication Magnum) install(FILES ${MagnumWindowlessGlxApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumWindowlessGlxApplication @@ -334,6 +342,7 @@ if(WITH_WINDOWLESSWGLAPPLICATION) target_link_libraries(MagnumWindowlessWglApplication Magnum) # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib + target_link_libraries(MagnumWindowlessWglApplication Magnum) install(FILES ${MagnumWindowlessWglApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumWindowlessWglApplication @@ -368,6 +377,7 @@ if(WITH_WINDOWLESSWINDOWSEGLAPPLICATION) target_link_libraries(MagnumWindowlessWindowsEglApplication Magnum ${EGL_LIBRARY}) # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib + target_link_libraries(MagnumWindowlessWindowsEglApplication Magnum) install(FILES ${MagnumWindowlessWindowsEglApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumWindowlessWindowsEglApplication @@ -395,6 +405,7 @@ if(WITH_WINDOWLESSCGLAPPLICATION) target_link_libraries(MagnumWindowlessCglApplication Magnum) # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib + target_link_libraries(MagnumWindowlessCglApplication Magnum) install(FILES ${MagnumWindowlessCglApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumWindowlessCglApplication @@ -505,6 +516,7 @@ if(NEED_CGLCONTEXT OR WITH_CGLCONTEXT) if(BUILD_STATIC_PIC) set_target_properties(MagnumCglContext PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() + target_link_libraries(MagnumCglContext Magnum) install(TARGETS MagnumCglContext RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} @@ -538,6 +550,7 @@ if(NEED_EGLCONTEXT OR WITH_EGLCONTEXT) if(BUILD_STATIC_PIC) set_target_properties(MagnumEglContext PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() + target_link_libraries(MagnumEglContext Magnum) install(TARGETS MagnumEglContext RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} @@ -564,6 +577,7 @@ if(NEED_GLXCONTEXT OR WITH_GLXCONTEXT) if(BUILD_STATIC_PIC) set_target_properties(MagnumGlxContext PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() + target_link_libraries(MagnumGlxContext Magnum) install(TARGETS MagnumGlxContext RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} @@ -589,6 +603,7 @@ if(NEED_WGLCONTEXT OR WITH_WGLCONTEXT) if(BUILD_STATIC_PIC) set_target_properties(MagnumWglContext PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() + target_link_libraries(MagnumWglContext Magnum) install(TARGETS MagnumWglContext RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} From 5975945d29712aa73171b91613a49970bc1cb2ae Mon Sep 17 00:00:00 2001 From: dlardi Date: Tue, 1 Mar 2016 18:28:19 +0200 Subject: [PATCH 148/258] WGL context library build fixed --- src/Magnum/Platform/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index 87382d32b..5a0134b0d 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -597,7 +597,7 @@ if(NEED_WGLCONTEXT OR WITH_WGLCONTEXT) endif() # Also create proper static library, if requested - if(WITH_GLXCONTEXT) + if(WITH_WGLCONTEXT) add_library(MagnumWglContext STATIC $) set_target_properties(MagnumWglContext PROPERTIES DEBUG_POSTFIX "-d") if(BUILD_STATIC_PIC) From f9ead4ef834babffd4f2b2b535190d2d1990db11 Mon Sep 17 00:00:00 2001 From: "Nicholas \"LB\" Braden" Date: Wed, 2 Mar 2016 12:50:25 -0600 Subject: [PATCH 149/258] Fix 'zero as null pointer constant' warning Scanning dependencies of target MagnumWindowlessWglApplication [ 30%] Building CXX object src/Magnum/Platform/CMakeFiles/MagnumWindowlessWglApplication.dir/WindowlessWglApplication.cpp.obj C:\Users\LB\Code\Magnum\build\Magnum-prefix\src\Magnum\src\Magnum\Platform\WindowlessWglApplication.cpp: In member function 'bool Magnum::Platform::WindowlessWglApplication::tryCreateContext(const Magnum::Platform::WindowlessWglApplication::Configuration&)': C:\Users\LB\Code\Magnum\build\Magnum-prefix\src\Magnum\src\Magnum\Platform\WindowlessWglApplication.cpp:124:81: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant] _renderingContext = wglCreateContextAttribsARB(_deviceContext, 0, attributes); ^ [ 30%] Linking CXX static library libMagnumWindowlessWglApplication.a [ 30%] Built target MagnumWindowlessWglApplication --- src/Magnum/Platform/WindowlessWglApplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/Platform/WindowlessWglApplication.cpp b/src/Magnum/Platform/WindowlessWglApplication.cpp index e2b99aa62..72597d12d 100644 --- a/src/Magnum/Platform/WindowlessWglApplication.cpp +++ b/src/Magnum/Platform/WindowlessWglApplication.cpp @@ -121,7 +121,7 @@ bool WindowlessWglApplication::tryCreateContext(const Configuration& configurati with it */ typedef HGLRC(WINAPI*PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC, HGLRC, const int*); const PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = reinterpret_cast( wglGetProcAddress(reinterpret_cast("wglCreateContextAttribsARB"))); - _renderingContext = wglCreateContextAttribsARB(_deviceContext, 0, attributes); + _renderingContext = wglCreateContextAttribsARB(_deviceContext, nullptr, attributes); /* Delete the temporary context */ wglMakeCurrent(_deviceContext, nullptr); From 2f97617bb65b8cb32b2bb1e5aea1a7dca0ecbcd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 15 Mar 2016 09:49:04 +0100 Subject: [PATCH 150/258] Minor cleanup and documentation. --- src/Magnum/AbstractTexture.cpp | 3 +-- src/Magnum/Implementation/TextureState.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magnum/AbstractTexture.cpp b/src/Magnum/AbstractTexture.cpp index 6c6a1799e..aacee0e13 100644 --- a/src/Magnum/AbstractTexture.cpp +++ b/src/Magnum/AbstractTexture.cpp @@ -235,8 +235,7 @@ AbstractTexture::~AbstractTexture() { if(!_id || !(_flags & ObjectFlag::DeleteOnDestruction)) return; /* Remove all bindings */ - for(auto& binding: Context::current().state().texture->bindings) - { + for(auto& binding: Context::current().state().texture->bindings) { /* MSVC 2015 needs the parentheses around */ if(binding.second == _id) binding = {}; } diff --git a/src/Magnum/Implementation/TextureState.h b/src/Magnum/Implementation/TextureState.h index 2d87a29f5..ed1dfcc88 100644 --- a/src/Magnum/Implementation/TextureState.h +++ b/src/Magnum/Implementation/TextureState.h @@ -142,6 +142,7 @@ struct TextureState { Containers::Array> bindings; #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + /* Texture object ID, level, layered, layer, access */ Containers::Array> imageBindings; #endif }; From 3a87c9b94800a49abed80a989adb18477602d3da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 15 Mar 2016 09:49:17 +0100 Subject: [PATCH 151/258] Properly reset image bindings on destruction. --- src/Magnum/AbstractTexture.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Magnum/AbstractTexture.cpp b/src/Magnum/AbstractTexture.cpp index aacee0e13..c31a5e160 100644 --- a/src/Magnum/AbstractTexture.cpp +++ b/src/Magnum/AbstractTexture.cpp @@ -240,6 +240,12 @@ AbstractTexture::~AbstractTexture() { if(binding.second == _id) binding = {}; } + /* Remove all image bindings */ + for(auto& binding: Context::current().state().texture->imageBindings) { + /* MSVC 2015 needs the parentheses around */ + if(std::get<0>(binding) == _id) binding = {}; + } + glDeleteTextures(1, &_id); } From 70f7694d5a4207974d508b00a14f8da330dde28f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 15 Mar 2016 09:52:39 +0100 Subject: [PATCH 152/258] Fix building on GLES2/WebGL. --- src/Magnum/AbstractTexture.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Magnum/AbstractTexture.cpp b/src/Magnum/AbstractTexture.cpp index c31a5e160..815c029ef 100644 --- a/src/Magnum/AbstractTexture.cpp +++ b/src/Magnum/AbstractTexture.cpp @@ -240,11 +240,13 @@ AbstractTexture::~AbstractTexture() { if(binding.second == _id) binding = {}; } + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) /* Remove all image bindings */ for(auto& binding: Context::current().state().texture->imageBindings) { /* MSVC 2015 needs the parentheses around */ if(std::get<0>(binding) == _id) binding = {}; } + #endif glDeleteTextures(1, &_id); } From e832e463423a79431f83f6dfd23459a93daaa725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 15 Mar 2016 19:16:45 +0100 Subject: [PATCH 153/258] modules: updated FindCorrade.cmake. --- modules/FindCorrade.cmake | 53 ++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/modules/FindCorrade.cmake b/modules/FindCorrade.cmake index 6850cbac8..36fe4afb0 100644 --- a/modules/FindCorrade.cmake +++ b/modules/FindCorrade.cmake @@ -20,12 +20,10 @@ # chosen based on actual build configuration of the project (i.e. Debug build # is linked to debug libraries, Release build to release libraries). # -# On multi-configuration build systems (such as Visual Studio or XCode) the -# preprocessor variable CORRADE_IS_DEBUG_BUILD is defined if given build -# configuration is Debug (not Corrade itself, but build configuration of the -# project using it). Useful e.g. for selecting proper plugin directory. On -# single-configuration build systems (such as Makefiles) this information is -# not needed and thus the variable is not defined in any case. +# Corrade conditionally defines CORRADE_IS_DEBUG_BUILD preprocessor variable in +# case build configuration is Debug (not Corrade itself, but build +# configuration of the project using it). Useful e.g. for selecting proper +# plugin directory. # # Corrade configures the compiler to use C++11 standard (if it is not already # configured to do so). Additionally you can use CORRADE_CXX_FLAGS to enable @@ -121,6 +119,7 @@ # found # CORRADE_USE_MODULE - Path to UseCorrade.cmake module (included # automatically) +# CORRADE_TESTSUITE_XCTEST_RUNNER - Path to XCTestRunner.mm.in file # # @@ -188,19 +187,13 @@ find_path(_CORRADE_MODULE_DIR find_file(_CORRADE_CONFIGURE_FILE configure.h HINTS ${CORRADE_INCLUDE_DIR}/Corrade/) -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Corrade DEFAULT_MSG - CORRADE_UTILITY_LIBRARY - CORRADE_INTERCONNECT_LIBRARY - CORRADE_PLUGINMANAGER_LIBRARY - CORRADE_TESTSUITE_LIBRARY - CORRADE_INCLUDE_DIR - CORRADE_RC_EXECUTABLE - _CORRADE_MODULE_DIR - _CORRADE_CONFIGURE_FILE) - -if(NOT CORRADE_FOUND) - return() +# We need to open configure.h file from CORRADE_INCLUDE_DIR before we check for +# the components. Bail out with proper error message if it wasn't found. The +# complete check with all components is further below. +if(NOT CORRADE_INCLUDE_DIR) + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Corrade + REQUIRED_VARS CORRADE_INCLUDE_DIR _CORRADE_CONFIGURE_FILE) endif() # Read flags from fonfiguration @@ -219,7 +212,8 @@ set(_corradeFlags TARGET_NACL_NEWLIB TARGET_NACL_GLIBC TARGET_EMSCRIPTEN - TARGET_ANDROID) + TARGET_ANDROID + TESTSUITE_TARGET_XCTEST) foreach(_corradeFlag ${_corradeFlags}) string(FIND "${_corradeConfigure}" "#define CORRADE_${_corradeFlag}" _corrade_${_corradeFlag}) if(NOT _corrade_${_corradeFlag} EQUAL -1) @@ -227,6 +221,25 @@ foreach(_corradeFlag ${_corradeFlags}) endif() endforeach() +# XCTest runner file +if(CORRADE_TESTSUITE_TARGET_XCTEST) + find_file(CORRADE_TESTSUITE_XCTEST_RUNNER XCTestRunner.mm.in + PATH_SUFFIXES share/corrade/TestSuite) + set(CORRADE_TESTSUITE_XCTEST_RUNNER_NEEDED CORRADE_TESTSUITE_XCTEST_RUNNER) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Corrade DEFAULT_MSG + CORRADE_UTILITY_LIBRARY + CORRADE_INTERCONNECT_LIBRARY + CORRADE_PLUGINMANAGER_LIBRARY + CORRADE_TESTSUITE_LIBRARY + CORRADE_INCLUDE_DIR + CORRADE_RC_EXECUTABLE + _CORRADE_MODULE_DIR + _CORRADE_CONFIGURE_FILE + ${CORRADE_TESTSUITE_XCTEST_RUNNER_NEEDED}) + set(CORRADE_INCLUDE_DIRS ${CORRADE_INCLUDE_DIR}) set(CORRADE_UTILITY_LIBRARIES ${CORRADE_UTILITY_LIBRARY}) set(CORRADE_INTERCONNECT_LIBRARIES ${CORRADE_INTERCONNECT_LIBRARY} ${CORRADE_UTILITY_LIBRARIES}) From c33fddec86ec05d1167e2c7125ef98b5776e06eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 15 Mar 2016 19:17:03 +0100 Subject: [PATCH 154/258] Updated toolchains submodule. --- toolchains | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains b/toolchains index 47f5d2a76..30104c2c9 160000 --- a/toolchains +++ b/toolchains @@ -1 +1 @@ -Subproject commit 47f5d2a7682c119e0c34b9698c83bfcf2c1bba6d +Subproject commit 30104c2c9388c5825380febbf6e25bb487912da6 From 21e2ed7577e71652cf98ae9f31f3a74681731f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 17 Mar 2016 23:05:57 +0100 Subject: [PATCH 155/258] Math: no need to make the test complicated. --- src/Magnum/Math/Test/TypeTraitsTest.cpp | 113 +++++++++--------------- 1 file changed, 41 insertions(+), 72 deletions(-) diff --git a/src/Magnum/Math/Test/TypeTraitsTest.cpp b/src/Magnum/Math/Test/TypeTraitsTest.cpp index df4a08b68..7f733e6ed 100644 --- a/src/Magnum/Math/Test/TypeTraitsTest.cpp +++ b/src/Magnum/Math/Test/TypeTraitsTest.cpp @@ -33,102 +33,71 @@ namespace Magnum { namespace Math { namespace Test { struct TypeTraitsTest: Corrade::TestSuite::Tester { explicit TypeTraitsTest(); - void equalsIntegral(); - void equalsFloatingPoint0(); - void equalsFloatingPoint1(); - void equalsFloatingPointLarge(); - void equalsFloatingPointInfinity(); - void equalsFloatingPointNaN(); - - private: - template void _equalsIntegral(); - template void _equalsFloatingPoint0(); - template void _equalsFloatingPoint1(); - template void _equalsFloatingPointLarge(); - template void _equalsFloatingPointInfinity(); - template void _equalsFloatingPointNaN(); + template void equalsIntegral(); + template void equalsFloatingPoint0(); + template void equalsFloatingPoint1(); + template void equalsFloatingPointLarge(); + template void equalsFloatingPointInfinity(); + template void equalsFloatingPointNaN(); }; TypeTraitsTest::TypeTraitsTest() { - addTests({&TypeTraitsTest::equalsIntegral, - &TypeTraitsTest::equalsFloatingPoint0, - &TypeTraitsTest::equalsFloatingPoint1, - &TypeTraitsTest::equalsFloatingPointLarge, - &TypeTraitsTest::equalsFloatingPointInfinity, - &TypeTraitsTest::equalsFloatingPointNaN}); + addTests({&TypeTraitsTest::equalsIntegral, + &TypeTraitsTest::equalsIntegral, + &TypeTraitsTest::equalsIntegral, + &TypeTraitsTest::equalsIntegral, + &TypeTraitsTest::equalsIntegral, + &TypeTraitsTest::equalsIntegral, + &TypeTraitsTest::equalsIntegral, + &TypeTraitsTest::equalsIntegral, + &TypeTraitsTest::equalsFloatingPoint0, + #ifndef MAGNUM_TARGET_GLES + &TypeTraitsTest::equalsFloatingPoint0, + #endif + &TypeTraitsTest::equalsFloatingPoint1, + #ifndef MAGNUM_TARGET_GLES + &TypeTraitsTest::equalsFloatingPoint1, + #endif + &TypeTraitsTest::equalsFloatingPointLarge, + #ifndef MAGNUM_TARGET_GLES + &TypeTraitsTest::equalsFloatingPointLarge, + #endif + &TypeTraitsTest::equalsFloatingPointInfinity, + #ifndef MAGNUM_TARGET_GLES + &TypeTraitsTest::equalsFloatingPointInfinity, + #endif + &TypeTraitsTest::equalsFloatingPointNaN, + #ifndef MAGNUM_TARGET_GLES + &TypeTraitsTest::equalsFloatingPointNaN + #endif + }); } -void TypeTraitsTest::equalsIntegral() { - _equalsIntegral(); - _equalsIntegral(); - _equalsIntegral(); - _equalsIntegral(); - _equalsIntegral(); - _equalsIntegral(); - _equalsIntegral(); - _equalsIntegral(); -} - -template void TypeTraitsTest::_equalsIntegral() { +template void TypeTraitsTest::equalsIntegral() { CORRADE_VERIFY(!TypeTraits::equals(1, 1+TypeTraits::epsilon())); } -void TypeTraitsTest::equalsFloatingPoint0() { - _equalsFloatingPoint0(); - #ifndef MAGNUM_TARGET_GLES - _equalsFloatingPoint0(); - #endif -} - -template void TypeTraitsTest::_equalsFloatingPoint0() { +template void TypeTraitsTest::equalsFloatingPoint0() { CORRADE_VERIFY(TypeTraits::equals(T(0)+TypeTraits::epsilon()/T(2), T(0))); CORRADE_VERIFY(!TypeTraits::equals(T(0)+TypeTraits::epsilon()*T(2), T(0))); } -void TypeTraitsTest::equalsFloatingPoint1() { - _equalsFloatingPoint1(); - #ifndef MAGNUM_TARGET_GLES - _equalsFloatingPoint1(); - #endif -} - -template void TypeTraitsTest::_equalsFloatingPoint1() { +template void TypeTraitsTest::equalsFloatingPoint1() { CORRADE_VERIFY(TypeTraits::equals(T(1)+TypeTraits::epsilon()/T(2), T(1))); CORRADE_VERIFY(!TypeTraits::equals(T(1)+TypeTraits::epsilon()*T(3), T(1))); } -void TypeTraitsTest::equalsFloatingPointLarge() { - _equalsFloatingPointLarge(); - #ifndef MAGNUM_TARGET_GLES - _equalsFloatingPointLarge(); - #endif -} - -template void TypeTraitsTest::_equalsFloatingPointLarge() { +template void TypeTraitsTest::equalsFloatingPointLarge() { CORRADE_VERIFY(TypeTraits::equals(T(25)+TypeTraits::epsilon()*T(2), T(25))); CORRADE_VERIFY(!TypeTraits::equals(T(25)+TypeTraits::epsilon()*T(75), T(25))); } -void TypeTraitsTest::equalsFloatingPointInfinity() { - _equalsFloatingPointInfinity(); - #ifndef MAGNUM_TARGET_GLES - _equalsFloatingPointInfinity(); - #endif -} - -template void TypeTraitsTest::_equalsFloatingPointInfinity() { +template void TypeTraitsTest::equalsFloatingPointInfinity() { CORRADE_VERIFY(TypeTraits::equals(Constants::inf(), Constants::inf())); } -void TypeTraitsTest::equalsFloatingPointNaN() { - _equalsFloatingPointNaN(); - #ifndef MAGNUM_TARGET_GLES - _equalsFloatingPointNaN(); - #endif -} - -template void TypeTraitsTest::_equalsFloatingPointNaN() { +template void TypeTraitsTest::equalsFloatingPointNaN() { CORRADE_VERIFY(!TypeTraits::equals(Constants::nan(), Constants::nan())); } From ca887ddebedae3446a1d76974a16bc56df60db4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 27 Feb 2016 18:35:44 +0100 Subject: [PATCH 156/258] Modern CMake usage: use CMake 2.8.12 on Travis CI. --- package/ci/travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/ci/travis.yml b/package/ci/travis.yml index 46534f32f..817f5f0db 100644 --- a/package/ci/travis.yml +++ b/package/ci/travis.yml @@ -12,7 +12,7 @@ addons: apt: sources: - ubuntu-toolchain-r-test - - kalakris-cmake + - kubuntu-backports packages: - g++-4.7 - cmake From 4a540d5c6c3ae9834dc7b9212c8e44efdd9d4453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 21 Feb 2016 23:32:01 +0100 Subject: [PATCH 157/258] Modern CMake usage: bump minimal version to 2.8.12. --- CMakeLists.txt | 2 +- README.md | 2 +- doc/building.dox | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index da0becfb6..3de8d6856 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ # DEALINGS IN THE SOFTWARE. # -cmake_minimum_required(VERSION 2.8.9) +cmake_minimum_required(VERSION 2.8.12) project(Magnum) # CMake policies: enable MACOSX_RPATH by default diff --git a/README.md b/README.md index 0c941e11c..a65735174 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ Minimal dependencies On Windows you can also use **MinGW-w64**. GCC 4.6, 4.5, 4.4 and MSVC 2013 support involves some ugly workarounds and thus is available only in `compatibility` branch. -* **CMake** >= 2.8.9 +* **CMake** >= 2.8.12 * **Corrade** - Plugin management and utility library. You can get it at https://github.com/mosra/corrade. diff --git a/doc/building.dox b/doc/building.dox index 306d1a76b..70a2c70e1 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -37,7 +37,7 @@ Minimal set of tools and libraries required for building is: On Windows you can also use **MinGW-w64**. GCC 4.6, 4.5, 4.4 and MSVC 2013 support involves some ugly workarounds and thus is available only in `compatibility` branch. -- **CMake** >= 2.8.9 +- **CMake** >= 2.8.12 - **Corrade** - Plugin management and utility library. See @ref building-corrade "Corrade download and installation guide" for more information. From 08a2a75c5c9bfc9ce914402bbdd5981af387c776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 21 Feb 2016 22:25:26 +0100 Subject: [PATCH 158/258] Modern CMake usage: updated FindCorrade.cmake and FindNodeJs.cmake. --- modules/FindCorrade.cmake | 477 ++++++++++++++++++++++++++------------ modules/FindNodeJs.cmake | 15 +- 2 files changed, 337 insertions(+), 155 deletions(-) diff --git a/modules/FindCorrade.cmake b/modules/FindCorrade.cmake index 36fe4afb0..64a36100d 100644 --- a/modules/FindCorrade.cmake +++ b/modules/FindCorrade.cmake @@ -1,125 +1,188 @@ -# - Find Corrade -# -# Basic usage: -# find_package(Corrade [REQUIRED]) -# This module tries to find Corrade library and then defines: -# CORRADE_FOUND - True if Corrade is found -# CORRADE_INCLUDE_DIRS - Corrade include directories -# CORRADE_INTERCONNECT_LIBRARIES - Interconnect library and dependent -# libraries -# CORRADE_UTILITY_LIBRARIES - Utility library and dependent -# libraries -# CORRADE_PLUGINMANAGER_LIBRARIES - PluginManager library and dependent -# libraries -# CORRADE_TESTSUITE_LIBRARIES - TestSuite library and dependent -# libraries -# CORRADE_RC_EXECUTABLE - Resource compiler executable -# CORRADE_LIB_SUFFIX_MODULE - Path to CorradeLibSuffix.cmake module +#.rst: +# Find Corrade +# ------------ +# +# Finds the Corrade library. Basic usage:: +# +# find_package(Corrade REQUIRED) +# +# This module tries to find the base Corrade library and then defines the +# following: +# +# Corrade_FOUND - Whether the base library was found +# CORRADE_LIB_SUFFIX_MODULE - Path to CorradeLibSuffix.cmake module +# +# This command will try to find only the base library, not the optional +# components, which are: +# +# Containers - Containers library +# PluginManager - PluginManager library +# TestSuite - TestSuite library +# Utility - Utility library +# rc - corrade-rc executable +# +# Example usage with specifying additional components is:: +# +# find_package(Corrade REQUIRED Utility TestSuite) +# +# For each component is then defined: +# +# Corrade_*_FOUND - Whether the component was found +# Corrade::* - Component imported target +# # The package is found if either debug or release version of each library is # found. If both debug and release libraries are found, proper version is # chosen based on actual build configuration of the project (i.e. Debug build # is linked to debug libraries, Release build to release libraries). # -# Corrade conditionally defines CORRADE_IS_DEBUG_BUILD preprocessor variable in -# case build configuration is Debug (not Corrade itself, but build -# configuration of the project using it). Useful e.g. for selecting proper -# plugin directory. +# Corrade conditionally defines ``CORRADE_IS_DEBUG_BUILD`` preprocessor +# variable in case build configuration is ``Debug`` (not Corrade itself, but +# build configuration of the project using it). Useful e.g. for selecting +# proper plugin directory. # -# Corrade configures the compiler to use C++11 standard (if it is not already -# configured to do so). Additionally you can use CORRADE_CXX_FLAGS to enable -# additional pedantic set of warnings and enable hidden visibility by default. +# Corrade defines the following custom target properties: +# +# CORRADE_CXX_STANDARD - C++ standard to require when compiling given +# target. Does nothing if :variable:`CMAKE_CXX_FLAGS` already contains +# particular standard setting flag or if given target contains +# :prop_tgt:`CMAKE_CXX_STANDARD` property. Allowed value is 11, 14 or 17. +# INTERFACE_CORRADE_CXX_STANDARD - C++ standard to require when using given +# target. Does nothing if :variable:`CMAKE_CXX_FLAGS` already contains +# particular standard setting flag or if given target contains +# :prop_tgt:`CMAKE_CXX_STANDARD` property. Allowed value is 11, 14 or 17. +# CORRADE_USE_PEDANTIC_FLAGS - Enable additional compiler/linker flags. +# Boolean. +# +# These properties are inherited from directory properties, meaning that if you +# set them on directories, they get implicitly set on all targets in given +# directory (with a possibility to do target-specific overrides). All Corrade +# libraries have the :prop_tgt:`INTERFACE_CORRADE_CXX_STANDARD` property set to +# 11, meaning that you will always have at least C++11 enabled once you link to +# any Corrade library. # # Features of found Corrade library are exposed in these variables: -# CORRADE_GCC47_COMPATIBILITY - Defined if compiled with compatibility -# mode for GCC 4.7 -# CORRADE_MSVC2015_COMPATIBILITY - Defined if compiled with compatibility +# +# CORRADE_GCC47_COMPATIBILITY - Defined if compiled with compatibility mode +# for GCC 4.7 +# CORRADE_MSVC2015_COMPATIBILITY - Defined if compiled with compatibility # mode for MSVC 2015 # CORRADE_BUILD_DEPRECATED - Defined if compiled with deprecated APIs # included -# CORRADE_BUILD_STATIC - Defined if compiled as static libraries +# CORRADE_BUILD_STATIC - Defined if compiled as static libraries. +# Default are shared libraries. # CORRADE_TARGET_UNIX - Defined if compiled for some Unix flavor # (Linux, BSD, OS X) # CORRADE_TARGET_APPLE - Defined if compiled for Apple platforms # CORRADE_TARGET_IOS - Defined if compiled for iOS # CORRADE_TARGET_WINDOWS - Defined if compiled for Windows # CORRADE_TARGET_WINDOWS_RT - Defined if compiled for Windows RT -# CORRADE_TARGET_NACL - Defined if compiled for Google Chrome -# Native Client -# CORRADE_TARGET_NACL_NEWLIB - Defined if compiled for Google Chrome -# Native Client with `newlib` toolchain -# CORRADE_TARGET_NACL_GLIBC - Defined if compiled for Google Chrome -# Native Client with `glibc` toolchain +# CORRADE_TARGET_NACL - Defined if compiled for Google Chrome Native +# Client +# CORRADE_TARGET_NACL_NEWLIB - Defined if compiled for Google Chrome Native +# Client with `newlib` toolchain +# CORRADE_TARGET_NACL_GLIBC - Defined if compiled for Google Chrome Native +# Client with `glibc` toolchain # CORRADE_TARGET_EMSCRIPTEN - Defined if compiled for Emscripten # CORRADE_TARGET_ANDROID - Defined if compiled for Android # +# Additionally these variables are defined for internal usage: +# +# CORRADE_INCLUDE_DIR - Root include dir +# CORRADE_*_LIBRARY_DEBUG - Debug version of given library, if found +# CORRADE_*_LIBRARY_RELEASE - Release version of given library, if found +# CORRADE_USE_MODULE - Path to UseCorrade.cmake module (included +# automatically) +# CORRADE_TESTSUITE_XCTEST_RUNNER - Path to XCTestRunner.mm.in file +# CORRADE_PEDANTIC_COMPILER_OPTIONS - List of pedantic compiler options used +# for targets with :prop_tgt:`CORRADE_USE_PEDANTIC_FLAGS` enabled +# CORRADE_PEDANTIC_COMPILER_DEFINITIONS - List of pedantic compiler +# definitions used for targets with :prop_tgt:`CORRADE_USE_PEDANTIC_FLAGS` +# enabled +# +# Workflows without :prop_tgt:`IMPORTED` targets are deprecated and the +# following variables are included just for backwards compatibility and only if +# :variable:`CORRADE_BUILD_DEPRECATED` is enabled: +# +# CORRADE_*_LIBRARIES - Expands to ``Corrade::*`` target. Use +# ``Corrade::*`` target directly instead. +# CORRADE_CXX_FLAGS - Pedantic compile flags. Use +# :prop_tgt:`CORRADE_USE_PEDANTIC_FLAGS` property instead. +# # Corrade provides these macros and functions: # +# .. command:: corrade_add_test +# +# Add unit test using Corrade's TestSuite:: +# +# corrade_add_test( +# ... +# [LIBRARIES ...]) # -# Add unit test using Corrade's TestSuite. -# corrade_add_test(test_name -# sources... -# [LIBRARIES libraries...]) # Test name is also executable name. You can also specify libraries to link -# with instead of using target_link_libraries(). CORRADE_TESTSUITE_LIBRARIES -# are linked automatically to each test. Note that the enable_testing() -# function must be called explicitly. +# with instead of using :command:`target_link_libraries()`. +# ``Corrade::TestSuite`` library is linked automatically to each test. Note +# that the :command:`enable_testing()` function must be called explicitly. +# +# .. command:: corrade_add_resource # +# Compile data resources into application binary:: # -# Compile data resources into application binary. -# corrade_add_resource(name resources.conf) -# Depends on corrade-rc, which is part of Corrade utilities. This command +# corrade_add_resource( ) +# +# Depends on ``Corrade::rc``, which is part of Corrade utilities. This command # generates resource data using given configuration file in current build # directory. Argument name is name under which the resources can be explicitly -# loaded. Variable `name` contains compiled resource filename, which is then -# used for compiling library / executable. Example usage: +# loaded. Variable ```` contains compiled resource filename, which is +# then used for compiling library / executable. Example usage:: +# # corrade_add_resource(app_resources resources.conf) # add_executable(app source1 source2 ... ${app_resources}) # -# Add dynamic plugin. -# corrade_add_plugin(plugin_name debug_install_dir release_install_dir -# metadata_file sources...) -# The macro adds preprocessor directive CORRADE_DYNAMIC_PLUGIN. Additional -# libraries can be linked in via target_link_libraries(plugin_name ...). If -# debug_install_dir is set to CMAKE_CURRENT_BINARY_DIR (e.g. for testing -# purposes), the files are copied directly, without the need to perform install -# step. Note that the files are actually put into configuration-based -# subdirectory, i.e. ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}. See -# documentation of CMAKE_CFG_INTDIR variable for more information. +# .. command:: corrade_add_plugin # +# Add dynamic plugin:: # -# Add static plugin. -# corrade_add_static_plugin(plugin_name install_dir metadata_file -# sources...) -# The macro adds preprocessor directive CORRADE_STATIC_PLUGIN. Additional -# libraries can be linked in via target_link_libraries(plugin_name ...). If -# install_dir is set to CMAKE_CURRENT_BINARY_DIR (e.g. for testing purposes), -# no installation rules are added. +# corrade_add_plugin( +# +# +# ...) # -# Note that plugins built in debug configuration (e.g. with CMAKE_BUILD_TYPE -# set to Debug) have "-d" suffix to make it possible to have both debug and -# release plugins installed alongside each other. +# The macro adds preprocessor directive ``CORRADE_DYNAMIC_PLUGIN``. Additional +# libraries can be linked in via :command:`target_link_libraries(plugin_name ...) `. +# If ```` is set to :variable:`CMAKE_CURRENT_BINARY_DIR` +# (e.g. for testing purposes), the files are copied directly, without the need +# to perform install step. Note that the files are actually put into +# configuration-based subdirectory, i.e. ``${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}``. +# See documentation of :variable:`CMAKE_CFG_INTDIR` variable for more +# information. # +# .. command:: corrade_add_static_plugin # -# Find corresponding DLLs for library files. -# corrade_find_dlls_for_libs( libs...) -# Available only on Windows, for all *.lib files tries to find corresponding -# DLL file. Useful for bundling dependencies for e.g. WinRT packages. +# Add static plugin:: # +# corrade_add_static_plugin( +# +# +# ...) # -# Additionally these variables are defined for internal usage: -# CORRADE_INCLUDE_DIR - Root include dir -# CORRADE_INTERCONNECT_LIBRARY - Interconnect library (w/o -# dependencies) -# CORRADE_UTILITY_LIBRARY - Utility library (w/o dependencies) -# CORRADE_PLUGINMANAGER_LIBRARY - Plugin manager library (w/o -# dependencies) -# CORRADE_TESTSUITE_LIBRARY - TestSuite library (w/o dependencies) -# CORRADE_*_LIBRARY_DEBUG - Debug version of given library, if found -# CORRADE_*_LIBRARY_RELEASE - Release version of given library, if -# found -# CORRADE_USE_MODULE - Path to UseCorrade.cmake module (included -# automatically) -# CORRADE_TESTSUITE_XCTEST_RUNNER - Path to XCTestRunner.mm.in file +# The macro adds preprocessor directive ``CORRADE_STATIC_PLUGIN``. Additional +# libraries can be linked in via :command:`target_link_libraries(plugin_name ...) `. +# If ```` is set to :variable:`CMAKE_CURRENT_BINARY_DIR` (e.g. for +# testing purposes), no installation rules are added. +# +# Note that plugins built in debug configuration (e.g. with :variable:`CMAKE_BUILD_TYPE` +# set to ``Debug``) have ``"-d"`` suffix to make it possible to have both debug +# and release plugins installed alongside each other. +# +# .. command:: corrade_find_dlls_for_libs +# +# Find corresponding DLLs for library files:: +# +# corrade_find_dlls_for_libs( ...) +# +# Available only on Windows, for all ``*.lib`` files tries to find +# corresponding DLL file. Useful for bundling dependencies for e.g. WinRT +# packages. # # @@ -147,45 +210,15 @@ # DEALINGS IN THE SOFTWARE. # -# Libraries -foreach(_component Interconnect Utility PluginManager TestSuite) - string(TOUPPER ${_component} _COMPONENT) - - # Try to find both debug and release version - find_library(CORRADE_${_COMPONENT}_LIBRARY_DEBUG Corrade${_component}-d) - find_library(CORRADE_${_COMPONENT}_LIBRARY_RELEASE Corrade${_component}) - - # Set the _LIBRARY variable based on what was found - if(CORRADE_${_COMPONENT}_LIBRARY_DEBUG AND CORRADE_${_COMPONENT}_LIBRARY_RELEASE) - set(CORRADE_${_COMPONENT}_LIBRARY - debug ${CORRADE_${_COMPONENT}_LIBRARY_DEBUG} - optimized ${CORRADE_${_COMPONENT}_LIBRARY_RELEASE}) - elseif(CORRADE_${_COMPONENT}_LIBRARY_DEBUG) - set(CORRADE_${_COMPONENT}_LIBRARY ${CORRADE_${_COMPONENT}_LIBRARY_DEBUG}) - elseif(CORRADE_${_COMPONENT}_LIBRARY_RELEASE) - set(CORRADE_${_COMPONENT}_LIBRARY ${CORRADE_${_COMPONENT}_LIBRARY_RELEASE}) - endif() - - mark_as_advanced(CORRADE_${_COMPONENT}_LIBRARY_DEBUG - CORRADE_${_COMPONENT}_LIBRARY_RELEASE - CORRADE_${_COMPONENT}_LIBRARY) -endforeach() - -# RC executable -find_program(CORRADE_RC_EXECUTABLE corrade-rc) - -# Include dir +# Root include dir find_path(CORRADE_INCLUDE_DIR - NAMES Corrade/PluginManager Corrade/Utility) - -# CMake module dir -find_path(_CORRADE_MODULE_DIR - NAMES UseCorrade.cmake CorradeLibSuffix.cmake - PATH_SUFFIXES share/cmake/Corrade) + NAMES Corrade/Corrade.h) +mark_as_advanced(CORRADE_INCLUDE_DIR) # Configuration file find_file(_CORRADE_CONFIGURE_FILE configure.h HINTS ${CORRADE_INCLUDE_DIR}/Corrade/) +mark_as_advanced(_CORRADE_CONFIGURE_FILE) # We need to open configure.h file from CORRADE_INCLUDE_DIR before we check for # the components. Bail out with proper error message if it wasn't found. The @@ -196,7 +229,7 @@ if(NOT CORRADE_INCLUDE_DIR) REQUIRED_VARS CORRADE_INCLUDE_DIR _CORRADE_CONFIGURE_FILE) endif() -# Read flags from fonfiguration +# Read flags from configuration file(READ ${_CORRADE_CONFIGURE_FILE} _corradeConfigure) set(_corradeFlags GCC47_COMPATIBILITY @@ -228,46 +261,188 @@ if(CORRADE_TESTSUITE_TARGET_XCTEST) set(CORRADE_TESTSUITE_XCTEST_RUNNER_NEEDED CORRADE_TESTSUITE_XCTEST_RUNNER) endif() -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Corrade DEFAULT_MSG - CORRADE_UTILITY_LIBRARY - CORRADE_INTERCONNECT_LIBRARY - CORRADE_PLUGINMANAGER_LIBRARY - CORRADE_TESTSUITE_LIBRARY - CORRADE_INCLUDE_DIR - CORRADE_RC_EXECUTABLE - _CORRADE_MODULE_DIR - _CORRADE_CONFIGURE_FILE - ${CORRADE_TESTSUITE_XCTEST_RUNNER_NEEDED}) +# CMake module dir +find_path(_CORRADE_MODULE_DIR + NAMES UseCorrade.cmake CorradeLibSuffix.cmake + PATH_SUFFIXES share/cmake/Corrade) +mark_as_advanced(_CORRADE_MODULE_DIR) -set(CORRADE_INCLUDE_DIRS ${CORRADE_INCLUDE_DIR}) -set(CORRADE_UTILITY_LIBRARIES ${CORRADE_UTILITY_LIBRARY}) -set(CORRADE_INTERCONNECT_LIBRARIES ${CORRADE_INTERCONNECT_LIBRARY} ${CORRADE_UTILITY_LIBRARIES}) -set(CORRADE_PLUGINMANAGER_LIBRARIES ${CORRADE_PLUGINMANAGER_LIBRARY} ${CORRADE_UTILITY_LIBRARIES}) -set(CORRADE_TESTSUITE_LIBRARIES ${CORRADE_TESTSUITE_LIBRARY} ${CORRADE_UTILITY_LIBRARIES}) set(CORRADE_USE_MODULE ${_CORRADE_MODULE_DIR}/UseCorrade.cmake) set(CORRADE_LIB_SUFFIX_MODULE ${_CORRADE_MODULE_DIR}/CorradeLibSuffix.cmake) -# If the configure file is somewhere else than in root include dir (e.g. when -# using CMake subproject), we need to include that dir too -if(NOT ${CORRADE_INCLUDE_DIR}/Corrade/configure.h STREQUAL ${_CORRADE_CONFIGURE_FILE}) - # Go two levels up - get_filename_component(_CORRADE_CONFIGURE_FILE_INCLUDE_DIR ${_CORRADE_CONFIGURE_FILE} DIRECTORY) - get_filename_component(_CORRADE_CONFIGURE_FILE_INCLUDE_DIR ${_CORRADE_CONFIGURE_FILE_INCLUDE_DIR} DIRECTORY) - list(APPEND CORRADE_INCLUDE_DIRS ${_CORRADE_CONFIGURE_FILE_INCLUDE_DIR}) -endif() +# Ensure that all inter-component dependencies are specified as well +foreach(_component ${Corrade_FIND_COMPONENTS}) + string(TOUPPER ${_component} _COMPONENT) -# At least static build needs this -if(CORRADE_TARGET_UNIX OR CORRADE_TARGET_NACL_GLIBC) - set(CORRADE_PLUGINMANAGER_LIBRARIES ${CORRADE_PLUGINMANAGER_LIBRARIES} ${CMAKE_DL_LIBS}) -endif() + if(_component STREQUAL Containers) + set(_CORRADE_${_COMPONENT}_DEPENDENCIES Utility) + elseif(_component STREQUAL Interconnect) + set(_CORRADE_${_COMPONENT}_DEPENDENCIES Utility) + elseif(_component STREQUAL PluginManager) + set(_CORRADE_${_COMPONENT}_DEPENDENCIES Containers Utility rc) + elseif(_component STREQUAL TestSuite) + set(_CORRADE_${_COMPONENT}_DEPENDENCIES Utility) + elseif(_component STREQUAL Utility) + set(_CORRADE_${_COMPONENT}_DEPENDENCIES Containers rc) + endif() -# AndroidLogStreamBuffer class needs to be linked to log library -if(CORRADE_TARGET_ANDROID) - set(CORRADE_UTILITY_LIBRARIES ${CORRADE_UTILITY_LIBRARIES} log) + list(APPEND _CORRADE_ADDITIONAL_COMPONENTS ${_CORRADE_${_COMPONENT}_DEPENDENCIES}) +endforeach() + +# Join the lists, remove duplicate components +if(_CORRADE_ADDITIONAL_COMPONENTS) + list(INSERT Corrade_FIND_COMPONENTS 0 ${_CORRADE_ADDITIONAL_COMPONENTS}) +endif() +if(Corrade_FIND_COMPONENTS) + list(REMOVE_DUPLICATES Corrade_FIND_COMPONENTS) endif() -mark_as_advanced(_CORRADE_CONFIGURE_FILE _CORRADE_MODULE_DIR) +# Component distinction +set(_CORRADE_LIBRARY_COMPONENTS "^(Containers|Interconnect|PluginManager|TestSuite|Utility)$") +set(_CORRADE_HEADER_ONLY_COMPONENTS "^(Containers)$") +set(_CORRADE_EXECUTABLE_COMPONENTS "^(rc)$") + +# Find all components +foreach(_component ${Corrade_FIND_COMPONENTS}) + string(TOUPPER ${_component} _COMPONENT) + + # Create imported target in case the library is found. If the project is + # added as subproject to CMake, the target already exists and all the + # required setup is already done from the build tree. + if(TARGET Corrade::${_component}) + set(Corrade_${_component}_FOUND TRUE) + else() + # Library components + if(_component MATCHES ${_CORRADE_LIBRARY_COMPONENTS} AND NOT _component MATCHES ${_CORRADE_HEADER_ONLY_COMPONENTS}) + add_library(Corrade::${_component} UNKNOWN IMPORTED) + + # Try to find both debug and release version + find_library(CORRADE_${_COMPONENT}_LIBRARY_DEBUG Corrade${_component}-d) + find_library(CORRADE_${_COMPONENT}_LIBRARY_RELEASE Corrade${_component}) + mark_as_advanced(CORRADE_${_COMPONENT}_LIBRARY_DEBUG + CORRADE_${_COMPONENT}_LIBRARY_RELEASE) + + if(CORRADE_${_COMPONENT}_LIBRARY_RELEASE) + set_property(TARGET Corrade::${_component} APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_property(TARGET Corrade::${_component} PROPERTY + IMPORTED_LOCATION_RELEASE ${CORRADE_${_COMPONENT}_LIBRARY_RELEASE}) + endif() + + if(CORRADE_${_COMPONENT}_LIBRARY_DEBUG) + set_property(TARGET Corrade::${_component} APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_property(TARGET Corrade::${_component} PROPERTY + IMPORTED_LOCATION_DEBUG ${CORRADE_${_COMPONENT}_LIBRARY_DEBUG}) + endif() + endif() + + # Header-only library components (CMake >= 3.0) + if(_component MATCHES ${_CORRADE_HEADER_ONLY_COMPONENTS} AND NOT CMAKE_VERSION VERSION_LESS 3.0.0) + add_library(Corrade::${_component} INTERFACE IMPORTED) + endif() + + # Executable components + if(_component MATCHES ${_CORRADE_EXECUTABLE_COMPONENTS}) + add_executable(Corrade::${_component} IMPORTED) + + find_program(CORRADE_${_COMPONENT}_EXECUTABLE corrade-${_component}) + mark_as_advanced(CORRADE_${_COMPONENT}_EXECUTABLE) + + if(CORRADE_${_COMPONENT}_EXECUTABLE) + set_property(TARGET Corrade::${_component} PROPERTY + IMPORTED_LOCATION ${CORRADE_${_COMPONENT}_EXECUTABLE}) + endif() + endif() + + # No special setup for Containers library + # No special setup for Interconnect library + + # PluginManager library + if(_component STREQUAL PluginManager) + # At least static build needs this + if(CORRADE_TARGET_UNIX OR CORRADE_TARGET_NACL_GLIBC) + set_property(TARGET Corrade::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS}) + endif() + + # No special setup for TestSuite library + + # Utility library (contains all setup that is used by others) + elseif(_component STREQUAL Utility) + # Top-level include directory + set_property(TARGET Corrade::${_component} APPEND PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${CORRADE_INCLUDE_DIR}) + + # Require (at least) C++11 for users + if(NOT CMAKE_VERSION VERSION_LESS 3.0.0) + set_property(TARGET Corrade::${_component} PROPERTY + INTERFACE_CORRADE_CXX_STANDARD 11) + set_property(TARGET Corrade::${_component} APPEND PROPERTY + COMPATIBLE_INTERFACE_NUMBER_MAX CORRADE_CXX_STANDARD) + else() + # 2.8.12 is fucking buggy shit. Besides the fact that it + # doesn't know COMPATIBLE_INTERFACE_NUMBER_MAX, if I + # define_property() so I can inherit it from directory on a + # target, then I can't use it in COMPATIBLE_INTERFACE_STRING + # to inherit it from interfaces BECAUSE!! it thinks that it is + # not an user-defined property anymore. So I need to have two + # sets of properties, CORRADE_CXX_STANDARD_ used silently for + # inheritance from interfaces and CORRADE_CXX_STANDARD used + # publicly for inheritance from directories. AAAAAAAAARGH. + set_property(TARGET Corrade::${_component} PROPERTY + INTERFACE_CORRADE_CXX_STANDARD_ 11) + set_property(TARGET Corrade::${_component} APPEND PROPERTY + COMPATIBLE_INTERFACE_STRING CORRADE_CXX_STANDARD_) + endif() + + # AndroidLogStreamBuffer class needs to be linked to log library + if(CORRADE_TARGET_ANDROID) + set_property(TARGET Corrade::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES "log") + endif() + endif() + + # Find library includes + if(_component MATCHES ${_CORRADE_LIBRARY_COMPONENTS}) + find_path(_CORRADE_${_COMPONENT}_INCLUDE_DIR + NAMES ${_component}.h + HINTS ${CORRADE_INCLUDE_DIR}/Corrade/${_component}) + mark_as_advanced(_CORRADE_${_COMPONENT}_INCLUDE_DIR) + endif() + + # Add inter-library dependencies (except for the header-only libraries + # on 2.8.12) + if(_component MATCHES ${_CORRADE_LIBRARY_COMPONENTS} AND (NOT CMAKE_VERSION VERSION_LESS 3.0.0 OR NOT _component MATCHES ${_CORRADE_HEADER_ONLY_COMPONENTS})) + foreach(_dependency ${_CORRADE_${_COMPONENT}_DEPENDENCIES}) + if(_dependency MATCHES ${_CORRADE_LIBRARY_COMPONENTS} AND (NOT CMAKE_VERSION VERSION_LESS 3.0.0 OR NOT _dependency MATCHES ${_CORRADE_HEADER_ONLY_COMPONENTS})) + set_property(TARGET Corrade::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES Corrade::${_dependency}) + endif() + endforeach() + endif() + + # Decide if the component was found + if((_component MATCHES ${_CORRADE_LIBRARY_COMPONENTS} AND _CORRADE_${_COMPONENT}_INCLUDE_DIR AND (_component MATCHES ${_CORRADE_HEADER_ONLY_COMPONENTS} OR CORRADE_${_COMPONENT}_LIBRARY_RELEASE OR CORRADE_${_COMPONENT}_LIBRARY_DEBUG)) OR (_component MATCHES ${_CORRADE_EXECUTABLE_COMPONENTS} AND CORRADE_${_COMPONENT}_EXECUTABLE)) + set(Corrade_${_component}_FOUND TRUE) + else() + set(Corrade_${_component}_FOUND FALSE) + endif() + endif() + + # Deprecated variables + if(CORRADE_BUILD_DEPRECATED AND _component MATCHES ${_CORRADE_LIBRARY_COMPONENTS} AND NOT _component MATCHES ${_CORRADE_HEADER_ONLY_COMPONENTS}) + set(CORRADE_${_COMPONENT}_LIBRARIES Corrade::${_component}) + endif() +endforeach() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Corrade REQUIRED_VARS + CORRADE_INCLUDE_DIR + _CORRADE_MODULE_DIR + _CORRADE_CONFIGURE_FILE + ${CORRADE_TESTSUITE_XCTEST_RUNNER_NEEDED} + HANDLE_COMPONENTS) # Finalize the finding process include(${CORRADE_USE_MODULE}) diff --git a/modules/FindNodeJs.cmake b/modules/FindNodeJs.cmake index 90f7ebf21..fe85046b2 100644 --- a/modules/FindNodeJs.cmake +++ b/modules/FindNodeJs.cmake @@ -1,15 +1,17 @@ -# - Find Node.js +#.rst: +# Find Node.js +# ------------ # -# This module defines: +# Finds the Node.js executable. This module defines: # # NODEJS_FOUND - True if Node.js executable is found -# NODEJS_EXECUTABLE - Node.js executable +# NodeJs::NodeJs - Node.js executable imported target # # # This file is part of Corrade. # -# Copyright © 2007, 2008, 2009, 2010, 2011, 2012, 2013 +# Copyright © 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 # Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a @@ -35,3 +37,8 @@ find_program(NODEJS_EXECUTABLE node) include(FindPackageHandleStandardArgs) find_package_handle_standard_args("NodeJs" DEFAULT_MSG NODEJS_EXECUTABLE) + +if(NOT TARGET NodeJs::NodeJs) + add_executable(NodeJs::NodeJs IMPORTED) + set_property(TARGET NodeJs::NodeJs PROPERTY IMPORTED_LOCATION ${NODEJS_EXECUTABLE}) +endif() From 01ffbe93a95c3f2e5dcac561f621be3778a60cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 21 Feb 2016 23:31:00 +0100 Subject: [PATCH 159/258] Modern CMake usage: reworked to use target-specific properties. As with Corrade, this is not exactly backwards compatible, but for common use case without OBJECT libraries this should not be a problem. In any case, recreate the build dir and update your copy of all Find*.cmake modules to avoid weird things happening. User-facing changes: * Documentation of all Find*.cmake modules converted to reStructuredText to follow official CMake guidelines. * The newfangled way to use the libraries is to link to Magnum::Shaders instead of adding ${MAGNUM_SHADERS_INCLUDE_DIRS} to include path and linking to ${MAGNUM_SHADERS_LIBRARIES}. * The old ${MAGNUM_*_LIBRARIES} are deprecated and now just expand to Magnum::* target. Use the target directly. These are also enabled only when building with MAGNUM_BUILD_DEPRECATED. * The old ${MAGNUM_*_INCLUDE_DIRS} are removed as the Magnum::* targets cover these too. Internal changes: * Global state such as include_directories() was replaced with target-specific settings. --- CMakeLists.txt | 6 +- doc/cmake.dox | 49 +- doc/generated/CMakeLists.txt | 23 +- doc/getting-started.dox | 11 +- doc/namespaces.dox | 77 +- doc/platform.dox | 32 +- doc/plugins.dox | 2 +- doc/portability.dox | 6 +- modules/FindEGL.cmake | 19 +- modules/FindMagnum.cmake | 928 ++++++++++-------- modules/FindOpenGLES2.cmake | 30 +- modules/FindOpenGLES3.cmake | 28 +- modules/FindSDL2.cmake | 42 +- src/CMakeLists.txt | 14 +- src/Magnum/Audio/CMakeLists.txt | 11 +- src/Magnum/Audio/Extensions.h | 10 +- src/Magnum/Audio/Test/CMakeLists.txt | 3 +- src/Magnum/CMakeLists.txt | 34 +- src/Magnum/DebugTools/CMakeLists.txt | 4 +- src/Magnum/Extensions.h | 5 +- src/Magnum/Math/Geometry/Test/CMakeLists.txt | 2 +- src/Magnum/Math/Test/CMakeLists.txt | 14 +- src/Magnum/MeshTools/CMakeLists.txt | 14 +- src/Magnum/MeshTools/Test/CMakeLists.txt | 11 +- src/Magnum/Platform/AndroidApplication.h | 12 +- src/Magnum/Platform/CMakeLists.txt | 139 +-- src/Magnum/Platform/GlutApplication.h | 10 +- src/Magnum/Platform/GlxApplication.h | 8 +- src/Magnum/Platform/NaClApplication.h | 8 +- src/Magnum/Platform/Sdl2Application.h | 7 +- .../Platform/WindowlessGlxApplication.h | 12 +- .../Platform/WindowlessWglApplication.h | 12 +- .../WindowlessWindowsEglApplication.h | 12 +- src/Magnum/Platform/XEglApplication.h | 7 +- src/Magnum/Primitives/CMakeLists.txt | 5 +- src/Magnum/SceneGraph/CMakeLists.txt | 14 +- src/Magnum/SceneGraph/Test/CMakeLists.txt | 5 +- src/Magnum/Shaders/CMakeLists.txt | 3 +- src/Magnum/Shapes/CMakeLists.txt | 5 +- src/Magnum/Test/CMakeLists.txt | 11 +- src/Magnum/Text/CMakeLists.txt | 19 +- src/Magnum/Text/Test/CMakeLists.txt | 4 +- src/Magnum/TextureTools/CMakeLists.txt | 19 +- src/Magnum/Trade/Test/CMakeLists.txt | 4 +- src/MagnumExternal/OpenGL/GL/CMakeLists.txt | 7 +- .../OpenGL/GLES2/CMakeLists.txt | 7 +- .../OpenGL/GLES3/CMakeLists.txt | 7 +- src/MagnumPlugins/MagnumFont/CMakeLists.txt | 7 +- src/MagnumPlugins/MagnumFont/MagnumFont.h | 4 +- .../MagnumFont/Test/CMakeLists.txt | 3 +- .../MagnumFontConverter/CMakeLists.txt | 7 +- .../MagnumFontConverter/MagnumFontConverter.h | 5 +- .../MagnumFontConverter/Test/CMakeLists.txt | 5 +- src/MagnumPlugins/ObjImporter/CMakeLists.txt | 4 +- src/MagnumPlugins/ObjImporter/ObjImporter.h | 4 +- .../ObjImporter/Test/CMakeLists.txt | 3 +- .../TgaImageConverter/CMakeLists.txt | 8 +- .../TgaImageConverter/Test/CMakeLists.txt | 8 +- .../TgaImageConverter/TgaImageConverter.h | 5 +- src/MagnumPlugins/TgaImporter/CMakeLists.txt | 8 +- .../TgaImporter/Test/CMakeLists.txt | 5 +- src/MagnumPlugins/TgaImporter/TgaImporter.h | 4 +- .../WavAudioImporter/CMakeLists.txt | 12 +- .../WavAudioImporter/Test/CMakeLists.txt | 3 +- .../WavAudioImporter/WavImporter.h | 4 +- 65 files changed, 981 insertions(+), 830 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3de8d6856..6f46c1d37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,9 +31,10 @@ if(POLICY CMP0042) cmake_policy(SET CMP0042 NEW) endif() -# Find Corrade first so we can check on the target set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/modules/") -find_package(Corrade REQUIRED) + +# Find Corrade first so we can check on the target +find_package(Corrade REQUIRED PluginManager Utility) include(CMakeDependentOption) @@ -131,6 +132,7 @@ option(BUILD_PLUGINS_STATIC "Build static plugins (default are dynamic)" OFF) option(BUILD_TESTS "Build unit tests" OFF) cmake_dependent_option(BUILD_GL_TESTS "Build unit tests for OpenGL code" OFF "BUILD_TESTS" OFF) if(BUILD_TESTS) + find_package(Corrade REQUIRED TestSuite) enable_testing() endif() diff --git a/doc/cmake.dox b/doc/cmake.dox index 726dba2a1..32fae0679 100644 --- a/doc/cmake.dox +++ b/doc/cmake.dox @@ -50,12 +50,10 @@ Basic usage is: find_package(Magnum REQUIRED) -This command tries to find base Magnum library and then defines these -variables: +This module tries to find base Magnum library and then defines: -- `MAGNUM_FOUND` -- Whether the library was found -- `MAGNUM_LIBRARIES` -- Magnum library and dependent libraries -- `MAGNUM_INCLUDE_DIRS` -- Root include dir and include dirs of dependencies +- `Magnum_FOUND` -- Whether the library was found +- `Magnum::Magnum` -- Base library imported target - `MAGNUM_PLUGINS_DEBUG_DIR` -- Base directory with dynamic plugins for debug builds, defaults to `magnum-d/` subdirectory of dir where Magnum library was found @@ -135,6 +133,12 @@ dependencies, you need to find the dependency and then link to it. - `TgaImporter` -- @ref Trade::TgaImporter "TgaImporter" plugin - `WavAudioImporter` -- @ref Audio::WavImporter "WavAudioImporter" plugin +Lastly, a few utility executables are available: + +- `distancefieldconverter` -- @ref magnum-distancefieldconverter executable +- `fontconverter` -- @ref magnum-fontconverter executable +- `info` -- @ref magnum-info executable + Note that [each namespace](namespaces.html), all @ref Platform libraries and each plugin class contain more detailed information about dependencies, availability on particular platform and also guide how to enable given library @@ -146,18 +150,14 @@ Example usage with specifying additional components is: For each component is then defined: -- `MAGNUM_*_FOUND` -- Whether the component was found -- `MAGNUM_*_LIBRARIES` -- Component library and dependent libraries -- `MAGNUM_*_INCLUDE_DIRS` -- Include dirs of module dependencies +- `Magnum_*_FOUND` -- Whether the component was found +- `Magnum::*` -- Component imported target If exactly one `*Application` or exactly one `Windowless*Application` component -is requested and found, its libraries and include dirs are available in -convenience aliases `MAGNUM_APPLICATION_LIBRARIES` / -`MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES` and `MAGNUM_APPLICATION_INCLUDE_DIRS` -/ `MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS` to simplify porting. Similarly, -if exactly one `*Context` component is requested and found, its libraries and -include dirs are available in convenience aliases `MAGNUM_CONTEXT_LIBRARIES` -and `MAGNUM_CONTEXT_INCLUDE_DIRS`. +is requested and found, its target is available in convenience alias +`Magnum::Application` / `Magnum::WindowlessApplication` to simplify porting. +Similarly, if exactly one `*Context` component is requested and found, its +target is available in convenience alias `Magnum::Context`. The package is found if either debug or release version of each requested library (or plugin) is found. If both debug and release libraries (or plugins) @@ -184,10 +184,25 @@ are also available as preprocessor variables if including emulation on desktop OpenGL - `MAGNUM_TARGET_WEBGL` --- Defined if compiled for WebGL +Workflows without imported targets are deprecated and the following variables +are included just for backwards compatibility and only if +@ref MAGNUM_BUILD_DEPRECATED is enabled: + +- `MAGNUM_LIBRARIES` -- Expands to `Magnum::Magnum` target. Use `Magnum::Magnum` + target directly instead. +- `MAGNUM_*_LIBRARIES` -- Expands to `Magnum::*` target. Use `Magnum::*` + target directly instead. +- `MAGNUM_APPLICATION_LIBRARIES` / `MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES` + -- Expands to `Magnum::Application` / `Magnum::WindowlessApplication` + target. Use `Magnum::Application` / `Magnum::WindowlessApplication` target + directly instead. +- `MAGNUM_CONTEXT_LIBRARIES` -- Expands to `Magnum::Context` target. Use + `Magnum::Context` target directly instead. + Corrade library provides also its own set of CMake macros and variables, see @ref corrade-cmake "its documentation" for more information. -@ref cmake-plugins "Plugins repository" and @ref cmake-integration "Integration library" -have also their own CMake modules. +@ref cmake-plugins "Plugins repository", @ref cmake-integration "Integration repository" +and @ref cmake-extras "Extras repository" have also their own CMake modules. */ } diff --git a/doc/generated/CMakeLists.txt b/doc/generated/CMakeLists.txt index 2015eb44d..394584469 100644 --- a/doc/generated/CMakeLists.txt +++ b/doc/generated/CMakeLists.txt @@ -34,6 +34,8 @@ find_package(Magnum REQUIRED Shaders Sdl2Application) +set_directory_properties(PROPERTIES CORRADE_USE_PEDANTIC_FLAGS ON) + if(CORRADE_TARGET_APPLE) find_package(Magnum REQUIRED WindowlessCglApplication) elseif(CORRADE_TARGET_UNIX) @@ -46,22 +48,17 @@ endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/configure.h) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CORRADE_CXX_FLAGS}") -include_directories(${MAGNUM_INCLUDE_DIRS} - ${MAGNUM_APPLICATION_INCLUDE_DIRS} - ${MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS}) add_executable(hello hello.cpp) target_link_libraries(hello - ${MAGNUM_LIBRARIES} - ${MAGNUM_APPLICATION_LIBRARIES}) + Magnum::Magnum + Magnum::Application) add_executable(shaders shaders.cpp) +target_include_directories(shaders PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(shaders - ${MAGNUM_LIBRARIES} - ${MAGNUM_MESHTOOLS_LIBRARIES} - ${MAGNUM_PRIMITIVES_LIBRARIES} - ${MAGNUM_SHADERS_LIBRARIES} - ${MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES}) + Magnum::Magnum + Magnum::MeshTools + Magnum::Primitives + Magnum::Shaders + Magnum::WindowlessApplication) diff --git a/doc/getting-started.dox b/doc/getting-started.dox index deb6ba4b1..57e6c2634 100644 --- a/doc/getting-started.dox +++ b/doc/getting-started.dox @@ -143,18 +143,17 @@ MAGNUM_APPLICATION_MAIN(MyApplication) The application essentially does nothing, just clears screen framebuffer to default (dark gray) color and then does buffer swap to actually display it on -the screen. The `src/CMakeLists.txt` file finds Magnum, sets up compiler flags, -creates the executable and links it to all needed libraries: +the screen. The `src/CMakeLists.txt` file finds Magnum, creates the executable +and links it to all needed libraries: @code find_package(Magnum REQUIRED Sdl2Application) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CORRADE_CXX_FLAGS}") -include_directories(${MAGNUM_INCLUDE_DIRS} ${MAGNUM_APPLICATION_INCLUDE_DIRS}) +set_directory_properties(PROPERTIES CORRADE_USE_PEDANTIC_FLAGS ON) add_executable(MyApplication MyApplication.cpp) target_link_libraries(MyApplication - ${MAGNUM_LIBRARIES} - ${MAGNUM_APPLICATION_LIBRARIES}) + Magnum::Magnum + Magnum::Application) @endcode In the following tutorials the code will be explained more thoroughly. diff --git a/doc/namespaces.dox b/doc/namespaces.dox index 2f621ddc4..a6af136b4 100644 --- a/doc/namespaces.dox +++ b/doc/namespaces.dox @@ -32,9 +32,8 @@ Contains classes for interacting with OpenGL. This library is built as part of Magnum by default. To use it, you need to -find `Magnum` package, add `${MAGNUM_INCLUDE_DIRS}` to include path and link -to `${MAGNUM_LIBRARIES}`. See @ref building and @ref cmake for more -information. +find `Magnum` package and link to `Magnum::Magnum` target. See @ref building +and @ref cmake for more information. */ /** @dir Magnum/Platform @@ -48,9 +47,8 @@ Base classes for creating applications with various toolkits. Parts of this namespace are built if `WITH_*APPLICATION` is enabled when building Magnum, with each library having specific toolkit dependencies and platform requirements. To use particular application library, you need to -request given `*Application` component of `Magnum` package in CMake, add -`${MAGNUM_*APPLICATION_INCLUDE_DIRS}` to include path and link to -`${MAGNUM_*APPLICATION_LIBRARIES}`. See particular `*Application` class +request given `*Application` component of `Magnum` package in CMake and link to +`Magnum::*Application` target. See particular `*Application` class documentation, @ref building, @ref cmake and @ref platform for more information. */ @@ -64,9 +62,8 @@ information. Template classes for matrix and vector calculations. This library is built as part of Magnum by default. To use it, you need to -find `Magnum` package, add `${MAGNUM_INCLUDE_DIRS}` to include path and link -to `${MAGNUM_LIBRARIES}`. See @ref building, @ref cmake, @ref matrix-vector and -@ref transformations for more information. +find `Magnum` package and link to `Magnum::Magnum` target. See @ref building, +@ref cmake, @ref matrix-vector and @ref transformations for more information. */ /** @dir Magnum/Math/Algorithms @@ -78,9 +75,8 @@ to `${MAGNUM_LIBRARIES}`. See @ref building, @ref cmake, @ref matrix-vector and Various matrix and vector algorithms. This library is built as part of Magnum by default. To use it, you need to -find `Magnum` package, add `${MAGNUM_INCLUDE_DIRS}` to include path and link -to `${MAGNUM_LIBRARIES}`. See @ref building and @ref cmake for more -information. +find `Magnum` package and link to `Magnum::Magnum` target. See @ref building +and @ref cmake for more information. */ /** @dir Magnum/Math/Geometry @@ -92,9 +88,8 @@ information. Functions for computing intersections, distances, areas and volumes. This library is built as part of Magnum by default. To use it, you need to -find `Magnum` package, add `${MAGNUM_INCLUDE_DIRS}` to include path and link -to `${MAGNUM_LIBRARIES}`. See @ref building and @ref cmake for more -information. +find `Magnum` package and link to `Magnum::Magnum` target. See @ref building +and @ref cmake for more information. */ /** @dir Magnum/Audio @@ -107,11 +102,11 @@ Audio import, playback and integration with @ref SceneGraph. This library depends on **OpenAL** library. It is built if `WITH_AUDIO` is enabled when building Magnum. To use this library, you need to request -`Audio` component of `Magnum` package in CMake, add `${MAGNUM_AUDIO_INCLUDE_DIRS}` -to include path and link to `${MAGNUM_AUDIO_LIBRARIES}`. See @ref building and -@ref cmake for more information. Additional plugins are enabled separately, see -particular `*Importer` class documentation, @ref building-plugins, -@ref cmake-plugins and @ref plugins for more information. +`Audio` component of `Magnum` package in CMake and link to +`Magnum::Audio` target. See @ref building and @ref cmake for more information. +Additional plugins are enabled separately, see particular `Audio::*Importer` +class documentation, @ref building-plugins, @ref cmake-plugins and @ref plugins +for more information. */ /** @dir Magnum/DebugTools @@ -124,8 +119,8 @@ Debugging helpers, renderers and profilers. This library is built if `WITH_DEBUGTOOLS` is enabled when building Magnum. To use this library, you need to request `DebugTools` component of `Magnum` -package in CMake and link to `${MAGNUM_DEBUGTOOLS_LIBRARIES}`. See -@ref building, @ref cmake and @ref debug-tools for more information. +package in CMake and link to `Magnum::DebugTools` target. See @ref building, +@ref cmake and @ref debug-tools for more information. */ /** @dir Magnum/MeshTools @@ -138,8 +133,8 @@ Tools for generating, optimizing and cleaning meshes. This library is built if `WITH_MESHTOOLS` is enabled when building Magnum. To use this library, you need to request `MeshTools` component of `Magnum` -package in CMake and link to `${MAGNUM_MESHTOOLS_LIBRARIES}`. See @ref building -and @ref cmake for more information. +package in CMake and link to `Magnum::MeshTools` target. See @ref building and +@ref cmake for more information. */ /** @dir Magnum/Primitives @@ -152,8 +147,8 @@ Basic primitives for testing purposes. This library is built if `WITH_PRIMITIVES` is enabled when building Magnum. To use this library, you need to request `Primitives` component of `Magnum` -package in CMake and link to `${MAGNUM_PRIMITIVES_LIBRARIES}`. See -@ref building and @ref cmake for more information. +package in CMake and link to `Magnum::Primitives` target. See @ref building and +@ref cmake for more information. */ /** @dir Magnum/SceneGraph @@ -166,8 +161,8 @@ Managing object hierarchy, transformations and interactions. This library is built if `WITH_SCENEGRAPH` is enabled when building Magnum. To use this library, you need to request `SceneGraph` component of `Magnum` -package in CMake and link to `${MAGNUM_SCENEGRAPH_LIBRARIES}`. See -@ref building, @ref cmake and @ref scenegraph for more information. +package in CMake and link to `Magnum::SceneGraph` target. See @ref building, +@ref cmake and @ref scenegraph for more information. */ /** @dir Magnum/Shaders @@ -180,8 +175,8 @@ Collection of shaders for easy prototyping and basic usage. This library is built if `WITH_SHADERS` is enabled when building Magnum. To use this library, you need to request `Shaders` component of `Magnum` package -in CMake and link to `${MAGNUM_MESHTOOLS_SHADERS}`. See @ref building and -@ref cmake and @ref shaders for more information. +in CMake and link to `Magnum::Shaders` target. See @ref building, @ref cmake +and @ref shaders for more information. */ /** @dir Magnum/Shapes @@ -194,8 +189,8 @@ Collision detection system. This library is built if `WITH_SHAPES` is enabled when building Magnum. To use this library, you need to request `Shapes` component of `Magnum` package in -CMake and link to `${MAGNUM_SHAPES_LIBRARIES}`. See @ref building, @ref cmake -and @ref shapes for more information. +CMake and link to `Magnum::Shapes` target. See @ref building, @ref cmake and +@ref shapes for more information. */ /** @dir Magnum/Text @@ -208,8 +203,8 @@ Font texture creation and text layouting. This library is built if `WITH_TEXT` is enabled when building Magnum. To use this library, you need to request `Text` component of `Magnum` package in -CMake and link to `${MAGNUM_TEXT_LIBRARIES}`. See @ref building and @ref cmake -for more information. Additional plugins are enabled separately, see particular +CMake and link to `Magnum::Text` target. See @ref building and @ref cmake for +more information. Additional plugins are enabled separately, see particular `*Font` and `*FontConverter` class documentation, @ref building-plugins, @ref cmake-plugins and @ref plugins for more information. */ @@ -224,8 +219,8 @@ Tools for generating, compressing and optimizing textures. This library is built if `WITH_TEXTURETOOLS` is enabled when building Magnum. To use this library, you need to request `TextureTools` component of `Magnum` -package in CMake and link to `${MAGNUM_TEXTURETOOLS_LIBRARIES}`. See -@ref building and @ref cmake for more information. +package in CMake and link to `Magnum::TextureTools`. See @ref building and +@ref cmake for more information. */ /** @dir Magnum/Trade @@ -238,11 +233,11 @@ Contains plugin interfaces for importing data of various formats and classes for direct access to the data. This library is built as part of Magnum by default. To use it, you need to -find `Magnum` package, add `${MAGNUM_INCLUDE_DIRS}` to include path and link -to `${MAGNUM_LIBRARIES}`. See @ref building and @ref cmake for more -information. Additional plugins are enabled separately, see particular -`*Importer` and `*ImageConverter` class documentation, @ref building-plugins, -@ref cmake-plugins and @ref plugins for more information. +find `Magnum` package and link to `Magnum::Magnum` target. See @ref building +and @ref cmake for more information. Additional plugins are enabled separately, +see particular `Trade::*Importer` and `*ImageConverter` class documentation, +@ref building-plugins, @ref cmake-plugins and @ref plugins for more +information. */ /** @dir magnum/src/MagnumPlugins diff --git a/doc/platform.dox b/doc/platform.dox index 5b257bd89..bc58a29b4 100644 --- a/doc/platform.dox +++ b/doc/platform.dox @@ -182,15 +182,12 @@ MAGNUM_WINDOWLESSAPPLICATION_MAIN(MyApplication) @section platform-compilation Compilation with CMake -Barebone compilation consists just of finding Magnum library with required -`*Application` component, adding Magnum's `${MAGNUM_INCLUDE_DIRS}` and -application-specific `${MAGNUM_SDL2APPLICATION_INCLUDE_DIRS}` to include path, -compilation of the executable and linking `${MAGNUM_LIBRARIES}` and -`${MAGNUM_SDL2APPLICATION_LIBRARIES}` to it. - -Again, to simplify porting, you can also use generic `${MAGNUM_APPLICATION_INCLUDE_DIRS}` -and `${MAGNUM_APPLICATION_LIBRARIES}` aliases (or `${MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS}`, -`${MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES}` for windowless applications), but +Barebone compilation consists just of finding Magnum library with, for example, +`Sdl2Application` component, compilation of the executable and linking +`Magnum::Magnum` and `Magnum::Sdl2Application` to it. + +Again, to simplify porting, you can also use generic `Magnum::Application` +aliases (or `Magnum::WindowlessApplication` for windowless applications), but only if only one application (windowless application) component is requested to avoid ambiguity. Changing the build script to use different toolkit is then matter of replacing only the requested `*Application` component (and one @@ -199,12 +196,10 @@ matter of replacing only the requested `*Application` component (and one @code find_package(Magnum REQUIRED Sdl2Application) -include_directories(${MAGNUM_INCLUDE_DIRS} ${MAGNUM_APPLICATION_INCLUDE_DIRS}) - add_executable(myapplication MyApplication.cpp) target_link_libraries(myapplication - ${MAGNUM_LIBRARIES} - ${MAGNUM_APPLICATION_LIBRARIES}) + Magnum::Magnum + Magnum::Application) @endcode @section platform-configuration Specifying configuration @@ -311,20 +306,17 @@ Systems not listed here (such as Emscripten or NaCl) don't need any `Context` library, because dynamic function pointer loading is not available on these. For example, when you create the OpenGL context using GLX, you need to find -`GlxContext` component, include `${MAGNUM_GLXCONTEXT_INCLUDE_DIRS}` and link to -`${MAGNUM_GLXCONTEXT_LIBRARIES}`. Similarly to application libraries, you can -also use generic `${MAGNUM_CONTEXT_INCLUDE_DIRS}` and `${MAGNUM_CONTEXT_LIBRARIES}`, +`GlxContext` component, and link to `Magnum::GlxContext` target. Similarly to +application libraries, you can also use generic `Magnum::Context` target, providing you requested only one `*Context` component in the `find_package()` call. Complete example: @code find_package(Magnum REQUIRED GlxContext) -include_directories(${MAGNUM_INCLUDE_DIRS} ${MAGNUM_CONTEXT_INCLUDE_DIRS}) - add_executable(myapplication MyCustomApplication.cpp) target_link_libraries(myapplication - ${MAGNUM_LIBRARIES} - ${MAGNUM_CONTEXT_LIBRARIES}) + Magnum::Magnum + Magnum::Context) @endcode - Next page: @ref types diff --git a/doc/plugins.dox b/doc/plugins.dox index 2acc735f5..4a8432cd5 100644 --- a/doc/plugins.dox +++ b/doc/plugins.dox @@ -182,7 +182,7 @@ and @ref cmake-plugins for additional information. find_package(Magnum REQUIRED TgaImporter) add_executable(MyApp ...) -target_link_libraries(MyApp ... ${MAGNUM_TGAIMPORTER_LIBRARIES}) +target_link_libraries(MyApp ... Magnum::TgaImporter) @endcode The only user-visible behavioral change will be that diff --git a/doc/portability.dox b/doc/portability.dox index d335bb2d2..64abeb97b 100644 --- a/doc/portability.dox +++ b/doc/portability.dox @@ -223,12 +223,10 @@ else() find_package(Magnum REQUIRED XEglApplication) endif() -include_directories(${MAGNUM_INCLUDE_DIRS} ${MAGNUM_APPLICATION_INCLUDE_DIRS}) - add_executable(myapplication MyApplication.cpp) target_link_libraries(myapplication - ${MAGNUM_LIBRARIES} - ${MAGNUM_APPLICATION_LIBRARIES}) + Magnum::Magnum + Magnum::Application) @endcode */ diff --git a/modules/FindEGL.cmake b/modules/FindEGL.cmake index 8e506ac1b..14ea3baf6 100644 --- a/modules/FindEGL.cmake +++ b/modules/FindEGL.cmake @@ -1,8 +1,14 @@ -# - Find EGL +#.rst: +# Find EGL +# -------- # -# This module defines: +# Finds the EGL library. This module defines: # # EGL_FOUND - True if EGL library is found +# EGL::EGL - EGL imported target +# +# Additionally these variables are defined for internal usage: +# # EGL_LIBRARY - EGL library # EGL_INCLUDE_DIR - Include dir # @@ -50,6 +56,13 @@ find_path(EGL_INCLUDE_DIR NAMES EAGL.h) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args("EGL" DEFAULT_MSG +find_package_handle_standard_args(EGL DEFAULT_MSG EGL_LIBRARY EGL_INCLUDE_DIR) + +if(NOT TARGET EGL::EGL) + add_library(EGL::EGL UNKNOWN IMPORTED) + set_target_properties(EGL::EGL PROPERTIES + IMPORTED_LOCATION ${EGL_LIBRARY} + INTERFACE_INCLUDE_DIRECTORIES ${EGL_INCLUDE_DIR}) +endif() diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 0852a0fc8..49b8856d7 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -1,12 +1,15 @@ -# - Find Magnum +#.rst: +# Find Magnum +# ----------- # -# Basic usage: -# find_package(Magnum [REQUIRED]) -# This command tries to find base Magnum library and then defines: -# MAGNUM_FOUND - Whether the base library was found -# MAGNUM_LIBRARIES - Magnum library and dependent libraries -# MAGNUM_INCLUDE_DIRS - Root include dir and include dirs of -# dependencies +# Finds the Magnum library. Basic usage:: +# +# find_package(Magnum REQUIRED) +# +# This module tries to find the base Magnum library and then defines the +# following: +# +# Magnum_FOUND - Whether the base library was found # MAGNUM_PLUGINS_DEBUG_DIR - Base directory with dynamic plugins for # debug builds, defaults to magnum-d/ subdirectory of dir where Magnum # library was found @@ -14,11 +17,11 @@ # release builds, defaults to magnum/ subdirectory of dir where Magnum # library was found # MAGNUM_PLUGINS_DIR - Base directory with dynamic plugins, defaults -# to MAGNUM_PLUGINS_RELEASE_DIR in release builds and multi-configuration -# builds or to MAGNUM_PLUGINS_DEBUG_DIR in debug builds. You can modify all -# three variable (e.g. set them to . when deploying on Windows with plugins -# stored relatively to the executable), the following MAGNUM_PLUGINS_*_DIR -# variables depend on it. +# to :variable:`MAGNUM_PLUGINS_RELEASE_DIR` in release builds and +# multi-configuration builds or to :variable:`MAGNUM_PLUGINS_DEBUG_DIR` in +# debug builds. You can modify all three variables (e.g. set them to ``.`` +# when deploying on Windows with plugins stored relatively to the +# executable), the following ``MAGNUM_PLUGINS_*_DIR`` variables depend on it. # MAGNUM_PLUGINS_FONT[|_DEBUG|_RELEASE]_DIR - Directory with dynamic font # plugins # MAGNUM_PLUGINS_FONTCONVERTER[|_DEBUG|_RELEASE]_DIR - Directory with dynamic @@ -29,66 +32,73 @@ # importer plugins # MAGNUM_PLUGINS_AUDIOIMPORTER[|_DEBUG|_RELEASE]_DIR - Directory with dynamic # audio importer plugins +# # This command will try to find only the base library, not the optional # components. The base library depends on Corrade and OpenGL libraries (or # OpenGL ES libraries). Additional dependencies are specified by the # components. The optional components are: -# Audio - Audio library -# DebugTools - DebugTools library -# MeshTools - MeshTools library -# Primitives - Primitives library -# SceneGraph - SceneGraph library -# Shaders - Shaders library -# Shapes - Shapes library -# Text - Text library -# TextureTools - TextureTools library -# MagnumFont - Magnum bitmap font plugin -# MagnumFontConverter - Magnum bitmap font converter plugin -# ObjImporter - OBJ importer plugin -# TgaImageConverter - TGA image converter plugin -# TgaImporter - TGA importer plugin -# WavAudioImporter - WAV audio importer plugin -# GlutApplication - GLUT application -# GlxApplication - GLX application -# NaClApplication - NaCl application -# Sdl2Application - SDL2 application -# XEglApplication - X/EGL application -# WindowlessCglApplication - Windowless CGL application -# WindowlessGlxApplication - Windowless GLX application -# WindowlessNaClApplication - Windowless NaCl application -# WindowlessWglApplication - Windowless WGL application +# +# Audio - Audio library +# DebugTools - DebugTools library +# MeshTools - MeshTools library +# Primitives - Primitives library +# SceneGraph - SceneGraph library +# Shaders - Shaders library +# Shapes - Shapes library +# Text - Text library +# TextureTools - TextureTools library +# GlutApplication - GLUT application +# GlxApplication - GLX application +# NaClApplication - NaCl application +# Sdl2Application - SDL2 application +# XEglApplication - X/EGL application +# WindowlessCglApplication - Windowless CGL application +# WindowlessGlxApplication - Windowless GLX application +# WindowlessNaClApplication - Windowless NaCl application +# WindowlessWglApplication - Windowless WGL application # WindowlessWindowsEglApplication - Windowless Windows/EGL application -# CglContext - CGL context -# EglContext - EGL context -# GlxContext - GLX context -# WglContext - WGL context -# Example usage with specifying additional components is: -# find_package(Magnum [REQUIRED|COMPONENTS] -# MeshTools Primitives GlutApplication) +# CglContext - CGL context +# EglContext - EGL context +# GlxContext - GLX context +# WglContext - WGL context +# MagnumFont - Magnum bitmap font plugin +# MagnumFontConverter - Magnum bitmap font converter plugin +# ObjImporter - OBJ importer plugin +# TgaImageConverter - TGA image converter plugin +# TgaImporter - TGA importer plugin +# WavAudioImporter - WAV audio importer plugin +# distancefieldconverter - magnum-distancefieldconverter executable +# fontconverter - magnum-fontconverter executable +# info - magnum-info executable +# +# Example usage with specifying additional components is:: +# +# find_package(Magnum REQUIRED MeshTools Primitives GlutApplication) +# # For each component is then defined: -# MAGNUM_*_FOUND - Whether the component was found -# MAGNUM_*_LIBRARIES - Component library and dependent libraries -# MAGNUM_*_INCLUDE_DIRS - Include dirs of module dependencies -# If exactly one *Application or exactly one Windowless*Application -# component is requested and found, its libraries and include dirs are -# available in convenience aliases MAGNUM_APPLICATION_LIBRARIES / -# MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES and MAGNUM_APPLICATION_INCLUDE_DIRS -# / MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS to simplify porting. Similarly, -# if exactly one *Context component is requested and found, its libraries and -# include dirs are available in convenience aliases MAGNUM_CONTEXT_LIBRARIES -# and MAGNUM_CONTEXT_INCLUDE_DIRS. +# +# Magnum_*_FOUND - Whether the component was found +# Magnum::* - Component imported target +# +# If exactly one ``*Application`` or exactly one ``Windowless*Application`` +# component is requested and found, its target is available in convenience +# alias ``Magnum::Application`` / ``Magnum::WindowlessApplication`` to simplify +# porting. Similarly, if exactly one ``*Context`` component is requested and +# found, its target is available in convenience alias ``Magnum::Context``. # # The package is found if either debug or release version of each requested # library (or plugin) is found. If both debug and release libraries (or # plugins) are found, proper version is chosen based on actual build # configuration of the project (i.e. Debug build is linked to debug libraries, # Release build to release libraries). Note that this autodetection might fail -# for the MAGNUM_PLUGINS_DIR variable, especially on multi-configuration build -# systems. You can make use of CORRADE_IS_DEBUG_BUILD preprocessor variable -# along with MAGNUM_PLUGINS_*_DEBUG_DIR / MAGNUM_PLUGINS_*_RELEASE_DIR -# variables to decide in preprocessing step. +# for the :variable:`MAGNUM_PLUGINS_DIR` variable, especially on +# multi-configuration build systems. You can make use of +# ``CORRADE_IS_DEBUG_BUILD`` preprocessor variable along with +# ``MAGNUM_PLUGINS_*_DEBUG_DIR`` / ``MAGNUM_PLUGINS_*_RELEASE_DIR`` variables +# to decide in preprocessing step. # # Features of found Magnum library are exposed in these variables: +# # MAGNUM_BUILD_DEPRECATED - Defined if compiled with deprecated APIs # included # MAGNUM_BUILD_STATIC - Defined if compiled as static libraries @@ -100,6 +110,7 @@ # MAGNUM_TARGET_WEBGL - Defined if compiled for WebGL # # Additionally these variables are defined for internal usage: +# # MAGNUM_INCLUDE_DIR - Root include dir (w/o dependencies) # MAGNUM_LIBRARY - Magnum library (w/o dependencies) # MAGNUM_LIBRARY_DEBUG - Debug version of Magnum library, if found @@ -124,6 +135,21 @@ # MAGNUM_INCLUDE_INSTALL_DIR - Header installation directory # MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR - Plugin header installation directory # +# Workflows without imported targets are deprecated and the following variables +# are included just for backwards compatibility and only if +# :variable:`MAGNUM_BUILD_DEPRECATED` is enabled: +# +# MAGNUM_LIBRARIES - Expands to ``Magnum::Magnum`` target. Use +# ``Magnum::Magnum`` target directly instead. +# MAGNUM_*_LIBRARIES - Expands to ``Magnum::*`` target. Use +# ``Magnum::*`` target directly instead. +# MAGNUM_APPLICATION_LIBRARIES / MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES +# - Expands to ``Magnum::Application`` / +# ``Magnum::WindowlessApplication`` target. Use ``Magnum::Application`` / +# ``Magnum::WindowlessApplication`` target directly instead. +# MAGNUM_CONTEXT_LIBRARIES - Expands to ``Magnum::Context`` target. Use +# ``Magnum::Context`` target directly instead. +# # # This file is part of Magnum. @@ -151,34 +177,12 @@ # # Dependencies -find_package(Corrade REQUIRED) - -# Base Magnum library -find_library(MAGNUM_LIBRARY_DEBUG Magnum-d) -find_library(MAGNUM_LIBRARY_RELEASE Magnum) - -# Set the MAGNUM_LIBRARY variable based on what was found, use that information -# to guess also build type of dynamic plugins -if(MAGNUM_LIBRARY_DEBUG AND MAGNUM_LIBRARY_RELEASE) - set(MAGNUM_LIBRARY - debug ${MAGNUM_LIBRARY_DEBUG} - optimized ${MAGNUM_LIBRARY_RELEASE}) - get_filename_component(_MAGNUM_LIBRARY_PATH ${MAGNUM_LIBRARY_DEBUG} PATH) - if(CMAKE_BUILD_TYPE STREQUAL "Debug") - set(_MAGNUM_PLUGINS_DIR_SUFFIX "-d") - endif() -elseif(MAGNUM_LIBRARY_DEBUG) - set(MAGNUM_LIBRARY ${MAGNUM_LIBRARY_DEBUG}) - get_filename_component(_MAGNUM_LIBRARY_PATH ${MAGNUM_LIBRARY_DEBUG} PATH) - set(_MAGNUM_PLUGINS_DIR_SUFFIX "-d") -elseif(MAGNUM_LIBRARY_RELEASE) - set(MAGNUM_LIBRARY ${MAGNUM_LIBRARY_RELEASE}) - get_filename_component(_MAGNUM_LIBRARY_PATH ${MAGNUM_LIBRARY_RELEASE} PATH) -endif() +find_package(Corrade REQUIRED Utility PluginManager) # Root include dir find_path(MAGNUM_INCLUDE_DIR NAMES Magnum/Magnum.h) +mark_as_advanced(MAGNUM_INCLUDE_DIR) # Configuration file find_file(_MAGNUM_CONFIGURE_FILE configure.h @@ -190,10 +194,10 @@ find_file(_MAGNUM_CONFIGURE_FILE configure.h if(NOT MAGNUM_INCLUDE_DIR) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Magnum - REQUIRED_VARS MAGNUM_LIBRARY MAGNUM_INCLUDE_DIR _MAGNUM_CONFIGURE_FILE) + REQUIRED_VARS MAGNUM_INCLUDE_DIR _MAGNUM_CONFIGURE_FILE) endif() -# Configuration +# Read flags from configuration file(READ ${_MAGNUM_CONFIGURE_FILE} _magnumConfigure) set(_magnumFlags BUILD_DEPRECATED @@ -210,62 +214,102 @@ foreach(_magnumFlag ${_magnumFlags}) endif() endforeach() -# Dependent libraries and includes -set(MAGNUM_INCLUDE_DIRS ${MAGNUM_INCLUDE_DIR} - ${MAGNUM_INCLUDE_DIR}/MagnumExternal/OpenGL - ${CORRADE_INCLUDE_DIRS}) -set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARY} - ${CORRADE_UTILITY_LIBRARIES} - ${CORRADE_PLUGINMANAGER_LIBRARIES}) -if(NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES) - find_package(OpenGL REQUIRED) - set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARIES} ${OPENGL_gl_LIBRARY}) -elseif(MAGNUM_TARGET_GLES2) - find_package(OpenGLES2 REQUIRED) - set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARIES} ${OPENGLES2_LIBRARY}) -elseif(MAGNUM_TARGET_GLES3) - find_package(OpenGLES3 REQUIRED) - set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARIES} ${OPENGLES3_LIBRARY}) -endif() +# Base Magnum library +if(NOT TARGET Magnum::Magnum) + add_library(Magnum::Magnum UNKNOWN IMPORTED) + + # Try to find both debug and release version + find_library(MAGNUM_LIBRARY_DEBUG Magnum-d) + find_library(MAGNUM_LIBRARY_RELEASE Magnum) + mark_as_advanced(MAGNUM_LIBRARY_DEBUG + MAGNUM_LIBRARY_RELEASE) + + # Set the MAGNUM_LIBRARY variable based on what was found, use that + # information to guess also build type of dynamic plugins + if(MAGNUM_LIBRARY_DEBUG AND MAGNUM_LIBRARY_RELEASE) + set(MAGNUM_LIBRARY ${MAGNUM_LIBRARY_RELEASE}) + get_filename_component(_MAGNUM_LIBRARY_PATH ${MAGNUM_LIBRARY_DEBUG} PATH) + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(_MAGNUM_PLUGINS_DIR_SUFFIX "-d") + endif() + elseif(MAGNUM_LIBRARY_DEBUG) + set(MAGNUM_LIBRARY ${MAGNUM_LIBRARY_DEBUG}) + get_filename_component(_MAGNUM_LIBRARY_PATH ${MAGNUM_LIBRARY_DEBUG} PATH) + set(_MAGNUM_PLUGINS_DIR_SUFFIX "-d") + elseif(MAGNUM_LIBRARY_RELEASE) + set(MAGNUM_LIBRARY ${MAGNUM_LIBRARY_RELEASE}) + get_filename_component(_MAGNUM_LIBRARY_PATH ${MAGNUM_LIBRARY_RELEASE} PATH) + endif() -# If the configure file is somewhere else than in root include dir (e.g. when -# using CMake subproject), we need to include that dir too -if(NOT ${MAGNUM_INCLUDE_DIR}/Magnum/configure.h STREQUAL ${_MAGNUM_CONFIGURE_FILE}) - # Go two levels up - get_filename_component(_MAGNUM_CONFIGURE_FILE_INCLUDE_DIR ${_MAGNUM_CONFIGURE_FILE} DIRECTORY) - get_filename_component(_MAGNUM_CONFIGURE_FILE_INCLUDE_DIR ${_MAGNUM_CONFIGURE_FILE_INCLUDE_DIR} DIRECTORY) - list(APPEND MAGNUM_INCLUDE_DIRS ${_MAGNUM_CONFIGURE_FILE_INCLUDE_DIR}) -endif() + if(MAGNUM_LIBRARY_RELEASE) + set_property(TARGET Magnum::Magnum APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_property(TARGET Magnum::Magnum PROPERTY + IMPORTED_LOCATION_RELEASE ${MAGNUM_LIBRARY_RELEASE}) + endif() + + if(MAGNUM_LIBRARY_DEBUG) + set_property(TARGET Magnum::Magnum APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_property(TARGET Magnum::Magnum PROPERTY + IMPORTED_LOCATION_DEBUG ${MAGNUM_LIBRARY_DEBUG}) + endif() + + # Include directories + set_property(TARGET Magnum::Magnum APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + ${MAGNUM_INCLUDE_DIR} + ${MAGNUM_INCLUDE_DIR}/MagnumExternal/OpenGL) + + # Dependent libraries + set_property(TARGET Magnum::Magnum APPEND PROPERTY INTERFACE_LINK_LIBRARIES + Corrade::Utility + Corrade::PluginManager) + + # Dependent libraries and includes + if(NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES) + find_package(OpenGL REQUIRED) + set_property(TARGET Magnum::Magnum APPEND PROPERTY + INTERFACE_LINK_LIBRARIES ${OPENGL_gl_LIBRARY}) + elseif(MAGNUM_TARGET_GLES2) + find_package(OpenGLES2 REQUIRED) + set_property(TARGET Magnum::Magnum APPEND PROPERTY + INTERFACE_LINK_LIBRARIES OpenGLES2::OpenGLES2) + elseif(MAGNUM_TARGET_GLES3) + find_package(OpenGLES3 REQUIRED) + set_property(TARGET Magnum::Magnum APPEND PROPERTY + INTERFACE_LINK_LIBRARIES OpenGLES3::OpenGLES3) + endif() -# Emscripten needs special flag to use WebGL 2 -if(CORRADE_TARGET_EMSCRIPTEN AND NOT MAGNUM_TARGET_GLES2 AND NOT CMAKE_EXE_LINKER_FLAGS MATCHES "USE_WEBGL2") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s USE_WEBGL2=1") + # Emscripten needs special flag to use WebGL 2 + if(CORRADE_TARGET_EMSCRIPTEN AND NOT MAGNUM_TARGET_GLES2) + # TODO: give me INTERFACE_LINK_OPTIONS or something, please + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s USE_WEBGL2=1") + endif() endif() # Ensure that all inter-component dependencies are specified as well set(_MAGNUM_ADDITIONAL_COMPONENTS ) -foreach(component ${Magnum_FIND_COMPONENTS}) - string(TOUPPER ${component} _COMPONENT) +foreach(_component ${Magnum_FIND_COMPONENTS}) + string(TOUPPER ${_component} _COMPONENT) - # The dependencies need to be sorted by their dependency order as well - if(component STREQUAL Shapes) + if(_component STREQUAL Shapes) set(_MAGNUM_${_COMPONENT}_DEPENDENCIES SceneGraph) - elseif(component STREQUAL Text) + elseif(_component STREQUAL Text) set(_MAGNUM_${_COMPONENT}_DEPENDENCIES TextureTools) - elseif(component STREQUAL DebugTools) + elseif(_component STREQUAL DebugTools) set(_MAGNUM_${_COMPONENT}_DEPENDENCIES MeshTools Primitives SceneGraph Shaders Shapes) - elseif(component STREQUAL MagnumFont) + elseif(_component STREQUAL MagnumFont) set(_MAGNUM_${_COMPONENT}_DEPENDENCIES TgaImporter) # and below - elseif(component STREQUAL MagnumFontConverter) + elseif(_component STREQUAL MagnumFontConverter) set(_MAGNUM_${_COMPONENT}_DEPENDENCIES TgaImageConverter) # and below - elseif(component STREQUAL ObjImporter) + elseif(_component STREQUAL ObjImporter) set(_MAGNUM_${_COMPONENT}_DEPENDENCIES MeshTools) endif() - if(component MATCHES ".+AudioImporter") - set(_MAGNUM_${_COMPONENT}_DEPENDENCIES ${_MAGNUM_${_COMPONENT}_DEPENDENCIES} Audio) - elseif(component MATCHES ".+(Font|FontConverter)") - set(_MAGNUM_${_COMPONENT}_DEPENDENCIES ${_MAGNUM_${_COMPONENT}_DEPENDENCIES} Text TextureTools) + if(_component MATCHES ".+AudioImporter") + list(APPEND _MAGNUM_${_COMPONENT}_DEPENDENCIES Audio) + elseif(_component MATCHES ".+(Font|FontConverter)") + list(APPEND _MAGNUM_${_COMPONENT}_DEPENDENCIES Text TextureTools) endif() list(APPEND _MAGNUM_ADDITIONAL_COMPONENTS ${_MAGNUM_${_COMPONENT}_DEPENDENCIES}) @@ -279,323 +323,387 @@ if(Magnum_FIND_COMPONENTS) list(REMOVE_DUPLICATES Magnum_FIND_COMPONENTS) endif() +# Component distinction (listing them explicitly to avoid mistakes with finding +# components from other repositories) +set(_MAGNUM_LIBRARY_COMPONENTS "^(Audio|DebugTools|MeshTools|Primitives|SceneGraph|Shaders|Shapes|Text|TextureTools|GlutApplication|GlxApplication|NaClApplication|Sdl2Application|XEglApplication|WindowlessCglApplication|WindowlessGlxApplication|WindowlessNaClApplication|WindowlessWindowsEglApplication|CglContext|EglContext|GlxContext|WglContext)$") +set(_MAGNUM_PLUGIN_COMPONENTS "^(MagnumFont|MagnumFontConverter|ObjImporter|TgaImageConverter|TgaImporter|WavAudioImporter)$") +set(_MAGNUM_EXECUTABLE_COMPONENTS "^(distancefieldconverter|fontconverter|info)$") + # Find all components -foreach(component ${Magnum_FIND_COMPONENTS}) - string(TOUPPER ${component} _COMPONENT) - - # AudioImporter plugin specific name suffixes - if(${component} MATCHES ".+AudioImporter$") - set(_MAGNUM_${_COMPONENT}_IS_PLUGIN 1) - set(_MAGNUM_${_COMPONENT}_PATH_SUFFIX audioimporters) - - # Audio importer class is Audio::*Importer, thus we need to convert - # *AudioImporter.h to *Importer.h - string(REPLACE "AudioImporter" "Importer" _MAGNUM_${_COMPONENT}_HEADER_NAME "${component}") - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES ${_MAGNUM_${_COMPONENT}_HEADER_NAME}.h) - - # Importer plugin specific name suffixes - elseif(${component} MATCHES ".+Importer$") - set(_MAGNUM_${_COMPONENT}_IS_PLUGIN 1) - set(_MAGNUM_${_COMPONENT}_PATH_SUFFIX importers) - - # Font plugin specific name suffixes - elseif(${component} MATCHES ".+Font$") - set(_MAGNUM_${_COMPONENT}_IS_PLUGIN 1) - set(_MAGNUM_${_COMPONENT}_PATH_SUFFIX fonts) - - # ImageConverter plugin specific name suffixes - elseif(${component} MATCHES ".+ImageConverter$") - set(_MAGNUM_${_COMPONENT}_IS_PLUGIN 1) - set(_MAGNUM_${_COMPONENT}_PATH_SUFFIX imageconverters) - - # FontConverter plugin specific name suffixes - elseif(${component} MATCHES ".+FontConverter$") - set(_MAGNUM_${_COMPONENT}_IS_PLUGIN 1) - set(_MAGNUM_${_COMPONENT}_PATH_SUFFIX fontconverters) - endif() +foreach(_component ${Magnum_FIND_COMPONENTS}) + string(TOUPPER ${_component} _COMPONENT) + + # Create imported target in case the library is found. If the project is + # added as subproject to CMake, the target already exists and all the + # required setup is already done from the build tree. + if(TARGET Magnum::${_component}) + set(Magnum_${_component}_FOUND TRUE) + else() + # Library components + if(_component MATCHES ${_MAGNUM_LIBRARY_COMPONENTS}) + add_library(Magnum::${_component} UNKNOWN IMPORTED) + + # Set library defaults, find the library + set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX Magnum/${_component}) + set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES ${_component}.h) + + # Try to find both debug and release version + find_library(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG Magnum${_component}-d) + find_library(MAGNUM_${_COMPONENT}_LIBRARY_RELEASE Magnum${_component}) + mark_as_advanced(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG + MAGNUM_${_COMPONENT}_LIBRARY_RELEASE) + endif() - # Set plugin defaults, find the plugin - if(_MAGNUM_${_COMPONENT}_IS_PLUGIN) - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX MagnumPlugins/${component}) + # Plugin components + if(_component MATCHES ${_MAGNUM_PLUGIN_COMPONENTS}) + add_library(Magnum::${_component} UNKNOWN IMPORTED) - # Don't override the one for *AudioImporter plugins - if(NOT _MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES) - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES ${component}.h) - endif() + # AudioImporter plugin specific name suffixes + if(_component MATCHES ".+AudioImporter$") + set(_MAGNUM_${_COMPONENT}_PATH_SUFFIX audioimporters) - # Dynamic plugins don't have any prefix (e.g. `lib` on Linux), search - # with empty prefix and then reset that back so we don't accidentaly - # break something else - set(_tmp_prefixes ${CMAKE_FIND_LIBRARY_PREFIXES}) - set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "") - - find_library(MAGNUM_${_COMPONENT}_LIBRARY ${component} - PATH_SUFFIXES magnum/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX}) - - # Try to find both debug and release version. Dynamic and static debug - # libraries are on different places. - find_library(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG ${component} - PATH_SUFFIXES magnum-d/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX}) - find_library(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG ${component}-d - PATH_SUFFIXES magnum/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX}) - find_library(MAGNUM_${_COMPONENT}_LIBRARY_RELEASE ${component} - PATH_SUFFIXES magnum/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX}) - - # Set the _LIBRARY variable based on what was found - if(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG AND MAGNUM_${_COMPONENT}_LIBRARY_RELEASE) - set(MAGNUM_${_COMPONENT}_LIBRARY - debug ${MAGNUM_${_COMPONENT}_LIBRARY_DEBUG} - optimized ${MAGNUM_${_COMPONENT}_LIBRARY_RELEASE}) - elseif(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG) - set(MAGNUM_${_COMPONENT}_LIBRARY ${MAGNUM_${_COMPONENT}_LIBRARY_DEBUG}) - elseif(MAGNUM_${_COMPONENT}_LIBRARY_RELEASE) - set(MAGNUM_${_COMPONENT}_LIBRARY ${MAGNUM_${_COMPONENT}_LIBRARY_RELEASE}) - endif() + # Audio importer class is Audio::*Importer, thus we need to + # convert *AudioImporter.h to *Importer.h + string(REPLACE "AudioImporter" "Importer" _MAGNUM_${_COMPONENT}_HEADER_NAME "${_component}") + set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES ${_MAGNUM_${_COMPONENT}_HEADER_NAME}.h) - set(CMAKE_FIND_LIBRARY_PREFIXES ${_tmp_prefixes}) + # Importer plugin specific name suffixes + elseif(_component MATCHES ".+Importer$") + set(_MAGNUM_${_COMPONENT}_PATH_SUFFIX importers) - # Set library defaults, find the library - else() - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX Magnum/${component}) - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES ${component}.h) - - # Try to find both debug and release version - find_library(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG Magnum${component}-d) - find_library(MAGNUM_${_COMPONENT}_LIBRARY_RELEASE Magnum${component}) - - # Set the _LIBRARY variable based on what was found - if(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG AND MAGNUM_${_COMPONENT}_LIBRARY_RELEASE) - set(MAGNUM_${_COMPONENT}_LIBRARY - debug ${MAGNUM_${_COMPONENT}_LIBRARY_DEBUG} - optimized ${MAGNUM_${_COMPONENT}_LIBRARY_RELEASE}) - elseif(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG) - set(MAGNUM_${_COMPONENT}_LIBRARY ${MAGNUM_${_COMPONENT}_LIBRARY_DEBUG}) - elseif(MAGNUM_${_COMPONENT}_LIBRARY_RELEASE) - set(MAGNUM_${_COMPONENT}_LIBRARY ${MAGNUM_${_COMPONENT}_LIBRARY_RELEASE}) - endif() - endif() + # Font plugin specific name suffixes + elseif(_component MATCHES ".+Font$") + set(_MAGNUM_${_COMPONENT}_PATH_SUFFIX fonts) - # Applications - if(${component} MATCHES ".+Application") - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX Magnum/Platform) - - # Android application dependencies - if(${component} STREQUAL AndroidApplication) - find_package(EGL) - if(EGL_FOUND) - set(_MAGNUM_${_COMPONENT}_LIBRARIES android ${EGL_LIBRARY}) - set(_MAGNUM_${_COMPONENT}_INCLUDE_DIRS ${ANDROID_NATIVE_APP_GLUE_INCLUDE_DIR}) - else() - unset(MAGNUM_${_COMPONENT}_LIBRARY) - endif() + # ImageConverter plugin specific name suffixes + elseif(_component MATCHES ".+ImageConverter$") + set(_MAGNUM_${_COMPONENT}_PATH_SUFFIX imageconverters) - # GLUT application dependencies - elseif(${component} STREQUAL GlutApplication) - find_package(GLUT) - if(GLUT_FOUND) - set(_MAGNUM_${_COMPONENT}_LIBRARIES ${GLUT_glut_LIBRARY}) - else() - unset(MAGNUM_${_COMPONENT}_LIBRARY) + # FontConverter plugin specific name suffixes + elseif(_component MATCHES ".+FontConverter$") + set(_MAGNUM_${_COMPONENT}_PATH_SUFFIX fontconverters) endif() - # SDL2 application dependencies - elseif(${component} STREQUAL Sdl2Application) - find_package(SDL2) - if(SDL2_FOUND) - set(_MAGNUM_${_COMPONENT}_LIBRARIES ${SDL2_LIBRARIES}) - set(_MAGNUM_${_COMPONENT}_INCLUDE_DIRS ${SDL2_INCLUDE_DIRS}) - else() - unset(MAGNUM_${_COMPONENT}_LIBRARY) + # Don't override the exception for *AudioImporter plugins + set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX MagnumPlugins/${_component}) + if(NOT _MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES) + set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES ${_component}.h) endif() - # Find also EGL library, if on ES (and not on WebGL) - if(MAGNUM_TARGET_GLES AND NOT MAGNUM_TARGET_DESKTOP_GLES AND NOT MAGNUM_TARGET_WEBGL) - find_package(EGL) - if(EGL_FOUND) - list(APPEND _MAGNUM_${_COMPONENT}_LIBRARIES ${EGL_LIBRARY}) - else() - unset(MAGNUM_${_COMPONENT}_LIBRARY) - endif() + # Dynamic plugins don't have any prefix (e.g. `lib` on Linux), + # search with empty prefix and then reset that back so we don't + # accidentaly break something else + set(_tmp_prefixes ${CMAKE_FIND_LIBRARY_PREFIXES}) + set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "") + + # Try to find both debug and release version. Dynamic and static + # debug libraries are in different places. + find_library(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG ${_component} + PATH_SUFFIXES magnum-d/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX}) + find_library(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG ${_component}-d + PATH_SUFFIXES magnum/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX}) + find_library(MAGNUM_${_COMPONENT}_LIBRARY_RELEASE ${_component} + PATH_SUFFIXES magnum/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX}) + mark_as_advanced(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG + MAGNUM_${_COMPONENT}_LIBRARY_RELEASE) + + # Reset back + set(CMAKE_FIND_LIBRARY_PREFIXES ${_tmp_prefixes}) + endif() + + # Library location for libraries/plugins + if(_component MATCHES ${_MAGNUM_LIBRARY_COMPONENTS} OR _component MATCHES ${_MAGNUM_PLUGIN_COMPONENTS}) + if(MAGNUM_${_COMPONENT}_LIBRARY_RELEASE) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_property(TARGET Magnum::${_component} PROPERTY + IMPORTED_LOCATION_RELEASE ${MAGNUM_${_COMPONENT}_LIBRARY_RELEASE}) endif() - # (Windowless) NaCl application dependencies - elseif(${component} STREQUAL NaClApplication OR ${component} STREQUAL WindowlessNaClApplication) - set(_MAGNUM_${_COMPONENT}_LIBRARIES ppapi_cpp ppapi) - - # (Windowless) GLX application dependencies - elseif(${component} STREQUAL GlxApplication OR ${component} STREQUAL WindowlessGlxApplication) - find_package(X11) - if(X11_FOUND) - set(_MAGNUM_${_COMPONENT}_LIBRARIES ${X11_LIBRARIES}) - else() - unset(MAGNUM_${_COMPONENT}_LIBRARY) + if(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_property(TARGET Magnum::${_component} PROPERTY + IMPORTED_LOCATION_DEBUG ${MAGNUM_${_COMPONENT}_LIBRARY_DEBUG}) endif() + endif() - # Windowless CGL application has no additional dependencies - # Windowless WGL application has no additional dependencies + # Executables + if(_component MATCHES ${_MAGNUM_EXECUTABLE_COMPONENTS}) + add_executable(Magnum::${_component} IMPORTED) - # Windowless Windows/EGL application dependencies - elseif(${component} STREQUAL WindowlessWindowsEglApplication) - find_package(EGL) - if(EGL_FOUND) - set(_MAGNUM_${_COMPONENT}_LIBRARIES ${EGL_LIBRARY}) - else() - unset(MAGNUM_${_COMPONENT}_LIBRARY) - endif() + find_program(MAGNUM_${_COMPONENT}_EXECUTABLE magnum-${_component}) + mark_as_advanced(MAGNUM_${_COMPONENT}_EXECUTABLE) - # X/EGL application dependencies - elseif(${component} STREQUAL XEglApplication) - find_package(EGL) - find_package(X11) - if(EGL_FOUND AND X11_FOUND) - set(_MAGNUM_${_COMPONENT}_LIBRARIES ${EGL_LIBRARY} ${X11_LIBRARIES}) - else() - unset(MAGNUM_${_COMPONENT}_LIBRARY) + if(MAGNUM_${_COMPONENT}_EXECUTABLE) + set_property(TARGET Magnum::${_component} PROPERTY + IMPORTED_LOCATION ${MAGNUM_${_COMPONENT}_EXECUTABLE}) endif() endif() - # Context libraries - elseif(${component} MATCHES ".+Context") - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX Magnum/Platform) - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Context.h) - - # GLX context dependencies - if(${component} STREQUAL GlxContext) - find_package(X11) - if(X11_FOUND) - set(_MAGNUM_${_COMPONENT}_LIBRARIES ${X11_LIBRARIES}) - else() - unset(MAGNUM_${_COMPONENT}_LIBRARY) + # Applications + if(_component MATCHES ".+Application") + set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX Magnum/Platform) + + # Android application dependencies + if(_component STREQUAL AndroidApplication) + find_package(EGL) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${ANDROID_NATIVE_APP_GLUE_INCLUDE_DIR}) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES android EGL::EGL) + + # 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}) + + # SDL2 application dependencies + elseif(_component STREQUAL Sdl2Application) + find_package(SDL2) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES SDL2::SDL2) + + # (Windowless) NaCl application dependencies + elseif(_component STREQUAL NaClApplication OR _component STREQUAL WindowlessNaClApplication) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES ppapi_cpp ppapi) + + # (Windowless) GLX application dependencies + elseif(_component STREQUAL GlxApplication OR _component STREQUAL WindowlessGlxApplication) + find_package(X11) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${X11_INCLUDE_DIR}) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES ${X11_LIBRARIES}) + + # Windowless CGL application has no additional dependencies + # Windowless WGL application has no additional dependencies + + # Windowless Windows/EGL application dependencies + elseif(_component STREQUAL WindowlessWindowsEglApplication) + find_package(EGL) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES EGL::EGL) + + # X/EGL application dependencies + elseif(_component STREQUAL XEglApplication) + find_package(EGL) + find_package(X11) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${X11_INCLUDE_DIR}) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES EGL::EGL ${X11_LIBRARIES}) endif() - endif() - # EGL context dependencies - if(${component} STREQUAL EglContext) - find_package(EGL) - if(EGL_FOUND) - set(_MAGNUM_${_COMPONENT}_LIBRARIES ${EGL_LIBRARIES}) - else() - unset(MAGNUM_${_COMPONENT}_LIBRARY) + # Context libraries + elseif(_component MATCHES ".+Context") + set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX Magnum/Platform) + set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Context.h) + + # GLX context dependencies + if(_component STREQUAL GlxContext) + find_package(X11) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${X11_INCLUDE_DIR}) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES ${X11_LIBRARIES}) + endif() + + # EGL context dependencies + if(_component STREQUAL EglContext) + find_package(EGL) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES EGL::EGL) endif() - endif() - # No additional dependencies for CGL context - # No additional dependencies for WGL context + # No additional dependencies for CGL context + # No additional dependencies for WGL context - # Audio library - elseif(${component} STREQUAL Audio) - find_package(OpenAL) - if(OPENAL_FOUND) - set(_MAGNUM_${_COMPONENT}_LIBRARIES ${OPENAL_LIBRARY}) - set(_MAGNUM_${_COMPONENT}_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR}) - else() - unset(MAGNUM_${_COMPONENT}_LIBRARY) - endif() + # Audio library + elseif(_component STREQUAL Audio) + find_package(OpenAL) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${OPENAL_INCLUDE_DIR}) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES ${OPENAL_LIBRARY}) - # No special setup for DebugTools library + # No special setup for DebugTools library - # Mesh tools library - elseif(${component} STREQUAL MeshTools) - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES CompressIndices.h) + # Mesh tools library + elseif(_component STREQUAL MeshTools) + set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES CompressIndices.h) - # Primitives library - elseif(${component} STREQUAL Primitives) - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Cube.h) + # Primitives library + elseif(_component STREQUAL Primitives) + set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Cube.h) - # No special setup for SceneGraph library - # No special setup for Shaders library - # No special setup for Shapes library - # No special setup for Text library + # No special setup for SceneGraph library + # No special setup for Shaders library + # No special setup for Shapes library + # No special setup for Text library - # TextureTools library - elseif(${component} STREQUAL TextureTools) - set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Atlas.h) - endif() + # TextureTools library + elseif(_component STREQUAL TextureTools) + set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Atlas.h) + endif() - # No special setup for plugins + # Find library/plugin includes + if(_component MATCHES ${_MAGNUM_LIBRARY_COMPONENTS} OR _component MATCHES ${_MAGNUM_PLUGIN_COMPONENTS}) + find_path(_MAGNUM_${_COMPONENT}_INCLUDE_DIR + NAMES ${_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES} + HINTS ${MAGNUM_INCLUDE_DIR}/${_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX}) + mark_as_advanced(_MAGNUM_${_COMPONENT}_INCLUDE_DIR) + endif() + + # Link to core Magnum library, add inter-library dependencies + if(_component MATCHES ${_MAGNUM_LIBRARY_COMPONENTS} OR _component MATCHES ${_MAGNUM_PLUGIN_COMPONENTS}) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES Magnum::Magnum) + foreach(_dependency ${_MAGNUM_${_COMPONENT}_DEPENDENCIES}) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES Magnum::${_dependency}) + endforeach() + endif() - # Try to find the includes - if(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES) - find_path(_MAGNUM_${_COMPONENT}_INCLUDE_DIR - NAMES ${_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES} - HINTS ${MAGNUM_INCLUDE_DIR}/${_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX}) + # Decide if the library was found + if(((_component MATCHES ${_MAGNUM_LIBRARY_COMPONENTS} OR _component MATCHES ${_MAGNUM_PLUGIN_COMPONENTS}) AND _MAGNUM_${_COMPONENT}_INCLUDE_DIR AND (MAGNUM_${_COMPONENT}_LIBRARY_DEBUG OR MAGNUM_${_COMPONENT}_LIBRARY_RELEASE)) OR (_component MATCHES ${_MAGNUM_EXECUTABLE_COMPONENTS} AND MAGNUM_${_COMPONENT}_EXECUTABLE)) + set(Magnum_${_component}_FOUND TRUE) + else() + set(Magnum_${_component}_FOUND FALSE) + endif() endif() - # Add inter-project dependencies, mark the component as not found if - # any dependency is not found - set(_MAGNUM_${_COMPONENT}_DEPENDENCY_LIBRARIES ) - set(_MAGNUM_${_COMPONENT}_DEPENDENCY_INCLUDE_DIRS ) - foreach(dependency ${_MAGNUM_${_COMPONENT}_DEPENDENCIES}) - string(TOUPPER ${dependency} _DEPENDENCY) - if(MAGNUM_${_DEPENDENCY}_LIBRARY) - list(APPEND _MAGNUM_${_COMPONENT}_DEPENDENCY_LIBRARIES ${MAGNUM_${_DEPENDENCY}_LIBRARY} ${_MAGNUM_${_DEPENDENCY}_LIBRARIES}) - list(APPEND _MAGNUM_${_COMPONENT}_DEPENDENCY_INCLUDE_DIRS ${_MAGNUM_${_DEPENDENCY}_INCLUDE_DIRS}) + # Global aliases for Windowless*Application, *Application and *Context + # components. If already set, unset them to avoid ambiguity. + if(_component MATCHES "Windowless.+Application") + if(NOT DEFINED _MAGNUM_WINDOWLESSAPPLICATION_ALIAS) + set(_MAGNUM_WINDOWLESSAPPLICATION_ALIAS Magnum::${_component}) else() - unset(MAGNUM_${_COMPONENT}_LIBRARY) + unset(_MAGNUM_WINDOWLESSAPPLICATION_ALIAS) endif() - endforeach() - - # Decide if the library was found - if(MAGNUM_${_COMPONENT}_LIBRARY AND _MAGNUM_${_COMPONENT}_INCLUDE_DIR) - set(MAGNUM_${_COMPONENT}_LIBRARIES - ${MAGNUM_${_COMPONENT}_LIBRARY} - ${_MAGNUM_${_COMPONENT}_LIBRARIES} - ${_MAGNUM_${_COMPONENT}_DEPENDENCY_LIBRARIES} - ${MAGNUM_LIBRARIES}) - set(MAGNUM_${_COMPONENT}_INCLUDE_DIRS - ${_MAGNUM_${_COMPONENT}_INCLUDE_DIRS} - ${_MAGNUM_${_COMPONENT}_DEPENDENCY_INCLUDE_DIRS}) - - set(Magnum_${component}_FOUND TRUE) - - # Don't expose variables w/o dependencies to end users - mark_as_advanced(FORCE - MAGNUM_${_COMPONENT}_LIBRARY_DEBUG - MAGNUM_${_COMPONENT}_LIBRARY_RELEASE - MAGNUM_${_COMPONENT}_LIBRARY - _MAGNUM_${_COMPONENT}_INCLUDE_DIR) - - # Global aliases for Windowless*Application and *Application - # components. If already set, unset them to avoid ambiguity. - if(${component} MATCHES "Windowless.+Application") - if(NOT DEFINED MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES AND NOT DEFINED MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS) - set(MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES ${MAGNUM_${_COMPONENT}_LIBRARIES}) - set(MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS ${MAGNUM_${_COMPONENT}_INCLUDE_DIRS}) - elseif(NOT MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES STREQUAL MAGNUM_${_COMPONENT}_LIBRARIES AND NOT MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS STREQUAL MAGNUM_${_COMPONENT}_INCLUDE_DIRS) - set(MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES-NOTFOUND) - set(MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS-NOTFOUND) - endif() - elseif(${component} MATCHES ".+Application") - if(NOT DEFINED MAGNUM_APPLICATION_LIBRARIES AND NOT DEFINED MAGNUM_APPLICATION_INCLUDE_DIRS) - set(MAGNUM_APPLICATION_LIBRARIES ${MAGNUM_${_COMPONENT}_LIBRARIES}) - set(MAGNUM_APPLICATION_INCLUDE_DIRS ${MAGNUM_${_COMPONENT}_INCLUDE_DIRS}) - else(NOT MAGNUM_APPLICATION_LIBRARIES STREQUAL MAGNUM_${_COMPONENT}_LIBRARIES AND NOT MAGNUM_APPLICATION_INCLUDE_DIRS STREQUAL MAGNUM_${_COMPONENT}_INCLUDE_DIRS) - set(MAGNUM_APPLICATION_LIBRARIES MAGNUM_APPLICATION_LIBRARIES-NOTFOUND) - set(MAGNUM_APPLICATION_INCLUDE_DIRS MAGNUM_APPLICATION_INCLUDE_DIRS-NOTFOUND) - endif() + elseif(_component MATCHES ".+Application") + if(NOT DEFINED _MAGNUM_APPLICATION_ALIAS) + set(_MAGNUM_APPLICATION_ALIAS Magnum::${_component}) + else() + unset(_MAGNUM_APPLICATION_ALIAS) endif() - - # Global aliases for *Context components. If already set, unset them to - # avoid ambiguity. - if(${component} MATCHES ".+Context") - if(NOT DEFINED MAGNUM_CONTEXT_LIBRARIES AND NOT DEFINED MAGNUM_CONTEXT_INCLUDE_DIRS) - set(MAGNUM_CONTEXT_LIBRARIES ${MAGNUM_${_COMPONENT}_LIBRARIES}) - set(MAGNUM_CONTEXT_INCLUDE_DIRS ${MAGNUM_${_COMPONENT}_INCLUDE_DIRS}) - else() - unset(MAGNUM_CONTEXT_LIBRARIES) - unset(MAGNUM_CONTEXT_INCLUDE_DIRS) - endif() + elseif(_component MATCHES ".+Context") + if(NOT DEFINED _MAGNUM_CONTEXT_ALIAS) + set(_MAGNUM_CONTEXT_ALIAS Magnum::${_component}) + else() + unset(_MAGNUM_CONTEXT_ALIAS) endif() - else() - set(Magnum_${component}_FOUND FALSE) + endif() + + # Deprecated variables + if(MAGNUM_BUILD_DEPRECATED AND _component MATCHES ${_MAGNUM_LIBRARY_COMPONENTS} OR _component MATCHES ${_MAGNUM_PLUGIN_COMPONENTS}) + set(MAGNUM_${_COMPONENT}_LIBRARIES Magnum::${_component}) endif() endforeach() # Complete the check with also all components +include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Magnum REQUIRED_VARS MAGNUM_LIBRARY MAGNUM_INCLUDE_DIR HANDLE_COMPONENTS) +# Create Windowless*Application, *Application and *Context aliases +# TODO: ugh why can't I make an alias of IMPORTED target? +if(_MAGNUM_WINDOWLESSAPPLICATION_ALIAS AND NOT TARGET Magnum::WindowlessApplication) + get_target_property(_MAGNUM_WINDOWLESSAPPLICATION_ALIASED_TARGET ${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS} ALIASED_TARGET) + if(_MAGNUM_WINDOWLESSAPPLICATION_ALIASED_TARGET) + add_library(${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS} ALIAS ${_MAGNUM_WINDOWLESSAPPLICATION_ALIASED_TARGET}) + else() + add_library(Magnum::WindowlessApplication UNKNOWN IMPORTED) + get_target_property(_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_CONFIGURATIONS ${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS} IMPORTED_CONFIGURATIONS) + get_target_property(_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_LOCATION_RELEASE ${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS} IMPORTED_LOCATION_RELEASE) + get_target_property(_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_LOCATION_DEBUG ${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS} IMPORTED_LOCATION_DEBUG) + set_target_properties(Magnum::WindowlessApplication PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES $ + INTERFACE_COMPILE_DEFINITIONS $ + INTERFACE_COMPILE_OPTIONS $ + INTERFACE_LINK_LIBRARIES $ + IMPORTED_CONFIGURATIONS ${_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_CONFIGURATIONS}) + if(_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_LOCATION_RELEASE) + set_target_properties(Magnum::WindowlessApplication PROPERTIES + IMPORTED_LOCATION_RELEASE ${_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_LOCATION_RELEASE}) + endif() + if(_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_LOCATION_DEBUG) + set_target_properties(Magnum::WindowlessApplication PROPERTIES + IMPORTED_LOCATION_DEBUG ${_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_LOCATION_DEBUG}) + endif() + endif() + if(MAGNUM_BUILD_DEPRECATED) + set(MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES Magnum::WindowlessApplication) + endif() + # Prevent creating the alias again + unset(_MAGNUM_WINDOWLESSAPPLICATION_ALIAS) +endif() +if(_MAGNUM_APPLICATION_ALIAS AND NOT TARGET Magnum::Application) + get_target_property(_MAGNUM_APPLICATION_ALIASED_TARGET ${_MAGNUM_APPLICATION_ALIAS} ALIASED_TARGET) + if(_MAGNUM_APPLICATION_ALIASED_TARGET) + add_library(${_MAGNUM_APPLICATION_ALIAS} ALIAS ${_MAGNUM_APPLICATION_ALIASED_TARGET}) + else() + add_library(Magnum::Application UNKNOWN IMPORTED) + get_target_property(_MAGNUM_APPLICATION_IMPORTED_CONFIGURATIONS ${_MAGNUM_APPLICATION_ALIAS} IMPORTED_CONFIGURATIONS) + get_target_property(_MAGNUM_APPLICATION_IMPORTED_LOCATION_RELEASE ${_MAGNUM_APPLICATION_ALIAS} IMPORTED_LOCATION_RELEASE) + get_target_property(_MAGNUM_APPLICATION_IMPORTED_LOCATION_DEBUG ${_MAGNUM_APPLICATION_ALIAS} IMPORTED_LOCATION_DEBUG) + set_target_properties(Magnum::Application PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES $ + INTERFACE_COMPILE_DEFINITIONS $ + INTERFACE_COMPILE_OPTIONS $ + INTERFACE_LINK_LIBRARIES $ + IMPORTED_CONFIGURATIONS ${_MAGNUM_APPLICATION_IMPORTED_CONFIGURATIONS}) + if(_MAGNUM_APPLICATION_IMPORTED_LOCATION_RELEASE) + set_target_properties(Magnum::Application PROPERTIES + IMPORTED_LOCATION_RELEASE ${_MAGNUM_APPLICATION_IMPORTED_LOCATION_RELEASE}) + endif() + if(_MAGNUM_APPLICATION_IMPORTED_LOCATION_DEBUG) + set_target_properties(Magnum::Application PROPERTIES + IMPORTED_LOCATION_DEBUG ${_MAGNUM_APPLICATION_IMPORTED_LOCATION_DEBUG}) + endif() + endif() + if(MAGNUM_BUILD_DEPRECATED) + set(MAGNUM_APPLICATION_LIBRARIES Magnum::Application) + endif() + # Prevent creating the alias again + unset(_MAGNUM_APPLICATION_ALIAS) +endif() +if(_MAGNUM_CONTEXT_ALIAS AND NOT TARGET Magnum::Context) + get_target_property(_MAGNUM_CONTEXT_ALIASED_TARGET ${_MAGNUM_CONTEXT_ALIAS} ALIASED_TARGET) + if(_MAGNUM_CONTEXT_ALIASED_TARGET) + add_library(${_MAGNUM_CONTEXT_ALIAS} ALIAS ${_MAGNUM_CONTEXT_ALIASED_TARGET}) + else() + add_library(Magnum::Context UNKNOWN IMPORTED) + get_target_property(_MAGNUM_CONTEXT_IMPORTED_CONFIGURATIONS ${_MAGNUM_CONTEXT_ALIAS} IMPORTED_CONFIGURATIONS) + get_target_property(_MAGNUM_CONTEXT_IMPORTED_LOCATION_RELEASE ${_MAGNUM_CONTEXT_ALIAS} IMPORTED_LOCATION_RELEASE) + get_target_property(_MAGNUM_CONTEXT_IMPORTED_LOCATION_DEBUG ${_MAGNUM_CONTEXT_ALIAS} IMPORTED_LOCATION_DEBUG) + set_target_properties(Magnum::Context PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES $ + INTERFACE_COMPILE_DEFINITIONS $ + INTERFACE_COMPILE_OPTIONS $ + INTERFACE_LINK_LIBRARIES $ + IMPORTED_CONFIGURATIONS ${_MAGNUM_CONTEXT_IMPORTED_CONFIGURATIONS}) + if(_MAGNUM_CONTEXT_IMPORTED_LOCATION_RELEASE) + set_target_properties(Magnum::Context PROPERTIES + IMPORTED_LOCATION_RELEASE ${_MAGNUM_CONTEXT_IMPORTED_LOCATION_RELEASE}) + endif() + if(_MAGNUM_CONTEXT_IMPORTED_LOCATION_DEBUG) + set_target_properties(Magnum::Context PROPERTIES + IMPORTED_LOCATION_DEBUG ${_MAGNUM_CONTEXT_IMPORTED_LOCATION_DEBUG}) + endif() + endif() + if(MAGNUM_BUILD_DEPRECATED) + set(MAGNUM_CONTEXT_LIBRARIES Magnum::Context) + endif() + # Prevent creating the alias again + unset(_MAGNUM_CONTEXT_ALIAS) +endif() + # Installation dirs include(${CORRADE_LIB_SUFFIX_MODULE}) set(MAGNUM_BINARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin) @@ -615,29 +723,6 @@ set(MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_INSTAL set(MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_INSTALL_DIR}/audioimporters) set(MAGNUM_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/Magnum) set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/MagnumPlugins) -mark_as_advanced(FORCE - MAGNUM_LIBRARY_DEBUG - MAGNUM_LIBRARY_RELEASE - MAGNUM_LIBRARY - MAGNUM_INCLUDE_DIR - MAGNUM_BINARY_INSTALL_DIR - MAGNUM_LIBRARY_INSTALL_DIR - MAGNUM_PLUGINS_DEBUG_INSTALL_DIR - MAGNUM_PLUGINS_RELEASE_INSTALL_DIR - MAGNUM_PLUGINS_FONT_DEBUG_INSTALL_DIR - MAGNUM_PLUGINS_FONT_RELEASE_INSTALL_DIR - MAGNUM_PLUGINS_FONTCONVERTER_DEBUG_INSTALL_DIR - MAGNUM_PLUGINS_FONTCONVERTER_RELEASE_INSTALL_DIR - MAGNUM_PLUGINS_IMAGECONVERTER_DEBUG_INSTALL_DIR - MAGNUM_PLUGINS_IMAGECONVERTER_RELEASE_INSTALL_DIR - MAGNUM_PLUGINS_IMPORTER_DEBUG_INSTALL_DIR - MAGNUM_PLUGINS_IMPORTER_RELEASE_INSTALL_DIR - MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_INSTALL_DIR - MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_INSTALL_DIR - MAGNUM_CMAKE_MODULE_INSTALL_DIR - MAGNUM_INCLUDE_INSTALL_DIR - MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR - _MAGNUM_CONFIGURE_FILE) # Get base plugin directory from main library location set(MAGNUM_PLUGINS_DEBUG_DIR ${_MAGNUM_LIBRARY_PATH}/magnum-d @@ -663,3 +748,8 @@ set(MAGNUM_PLUGINS_IMPORTER_RELEASE_DIR ${MAGNUM_PLUGINS_RELEASE_DIR}/importers) set(MAGNUM_PLUGINS_AUDIOIMPORTER_DIR ${MAGNUM_PLUGINS_DIR}/audioimporters) set(MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_DIR ${MAGNUM_PLUGINS_DEBUG_DIR}/audioimporters) set(MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_DIR ${MAGNUM_PLUGINS_RELEASE_DIR}/audioimporters) + +# Deprecated variables +if(MAGNUM_BUILD_DEPRECATED) + set(MAGNUM_LIBRARIES Magnum::Magnum) +endif() diff --git a/modules/FindOpenGLES2.cmake b/modules/FindOpenGLES2.cmake index acba08faf..edccd9c22 100644 --- a/modules/FindOpenGLES2.cmake +++ b/modules/FindOpenGLES2.cmake @@ -1,8 +1,14 @@ -# - Find OpenGL ES 2 +#.rst: +# Find OpenGL ES 2 +# ---------------- # -# This module defines: +# Finds the OpenGL ES 2 library. This module defines: +# +# OpenGLES2_FOUND - True if OpenGL ES 2 library is found +# OpenGLES2::OpenGLES2 - OpenGL ES 2 imported target +# +# Additionally these variables are defined for internal usage: # -# OPENGLES2_FOUND - True if OpenGL ES 2 library is found # OPENGLES2_LIBRARY - OpenGL ES 2 library # OPENGLES2_INCLUDE_DIR - Include dir # @@ -57,6 +63,22 @@ find_path(OPENGLES2_INCLUDE_DIR NAMES ES2/gl.h) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args("OpenGLES2" DEFAULT_MSG +find_package_handle_standard_args(OpenGLES2 DEFAULT_MSG ${OPENGLES2_LIBRARY_NEEDED} OPENGLES2_INCLUDE_DIR) + +if(NOT TARGET OpenGLES2::OpenGLES2) + if(OPENGLES2_LIBRARY_NEEDED) + add_library(OpenGLES2::OpenGLES2 UNKNOWN IMPORTED) + set_property(TARGET OpenGLES2::OpenGLES2 PROPERTY + IMPORTED_LOCATION ${OPENGLES2_LIBRARY}) + else() + # This won't work in CMake 2.8.12, but that affects Emscripten only so + # I assume people building for that are not on that crap old Ubuntu + # 14.04 LTS + add_library(OpenGLES2::OpenGLES2 INTERFACE IMPORTED) + endif() + + set_property(TARGET OpenGLES2::OpenGLES2 PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${OPENGLES2_INCLUDE_DIR}) +endif() diff --git a/modules/FindOpenGLES3.cmake b/modules/FindOpenGLES3.cmake index 23f4149ed..51b476a4e 100644 --- a/modules/FindOpenGLES3.cmake +++ b/modules/FindOpenGLES3.cmake @@ -1,8 +1,14 @@ -# - Find OpenGL ES 3 +#.rst: +# Find OpenGL ES 3 +# ---------------- # -# This module defines: +# Finds the OpenGL ES 3 library. This module defines: +# +# OpenGLES3_FOUND - True if OpenGL ES 3 library is found +# OpenGLES3::OpenGLES3 - OpenGL ES 3 imported target +# +# Additionally these variables are defined for internal usage: # -# OPENGLES3_FOUND - True if OpenGL ES 3 library is found # OPENGLES3_LIBRARY - OpenGL ES 3 library # OPENGLES3_INCLUDE_DIR - Include dir # @@ -61,3 +67,19 @@ include(FindPackageHandleStandardArgs) find_package_handle_standard_args("OpenGLES3" DEFAULT_MSG ${OPENGLES3_LIBRARY_NEEDED} OPENGLES3_INCLUDE_DIR) + +if(NOT TARGET OpenGLES3::OpenGLES3) + if(OPENGLES3_LIBRARY_NEEDED) + add_library(OpenGLES3::OpenGLES3 UNKNOWN IMPORTED) + set_property(TARGET OpenGLES3::OpenGLES3 PROPERTY + IMPORTED_LOCATION ${OPENGLES3_LIBRARY}) + else() + # This won't work in CMake 2.8.12, but that affects Emscripten only so + # I assume people building for that are not on that crap old Ubuntu + # 14.04 LTS + add_library(OpenGLES3::OpenGLES3 INTERFACE IMPORTED) + endif() + + set_property(TARGET OpenGLES3::OpenGLES3 PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${OPENGLES3_INCLUDE_DIR}) +endif() diff --git a/modules/FindSDL2.cmake b/modules/FindSDL2.cmake index 11544cb4b..60eba212b 100644 --- a/modules/FindSDL2.cmake +++ b/modules/FindSDL2.cmake @@ -1,14 +1,16 @@ -# - Find SDL2 +#.rst: +# Find SDL2 +# --------- # -# This module defines: +# Finds the SDL2 library. This module defines: # # SDL2_FOUND - True if SDL2 library is found -# SDL2_LIBRARIES - SDL2 library and dependent libraries -# SDL2_INCLUDE_DIRS - Root include dir and include dirs of dependencies +# SDL2::SDL2 - SDL2 imported target # # Additionally these variables are defined for internal usage: -# SDL2_INCLUDE_DIR - Root include dir (w/o dependencies) -# SDL2_LIBRARY - SDL2 library (w/o dependencies) +# +# SDL2_LIBRARY - SDL2 library +# SDL2_INCLUDE_DIR - Root include dir # # @@ -89,5 +91,29 @@ find_package_handle_standard_args("SDL2" DEFAULT_MSG ${_SDL2_FRAMEWORK_LIBRARY_NAMES} SDL2_INCLUDE_DIR) -set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR}) -set(SDL2_LIBRARIES ${SDL2_LIBRARY} ${_SDL2_FRAMEWORK_LIBRARIES}) +if(NOT TARGET SDL2::SDL2) + if(SDL2_LIBRARY_NEEDED) + add_library(SDL2::SDL2 UNKNOWN IMPORTED) + set_property(TARGET SDL2::SDL2 PROPERTY IMPORTED_LOCATION ${SDL2_LIBRARY}) + + # Link frameworks on iOS + if(CORRADE_TARGET_IOS) + set_property(TARGET SDL2::SDL2 APPEND PROPERTY + INTERFACE_LINK_LIBRARIES ${_SDL2_FRAMEWORK_LIBRARIES}) + endif() + + # Link also EGL library, if on ES (and not on WebGL) + if(MAGNUM_TARGET_GLES AND NOT MAGNUM_TARGET_DESKTOP_GLES AND NOT MAGNUM_TARGET_WEBGL) + set_property(TARGET SDL2::SDL2 APPEND PROPERTY + INTERFACE_LINK_LIBRARIES EGL::EGL) + endif() + else() + # This won't work in CMake 2.8.12, but that affects Emscripten only so + # I assume people building for that are not on that crap old Ubuntu + # 14.04 LTS + add_library(SDL2::SDL2 INTERFACE IMPORTED) + endif() + + set_property(TARGET SDL2::SDL2 PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR}) +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5bd81cde5..4d22dc8f2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -27,7 +27,7 @@ # without any warning, only in release build, any attempt to add debug print # results in issue disappearing. Not an issue on Clang or GCC < 4.8. if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.0") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") + add_compile_options("-fno-strict-aliasing") endif() # On MSVC remove /W3, as we are replacing it with /W4 @@ -37,17 +37,13 @@ endif() # Emscripten needs special flag to use WebGL 2 if(CORRADE_TARGET_EMSCRIPTEN AND NOT TARGET_GLES2) + # TODO: give me INTERFACE_LINK_OPTIONS or something, please set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s USE_WEBGL2=1") endif() -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CORRADE_CXX_FLAGS}") - -include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CORRADE_INCLUDE_DIRS}) - -# We can use both implicit include path (GLES2/gl2.h) where our headers can -# be overriden with system ones or explicit (MagnumExternal/OpenGL/GLES2/gl2ext.h) -# where only our headers will be used -include_directories(${PROJECT_SOURCE_DIR}/src/MagnumExternal/OpenGL) +set_directory_properties(PROPERTIES + CORRADE_CXX_STANDARD 11 + CORRADE_USE_PEDANTIC_FLAGS ON) add_subdirectory(MagnumExternal) add_subdirectory(Magnum) diff --git a/src/Magnum/Audio/CMakeLists.txt b/src/Magnum/Audio/CMakeLists.txt index 4d57b6b0c..1a156e3ff 100644 --- a/src/Magnum/Audio/CMakeLists.txt +++ b/src/Magnum/Audio/CMakeLists.txt @@ -25,8 +25,6 @@ find_package(OpenAL REQUIRED) -include_directories(${OPENAL_INCLUDE_DIR}) - set(MagnumAudio_SRCS AbstractImporter.cpp Audio.cpp @@ -60,13 +58,12 @@ endif() add_library(MagnumAudio ${SHARED_OR_STATIC} ${MagnumAudio_SRCS} ${MagnumAudio_HEADERS}) +target_include_directories(MagnumAudio PUBLIC ${OPENAL_INCLUDE_DIR}) set_target_properties(MagnumAudio PROPERTIES DEBUG_POSTFIX "-d") if(BUILD_STATIC_PIC) set_target_properties(MagnumAudio PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() - -target_link_libraries(MagnumAudio Magnum ${CORRADE_PLUGINMANAGER_LIBRARIES} ${OPENAL_LIBRARY}) - +target_link_libraries(MagnumAudio Magnum Corrade::PluginManager ${OPENAL_LIBRARY}) if(WITH_SCENEGRAPH) target_link_libraries(MagnumAudio MagnumSceneGraph) endif() @@ -81,5 +78,5 @@ if(BUILD_TESTS) add_subdirectory(Test) endif() -# Magnum Audio library for superprojects -set(MAGNUM_AUDIO_LIBRARY MagnumAudio CACHE INTERNAL "") +# Magnum Audio target alias for superprojects +add_library(Magnum::Audio ALIAS MagnumAudio) diff --git a/src/Magnum/Audio/Extensions.h b/src/Magnum/Audio/Extensions.h index 2a72f2eb9..478903e56 100644 --- a/src/Magnum/Audio/Extensions.h +++ b/src/Magnum/Audio/Extensions.h @@ -50,11 +50,11 @@ usage. This namespace is not built by default. It is built if `WITH_AUDIO` is enabled when building Magnum. To use this library, you need to request -`Audio` component of `Magnum` package in CMake, add `${MAGNUM_AUDIO_INCLUDE_DIRS}` -to include path and link to `${MAGNUM_AUDIO_LIBRARIES}`. See @ref building and -@ref cmake for more information. Additional plugins are enabled separately, see -particular `*Importer` class documentation, @ref building-plugins, -@ref cmake-plugins and @ref plugins for more information. +`Audio` component of `Magnum` package in CMake and link to `Magnum::Audio` +target. See @ref building and @ref cmake for more information. Additional +plugins are enabled separately, see particular `*Importer` class documentation, +@ref building-plugins, @ref cmake-plugins and @ref plugins for more +information. @see @ref MAGNUM_ASSERT_AUDIO_EXTENSION_SUPPORTED() @todo Manual indices for extensions, this has gaps */ diff --git a/src/Magnum/Audio/Test/CMakeLists.txt b/src/Magnum/Audio/Test/CMakeLists.txt index b5aa82e71..939cecd9c 100644 --- a/src/Magnum/Audio/Test/CMakeLists.txt +++ b/src/Magnum/Audio/Test/CMakeLists.txt @@ -27,9 +27,8 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/configure.h) -include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) - corrade_add_test(AudioAbstractImporterTest AbstractImporterTest.cpp LIBRARIES MagnumAudio) +target_include_directories(AudioAbstractImporterTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) corrade_add_test(AudioBufferTest BufferTest.cpp LIBRARIES MagnumAudio) corrade_add_test(AudioContextTest ContextTest.cpp LIBRARIES MagnumAudio) corrade_add_test(AudioRendererTest RendererTest.cpp LIBRARIES MagnumAudio) diff --git a/src/Magnum/CMakeLists.txt b/src/Magnum/CMakeLists.txt index 936bad8ab..72f3353e4 100644 --- a/src/Magnum/CMakeLists.txt +++ b/src/Magnum/CMakeLists.txt @@ -232,8 +232,9 @@ set(MagnumMath_SRCS # Objects shared between main and test library add_library(MagnumMathObjects OBJECT ${MagnumMath_SRCS}) +target_include_directories(MagnumMathObjects PUBLIC $) if(NOT BUILD_STATIC) - set_target_properties(MagnumMathObjects PROPERTIES COMPILE_FLAGS "-DMagnumMathObjects_EXPORTS") + target_compile_definitions(MagnumMathObjects PRIVATE "MagnumMathObjects_EXPORTS") endif() if(NOT BUILD_STATIC OR BUILD_STATIC_PIC) set_target_properties(MagnumMathObjects PROPERTIES POSITION_INDEPENDENT_CODE ON) @@ -248,22 +249,27 @@ add_library(Magnum ${SHARED_OR_STATIC} $) set_target_properties(Magnum PROPERTIES DEBUG_POSTFIX "-d") if(NOT BUILD_STATIC) - set_target_properties(Magnum PROPERTIES COMPILE_FLAGS "-DFlextGL_EXPORTS") + target_compile_definitions(Magnum PRIVATE "FlextGL_EXPORTS") elseif(BUILD_STATIC_PIC) set_target_properties(Magnum PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() - -set(Magnum_LIBS - ${CORRADE_UTILITY_LIBRARIES} - ${CORRADE_PLUGINMANAGER_LIBRARIES}) +# We can use both implicit include path (GLES2/gl2.h) where our headers can +# be overriden with system ones or explicit (MagnumExternal/OpenGL/GLES2/gl2ext.h) +# where only our headers will be used +target_include_directories(Magnum PUBLIC + ${PROJECT_SOURCE_DIR}/src + ${PROJECT_BINARY_DIR}/src + ${PROJECT_SOURCE_DIR}/src/MagnumExternal/OpenGL) +target_link_libraries(Magnum + Corrade::Utility + Corrade::PluginManager) if(NOT TARGET_GLES OR TARGET_DESKTOP_GLES) - set(Magnum_LIBS ${Magnum_LIBS} ${OPENGL_gl_LIBRARY}) + target_link_libraries(Magnum ${OPENGL_gl_LIBRARY}) elseif(TARGET_GLES2) - set(Magnum_LIBS ${Magnum_LIBS} ${OPENGLES2_LIBRARY}) + target_link_libraries(Magnum OpenGLES2::OpenGLES2) else() - set(Magnum_LIBS ${Magnum_LIBS} ${OPENGLES3_LIBRARY}) + target_link_libraries(Magnum OpenGLES3::OpenGLES3) endif() -target_link_libraries(Magnum ${Magnum_LIBS}) install(TARGETS Magnum RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} @@ -318,10 +324,10 @@ if(BUILD_TESTS) add_library(MagnumMathTestLib ${SHARED_OR_STATIC} $ Math/dummy.cpp) # XCode workaround, see file comment for details - set_target_properties(MagnumMathTestLib PROPERTIES - COMPILE_FLAGS "-DCORRADE_GRACEFUL_ASSERT" - DEBUG_POSTFIX "-d") - target_link_libraries(MagnumMathTestLib ${CORRADE_UTILITY_LIBRARIES}) + target_include_directories(MagnumMathTestLib PUBLIC $) + target_compile_definitions(MagnumMathTestLib PRIVATE "CORRADE_GRACEFUL_ASSERT") + set_target_properties(MagnumMathTestLib PROPERTIES DEBUG_POSTFIX "-d") + target_link_libraries(MagnumMathTestLib Corrade::Utility) # On Windows we need to install first and then run the tests to avoid "DLL # not found" hell, thus we need to install this too diff --git a/src/Magnum/DebugTools/CMakeLists.txt b/src/Magnum/DebugTools/CMakeLists.txt index 1a4fbd6e9..f7caa6ae4 100644 --- a/src/Magnum/DebugTools/CMakeLists.txt +++ b/src/Magnum/DebugTools/CMakeLists.txt @@ -113,5 +113,5 @@ if(BUILD_TESTS) add_subdirectory(Test) endif() -# Magnum DebugTools library for superprojects -set(MAGNUM_DEBUGTOOLS_LIBRARY MagnumDebugTools CACHE INTERNAL "") +# Magnum DebugTools target alias for superprojects +add_library(Magnum::DebugTools ALIAS MagnumDebugTools) diff --git a/src/Magnum/Extensions.h b/src/Magnum/Extensions.h index fe7d4b14d..478bff6e9 100644 --- a/src/Magnum/Extensions.h +++ b/src/Magnum/Extensions.h @@ -58,9 +58,8 @@ but these structs are better suited for compile-time decisions rather than @ref Extension instances. See @ref Context::isExtensionSupported() for example usage. -This namespace is built by default. To use it, you need to add `${MAGNUM_INCLUDE_DIRS}` -to include path and link to `${MAGNUM_LIBRARIES}`. See @ref building and -@ref cmake for more information. +This namespace is built by default. To use it, you need to link to +`Magnum::Magnum` target. See @ref building and @ref cmake for more information. @see @ref MAGNUM_ASSERT_EXTENSION_SUPPORTED() @todo Manual indices for extensions, this has gaps */ diff --git a/src/Magnum/Math/Geometry/Test/CMakeLists.txt b/src/Magnum/Math/Geometry/Test/CMakeLists.txt index 6620cd528..b5aca0649 100644 --- a/src/Magnum/Math/Geometry/Test/CMakeLists.txt +++ b/src/Magnum/Math/Geometry/Test/CMakeLists.txt @@ -23,5 +23,5 @@ # DEALINGS IN THE SOFTWARE. # -corrade_add_test(MathGeometryDistanceTest DistanceTest.cpp) +corrade_add_test(MathGeometryDistanceTest DistanceTest.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(MathGeometryIntersectionTest IntersectionTest.cpp LIBRARIES MagnumMathTestLib) diff --git a/src/Magnum/Math/Test/CMakeLists.txt b/src/Magnum/Math/Test/CMakeLists.txt index 5e53b73e9..9eeba4cfb 100644 --- a/src/Magnum/Math/Test/CMakeLists.txt +++ b/src/Magnum/Math/Test/CMakeLists.txt @@ -23,11 +23,11 @@ # DEALINGS IN THE SOFTWARE. # -corrade_add_test(MathBoolVectorTest BoolVectorTest.cpp) -corrade_add_test(MathConstantsTest ConstantsTest.cpp) +corrade_add_test(MathBoolVectorTest BoolVectorTest.cpp LIBRARIES MagnumMathTestLib) +corrade_add_test(MathConstantsTest ConstantsTest.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(MathFunctionsTest FunctionsTest.cpp LIBRARIES MagnumMathTestLib) -corrade_add_test(MathTagsTest TagsTest.cpp) -corrade_add_test(MathTypeTraitsTest TypeTraitsTest.cpp) +corrade_add_test(MathTagsTest TagsTest.cpp LIBRARIES MagnumMathTestLib) +corrade_add_test(MathTypeTraitsTest TypeTraitsTest.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(MathVectorTest VectorTest.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(MathVector2Test Vector2Test.cpp LIBRARIES MagnumMathTestLib) @@ -41,7 +41,7 @@ corrade_add_test(MathMatrix3Test Matrix3Test.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(MathMatrix4Test Matrix4Test.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(MathSwizzleTest SwizzleTest.cpp LIBRARIES MagnumMathTestLib) -corrade_add_test(MathUnitTest UnitTest.cpp) +corrade_add_test(MathUnitTest UnitTest.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(MathAngleTest AngleTest.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(MathRangeTest RangeTest.cpp LIBRARIES MagnumMathTestLib) @@ -51,7 +51,7 @@ corrade_add_test(MathDualComplexTest DualComplexTest.cpp LIBRARIES MagnumMathTes corrade_add_test(MathQuaternionTest QuaternionTest.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(MathDualQuaternionTest DualQuaternionTest.cpp LIBRARIES MagnumMathTestLib) -set_target_properties( +set_property(TARGET MathVectorTest MathMatrixTest MathMatrix3Test @@ -60,4 +60,4 @@ set_target_properties( MathDualComplexTest MathQuaternionTest MathDualQuaternionTest - PROPERTIES COMPILE_FLAGS -DCORRADE_GRACEFUL_ASSERT) + APPEND PROPERTY COMPILE_DEFINITIONS "CORRADE_GRACEFUL_ASSERT") diff --git a/src/Magnum/MeshTools/CMakeLists.txt b/src/Magnum/MeshTools/CMakeLists.txt index 81e70c520..6de79e52d 100644 --- a/src/Magnum/MeshTools/CMakeLists.txt +++ b/src/Magnum/MeshTools/CMakeLists.txt @@ -56,8 +56,9 @@ set(MagnumMeshTools_HEADERS add_library(MagnumMeshToolsObjects OBJECT ${MagnumMeshTools_SRCS} ${MagnumMeshTools_HEADERS}) +target_include_directories(MagnumMeshToolsObjects PUBLIC $) if(NOT BUILD_STATIC) - set_target_properties(MagnumMeshToolsObjects PROPERTIES COMPILE_FLAGS "-DMagnumMeshToolsObjects_EXPORTS") + target_compile_definitions(MagnumMeshToolsObjects PRIVATE "MagnumMeshToolsObjects_EXPORTS") endif() if(NOT BUILD_STATIC OR BUILD_STATIC_PIC) set_target_properties(MagnumMeshToolsObjects PROPERTIES POSITION_INDEPENDENT_CODE ON) @@ -85,13 +86,12 @@ if(BUILD_TESTS) add_library(MagnumMeshToolsTestLib ${SHARED_OR_STATIC} $ ${MagnumMeshTools_GracefulAssert_SRCS}) - set_target_properties(MagnumMeshToolsTestLib PROPERTIES - COMPILE_FLAGS "-DCORRADE_GRACEFUL_ASSERT -DMagnumMeshTools_EXPORTS" - DEBUG_POSTFIX "-d") + set_target_properties(MagnumMeshToolsTestLib PROPERTIES DEBUG_POSTFIX "-d") + target_compile_definitions(MagnumMeshToolsTestLib PRIVATE + "CORRADE_GRACEFUL_ASSERT" "MagnumMeshTools_EXPORTS") if(BUILD_STATIC_PIC) set_target_properties(MagnumMeshToolsTestLib PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() - target_link_libraries(MagnumMeshToolsTestLib Magnum) # On Windows we need to install first and then run the tests to avoid "DLL @@ -106,5 +106,5 @@ if(BUILD_TESTS) add_subdirectory(Test) endif() -# Magnum MeshTools library for superprojects -set(MAGNUM_MESHTOOLS_LIBRARY MagnumMeshTools CACHE INTERNAL "") +# Magnum MeshTools target alias for superprojects +add_library(Magnum::MeshTools ALIAS MagnumMeshTools) diff --git a/src/Magnum/MeshTools/Test/CMakeLists.txt b/src/Magnum/MeshTools/Test/CMakeLists.txt index 3472f90d4..5a324d4b6 100644 --- a/src/Magnum/MeshTools/Test/CMakeLists.txt +++ b/src/Magnum/MeshTools/Test/CMakeLists.txt @@ -25,18 +25,19 @@ corrade_add_test(MeshToolsCombineIndexedArraysTest CombineIndexedArraysTest.cpp LIBRARIES MagnumMeshToolsTestLib) corrade_add_test(MeshToolsCompressIndicesTest CompressIndicesTest.cpp LIBRARIES MagnumMeshToolsTestLib) -corrade_add_test(MeshToolsDuplicateTest DuplicateTest.cpp) +corrade_add_test(MeshToolsDuplicateTest DuplicateTest.cpp LIBRARIES Magnum) corrade_add_test(MeshToolsFlipNormalsTest FlipNormalsTest.cpp LIBRARIES MagnumMeshToolsTestLib) corrade_add_test(MeshToolsGenerateFlatNormalsTest GenerateFlatNormalsTest.cpp LIBRARIES MagnumMeshToolsTestLib) -corrade_add_test(MeshToolsInterleaveTest InterleaveTest.cpp) +corrade_add_test(MeshToolsInterleaveTest InterleaveTest.cpp LIBRARIES Magnum) corrade_add_test(MeshToolsRemoveDuplicatesTest RemoveDuplicatesTest.cpp LIBRARIES Magnum) -corrade_add_test(MeshToolsSubdivideTest SubdivideTest.cpp) +corrade_add_test(MeshToolsSubdivideTest SubdivideTest.cpp LIBRARIES Magnum) # corrade_add_test(MeshToolsSubdivideRemoveDuplicatesBenchmark SubdivideRemoveDuplicatesBenchmark.h SubdivideRemoveDuplicatesBenchmark.cpp MagnumPrimitives) corrade_add_test(MeshToolsTipsifyTest TipsifyTest.cpp LIBRARIES MagnumMeshTools) corrade_add_test(MeshToolsTransformTest TransformTest.cpp LIBRARIES MagnumMeshTools) # Graceful assert for testing -set_target_properties(MeshToolsCombineIndexedArraysTest +set_property(TARGET + MeshToolsCombineIndexedArraysTest MeshToolsInterleaveTest MeshToolsSubdivideTest - PROPERTIES COMPILE_FLAGS -DCORRADE_GRACEFUL_ASSERT) + APPEND PROPERTY COMPILE_DEFINITIONS "CORRADE_GRACEFUL_ASSERT") diff --git a/src/Magnum/Platform/AndroidApplication.h b/src/Magnum/Platform/AndroidApplication.h index 4e735a98c..0927d1956 100644 --- a/src/Magnum/Platform/AndroidApplication.h +++ b/src/Magnum/Platform/AndroidApplication.h @@ -112,13 +112,11 @@ can be then installed directly on the device or emulator using `adb install`. For CMake you need to copy `FindEGL.cmake` and `FindOpenGLES2.cmake` (or `FindOpenGLES3.cmake`) from `modules/` directory in Magnum source to `modules/` dir in your project (so it is able to find EGL and OpenGL ES libraries). -Request `AndroidApplication` component, add -`${MAGNUM_ANDROIDAPPLICATION_INCLUDE_DIRS}` to include path and link to -`${MAGNUM_ANDROIDAPPLICATION_LIBRARIES}`. If no other application is requested, -you can also use generic `${MAGNUM_APPLICATION_INCLUDE_DIRS}` and -`${MAGNUM_APPLICATION_LIBRARIES}` aliases to simplify porting. Again, see -@ref building and @ref cmake for more information. Note that unlike on other -platforms you need to create *shared library* instead of executable. The +Request `AndroidApplication` component of `Magnum` package and link to +`Magnum::AndroidApplication` target. If no other application is requested, you +can also use generic `Magnum::Application` alias to simplify porting. Again, +see @ref building and @ref cmake for more information. Note that unlike on +other platforms you need to create *shared library* instead of executable. The resulting binary then needs to be copied to `lib/armeabi-v7a` and `lib/x86`, you can do that automatically in CMake using the following commands: diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index 5a0134b0d..2fc4b0f5c 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -61,8 +61,6 @@ if(WITH_ANDROIDAPPLICATION) set(NEED_EGLCONTEXT 1) - include_directories(${ANDROID_NATIVE_APP_GLUE_INCLUDE_DIR}) - set(MagnumAndroidApplication_SRCS AndroidApplication.cpp Implementation/Egl.cpp @@ -77,6 +75,7 @@ if(WITH_ANDROIDAPPLICATION) ${MagnumAndroidApplication_HEADERS} ${MagnumAndroidApplication_PRIVATE_HEADERS} ${ANDROID_NATIVE_APP_GLUE_SRC}) + target_include_directories(MagnumAndroidApplication PUBLIC ${ANDROID_NATIVE_APP_GLUE_INCLUDE_DIR}) set_target_properties(MagnumAndroidApplication PROPERTIES DEBUG_POSTFIX "-d") # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib @@ -88,8 +87,8 @@ if(WITH_ANDROIDAPPLICATION) LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - # Magnum AndroidApplication library for superprojects - set(MAGNUM_ANDROIDAPPLICATION_LIBRARY MagnumAndroidApplication CACHE INTERNAL "") + # Magnum AndroidApplication target alias for superprojects + add_library(Magnum::AndroidApplication ALIAS MagnumAndroidApplication) endif() # GLUT application @@ -110,7 +109,8 @@ if(WITH_GLUTAPPLICATION) set_target_properties(MagnumGlutApplication PROPERTIES DEBUG_POSTFIX "-d") # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib - target_link_libraries(MagnumGlutApplication Magnum) + target_include_directories(MagnumGlutApplication PUBLIC ${GLUT_INCLUDE_DIR}) + target_link_libraries(MagnumGlutApplication Magnum ${GLUT_glut_LIBRARY}) install(FILES ${MagnumGlutApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumGlutApplication @@ -118,8 +118,8 @@ if(WITH_GLUTAPPLICATION) LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - # Magnum GlutApplication library for superprojects - set(MAGNUM_GLUTAPPLICATION_LIBRARY MagnumGlutApplication CACHE INTERNAL "") + # Magnum GlutApplication target alias for superprojects + add_library(Magnum::GlutApplication ALIAS MagnumGlutApplication) endif() # SDL2 application @@ -129,8 +129,6 @@ if(WITH_SDL2APPLICATION) message(FATAL_ERROR "SDL2 library, required by Sdl2Application, was not found. Set WITH_SDL2APPLICATION to OFF to skip building it.") endif() - include_directories(${SDL2_INCLUDE_DIRS}) - set(MagnumSdl2Application_SRCS Sdl2Application.cpp ${MagnumSomeContext_OBJECTS}) @@ -142,7 +140,7 @@ if(WITH_SDL2APPLICATION) set_target_properties(MagnumSdl2Application PROPERTIES DEBUG_POSTFIX "-d") # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib - target_link_libraries(MagnumSdl2Application Magnum) + target_link_libraries(MagnumSdl2Application Magnum SDL2::SDL2) install(FILES ${MagnumSdl2Application_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumSdl2Application @@ -150,8 +148,8 @@ if(WITH_SDL2APPLICATION) LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - # Magnum Sdl2Application library for superprojects - set(MAGNUM_SDL2APPLICATION_LIBRARY MagnumSdl2Application CACHE INTERNAL "") + # Magnum Sdl2Application target alias for superprojects + add_library(Magnum::Sdl2Application ALIAS MagnumSdl2Application) endif() # NaCl application @@ -169,13 +167,16 @@ if(WITH_NACLAPPLICATION) set_target_properties(MagnumNaClApplication PROPERTIES DEBUG_POSTFIX "-d") # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib - target_link_libraries(MagnumNaClApplication Magnum) + target_link_libraries(MagnumNaClApplication Magnum ppapi_cpp ppapi) install(FILES ${MagnumNaClApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumNaClApplication RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) + + # Magnum NaClApplication target alias for superprojects + add_library(Magnum::NaClApplication ALIAS MagnumNaClApplication) endif() # Windowless NaCl application @@ -191,10 +192,9 @@ if(WITH_WINDOWLESSNACLAPPLICATION) ${MagnumWindowlessNaClApplication_SRCS} ${MagnumWindowlessNaClApplication_HEADERS}) set_target_properties(MagnumWindowlessNaClApplication PROPERTIES DEBUG_POSTFIX "-d") - target_link_libraries(MagnumWindowlessNaClApplication Magnum ppapi_cpp ppapi) # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib - target_link_libraries(MagnumWindowlessNaClApplication Magnum) + target_link_libraries(MagnumWindowlessNaClApplication Magnum ppapi_cpp ppapi) install(FILES ${MagnumWindowlessNaClApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumWindowlessNaClApplication @@ -202,8 +202,8 @@ if(WITH_WINDOWLESSNACLAPPLICATION) LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - # Magnum WindowlessNaClApplication library for superprojects - set(MAGNUM_WINDOWLESSNACLAPPLICATION_LIBRARY MagnumWindowlessNaClApplication CACHE INTERNAL "") + # Magnum WindowlessNaClApplication target alias for superprojects + add_library(Magnum::WindowlessNaClApplication ALIAS MagnumWindowlessNaClApplication) endif() # JavaScript and CSS stuff for NaCl @@ -243,7 +243,8 @@ if(WITH_GLXAPPLICATION) set_target_properties(MagnumGlxApplication PROPERTIES DEBUG_POSTFIX "-d") # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib - target_link_libraries(MagnumGlxApplication Magnum) + target_include_directories(MagnumGlxApplication PUBLIC ${X11_INCLUDE_DIR}) + target_link_libraries(MagnumGlxApplication Magnum ${X11_LIBRARIES}) install(FILES ${MagnumGlxApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumGlxApplication @@ -251,8 +252,8 @@ if(WITH_GLXAPPLICATION) LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - # Magnum GlxApplication library for superprojects - set(MAGNUM_GLXAPPLICATION_LIBRARY MagnumGlxApplication CACHE INTERNAL "") + # Magnum GlxApplication target alias for superprojects + add_library(Magnum::GlxApplication ALIAS MagnumGlxApplication) endif() # X/EGL application @@ -274,7 +275,8 @@ if(WITH_XEGLAPPLICATION) set_target_properties(MagnumXEglApplication PROPERTIES DEBUG_POSTFIX "-d") # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib - target_link_libraries(MagnumXEglApplication Magnum) + target_include_directories(MagnumXEglApplication PUBLIC ${X11_INCLUDE_DIR}) + target_link_libraries(MagnumXEglApplication Magnum ${X11_LIBRARIES}) install(FILES ${MagnumXEglApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumXEglApplication @@ -282,8 +284,8 @@ if(WITH_XEGLAPPLICATION) LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - # Magnum XEglApplication library for superprojects - set(MAGNUM_XEGLAPPLICATION_LIBRARY MagnumXEglApplication CACHE INTERNAL "") + # Magnum XEglApplication target alias for superprojects + add_library(Magnum::XEglApplication ALIAS MagnumXEglApplication) endif() if(WITH_WINDOWLESSGLXAPPLICATION OR NEED_ABSTRACTXAPPLICATION) @@ -306,13 +308,12 @@ if(WITH_WINDOWLESSGLXAPPLICATION) ${MagnumWindowlessGlxApplication_SRCS} ${MagnumWindowlessGlxApplication_HEADERS}) # X11 macros are a mess, disable warnings for C-style casts - set_target_properties(MagnumWindowlessGlxApplication PROPERTIES - COMPILE_FLAGS "-Wno-old-style-cast" - DEBUG_POSTFIX "-d") - target_link_libraries(MagnumWindowlessGlxApplication Magnum ${X11_LIBRARIES}) + set_target_properties(MagnumWindowlessGlxApplication PROPERTIES DEBUG_POSTFIX "-d") + target_compile_options(MagnumWindowlessGlxApplication PRIVATE "-Wno-old-style-cast") # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib - target_link_libraries(MagnumWindowlessGlxApplication Magnum) + target_include_directories(MagnumWindowlessGlxApplication PUBLIC ${X11_INCLUDE_DIR}) + target_link_libraries(MagnumWindowlessGlxApplication Magnum ${X11_LIBRARIES}) install(FILES ${MagnumWindowlessGlxApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumWindowlessGlxApplication @@ -320,8 +321,8 @@ if(WITH_WINDOWLESSGLXAPPLICATION) LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - # Magnum WindowlessGlxApplication library for superprojects - set(MAGNUM_WINDOWLESSGLXAPPLICATION_LIBRARY MagnumWindowlessGlxApplication CACHE INTERNAL "") + # Magnum WindowlessGlxApplication target alias for superprojects + add_library(Magnum::WindowlessGlxApplication ALIAS MagnumWindowlessGlxApplication) endif() # Windowless WGL application @@ -336,10 +337,8 @@ if(WITH_WINDOWLESSWGLAPPLICATION) add_library(MagnumWindowlessWglApplication STATIC ${MagnumWindowlessWglApplication_SRCS} ${MagnumWindowlessWglApplication_HEADERS}) - set_target_properties(MagnumWindowlessWglApplication PROPERTIES - COMPILE_FLAGS "-DUNICODE" - DEBUG_POSTFIX "-d") - target_link_libraries(MagnumWindowlessWglApplication Magnum) + set_target_properties(MagnumWindowlessWglApplication PROPERTIES DEBUG_POSTFIX "-d") + target_compile_definitions(MagnumWindowlessWglApplication PRIVATE "UNICODE") # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib target_link_libraries(MagnumWindowlessWglApplication Magnum) @@ -350,8 +349,8 @@ if(WITH_WINDOWLESSWGLAPPLICATION) LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - # Magnum WindowlessWglApplication library for superprojects - set(MAGNUM_WINDOWLESSWGLAPPLICATION_LIBRARY MagnumWindowlessWglApplication CACHE INTERNAL "") + # Magnum WindowlessWglApplication target alias for superprojects + add_library(Magnum::WindowlessWglApplication ALIAS MagnumWindowlessWglApplication) endif() # Windowless Windows/EGL application @@ -371,13 +370,11 @@ if(WITH_WINDOWLESSWINDOWSEGLAPPLICATION) ${MagnumWindowlessWindowsEglApplication_SRCS} ${MagnumWindowlessWindowsEglApplication_HEADERS} ${MagnumWindowlessWindowsEglApplication_PRIVATE_HEADERS}) - set_target_properties(MagnumWindowlessWindowsEglApplication PROPERTIES - COMPILE_FLAGS "-DUNICODE" - DEBUG_POSTFIX "-d") - target_link_libraries(MagnumWindowlessWindowsEglApplication Magnum ${EGL_LIBRARY}) + set_target_properties(MagnumWindowlessWindowsEglApplication PROPERTIES DEBUG_POSTFIX "-d") + target_compile_definitions(MagnumWindowlessWindowsEglApplication PRIVATE "UNICODE") # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib - target_link_libraries(MagnumWindowlessWindowsEglApplication Magnum) + target_link_libraries(MagnumWindowlessWindowsEglApplication Magnum EGL::EGL) install(FILES ${MagnumWindowlessWindowsEglApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(TARGETS MagnumWindowlessWindowsEglApplication @@ -385,8 +382,8 @@ if(WITH_WINDOWLESSWINDOWSEGLAPPLICATION) LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - # Magnum WindowlessWindowsEglApplication library for superprojects - set(MAGNUM_WINDOWLESSWINDOWSEGLAPPLICATION_LIBRARY MagnumWindowlessWindowsEglApplication CACHE INTERNAL "") + # Magnum WindowlessWindowsEglApplication target alias for superprojects + add_library(Magnum::WindowlessWindowsEglApplication ALIAS MagnumWindowlessWindowsEglApplication) endif() # Windowless CGL application @@ -402,7 +399,6 @@ if(WITH_WINDOWLESSCGLAPPLICATION) ${MagnumWindowlessCglApplication_SRCS} ${MagnumWindowlessCglApplication_HEADERS}) set_target_properties(MagnumWindowlessCglApplication PROPERTIES DEBUG_POSTFIX "-d") - target_link_libraries(MagnumWindowlessCglApplication Magnum) # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib target_link_libraries(MagnumWindowlessCglApplication Magnum) @@ -414,7 +410,7 @@ if(WITH_WINDOWLESSCGLAPPLICATION) ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) # Magnum WindowlessCglApplication library for superprojects - set(MAGNUM_WINDOWLESSCGLAPPLICATION_LIBRARY MagnumWindowlessCglApplication CACHE INTERNAL "") + add_library(Magnum::WindowlessCglApplication ALIAS MagnumWindowlessCglApplication) endif() # Abstract X application @@ -425,8 +421,9 @@ if(NEED_ABSTRACTXAPPLICATION) add_library(MagnumAbstractXApplication OBJECT ${MagnumAbstractXApplication_SRCS} ${MagnumAbstractXApplication_HEADERS}) + target_include_directories(MagnumAbstractXApplication PUBLIC $) # X11 macros are a mess, disable warnings for C-style casts - set_target_properties(MagnumAbstractXApplication PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast") + target_compile_options(MagnumAbstractXApplication PRIVATE "-Wno-old-style-cast") # Assuming that PIC is not needed because the Application lib is always # linked to the executable and not to any intermediate shared lib @@ -444,8 +441,9 @@ if(NEED_GLXCONTEXTHANDLER) add_library(MagnumGlxContextHandler OBJECT ${MagnumGlxContextHandler_SRCS} ${MagnumGlxContextHandler_PRIVATE_HEADERS}) + target_include_directories(MagnumGlxContextHandler PUBLIC $) # X11 macros are a mess, disable warnings for C-style casts - set_target_properties(MagnumGlxContextHandler PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast") + target_compile_options(MagnumGlxContextHandler PRIVATE "-Wno-old-style-cast") # Assuming that PIC is not needed because this is part of Application lib, # which is always linked to the executable and not to any intermediate # shared lib @@ -458,8 +456,6 @@ if(NEED_EGLCONTEXTHANDLER) message(FATAL_ERROR "EGL library, required by some contexts, was not found. Set WITH_*EGL*APPLICATION to OFF to skip building them.") endif() - include_directories(${EGL_INCLUDE_DIR}) - set(MagnumEglContextHandler_SRCS Implementation/EglContextHandler.cpp Implementation/Egl.cpp) @@ -471,8 +467,11 @@ if(NEED_EGLCONTEXTHANDLER) add_library(MagnumEglContextHandler OBJECT ${MagnumEglContextHandler_SRCS} ${MagnumEglContextHandler_PRIVATE_HEADERS}) + target_include_directories(MagnumEglContextHandler PUBLIC + $ + $) # X11 macros are a mess, disable warnings for C-style casts - set_target_properties(MagnumEglContextHandler PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast") + target_compile_options(MagnumEglContextHandler PRIVATE "-Wno-old-style-cast") # Assuming that PIC is not needed because this is part of Application lib, # which is always linked to the executable and not to any intermediate # shared lib @@ -502,6 +501,7 @@ endif() # CGL context if(NEED_CGLCONTEXT OR WITH_CGLCONTEXT) add_library(MagnumCglContextObjects OBJECT ${MagnumContext_SRCS}) + target_include_directories(MagnumCglContextObjects PUBLIC $) if(BUILD_STATIC_PIC) set_target_properties(MagnumCglContextObjects PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() @@ -523,8 +523,8 @@ if(NEED_CGLCONTEXT OR WITH_CGLCONTEXT) LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - # Magnum CglContext library for superprojects - set(MAGNUM_CGLCONTEXT_LIBRARY MagnumCglContext CACHE INTERNAL "") + # Magnum CglContext target alias for superprojects + add_library(Magnum::CglContext ALIAS MagnumCglContext) endif() endif() @@ -535,10 +535,11 @@ if(NEED_EGLCONTEXT OR WITH_EGLCONTEXT) message(FATAL_ERROR "EGL library, required by some contexts, was not found. Set WITH_*APPLICATION and/or WITH_EGLCONTEXT to OFF to skip building them.") endif() - include_directories(${EGL_INCLUDE_DIR}) - add_library(MagnumEglContextObjects OBJECT ${MagnumContext_SRCS}) - set_target_properties(MagnumEglContextObjects PROPERTIES COMPILE_DEFINITIONS "MAGNUM_PLATFORM_USE_EGL") + target_include_directories(MagnumEglContextObjects PUBLIC + $ + $) + target_compile_definitions(MagnumEglContextObjects PRIVATE "MAGNUM_PLATFORM_USE_EGL") if(BUILD_STATIC_PIC) set_target_properties(MagnumEglContextObjects PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() @@ -550,22 +551,25 @@ if(NEED_EGLCONTEXT OR WITH_EGLCONTEXT) if(BUILD_STATIC_PIC) set_target_properties(MagnumEglContext PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() - target_link_libraries(MagnumEglContext Magnum) + target_link_libraries(MagnumEglContext Magnum EGL::EGL) install(TARGETS MagnumEglContext RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - # Magnum EglContext library for superprojects - set(MAGNUM_EGLCONTEXT_LIBRARY MagnumEglContext CACHE INTERNAL "") + # Magnum EglContext target alias for superprojects + add_library(Magnum::EglContext ALIAS MagnumEglContext) endif() endif() # GLX context if(NEED_GLXCONTEXT OR WITH_GLXCONTEXT) add_library(MagnumGlxContextObjects OBJECT ${MagnumContext_SRCS}) - set_target_properties(MagnumGlxContextObjects PROPERTIES COMPILE_DEFINITIONS "MAGNUM_PLATFORM_USE_GLX") + target_include_directories(MagnumGlxContextObjects PUBLIC + $ + ${X11_INCLUDE_DIR}) + target_compile_definitions(MagnumGlxContextObjects PRIVATE "MAGNUM_PLATFORM_USE_GLX") if(BUILD_STATIC_PIC) set_target_properties(MagnumGlxContextObjects PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() @@ -577,21 +581,23 @@ if(NEED_GLXCONTEXT OR WITH_GLXCONTEXT) if(BUILD_STATIC_PIC) set_target_properties(MagnumGlxContext PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() - target_link_libraries(MagnumGlxContext Magnum) + target_include_directories(MagnumGlxContext PUBLIC ${X11_INCLUDE_DIR}) + target_link_libraries(MagnumGlxContext Magnum ${X11_LIBRARIES}) install(TARGETS MagnumGlxContext RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - # Magnum GlxContext library for superprojects - set(MAGNUM_GLXCONTEXT_LIBRARY MagnumGlxContext CACHE INTERNAL "") + # Magnum GlxContext target alias for superprojects + add_library(Magnum::GlxContext ALIAS MagnumGlxContext) endif() endif() # WGL context if(NEED_WGLCONTEXT OR WITH_WGLCONTEXT) add_library(MagnumWglContextObjects OBJECT ${MagnumContext_SRCS}) + target_include_directories(MagnumWglContextObjects PUBLIC $) if(BUILD_STATIC_PIC) set_target_properties(MagnumWglContextObjects PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() @@ -610,14 +616,15 @@ if(NEED_WGLCONTEXT OR WITH_WGLCONTEXT) LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - # Magnum WglContext library for superprojects - set(MAGNUM_WGLCONTEXT_LIBRARY MagnumWglContext CACHE INTERNAL "") + # Magnum WglContext target alias for superprojects + add_library(Magnum::WglContext ALIAS MagnumWglContext) endif() endif() # Magnum Info if(WITH_MAGNUMINFO) add_executable(magnum-info magnum-info.cpp) + target_link_libraries(magnum-info Magnum) if(CORRADE_TARGET_APPLE) target_link_libraries(magnum-info MagnumWindowlessCglApplication) elseif(CORRADE_TARGET_NACL) @@ -633,7 +640,6 @@ if(WITH_MAGNUMINFO) else() message(FATAL_ERROR "magnum-info is not available on this platform. Set WITH_MAGNUMINFO to OFF to skip building it.") endif() - target_link_libraries(magnum-info Magnum) install(TARGETS magnum-info DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}) if(CORRADE_TARGET_NACL) @@ -641,6 +647,9 @@ if(WITH_MAGNUMINFO) install(FILES magnum-info-nacl.nmf DESTINATION ${MAGNUM_DATA_INSTALL_DIR} RENAME magnum-info.nmf) list(APPEND MagnumPlatform_FILES magnum-info-nacl.html magnum-info-nacl.nmf) endif() + + # Magnum info target alias for superprojects + add_executable(Magnum::info ALIAS magnum-info) endif() # Force IDEs display also all header files and additional files in project view diff --git a/src/Magnum/Platform/GlutApplication.h b/src/Magnum/Platform/GlutApplication.h index 718f8a153..bedc3d1ff 100644 --- a/src/Magnum/Platform/GlutApplication.h +++ b/src/Magnum/Platform/GlutApplication.h @@ -71,12 +71,10 @@ See @ref cmake for more information. ## General usage -In CMake you need to request `GlutApplication` component, add -`${MAGNUM_GLUTAPPLICATION_INCLUDE_DIRS}` to include path and link to -`${MAGNUM_GLUTAPPLICATION_LIBRARIES}`. If no other application is requested, -you can also use generic `${MAGNUM_APPLICATION_INCLUDE_DIRS}` and -`${MAGNUM_APPLICATION_LIBRARIES}` aliases to simplify porting. Again, see -@ref building and @ref cmake for more information. +In CMake you need to request `GlutApplication` component of `Magnum` package +and link to `Magnum::GlutApplication` target. If no other application is +requested, you can also use 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 `main()` -- see diff --git a/src/Magnum/Platform/GlxApplication.h b/src/Magnum/Platform/GlxApplication.h index 26b52f975..674677ed4 100644 --- a/src/Magnum/Platform/GlxApplication.h +++ b/src/Magnum/Platform/GlxApplication.h @@ -52,11 +52,9 @@ more information. ## General usage -In CMake you need to request `GlxApplication` component, add -`${MAGNUM_GLXAPPLICATION_INCLUDE_DIRS}` to include path and link to -`${MAGNUM_GLXAPPLICATION_LIBRARIES}`. If no other application is requested, you -can also use generic `${MAGNUM_APPLICATION_INCLUDE_DIRS}` and -`${MAGNUM_APPLICATION_LIBRARIES}` aliases to simplify porting. See +In CMake you need to request `GlxApplication` component of `Magnum` package and +link to `Magnum::GlxApplication` target. If no other application is requested, +you can also use generic `Magnum::Application` alias to simplify porting. 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 diff --git a/src/Magnum/Platform/NaClApplication.h b/src/Magnum/Platform/NaClApplication.h index 5cd9beae3..352c8f2de 100644 --- a/src/Magnum/Platform/NaClApplication.h +++ b/src/Magnum/Platform/NaClApplication.h @@ -119,11 +119,9 @@ You can then open `MyApplication` through your webserver in Chrome (e.g. For CMake you need to copy `FindOpenGLES2.cmake` from `modules/` directory in Magnum source to `modules/` dir in your project (so it is able to find OpenGL -ES). Request `NaClApplication` component, add -`${MAGNUM_NACLAPPLICATION_INCLUDE_DIRS}` to include path and link to -`${MAGNUM_NACLAPPLICATION_LIBRARIES}`. If no other application is requested, -you can also use generic `${MAGNUM_APPLICATION_INCLUDE_DIRS}` and -`${MAGNUM_APPLICATION_LIBRARIES}` aliases to simplify porting. Again, see +ES). Request `NaClApplication` component of `Magnum` package and link to +`Magnum::NaClApplication` target. If no other application is requested, you can +also use 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 diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index 42c183fd3..7f39f7086 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -169,10 +169,9 @@ final package along with a PowerShell script for easy local installation. For CMake you need to copy `FindSDL2.cmake` from `modules/` directory in Magnum source to `modules/` dir in your project (so it is able to find SDL2). In case of Emscripten you need also `FindOpenGLES2.cmake`. Request -`Sdl2Application` component, add `${MAGNUM_SDL2APPLICATION_INCLUDE_DIRS}` -to include path and link to `${MAGNUM_SDL2APPLICATION_LIBRARIES}`. If no other -application is requested, you can also use generic `${MAGNUM_APPLICATION_INCLUDE_DIRS}` -and `${MAGNUM_APPLICATION_LIBRARIES}` aliases to simplify porting. Again, see +`Sdl2Application` component of `Magnum` package and link to +`Magnum::Sdl2Application` target. If no other application is requested, you can +also use 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 diff --git a/src/Magnum/Platform/WindowlessGlxApplication.h b/src/Magnum/Platform/WindowlessGlxApplication.h index 963f02742..bdc2d9ee2 100644 --- a/src/Magnum/Platform/WindowlessGlxApplication.h +++ b/src/Magnum/Platform/WindowlessGlxApplication.h @@ -76,13 +76,11 @@ See @ref cmake for more information. ## General usage -In CMake you need to request `WindowlessGlxApplication` component, add -`${MAGNUM_WINDOWLESSGLXAPPLICATION_INCLUDE_DIRS}` to include path and link to -`${MAGNUM_WINDOWLESSGLXAPPLICATION_LIBRARIES}`. If no other windowless -application is requested, you can also use generic -`${MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS}` and -`${MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES}` aliases to simplify porting. Again, -see @ref building and @ref cmake for more information. +In CMake you need to request `WindowlessGlxApplication` component of `Magnum` +package and link to `Magnum::WindowlessGlxApplication` target. If no other +windowless application is requested, you can also use generic +`Magnum::WindowlessApplication` alias to simplify porting. Again, see +@ref building and @ref cmake for more information. Place your code into @ref exec(). The subclass can be then used directly in `main()` -- see convenience macro @ref MAGNUM_WINDOWLESSGLXAPPLICATION_MAIN(). diff --git a/src/Magnum/Platform/WindowlessWglApplication.h b/src/Magnum/Platform/WindowlessWglApplication.h index 610e670b1..d5cfd2545 100644 --- a/src/Magnum/Platform/WindowlessWglApplication.h +++ b/src/Magnum/Platform/WindowlessWglApplication.h @@ -77,13 +77,11 @@ See @ref cmake for more information. ## General usage -In CMake you need to request `WindowlessWglApplication` component, add -`${MAGNUM_WINDOWLESSWGLAPPLICATION_INCLUDE_DIRS}` to include path and link to -`${MAGNUM_WINDOWLESSWGLAPPLICATION_LIBRARIES}`. If no other windowless -application is requested, you can also use generic -`${MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS}` and -`${MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES}` aliases to simplify porting. Again, -see @ref building and @ref cmake for more information. +In CMake you need to request `WindowlessWglApplication` component of `Magnum` +package and link to `Magnum::WindowlessWglApplication` target. If no other +windowless application is requested, you can also use generic +`Magnum::WindowlessApplication` alias to simplify porting. Again, see +@ref building and @ref cmake for more information. Place your code into @ref exec(). The subclass can be then used in main function using @ref MAGNUM_WINDOWLESSWGLAPPLICATION_MAIN() macro. See diff --git a/src/Magnum/Platform/WindowlessWindowsEglApplication.h b/src/Magnum/Platform/WindowlessWindowsEglApplication.h index 78dd221ae..3910d8be1 100644 --- a/src/Magnum/Platform/WindowlessWindowsEglApplication.h +++ b/src/Magnum/Platform/WindowlessWindowsEglApplication.h @@ -72,13 +72,11 @@ See @ref cmake for more information. ## General usage -In CMake you need to request `WindowlessWindowsEglApplication` component, add -`${MAGNUM_WINDOWLESSWINDOWSEGLAPPLICATION_INCLUDE_DIRS}` to include path and -link to `${MAGNUM_WINDOWLESSWINDOWSEGLAPPLICATION_LIBRARIES}`. If no other -windowless application is requested, you can also use generic -`${MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS}` and -`${MAGNUM_WINDOWLESSAPPLICATION_LIBRARIES}` aliases to simplify porting. Again, -see @ref building and @ref cmake for more information. +In CMake you need to request `WindowlessWindowsEglApplication` component of +`Magnum` package and link to `Magnum::WindowlessWindowsEglApplication` target. +If no other windowless application is requested, you can also use generic +`Magnum::WindowlessApplication` alias to simplify porting. Again, see +@ref building and @ref cmake for more information. Place your code into @ref exec(). The subclass can be then used in main function using @ref MAGNUM_WINDOWLESSWINDOWSEGLAPPLICATION_MAIN() macro. See diff --git a/src/Magnum/Platform/XEglApplication.h b/src/Magnum/Platform/XEglApplication.h index d96c4fbab..8244c6db4 100644 --- a/src/Magnum/Platform/XEglApplication.h +++ b/src/Magnum/Platform/XEglApplication.h @@ -53,10 +53,9 @@ more information. For CMake you need to copy `FindEGL.cmake` from `modules/` directory in Magnum source to `modules/` dir in your project (so it is able to find EGL), request -`XEglApplication` component, add `${MAGNUM_XEGLAPPLICATION_INCLUDE_DIRS}` to -include path and link to `${MAGNUM_XEGLAPPLICATION_LIBRARIES}`. If no other -application is requested, you can also use generic `${MAGNUM_APPLICATION_INCLUDE_DIRS}` -and `${MAGNUM_APPLICATION_LIBRARIES}` aliases to simplify porting. See +`XEglApplication` component of `Magnum` package and link to +`Magnum::XEglApplication` target. If no other application is requested, you +can also use generic `Magnum::Application` alias to simplify porting. 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 diff --git a/src/Magnum/Primitives/CMakeLists.txt b/src/Magnum/Primitives/CMakeLists.txt index a83344a2d..5f38603aa 100644 --- a/src/Magnum/Primitives/CMakeLists.txt +++ b/src/Magnum/Primitives/CMakeLists.txt @@ -66,7 +66,6 @@ set_target_properties(MagnumPrimitives PROPERTIES DEBUG_POSTFIX "-d") if(BUILD_STATIC_PIC) set_target_properties(MagnumPrimitives PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() - target_link_libraries(MagnumPrimitives Magnum) install(TARGETS MagnumPrimitives @@ -79,5 +78,5 @@ if(BUILD_TESTS) add_subdirectory(Test) endif() -# Magnum Primitives library for superprojects -set(MAGNUM_PRIMITIVES_LIBRARY MagnumPrimitives CACHE INTERNAL "") +# Magnum Primitives target alias for superprojects +add_library(Magnum::Primitives ALIAS MagnumPrimitives) diff --git a/src/Magnum/SceneGraph/CMakeLists.txt b/src/Magnum/SceneGraph/CMakeLists.txt index 8240cd655..80ff2cafb 100644 --- a/src/Magnum/SceneGraph/CMakeLists.txt +++ b/src/Magnum/SceneGraph/CMakeLists.txt @@ -79,8 +79,9 @@ endif() add_library(MagnumSceneGraphObjects OBJECT ${MagnumSceneGraph_SRCS} ${MagnumSceneGraph_HEADERS}) +target_include_directories(MagnumSceneGraphObjects PUBLIC $) if(NOT BUILD_STATIC) - set_target_properties(MagnumSceneGraphObjects PROPERTIES COMPILE_FLAGS "-DMagnumSceneGraphObjects_EXPORTS") + target_compile_definitions(MagnumSceneGraphObjects PRIVATE "MagnumSceneGraphObjects_EXPORTS") endif() if(NOT BUILD_STATIC OR BUILD_STATIC_PIC) set_target_properties(MagnumSceneGraphObjects PROPERTIES POSITION_INDEPENDENT_CODE ON) @@ -94,7 +95,6 @@ set_target_properties(MagnumSceneGraph PROPERTIES DEBUG_POSTFIX "-d") if(BUILD_STATIC_PIC) set_target_properties(MagnumSceneGraph PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() - target_link_libraries(MagnumSceneGraph Magnum) install(TARGETS MagnumSceneGraph @@ -108,9 +108,9 @@ if(BUILD_TESTS) add_library(MagnumSceneGraphTestLib ${SHARED_OR_STATIC} $ ${MagnumSceneGraph_GracefulAssert_SRCS}) - set_target_properties(MagnumSceneGraphTestLib PROPERTIES - COMPILE_FLAGS "-DCORRADE_GRACEFUL_ASSERT -DMagnumSceneGraph_EXPORTS" - DEBUG_POSTFIX "-d") + set_target_properties(MagnumSceneGraphTestLib PROPERTIES DEBUG_POSTFIX "-d") + target_compile_definitions(MagnumSceneGraphTestLib PRIVATE + "CORRADE_GRACEFUL_ASSERT" "MagnumSceneGraph_EXPORTS") target_link_libraries(MagnumSceneGraphTestLib MagnumMathTestLib) # On Windows we need to install first and then run the tests to avoid "DLL @@ -125,5 +125,5 @@ if(BUILD_TESTS) add_subdirectory(Test) endif() -# Magnum SceneGraph library for superprojects -set(MAGNUM_SCENEGRAPH_LIBRARY MagnumSceneGraph CACHE INTERNAL "") +# Magnum SceneGraph target alias for superprojects +add_library(Magnum::SceneGraph ALIAS MagnumSceneGraph) diff --git a/src/Magnum/SceneGraph/Test/CMakeLists.txt b/src/Magnum/SceneGraph/Test/CMakeLists.txt index aa7b7241a..4f4d7f48c 100644 --- a/src/Magnum/SceneGraph/Test/CMakeLists.txt +++ b/src/Magnum/SceneGraph/Test/CMakeLists.txt @@ -35,9 +35,10 @@ corrade_add_test(SceneGraphRigidMatrixTrans___3DTest RigidMatrixTransformation3D corrade_add_test(SceneGraphSceneTest SceneTest.cpp LIBRARIES MagnumSceneGraph) corrade_add_test(SceneGraphTranslationTransfo___Test TranslationTransformationTest.cpp LIBRARIES MagnumSceneGraph) -set_target_properties(SceneGraphDualComplexTransfo___Test +set_property(TARGET + SceneGraphDualComplexTransfo___Test SceneGraphDualQuaternionTran___Test SceneGraphRigidMatrixTrans___2DTest SceneGraphRigidMatrixTrans___3DTest SceneGraphTranslationTransfo___Test - PROPERTIES COMPILE_FLAGS "-DCORRADE_GRACEFUL_ASSERT") + PROPERTY COMPILE_DEFINITIONS "CORRADE_GRACEFUL_ASSERT") diff --git a/src/Magnum/Shaders/CMakeLists.txt b/src/Magnum/Shaders/CMakeLists.txt index 9db9aad8f..75b5b1b25 100644 --- a/src/Magnum/Shaders/CMakeLists.txt +++ b/src/Magnum/Shaders/CMakeLists.txt @@ -61,7 +61,6 @@ set_target_properties(MagnumShaders PROPERTIES DEBUG_POSTFIX "-d") if(BUILD_STATIC_PIC) set_target_properties(MagnumShaders PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() - target_link_libraries(MagnumShaders Magnum) install(TARGETS MagnumShaders @@ -75,4 +74,4 @@ if(BUILD_TESTS) endif() # Magnum Shaders library for superprojects -set(MAGNUM_SHADERS_LIBRARY MagnumShaders CACHE INTERNAL "") +add_library(Magnum::Shaders ALIAS MagnumShaders) diff --git a/src/Magnum/Shapes/CMakeLists.txt b/src/Magnum/Shapes/CMakeLists.txt index 5bcaeb535..c2c5bf0d2 100644 --- a/src/Magnum/Shapes/CMakeLists.txt +++ b/src/Magnum/Shapes/CMakeLists.txt @@ -73,7 +73,6 @@ set_target_properties(MagnumShapes PROPERTIES DEBUG_POSTFIX "-d") if(BUILD_STATIC_PIC) set_target_properties(MagnumShapes PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() - target_link_libraries(MagnumShapes Magnum MagnumSceneGraph) install(TARGETS MagnumShapes @@ -86,5 +85,5 @@ if(BUILD_TESTS) add_subdirectory(Test) endif() -# Magnum Shapes library for superprojects -set(MAGNUM_SHAPES_LIBRARY MagnumShapes CACHE INTERNAL "") +# Magnum Shapes target alias for superprojects +add_library(Magnum::Shapes ALIAS MagnumShapes) diff --git a/src/Magnum/Test/CMakeLists.txt b/src/Magnum/Test/CMakeLists.txt index 248f64f81..a2bca782f 100644 --- a/src/Magnum/Test/CMakeLists.txt +++ b/src/Magnum/Test/CMakeLists.txt @@ -24,7 +24,7 @@ # corrade_add_test(AbstractShaderProgramTest AbstractShaderProgramTest.cpp LIBRARIES Magnum) -corrade_add_test(ArrayTest ArrayTest.cpp) +corrade_add_test(ArrayTest ArrayTest.cpp LIBRARIES Magnum) corrade_add_test(FormatTest FormatTest.cpp LIBRARIES Magnum) corrade_add_test(ContextTest ContextTest.cpp LIBRARIES Magnum) corrade_add_test(DebugOutputTest DebugOutputTest.cpp LIBRARIES Magnum) @@ -36,15 +36,16 @@ corrade_add_test(MeshTest MeshTest.cpp LIBRARIES Magnum) corrade_add_test(PixelStorageTest PixelStorageTest.cpp LIBRARIES Magnum) corrade_add_test(RendererTest RendererTest.cpp LIBRARIES Magnum) corrade_add_test(ResourceManagerTest ResourceManagerTest.cpp LIBRARIES Magnum) +target_compile_definitions(ResourceManagerTest PRIVATE "CORRADE_GRACEFUL_ASSERT") corrade_add_test(SamplerTest SamplerTest.cpp LIBRARIES Magnum) corrade_add_test(ShaderTest ShaderTest.cpp LIBRARIES Magnum) corrade_add_test(VersionTest VersionTest.cpp LIBRARIES Magnum) -corrade_add_test(TagsTest TagsTest.cpp) +corrade_add_test(TagsTest TagsTest.cpp LIBRARIES Magnum) add_library(ResourceManagerLocalInstanceTestLib ${SHARED_OR_STATIC} ResourceManagerLocalInstanceTestLib.cpp) target_link_libraries(ResourceManagerLocalInstanceTestLib Magnum) if(NOT BUILD_STATIC) - set_target_properties(ResourceManagerLocalInstanceTestLib PROPERTIES COMPILE_FLAGS "-DResourceManagerLocalInstanceTestLib_EXPORTS") + target_compile_definitions(ResourceManagerLocalInstanceTestLib PRIVATE "ResourceManagerLocalInstanceTestLib_EXPORTS") endif() corrade_add_test(ResourceManagerLocalInstanceTest ResourceManagerLocalInstanceTest.cpp LIBRARIES Magnum ResourceManagerLocalInstanceTestLib) @@ -72,8 +73,8 @@ if(BUILD_GL_TESTS) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/configure.h) - include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) corrade_add_test(ShaderGLTest ShaderGLTest.cpp LIBRARIES ${GL_TEST_LIBRARIES}) + target_include_directories(ShaderGLTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) if(NOT MAGNUM_TARGET_GLES2) corrade_add_test(BufferImageGLTest BufferImageGLTest.cpp LIBRARIES ${GL_TEST_LIBRARIES}) @@ -89,5 +90,3 @@ if(BUILD_GL_TESTS) corrade_add_test(RectangleTextureGLTest RectangleTextureGLTest.cpp LIBRARIES ${GL_TEST_LIBRARIES}) endif() endif() - -set_target_properties(ResourceManagerTest PROPERTIES COMPILE_FLAGS -DCORRADE_GRACEFUL_ASSERT) diff --git a/src/Magnum/Text/CMakeLists.txt b/src/Magnum/Text/CMakeLists.txt index 3d0a26061..7c6579de9 100644 --- a/src/Magnum/Text/CMakeLists.txt +++ b/src/Magnum/Text/CMakeLists.txt @@ -48,7 +48,6 @@ set_target_properties(MagnumText PROPERTIES DEBUG_POSTFIX "-d") if(BUILD_STATIC_PIC) set_target_properties(MagnumText PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() - target_link_libraries(MagnumText Magnum MagnumTextureTools) install(TARGETS MagnumText @@ -61,26 +60,28 @@ if(WITH_FONTCONVERTER) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fontconverterConfigure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/fontconverterConfigure.h) - include_directories(${CMAKE_CURRENT_BINARY_DIR}) - add_executable(magnum-fontconverter fontconverter.cpp) - + target_include_directories(magnum-fontconverter PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries(magnum-fontconverter Magnum MagnumText) if(CORRADE_TARGET_APPLE) - target_link_libraries(magnum-fontconverter MagnumText MagnumWindowlessCglApplication) + target_link_libraries(magnum-fontconverter MagnumWindowlessCglApplication) elseif(CORRADE_TARGET_UNIX AND NOT TARGET_GLES) - target_link_libraries(magnum-fontconverter MagnumText MagnumWindowlessGlxApplication) + target_link_libraries(magnum-fontconverter MagnumWindowlessGlxApplication) elseif(CORRADE_TARGET_WINDOWS AND NOT TARGET_GLES) - target_link_libraries(magnum-fontconverter MagnumText MagnumWindowlessWglApplication) + target_link_libraries(magnum-fontconverter MagnumWindowlessWglApplication) else() message(FATAL_ERROR "magnum-fontconverter is not available on this platform. Set WITH_FONTCONVERTER to OFF to suppress this warning.") endif() install(TARGETS magnum-fontconverter DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}) + + # Magnum fontconverter target alias for superprojects + add_executable(Magnum::fontconverter ALIAS magnum-fontconverter) endif() if(BUILD_TESTS) add_subdirectory(Test) endif() -# Magnum Text library for superprojects -set(MAGNUM_TEXT_LIBRARY MagnumText CACHE INTERNAL "") +# Magnum Text target alias for superprojects +add_library(Magnum::Text ALIAS MagnumText) diff --git a/src/Magnum/Text/Test/CMakeLists.txt b/src/Magnum/Text/Test/CMakeLists.txt index 580d3d9b2..1fe654601 100644 --- a/src/Magnum/Text/Test/CMakeLists.txt +++ b/src/Magnum/Text/Test/CMakeLists.txt @@ -26,10 +26,10 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/configure.h) -include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) - corrade_add_test(TextAbstractFontTest AbstractFontTest.cpp LIBRARIES Magnum MagnumText) +target_include_directories(TextAbstractFontTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) corrade_add_test(TextAbstractFontConverterTest AbstractFontConverterTest.cpp LIBRARIES Magnum MagnumText) +target_include_directories(TextAbstractFontConverterTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) corrade_add_test(TextAbstractLayouterTest AbstractLayouterTest.cpp LIBRARIES Magnum MagnumText) if(BUILD_GL_TESTS) diff --git a/src/Magnum/TextureTools/CMakeLists.txt b/src/Magnum/TextureTools/CMakeLists.txt index ae14fb1ce..bb74b0957 100644 --- a/src/Magnum/TextureTools/CMakeLists.txt +++ b/src/Magnum/TextureTools/CMakeLists.txt @@ -44,28 +44,29 @@ set_target_properties(MagnumTextureTools PROPERTIES DEBUG_POSTFIX "-d") if(BUILD_STATIC_PIC) set_target_properties(MagnumTextureTools PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() - target_link_libraries(MagnumTextureTools Magnum) if(WITH_DISTANCEFIELDCONVERTER) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/distancefieldconverterConfigure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/distancefieldconverterConfigure.h) - include_directories(${CMAKE_CURRENT_BINARY_DIR}) - add_executable(magnum-distancefieldconverter distancefieldconverter.cpp) - + target_include_directories(magnum-distancefieldconverter PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries(magnum-distancefieldconverter Magnum MagnumTextureTools) if(CORRADE_TARGET_APPLE) - target_link_libraries(magnum-distancefieldconverter MagnumTextureTools MagnumWindowlessCglApplication) + target_link_libraries(magnum-distancefieldconverter MagnumWindowlessCglApplication) elseif(CORRADE_TARGET_UNIX AND NOT TARGET_GLES) - target_link_libraries(magnum-distancefieldconverter MagnumTextureTools Magnum MagnumWindowlessGlxApplication) + target_link_libraries(magnum-distancefieldconverter MagnumWindowlessGlxApplication) elseif(CORRADE_TARGET_WINDOWS AND NOT TARGET_GLES) - target_link_libraries(magnum-distancefieldconverter MagnumTextureTools MagnumWindowlessWglApplication) + target_link_libraries(magnum-distancefieldconverter MagnumWindowlessWglApplication) else() message(FATAL_ERROR "magnum-distancefieldconverter is not available on this platform. Set WITH_DISTANCEFIELDCONVERTER to OFF to suppress this warning.") endif() install(TARGETS magnum-distancefieldconverter DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}) + + # Magnum distancefieldconverter target alias for superprojects + add_executable(Magnum::distancefieldconverter ALIAS magnum-distancefieldconverter) endif() install(TARGETS MagnumTextureTools @@ -78,5 +79,5 @@ if(BUILD_TESTS) add_subdirectory(Test) endif() -# Magnum TextureTools library for superprojects -set(MAGNUM_TEXTURETOOLS_LIBRARY MagnumTextureTools CACHE INTERNAL "") +# Magnum TextureTools target alias for superprojects +add_library(Magnum::TextureTools ALIAS MagnumTextureTools) diff --git a/src/Magnum/Trade/Test/CMakeLists.txt b/src/Magnum/Trade/Test/CMakeLists.txt index 5e2a1ed27..ffe52e9c9 100644 --- a/src/Magnum/Trade/Test/CMakeLists.txt +++ b/src/Magnum/Trade/Test/CMakeLists.txt @@ -26,10 +26,10 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/configure.h) -include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) - corrade_add_test(TradeAbstractImageConverterTest AbstractImageConverterTest.cpp LIBRARIES Magnum) +target_include_directories(TradeAbstractImageConverterTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) corrade_add_test(TradeAbstractImporterTest AbstractImporterTest.cpp LIBRARIES Magnum) +target_include_directories(TradeAbstractImporterTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) corrade_add_test(TradeAbstractMaterialDataTest AbstractMaterialDataTest.cpp LIBRARIES Magnum) corrade_add_test(TradeImageDataTest ImageDataTest.cpp LIBRARIES Magnum) corrade_add_test(TradeObjectData2DTest ObjectData2DTest.cpp LIBRARIES Magnum) diff --git a/src/MagnumExternal/OpenGL/GL/CMakeLists.txt b/src/MagnumExternal/OpenGL/GL/CMakeLists.txt index fea1eb959..045c58921 100644 --- a/src/MagnumExternal/OpenGL/GL/CMakeLists.txt +++ b/src/MagnumExternal/OpenGL/GL/CMakeLists.txt @@ -25,11 +25,10 @@ # flextGLPlatform.cpp is compiled as part of Magnum*Context libraries in Platform add_library(MagnumFlextGLObjects OBJECT flextGL.cpp) +target_include_directories(MagnumFlextGLObjects PUBLIC $) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Clang") - set_target_properties(MagnumFlextGLObjects PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -DFlextGL_EXPORTS") -else() - set_target_properties(MagnumFlextGLObjects PROPERTIES COMPILE_FLAGS "-DFlextGL_EXPORTS") +if(NOT BUILD_STATIC) + target_compile_definitions(MagnumFlextGLObjects PRIVATE "FlextGL_EXPORTS") endif() if(NOT BUILD_STATIC OR BUILD_STATIC_PIC) set_target_properties(MagnumFlextGLObjects PROPERTIES POSITION_INDEPENDENT_CODE ON) diff --git a/src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt b/src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt index b2db05953..56d3cb0fd 100644 --- a/src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt +++ b/src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt @@ -27,11 +27,10 @@ if(NOT CORRADE_TARGET_NACL AND NOT CORRADE_TARGET_EMSCRIPTEN) # flextGLPlatform.cpp is compiled as part of Magnum*Context libraries in Platform add_library(MagnumFlextGLObjects OBJECT flextGL.cpp) + target_include_directories(MagnumFlextGLObjects PUBLIC $) - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Clang") - set_target_properties(MagnumFlextGLObjects PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -DFlextGL_EXPORTS") - else() - set_target_properties(MagnumFlextGLObjects PROPERTIES COMPILE_FLAGS "-DFlextGL_EXPORTS") + if(NOT BUILD_STATIC) + target_compile_definitions(MagnumFlextGLObjects PRIVATE "FlextGL_EXPORTS") endif() if(NOT BUILD_STATIC OR BUILD_STATIC_PIC) set_target_properties(MagnumFlextGLObjects PROPERTIES POSITION_INDEPENDENT_CODE ON) diff --git a/src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt b/src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt index f08212d95..0cd6050e3 100644 --- a/src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt +++ b/src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt @@ -25,11 +25,10 @@ # flextGLPlatform.cpp is compiled as part of Magnum*Context libraries in Platform add_library(MagnumFlextGLObjects OBJECT flextGL.cpp) +target_include_directories(MagnumFlextGLObjects PUBLIC $) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Clang") - set_target_properties(MagnumFlextGLObjects PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -DFlextGL_EXPORTS") -else() - set_target_properties(MagnumFlextGLObjects PROPERTIES COMPILE_FLAGS "-DFlextGL_EXPORTS") +if(NOT BUILD_STATIC) + target_compile_definitions(MagnumFlextGLObjects PRIVATE "FlextGL_EXPORTS") endif() if(NOT BUILD_STATIC OR BUILD_STATIC_PIC) set_target_properties(MagnumFlextGLObjects PROPERTIES POSITION_INDEPENDENT_CODE ON) diff --git a/src/MagnumPlugins/MagnumFont/CMakeLists.txt b/src/MagnumPlugins/MagnumFont/CMakeLists.txt index 1ed54ac21..a5cab2251 100644 --- a/src/MagnumPlugins/MagnumFont/CMakeLists.txt +++ b/src/MagnumPlugins/MagnumFont/CMakeLists.txt @@ -33,6 +33,7 @@ set(MagnumFont_HEADERS add_library(MagnumFontObjects OBJECT ${MagnumFont_SRCS} ${MagnumFont_HEADERS}) +target_include_directories(MagnumFontObjects PUBLIC $) if(NOT BUILD_PLUGINS_STATIC OR BUILD_STATIC_PIC) set_target_properties(MagnumFontObjects PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() @@ -62,7 +63,7 @@ if(BUILD_GL_TESTS) add_library(MagnumMagnumFontTestLib STATIC ${MagnumFont_SRCS} ${MagnumFont_HEADERS}) - set_target_properties(MagnumMagnumFontTestLib PROPERTIES COMPILE_FLAGS "-DMAGNUM_TGAIMPORTER_BUILD_STATIC") + target_compile_definitions(MagnumMagnumFontTestLib PRIVATE "MAGNUM_TGAIMPORTER_BUILD_STATIC") else() add_library(MagnumMagnumFontTestLib STATIC $) endif() @@ -71,5 +72,5 @@ if(BUILD_GL_TESTS) add_subdirectory(Test) endif() -# Magnum MagnumFont library for superprojects -set(MAGNUM_MAGNUMFONT_LIBRARY MagnumFont CACHE INTERNAL "") +# Magnum MagnumFont target alias for superprojects +add_library(Magnum::MagnumFont ALIAS MagnumFont) diff --git a/src/MagnumPlugins/MagnumFont/MagnumFont.h b/src/MagnumPlugins/MagnumFont/MagnumFont.h index bab42fd40..ee46d9389 100644 --- a/src/MagnumPlugins/MagnumFont/MagnumFont.h +++ b/src/MagnumPlugins/MagnumFont/MagnumFont.h @@ -42,8 +42,8 @@ built if `WITH_MAGNUMFONT` is enabled when building Magnum. To use dynamic plugin, you need to load `MagnumFont` plugin from `MAGNUM_PLUGINS_FONT_DIR`. To use static plugin or use this as a dependency of another plugin, you need to request `MagnumFont` component of `Magnum` package in CMake and link to -`${MAGNUM_MAGNUMFONT_LIBRARIES}`. See @ref building, @ref cmake and -@ref plugins for more information. +`Magnum::MagnumFont` target. See @ref building, @ref cmake and @ref plugins for +more information. The font consists of two files, one text file containing character and glyph info and one TGA file containing the glyphs in distance field format. The font diff --git a/src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt b/src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt index ea9242741..3b0a411d9 100644 --- a/src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt +++ b/src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt @@ -26,6 +26,5 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/configure.h) -include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) - corrade_add_test(MagnumFontGLTest MagnumFontGLTest.cpp LIBRARIES MagnumMagnumFontTestLib ${GL_TEST_LIBRARIES}) +target_include_directories(MagnumFontGLTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt b/src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt index 2d5a7fd43..7f2a5661b 100644 --- a/src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt +++ b/src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt @@ -33,6 +33,7 @@ set(MagnumFontConverter_HEADERS add_library(MagnumFontConverterObjects OBJECT ${MagnumFontConverter_SRCS} ${MagnumFontConverter_HEADERS}) +target_include_directories(MagnumFontConverterObjects PUBLIC $) if(NOT BUILD_PLUGINS_STATIC OR BUILD_STATIC_PIC) set_target_properties(MagnumFontConverterObjects PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() @@ -62,7 +63,7 @@ if(BUILD_GL_TESTS) add_library(MagnumMagnumFontConverterTestLib STATIC ${MagnumFontConverter_SRCS} ${MagnumFontConverter_HEADERS}) - set_target_properties(MagnumMagnumFontConverterTestLib PROPERTIES COMPILE_FLAGS "-DMAGNUM_TGAIMAGECONVERTER_BUILD_STATIC") + target_compile_definitions(MagnumMagnumFontConverterTestLib PRIVATE "MAGNUM_TGAIMAGECONVERTER_BUILD_STATIC") else() add_library(MagnumMagnumFontConverterTestLib STATIC $) endif() @@ -71,5 +72,5 @@ if(BUILD_GL_TESTS) add_subdirectory(Test) endif() -# Magnum MagnumFontConverter library for superprojects -set(MAGNUM_MAGNUMFONTCONVERTER_LIBRARY MagnumFontConverter CACHE INTERNAL "") +# Magnum MagnumFontConverter target alias for superprojects +add_library(Magnum::MagnumFontConverter ALIAS MagnumFontConverter) diff --git a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.h b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.h index 6aa6603f5..4f6595db2 100644 --- a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.h +++ b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.h @@ -46,9 +46,8 @@ to read back the generated data. It depends on plugin, you need to load `MagnumFontConverter` plugin from `MAGNUM_PLUGINS_FONTCONVERTER_DIR`. To use static plugin or use this as a dependency of another plugin, you need to request `MagnumFontConverter` -component of `Magnum` package in CMake and link to -`${MAGNUM_MAGNUMFONTCONVERTER_LIBRARIES}`. See @ref building, @ref cmake and -@ref plugins for more information. +component of `Magnum` package in CMake and link to `Magnum::MagnumFontConverter` +target. See @ref building, @ref cmake and @ref plugins for more information. */ class MagnumFontConverter: public Text::AbstractFontConverter { public: diff --git a/src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt b/src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt index 5ff4773ec..2e859b71b 100644 --- a/src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt @@ -26,17 +26,16 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/configure.h) -include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) - corrade_add_test(MagnumFontConverterGLTest MagnumFontConverterGLTest.cpp LIBRARIES MagnumMagnumFontConverterTestLib MagnumTgaImporterTestLib ${GL_TEST_LIBRARIES}) +target_include_directories(MagnumFontConverterGLTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) # On Win32 we need to avoid dllimporting TgaImporter symbols, because it would # search for the symbols in some DLL even though they were linked statically. # However it apparently doesn't matter that they were dllexported when building # the static library. EH. if(WIN32) - set_target_properties(MagnumFontConverterGLTest PROPERTIES COMPILE_FLAGS "-DMAGNUM_TGAIMPORTER_BUILD_STATIC") + target_compile_definitions(MagnumFontConverterGLTest PRIVATE "MAGNUM_TGAIMPORTER_BUILD_STATIC") endif() diff --git a/src/MagnumPlugins/ObjImporter/CMakeLists.txt b/src/MagnumPlugins/ObjImporter/CMakeLists.txt index 616459c7b..8973e22c2 100644 --- a/src/MagnumPlugins/ObjImporter/CMakeLists.txt +++ b/src/MagnumPlugins/ObjImporter/CMakeLists.txt @@ -33,6 +33,7 @@ set(ObjImporter_HEADERS add_library(ObjImporterObjects OBJECT ${ObjImporter_SRCS} ${ObjImporter_HEADERS}) +target_include_directories(ObjImporterObjects PUBLIC $) if(NOT BUILD_PLUGINS_STATIC OR BUILD_STATIC_PIC) set_target_properties(ObjImporterObjects PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() @@ -45,7 +46,6 @@ add_plugin(ObjImporter ${MAGNUM_PLUGINS_IMPORTER_DEBUG_INSTALL_DIR} ${MAGNUM_PLU if(BUILD_STATIC_PIC) set_target_properties(ObjImporter PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() - target_link_libraries(ObjImporter Magnum MagnumMeshTools) install(FILES ${ObjImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/ObjImporter) @@ -57,4 +57,4 @@ if(BUILD_TESTS) endif() # Magnum ObjImporter library for superprojects -set(MAGNUM_OBJIMPORTER_LIBRARY ObjImporter CACHE INTERNAL "") +add_library(Magnum:::ObjImporter ALIAS ObjImporter) diff --git a/src/MagnumPlugins/ObjImporter/ObjImporter.h b/src/MagnumPlugins/ObjImporter/ObjImporter.h index a6132ba7b..29d150f16 100644 --- a/src/MagnumPlugins/ObjImporter/ObjImporter.h +++ b/src/MagnumPlugins/ObjImporter/ObjImporter.h @@ -48,8 +48,8 @@ This plugin is built if `WITH_OBJIMPORTER` is enabled when building Magnum. To use dynamic plugin, you need to load `ObjImporter` plugin from `MAGNUM_PLUGINS_IMPORTER_DIR`. To use static plugin or use this as a dependency of another plugin, you need to request `ObjImporter` component of `Magnum` -package in CMake and link to `${MAGNUM_OBJIMPORTER_LIBRARIES}`. See -@ref building, @ref cmake and @ref plugins for more information. +package in CMake and link to `Magnum::ObjImporter` target. See @ref building, +@ref cmake and @ref plugins for more information. */ class ObjImporter: public AbstractImporter { public: diff --git a/src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt b/src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt index e0a2228a1..134e83d4d 100644 --- a/src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt @@ -26,6 +26,5 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/configure.h) -include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) - corrade_add_test(ObjImporterTest Test.cpp LIBRARIES MagnumObjImporterTestLib) +target_include_directories(ObjImporterTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/MagnumPlugins/TgaImageConverter/CMakeLists.txt b/src/MagnumPlugins/TgaImageConverter/CMakeLists.txt index 0a4e62ff8..2895f4618 100644 --- a/src/MagnumPlugins/TgaImageConverter/CMakeLists.txt +++ b/src/MagnumPlugins/TgaImageConverter/CMakeLists.txt @@ -40,8 +40,9 @@ set(TgaImageConverter_HEADERS add_library(TgaImageConverterObjects OBJECT ${TgaImageConverter_SRCS} ${TgaImageConverter_HEADERS}) +target_include_directories(TgaImageConverterObjects PUBLIC $) if(NOT BUILD_PLUGINS_STATIC) - set_target_properties(TgaImageConverterObjects PROPERTIES COMPILE_FLAGS "-DTgaImageConverterObjects_EXPORTS") + target_compile_definitions(TgaImageConverterObjects PRIVATE "TgaImageConverterObjects_EXPORTS") endif() if(NOT BUILD_PLUGINS_STATIC OR BUILD_STATIC_PIC) set_target_properties(TgaImageConverterObjects PROPERTIES POSITION_INDEPENDENT_CODE ON) @@ -55,7 +56,6 @@ add_plugin(TgaImageConverter ${MAGNUM_PLUGINS_IMAGECONVERTER_DEBUG_INSTALL_DIR} if(BUILD_STATIC_PIC) set_target_properties(TgaImageConverter PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() - target_link_libraries(TgaImageConverter Magnum) install(FILES ${TgaImageConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImageConverter) @@ -68,5 +68,5 @@ if(BUILD_TESTS) add_subdirectory(Test) endif() -# Magnum TgaImageConverter library for superprojects -set(MAGNUM_TGAIMAGECONVERTER_LIBRARY TgaImageConverter CACHE INTERNAL "") +# Magnum TgaImageConverter target alias for superprojects +add_library(Magnum::TgaImageConverter ALIAS TgaImageConverter) diff --git a/src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt b/src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt index bb3f0f0b1..aa1cb434a 100644 --- a/src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt @@ -26,14 +26,14 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/configure.h) -include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) - corrade_add_test(TgaImageConverterTest TgaImageConverterTest.cpp LIBRARIES MagnumTgaImageConverterTestLib MagnumTgaImporterTestLib) +target_include_directories(TgaImageConverterTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) # On Win32 we need to avoid dllimporting TgaImporter and TgaImageConverterTest # symbols, because it would search for the symbols in some DLL even though they # were linked statically. However it apparently doesn't matter that they were # dllexported when building the static library. EH. if(WIN32) - set_target_properties(TgaImageConverterTest PROPERTIES COMPILE_FLAGS - "-DMAGNUM_TGAIMAGECONVERTER_BUILD_STATIC -DMAGNUM_TGAIMPORTER_BUILD_STATIC") + target_compile_definitions(TgaImageConverterTest PRIVATE + "MAGNUM_TGAIMAGECONVERTER_BUILD_STATIC" + "MAGNUM_TGAIMPORTER_BUILD_STATIC") endif() diff --git a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.h b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.h index 308973d4b..90a51fdea 100644 --- a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.h +++ b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.h @@ -60,9 +60,8 @@ This plugin is built if `WITH_TGAIMAGECONVERTER` is enabled when building Magnum. To use dynamic plugin, you need to load `TgaImageConverter` plugin from `MAGNUM_PLUGINS_IMAGECONVERTER_DIR`. To use static plugin or use this as a dependency of another plugin, you need to request `TgaImageConverter` -component of `Magnum` package in CMake and link to -`${MAGNUM_TGAIMAGECONVERTER_LIBRARIES}`. See @ref building, @ref cmake and -@ref plugins for more information. +component of `Magnum` package in CMake and link to `Magnum::TgaImageConverter` +target. See @ref building, @ref cmake and @ref plugins for more information. */ class MAGNUM_TGAIMAGECONVERTER_EXPORT TgaImageConverter: public AbstractImageConverter { public: diff --git a/src/MagnumPlugins/TgaImporter/CMakeLists.txt b/src/MagnumPlugins/TgaImporter/CMakeLists.txt index e02987036..b2ebfb43e 100644 --- a/src/MagnumPlugins/TgaImporter/CMakeLists.txt +++ b/src/MagnumPlugins/TgaImporter/CMakeLists.txt @@ -41,8 +41,9 @@ set(TgaImporter_HEADERS add_library(TgaImporterObjects OBJECT ${TgaImporter_SRCS} ${TgaImporter_HEADERS}) +target_include_directories(TgaImporterObjects PUBLIC $) if(NOT BUILD_PLUGINS_STATIC) - set_target_properties(TgaImporterObjects PROPERTIES COMPILE_FLAGS "-DTgaImporterObjects_EXPORTS") + target_compile_definitions(TgaImporterObjects PRIVATE "TgaImporterObjects_EXPORTS") endif() if(NOT BUILD_PLUGINS_STATIC OR BUILD_STATIC_PIC) set_target_properties(TgaImporterObjects PROPERTIES POSITION_INDEPENDENT_CODE ON) @@ -56,7 +57,6 @@ add_plugin(TgaImporter ${MAGNUM_PLUGINS_IMPORTER_DEBUG_INSTALL_DIR} ${MAGNUM_PLU if(BUILD_STATIC_PIC) set_target_properties(TgaImporter PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() - target_link_libraries(TgaImporter Magnum) install(FILES ${TgaImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImporter) @@ -69,5 +69,5 @@ if(BUILD_TESTS) add_subdirectory(Test) endif() -# Magnum TgaImporter library for superprojects -set(MAGNUM_TGAIMPORTER_LIBRARY TgaImporter CACHE INTERNAL "") +# Magnum TgaImporter target alias for superprojects +add_library(Magnum::TgaImporter ALIAS TgaImporter) diff --git a/src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt b/src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt index 3405b61a5..e3499dd25 100644 --- a/src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt @@ -26,13 +26,12 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/configure.h) -include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) - corrade_add_test(TgaImporterTest TgaImporterTest.cpp LIBRARIES MagnumTgaImporterTestLib) +target_include_directories(TgaImporterTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) # On Win32 we need to avoid dllimporting TgaImporter symbols, because it would # search for the symbols in some DLL even though they were linked statically. # However it apparently doesn't matter that they were dllexported when building # the static library. EH. if(WIN32) - set_target_properties(TgaImporterTest PROPERTIES COMPILE_FLAGS "-DMAGNUM_TGAIMPORTER_BUILD_STATIC") + target_compile_definitions(TgaImporterTest PRIVATE "MAGNUM_TGAIMPORTER_BUILD_STATIC") endif() diff --git a/src/MagnumPlugins/TgaImporter/TgaImporter.h b/src/MagnumPlugins/TgaImporter/TgaImporter.h index 45c2087b6..e18c2c917 100644 --- a/src/MagnumPlugins/TgaImporter/TgaImporter.h +++ b/src/MagnumPlugins/TgaImporter/TgaImporter.h @@ -60,8 +60,8 @@ This plugin is built if `WITH_TGAIMPORTER` is enabled when building Magnum. To use dynamic plugin, you need to load `TgaImporter` plugin from `MAGNUM_PLUGINS_IMPORTER_DIR`. To use static plugin or use this as a dependency of another plugin, you need to request `TgaImporter` component of `Magnum` -package in CMake and link to `${MAGNUM_TGAIMPORTER_LIBRARIES}`. See -@ref building, @ref cmake and @ref plugins for more information. +package in CMake and link to `Magnum::TgaImporter` target. See @ref building, +@ref cmake and @ref plugins for more information. The images are imported with @ref PixelType::UnsignedByte and @ref PixelFormat::RGB, @ref PixelFormat::RGBA or @ref PixelFormat::Red, respectively. Grayscale images diff --git a/src/MagnumPlugins/WavAudioImporter/CMakeLists.txt b/src/MagnumPlugins/WavAudioImporter/CMakeLists.txt index 55a2bb1cf..adb4a558d 100644 --- a/src/MagnumPlugins/WavAudioImporter/CMakeLists.txt +++ b/src/MagnumPlugins/WavAudioImporter/CMakeLists.txt @@ -23,10 +23,6 @@ # DEALINGS IN THE SOFTWARE. # -find_package(OpenAL REQUIRED) - -include_directories(${OPENAL_INCLUDE_DIR}) - set(WavAudioImporter_SRCS WavImporter.cpp) @@ -38,6 +34,9 @@ set(WavAudioImporter_HEADERS add_library(WavAudioImporterObjects OBJECT ${WavAudioImporter_SRCS} ${WavAudioImporter_HEADERS}) +target_include_directories(WavAudioImporterObjects PUBLIC + $ + $) if(NOT BUILD_PLUGINS_STATIC OR BUILD_STATIC_PIC) set_target_properties(WavAudioImporterObjects PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() @@ -50,7 +49,6 @@ add_plugin(WavAudioImporter ${MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_INSTALL_DIR} ${ if(BUILD_STATIC_PIC) set_target_properties(WavAudioImporter PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() - target_link_libraries(WavAudioImporter Magnum MagnumAudio) install(FILES ${WavAudioImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/WavAudioImporter) @@ -61,5 +59,5 @@ if(BUILD_TESTS) add_subdirectory(Test) endif() -# Magnum WavAudioImporter library for superprojects -set(MAGNUM_WAVAUDIOIMPORTER_LIBRARY WavAudioImporter CACHE INTERNAL "") +# Magnum WavAudioImporter target alias for superprojects +add_library(Magnum::WavAudioImporter ALIAS WavAudioImporter) diff --git a/src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt b/src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt index 0bdd5b631..ec775d9e4 100644 --- a/src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt @@ -26,6 +26,5 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/configure.h) -include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) - corrade_add_test(WavAudioImporterTest WavImporterTest.cpp LIBRARIES MagnumWavAudioImporterTestLib) +target_include_directories(WavAudioImporterTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/MagnumPlugins/WavAudioImporter/WavImporter.h b/src/MagnumPlugins/WavAudioImporter/WavImporter.h index 20b272523..3300821e9 100644 --- a/src/MagnumPlugins/WavAudioImporter/WavImporter.h +++ b/src/MagnumPlugins/WavAudioImporter/WavImporter.h @@ -46,8 +46,8 @@ This plugin is built if `WITH_WAVAUDIOIMPORTER` is enabled when building Magnum. To use dynamic plugin, you need to load `WavAudioImporter` plugin from `MAGNUM_PLUGINS_AUDIOIMPORTER_DIR`. To use static plugin or use this as a dependency of another plugin, you need to request `WavAudioImporter` component -of `Magnum` package in CMake and link to `${MAGNUM_WAVAUDIOIMPORTER_LIBRARIES}`. -See @ref building, @ref cmake and @ref plugins for more information. +of `Magnum` package in CMake and link to `Magnum::WavAudioImporter` target. See +@ref building, @ref cmake and @ref plugins for more information. */ class WavImporter: public AbstractImporter { public: From 27ac1e45751f3329455e445636bdeb9b7ddbeb94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 21 Feb 2016 23:43:16 +0100 Subject: [PATCH 160/258] Modern CMake usage: don't treat imported targets as files. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f46c1d37..593c31144 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,10 @@ project(Magnum) if(POLICY CMP0042) cmake_policy(SET CMP0042 NEW) endif() +# Don't treat imported targets with :: as files +if(POLICY CMP0028) + cmake_policy(SET CMP0028 NEW) +endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/modules/") From 84c80c297fe0cc0e1018b379de76ee8cefc8db84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 18 Mar 2016 12:56:57 +0100 Subject: [PATCH 161/258] modules: CMake goes crazy when I'm using frameworks as imported targets. And the bug is closed as "wontfix". Dammit. https://cmake.org/Bug/view.php?id=13765 --- modules/FindSDL2.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/FindSDL2.cmake b/modules/FindSDL2.cmake index 60eba212b..afc8efdab 100644 --- a/modules/FindSDL2.cmake +++ b/modules/FindSDL2.cmake @@ -94,7 +94,14 @@ find_package_handle_standard_args("SDL2" DEFAULT_MSG if(NOT TARGET SDL2::SDL2) if(SDL2_LIBRARY_NEEDED) add_library(SDL2::SDL2 UNKNOWN IMPORTED) - set_property(TARGET SDL2::SDL2 PROPERTY IMPORTED_LOCATION ${SDL2_LIBRARY}) + + # Work around BUGGY framework support on OSX + # https://cmake.org/Bug/view.php?id=13765 + if(CORRADE_TARGET_APPLE AND ${SDL2_LIBRARY} MATCHES "\\.framework$") + set_property(TARGET SDL2::SDL2 PROPERTY IMPORTED_LOCATION ${SDL2_LIBRARY}/SDL2) + else() + set_property(TARGET SDL2::SDL2 PROPERTY IMPORTED_LOCATION ${SDL2_LIBRARY}) + endif() # Link frameworks on iOS if(CORRADE_TARGET_IOS) From a7acee651636c3ca7b569b1e71872c865b5fa400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 19 Mar 2016 14:08:12 +0100 Subject: [PATCH 162/258] modules: add forgotten WindowlessWglApplication into the find module. Sorry! --- modules/FindMagnum.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 49b8856d7..99babd05f 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -325,7 +325,7 @@ endif() # Component distinction (listing them explicitly to avoid mistakes with finding # components from other repositories) -set(_MAGNUM_LIBRARY_COMPONENTS "^(Audio|DebugTools|MeshTools|Primitives|SceneGraph|Shaders|Shapes|Text|TextureTools|GlutApplication|GlxApplication|NaClApplication|Sdl2Application|XEglApplication|WindowlessCglApplication|WindowlessGlxApplication|WindowlessNaClApplication|WindowlessWindowsEglApplication|CglContext|EglContext|GlxContext|WglContext)$") +set(_MAGNUM_LIBRARY_COMPONENTS "^(Audio|DebugTools|MeshTools|Primitives|SceneGraph|Shaders|Shapes|Text|TextureTools|GlutApplication|GlxApplication|NaClApplication|Sdl2Application|XEglApplication|WindowlessCglApplication|WindowlessGlxApplication|WindowlessNaClApplication|WindowlessWglApplication|WindowlessWindowsEglApplication|CglContext|EglContext|GlxContext|WglContext)$") set(_MAGNUM_PLUGIN_COMPONENTS "^(MagnumFont|MagnumFontConverter|ObjImporter|TgaImageConverter|TgaImporter|WavAudioImporter)$") set(_MAGNUM_EXECUTABLE_COMPONENTS "^(distancefieldconverter|fontconverter|info)$") From d86a5250133a364af30a4a6b58492001edd79247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 19 Mar 2016 14:15:14 +0100 Subject: [PATCH 163/258] package/ci: build (but not run) also GL tests. Should catch a bit more bugs with windowless applications and such. --- package/ci/appveyor.yml | 4 ++-- package/ci/travis.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package/ci/appveyor.yml b/package/ci/appveyor.yml index 52be3c8a4..802cbb4ad 100644 --- a/package/ci/appveyor.yml +++ b/package/ci/appveyor.yml @@ -56,7 +56,7 @@ install: build_script: - mkdir build - cd build -- cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=C:/Sys -DCMAKE_PREFIX_PATH="%APPVEYOR_BUILD_FOLDER%/SDL;%APPVEYOR_BUILD_FOLDER%/openal" -DWITH_AUDIO=ON -DWITH_SDL2APPLICATION=ON -DWITH_WINDOWLESSWGLAPPLICATION=ON -DWITH_WGLCONTEXT=ON -DWITH_MAGNUMFONT=ON -DWITH_MAGNUMFONTCONVERTER=ON -DWITH_OBJIMPORTER=ON -DWITH_TGAIMAGECONVERTER=ON -DWITH_TGAIMPORTER=ON -DWITH_WAVAUDIOIMPORTER=ON -DWITH_DISTANCEFIELDCONVERTER=ON -DWITH_FONTCONVERTER=ON -DWITH_MAGNUMINFO=ON -DBUILD_STATIC=%BUILD_STATIC% -DBUILD_TESTS=ON -G Ninja +- cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=C:/Sys -DCMAKE_PREFIX_PATH="%APPVEYOR_BUILD_FOLDER%/SDL;%APPVEYOR_BUILD_FOLDER%/openal" -DWITH_AUDIO=ON -DWITH_SDL2APPLICATION=ON -DWITH_WINDOWLESSWGLAPPLICATION=ON -DWITH_WGLCONTEXT=ON -DWITH_MAGNUMFONT=ON -DWITH_MAGNUMFONTCONVERTER=ON -DWITH_OBJIMPORTER=ON -DWITH_TGAIMAGECONVERTER=ON -DWITH_TGAIMPORTER=ON -DWITH_WAVAUDIOIMPORTER=ON -DWITH_DISTANCEFIELDCONVERTER=ON -DWITH_FONTCONVERTER=ON -DWITH_MAGNUMINFO=ON -DBUILD_STATIC=%BUILD_STATIC% -DBUILD_TESTS=ON -DBUILD_GL_TESTS=ON -G Ninja - cmake --build . - cmake --build . --target install - cmake . -DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/Deploy -DBUILD_TESTS=OFF @@ -67,7 +67,7 @@ build_script: test_script: - cd %APPVEYOR_BUILD_FOLDER%/build - SET fail=0 -- ctest --output-on-failure || SET fail=1 & ver > nul +- ctest --output-on-failure -E GLTest || SET fail=1 & ver > nul - cd %APPVEYOR_BUILD_FOLDER% - appveyor PushArtifact magnum.zip - exit %fail% diff --git a/package/ci/travis.yml b/package/ci/travis.yml index 817f5f0db..640a33771 100644 --- a/package/ci/travis.yml +++ b/package/ci/travis.yml @@ -52,6 +52,6 @@ install: script: - mkdir build && cd build -- cmake .. -DCMAKE_PREFIX_PATH="$HOME/sdl2;$HOME/deps" -DCMAKE_BUILD_TYPE=Release -DWITH_AUDIO=ON -DWITH_SDL2APPLICATION=ON -DWITH_WINDOWLESS${PLATFORM_GL_API}APPLICATION=ON -DWITH_${PLATFORM_GL_API}CONTEXT=ON -DWITH_MAGNUMFONT=ON -DWITH_MAGNUMFONTCONVERTER=ON -DWITH_OBJIMPORTER=ON -DWITH_TGAIMAGECONVERTER=ON -DWITH_TGAIMPORTER=ON -DWITH_WAVAUDIOIMPORTER=ON -DWITH_DISTANCEFIELDCONVERTER=ON -DWITH_FONTCONVERTER=ON -DWITH_MAGNUMINFO=ON -DBUILD_TESTS=ON +- cmake .. -DCMAKE_PREFIX_PATH="$HOME/sdl2;$HOME/deps" -DCMAKE_BUILD_TYPE=Release -DWITH_AUDIO=ON -DWITH_SDL2APPLICATION=ON -DWITH_WINDOWLESS${PLATFORM_GL_API}APPLICATION=ON -DWITH_${PLATFORM_GL_API}CONTEXT=ON -DWITH_MAGNUMFONT=ON -DWITH_MAGNUMFONTCONVERTER=ON -DWITH_OBJIMPORTER=ON -DWITH_TGAIMAGECONVERTER=ON -DWITH_TGAIMPORTER=ON -DWITH_WAVAUDIOIMPORTER=ON -DWITH_DISTANCEFIELDCONVERTER=ON -DWITH_FONTCONVERTER=ON -DWITH_MAGNUMINFO=ON -DBUILD_TESTS=ON -DBUILD_GL_TESTS=ON - cmake --build . -- ctest --output-on-failure +- ctest --output-on-failure -E GLTest From c943873a42e6c64b319b2702136839bab04adc8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 19 Mar 2016 14:40:13 +0100 Subject: [PATCH 164/258] package/ci: use Homebrew SDL2 package on OSX. --- package/ci/travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package/ci/travis.yml b/package/ci/travis.yml index 640a33771..af002c184 100644 --- a/package/ci/travis.yml +++ b/package/ci/travis.yml @@ -37,7 +37,8 @@ install: - printf "[General]\ndrivers=null" > ~/.alsoftrc # SDL (cached) -- if [ ! -e "$HOME/sdl2/include" ]; then curl -O http://www.libsdl.org/release/SDL2-2.0.3.tar.gz && tar -xzvf SDL2-2.0.3.tar.gz && cd SDL2-2.0.3 && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/sdl2 -DCMAKE_BUILD_TYPE=Release && cmake --build . --target install && cd ../..; fi +- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install sdl2; fi +- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ ! -e "$HOME/sdl2/include" ]; then curl -O http://www.libsdl.org/release/SDL2-2.0.3.tar.gz && tar -xzvf SDL2-2.0.3.tar.gz && cd SDL2-2.0.3 && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/deps -DCMAKE_BUILD_TYPE=Release && cmake --build . --target install && cd ../..; fi # Corrade - git clone --depth 1 git://github.com/mosra/corrade.git @@ -52,6 +53,6 @@ install: script: - mkdir build && cd build -- cmake .. -DCMAKE_PREFIX_PATH="$HOME/sdl2;$HOME/deps" -DCMAKE_BUILD_TYPE=Release -DWITH_AUDIO=ON -DWITH_SDL2APPLICATION=ON -DWITH_WINDOWLESS${PLATFORM_GL_API}APPLICATION=ON -DWITH_${PLATFORM_GL_API}CONTEXT=ON -DWITH_MAGNUMFONT=ON -DWITH_MAGNUMFONTCONVERTER=ON -DWITH_OBJIMPORTER=ON -DWITH_TGAIMAGECONVERTER=ON -DWITH_TGAIMPORTER=ON -DWITH_WAVAUDIOIMPORTER=ON -DWITH_DISTANCEFIELDCONVERTER=ON -DWITH_FONTCONVERTER=ON -DWITH_MAGNUMINFO=ON -DBUILD_TESTS=ON -DBUILD_GL_TESTS=ON +- cmake .. -DCMAKE_PREFIX_PATH=$HOME/deps -DCMAKE_BUILD_TYPE=Release -DWITH_AUDIO=ON -DWITH_SDL2APPLICATION=ON -DWITH_WINDOWLESS${PLATFORM_GL_API}APPLICATION=ON -DWITH_${PLATFORM_GL_API}CONTEXT=ON -DWITH_MAGNUMFONT=ON -DWITH_MAGNUMFONTCONVERTER=ON -DWITH_OBJIMPORTER=ON -DWITH_TGAIMAGECONVERTER=ON -DWITH_TGAIMPORTER=ON -DWITH_WAVAUDIOIMPORTER=ON -DWITH_DISTANCEFIELDCONVERTER=ON -DWITH_FONTCONVERTER=ON -DWITH_MAGNUMINFO=ON -DBUILD_TESTS=ON -DBUILD_GL_TESTS=ON - cmake --build . - ctest --output-on-failure -E GLTest From 2182e43f5e3155b421fbfea9a404293963d9e587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 19 Mar 2016 14:48:53 +0100 Subject: [PATCH 165/258] package/ci: and now let's fix Linux build, again. Also updated to SDL 2.0.4. --- package/ci/travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/ci/travis.yml b/package/ci/travis.yml index af002c184..627417abf 100644 --- a/package/ci/travis.yml +++ b/package/ci/travis.yml @@ -38,7 +38,7 @@ install: # SDL (cached) - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install sdl2; fi -- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ ! -e "$HOME/sdl2/include" ]; then curl -O http://www.libsdl.org/release/SDL2-2.0.3.tar.gz && tar -xzvf SDL2-2.0.3.tar.gz && cd SDL2-2.0.3 && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/deps -DCMAKE_BUILD_TYPE=Release && cmake --build . --target install && cd ../..; fi +- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ ! -e "$HOME/deps/include/SDL2" ]; then curl -O http://www.libsdl.org/release/SDL2-2.0.4.tar.gz && tar -xzvf SDL2-2.0.4.tar.gz && cd SDL2-2.0.4 && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/deps -DCMAKE_BUILD_TYPE=Release && cmake --build . --target install && cd ../..; fi # Corrade - git clone --depth 1 git://github.com/mosra/corrade.git From e71ccafbc78333f0cb12f455dfce723edba65db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 19 Mar 2016 14:59:23 +0100 Subject: [PATCH 166/258] package/ci: revert back to separate directory to have SDL2 build cached. --- package/ci/travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/ci/travis.yml b/package/ci/travis.yml index 627417abf..d37a15461 100644 --- a/package/ci/travis.yml +++ b/package/ci/travis.yml @@ -38,7 +38,7 @@ install: # SDL (cached) - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install sdl2; fi -- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ ! -e "$HOME/deps/include/SDL2" ]; then curl -O http://www.libsdl.org/release/SDL2-2.0.4.tar.gz && tar -xzvf SDL2-2.0.4.tar.gz && cd SDL2-2.0.4 && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/deps -DCMAKE_BUILD_TYPE=Release && cmake --build . --target install && cd ../..; fi +- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ ! -e "$HOME/sdl2/include" ]; then curl -O http://www.libsdl.org/release/SDL2-2.0.4.tar.gz && tar -xzvf SDL2-2.0.4.tar.gz && cd SDL2-2.0.4 && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/sdl2 -DCMAKE_BUILD_TYPE=Release && cmake --build . --target install && cd ../..; fi # Corrade - git clone --depth 1 git://github.com/mosra/corrade.git @@ -53,6 +53,6 @@ install: script: - mkdir build && cd build -- cmake .. -DCMAKE_PREFIX_PATH=$HOME/deps -DCMAKE_BUILD_TYPE=Release -DWITH_AUDIO=ON -DWITH_SDL2APPLICATION=ON -DWITH_WINDOWLESS${PLATFORM_GL_API}APPLICATION=ON -DWITH_${PLATFORM_GL_API}CONTEXT=ON -DWITH_MAGNUMFONT=ON -DWITH_MAGNUMFONTCONVERTER=ON -DWITH_OBJIMPORTER=ON -DWITH_TGAIMAGECONVERTER=ON -DWITH_TGAIMPORTER=ON -DWITH_WAVAUDIOIMPORTER=ON -DWITH_DISTANCEFIELDCONVERTER=ON -DWITH_FONTCONVERTER=ON -DWITH_MAGNUMINFO=ON -DBUILD_TESTS=ON -DBUILD_GL_TESTS=ON +- cmake .. -DCMAKE_PREFIX_PATH="$HOME/deps;$HOME/sdl2" -DCMAKE_BUILD_TYPE=Release -DWITH_AUDIO=ON -DWITH_SDL2APPLICATION=ON -DWITH_WINDOWLESS${PLATFORM_GL_API}APPLICATION=ON -DWITH_${PLATFORM_GL_API}CONTEXT=ON -DWITH_MAGNUMFONT=ON -DWITH_MAGNUMFONTCONVERTER=ON -DWITH_OBJIMPORTER=ON -DWITH_TGAIMAGECONVERTER=ON -DWITH_TGAIMPORTER=ON -DWITH_WAVAUDIOIMPORTER=ON -DWITH_DISTANCEFIELDCONVERTER=ON -DWITH_FONTCONVERTER=ON -DWITH_MAGNUMINFO=ON -DBUILD_TESTS=ON -DBUILD_GL_TESTS=ON - cmake --build . - ctest --output-on-failure -E GLTest From 1f0617ac2798ba995fdd0d176cf1c3f6a1e3106b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 21 Mar 2016 09:43:14 +0100 Subject: [PATCH 167/258] modules: updated FindMagnum.cmake. It was not handling the case of both debug and release libraries for application and contexts properly. --- modules/FindMagnum.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 99babd05f..851372a77 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -627,7 +627,7 @@ if(_MAGNUM_WINDOWLESSAPPLICATION_ALIAS AND NOT TARGET Magnum::WindowlessApplicat INTERFACE_COMPILE_DEFINITIONS $ INTERFACE_COMPILE_OPTIONS $ INTERFACE_LINK_LIBRARIES $ - IMPORTED_CONFIGURATIONS ${_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_CONFIGURATIONS}) + IMPORTED_CONFIGURATIONS "${_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_CONFIGURATIONS}") if(_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_LOCATION_RELEASE) set_target_properties(Magnum::WindowlessApplication PROPERTIES IMPORTED_LOCATION_RELEASE ${_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_LOCATION_RELEASE}) @@ -657,7 +657,7 @@ if(_MAGNUM_APPLICATION_ALIAS AND NOT TARGET Magnum::Application) INTERFACE_COMPILE_DEFINITIONS $ INTERFACE_COMPILE_OPTIONS $ INTERFACE_LINK_LIBRARIES $ - IMPORTED_CONFIGURATIONS ${_MAGNUM_APPLICATION_IMPORTED_CONFIGURATIONS}) + IMPORTED_CONFIGURATIONS "${_MAGNUM_APPLICATION_IMPORTED_CONFIGURATIONS}") if(_MAGNUM_APPLICATION_IMPORTED_LOCATION_RELEASE) set_target_properties(Magnum::Application PROPERTIES IMPORTED_LOCATION_RELEASE ${_MAGNUM_APPLICATION_IMPORTED_LOCATION_RELEASE}) @@ -687,7 +687,7 @@ if(_MAGNUM_CONTEXT_ALIAS AND NOT TARGET Magnum::Context) INTERFACE_COMPILE_DEFINITIONS $ INTERFACE_COMPILE_OPTIONS $ INTERFACE_LINK_LIBRARIES $ - IMPORTED_CONFIGURATIONS ${_MAGNUM_CONTEXT_IMPORTED_CONFIGURATIONS}) + IMPORTED_CONFIGURATIONS "${_MAGNUM_CONTEXT_IMPORTED_CONFIGURATIONS}") if(_MAGNUM_CONTEXT_IMPORTED_LOCATION_RELEASE) set_target_properties(Magnum::Context PROPERTIES IMPORTED_LOCATION_RELEASE ${_MAGNUM_CONTEXT_IMPORTED_LOCATION_RELEASE}) From f47a40614d9eadbd7e7851817ff3cc4c9a925560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 23 Mar 2016 22:18:26 +0100 Subject: [PATCH 168/258] Properly create Magnum::Magnum aliased target for superprojects. --- src/Magnum/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magnum/CMakeLists.txt b/src/Magnum/CMakeLists.txt index 72f3353e4..f973fc170 100644 --- a/src/Magnum/CMakeLists.txt +++ b/src/Magnum/CMakeLists.txt @@ -341,6 +341,6 @@ if(BUILD_TESTS) add_subdirectory(Test) endif() -# Magnum library and configure file for superprojects -set(MAGNUM_LIBRARY Magnum CACHE INTERNAL "") +# Magnum library target alias and configure file for superprojects +add_library(Magnum::Magnum ALIAS Magnum) set(_MAGNUM_CONFIGURE_FILE ${CMAKE_CURRENT_BINARY_DIR}/configure.h CACHE INTERNAL "") From b5851b552d4f4f0993c312f41ee56fc628ebb83b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 23 Mar 2016 22:19:31 +0100 Subject: [PATCH 169/258] modules: fix Application and Context aliases for superprojects. Oh well :( --- modules/FindMagnum.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 851372a77..3c3cdacb4 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -616,7 +616,7 @@ find_package_handle_standard_args(Magnum if(_MAGNUM_WINDOWLESSAPPLICATION_ALIAS AND NOT TARGET Magnum::WindowlessApplication) get_target_property(_MAGNUM_WINDOWLESSAPPLICATION_ALIASED_TARGET ${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS} ALIASED_TARGET) if(_MAGNUM_WINDOWLESSAPPLICATION_ALIASED_TARGET) - add_library(${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS} ALIAS ${_MAGNUM_WINDOWLESSAPPLICATION_ALIASED_TARGET}) + add_library(Magnum::WindowlessApplication ALIAS ${_MAGNUM_WINDOWLESSAPPLICATION_ALIASED_TARGET}) else() add_library(Magnum::WindowlessApplication UNKNOWN IMPORTED) get_target_property(_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_CONFIGURATIONS ${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS} IMPORTED_CONFIGURATIONS) @@ -646,7 +646,7 @@ endif() if(_MAGNUM_APPLICATION_ALIAS AND NOT TARGET Magnum::Application) get_target_property(_MAGNUM_APPLICATION_ALIASED_TARGET ${_MAGNUM_APPLICATION_ALIAS} ALIASED_TARGET) if(_MAGNUM_APPLICATION_ALIASED_TARGET) - add_library(${_MAGNUM_APPLICATION_ALIAS} ALIAS ${_MAGNUM_APPLICATION_ALIASED_TARGET}) + add_library(Magnum::Application ALIAS ${_MAGNUM_APPLICATION_ALIASED_TARGET}) else() add_library(Magnum::Application UNKNOWN IMPORTED) get_target_property(_MAGNUM_APPLICATION_IMPORTED_CONFIGURATIONS ${_MAGNUM_APPLICATION_ALIAS} IMPORTED_CONFIGURATIONS) @@ -676,7 +676,7 @@ endif() if(_MAGNUM_CONTEXT_ALIAS AND NOT TARGET Magnum::Context) get_target_property(_MAGNUM_CONTEXT_ALIASED_TARGET ${_MAGNUM_CONTEXT_ALIAS} ALIASED_TARGET) if(_MAGNUM_CONTEXT_ALIASED_TARGET) - add_library(${_MAGNUM_CONTEXT_ALIAS} ALIAS ${_MAGNUM_CONTEXT_ALIASED_TARGET}) + add_library(Magnum::Context ALIAS ${_MAGNUM_CONTEXT_ALIASED_TARGET}) else() add_library(Magnum::Context UNKNOWN IMPORTED) get_target_property(_MAGNUM_CONTEXT_IMPORTED_CONFIGURATIONS ${_MAGNUM_CONTEXT_ALIAS} IMPORTED_CONFIGURATIONS) From abe2c5bd6652814a0bd54f9f51522fce9f9bad5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 24 Mar 2016 14:07:27 +0100 Subject: [PATCH 170/258] modules: fix root library finding for superprojects. Will this never end?! --- modules/FindMagnum.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 3c3cdacb4..24699091a 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -285,6 +285,8 @@ if(NOT TARGET Magnum::Magnum) # TODO: give me INTERFACE_LINK_OPTIONS or something, please set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s USE_WEBGL2=1") endif() +else() + set(MAGNUM_LIBRARY Magnum::Magnum) endif() # Ensure that all inter-component dependencies are specified as well @@ -608,7 +610,7 @@ endforeach() # Complete the check with also all components include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Magnum - REQUIRED_VARS MAGNUM_LIBRARY MAGNUM_INCLUDE_DIR + REQUIRED_VARS MAGNUM_INCLUDE_DIR MAGNUM_LIBRARY HANDLE_COMPONENTS) # Create Windowless*Application, *Application and *Context aliases From 6af6c68d26461b6b394c13a8e739229ef3233eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 25 Mar 2016 14:42:25 +0100 Subject: [PATCH 171/258] modules: updated FindCorrade.cmake. --- modules/FindCorrade.cmake | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/FindCorrade.cmake b/modules/FindCorrade.cmake index 64a36100d..21744274d 100644 --- a/modules/FindCorrade.cmake +++ b/modules/FindCorrade.cmake @@ -84,6 +84,8 @@ # Client with `glibc` toolchain # CORRADE_TARGET_EMSCRIPTEN - Defined if compiled for Emscripten # CORRADE_TARGET_ANDROID - Defined if compiled for Android +# CORRADE_TESTSUITE_TARGET_XCTEST - Defined if TestSuite is targetting Xcode +# XCTest # # Additionally these variables are defined for internal usage: # @@ -246,7 +248,8 @@ set(_corradeFlags TARGET_NACL_GLIBC TARGET_EMSCRIPTEN TARGET_ANDROID - TESTSUITE_TARGET_XCTEST) + TESTSUITE_TARGET_XCTEST + UTILITY_USE_ANSI_COLORS) foreach(_corradeFlag ${_corradeFlags}) string(FIND "${_corradeConfigure}" "#define CORRADE_${_corradeFlag}" _corrade_${_corradeFlag}) if(NOT _corrade_${_corradeFlag} EQUAL -1) @@ -286,6 +289,13 @@ foreach(_component ${Corrade_FIND_COMPONENTS}) set(_CORRADE_${_COMPONENT}_DEPENDENCIES Containers rc) endif() + # Mark the dependencies as required if the component is also required + if(Corrade_FIND_REQUIRED_${_component}) + foreach(_dependency ${_CORRADE_${_COMPONENT}_DEPENDENCIES}) + set(Corrade_FIND_REQUIRED_${_dependency} TRUE) + endforeach() + endif() + list(APPEND _CORRADE_ADDITIONAL_COMPONENTS ${_CORRADE_${_COMPONENT}_DEPENDENCIES}) endforeach() From e03f812fef4a2326dad14021a058a73a23b80ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 25 Mar 2016 14:42:37 +0100 Subject: [PATCH 172/258] modules: properly handle implicit required inter-module dependencies. --- modules/FindMagnum.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 24699091a..0a8eea56a 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -314,6 +314,13 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) list(APPEND _MAGNUM_${_COMPONENT}_DEPENDENCIES Text TextureTools) endif() + # Mark the dependencies as required if the component is also required + if(Magnum_FIND_REQUIRED_${_component}) + foreach(_dependency ${_MAGNUM_${_COMPONENT}_DEPENDENCIES}) + set(Magnum_FIND_REQUIRED_${_dependency} TRUE) + endforeach() + endif() + list(APPEND _MAGNUM_ADDITIONAL_COMPONENTS ${_MAGNUM_${_COMPONENT}_DEPENDENCIES}) endforeach() From 5d52b74edf8e064a7fd2e8bbcfc11362ab161eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 25 Mar 2016 14:59:21 +0100 Subject: [PATCH 173/258] modules: updated FindCorrade.cmake. --- modules/FindCorrade.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/FindCorrade.cmake b/modules/FindCorrade.cmake index 21744274d..eba78cfc5 100644 --- a/modules/FindCorrade.cmake +++ b/modules/FindCorrade.cmake @@ -86,6 +86,8 @@ # CORRADE_TARGET_ANDROID - Defined if compiled for Android # CORRADE_TESTSUITE_TARGET_XCTEST - Defined if TestSuite is targetting Xcode # XCTest +# CORRADE_UTILITY_USE_ANSI_COLORS - Defined if ANSI escape sequences are used +# for colored output with Utility::Debug on Windows # # Additionally these variables are defined for internal usage: # From ecebf0fd024ab089e77b9408f841d7b03346257f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 25 Mar 2016 15:12:51 +0100 Subject: [PATCH 174/258] Platform: added new flags to magnum-info. --- src/Magnum/Platform/magnum-info.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index 3a48f47b2..a3854cbe3 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -221,6 +221,12 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #ifdef CORRADE_TARGET_ANDROID Debug() << " CORRADE_TARGET_ANDROID"; #endif + #ifdef CORRADE_TESTSUITE_TARGET_XCTEST + Debug() << " CORRADE_TESTSUITE_TARGET_XCTEST"; + #endif + #ifdef CORRADE_UTILITY_USE_ANSI_COLORS + Debug() << " CORRADE_UTILITY_USE_ANSI_COLORS"; + #endif #ifdef MAGNUM_BUILD_DEPRECATED Debug() << " MAGNUM_BUILD_DEPRECATED"; #endif From 9a70d06767cb571cefadbc0eb2acfb9dbd0da40e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 5 Feb 2016 17:34:18 +0100 Subject: [PATCH 175/258] Platform: new WindowlessEglApplication. Uses just EGL and no other platform toolkit, meaning that the same code can be used on all platforms if the drivers support it. Should be working for OpenGL ES for most drivers, however desktop OpenGL is supported only on NVidia since version 355. --- CMakeLists.txt | 4 +- doc/building.dox | 1 + doc/cmake.dox | 1 + modules/FindMagnum.cmake | 11 +- src/Magnum/Platform/CMakeLists.txt | 32 +++ .../Platform/WindowlessEglApplication.cpp | 137 ++++++++++ .../Platform/WindowlessEglApplication.h | 242 ++++++++++++++++++ 7 files changed, 426 insertions(+), 2 deletions(-) create mode 100644 src/Magnum/Platform/WindowlessEglApplication.cpp create mode 100644 src/Magnum/Platform/WindowlessEglApplication.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 593c31144..a88557da1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,9 +83,11 @@ cmake_dependent_option(WITH_SHADERS "Build Shaders library" ON "NOT WITH_DEBUGTO cmake_dependent_option(WITH_TEXT "Build Text library" ON "NOT WITH_MAGNUMFONT;NOT WITH_MAGNUMFONTCONVERTER" ON) cmake_dependent_option(WITH_TEXTURETOOLS "Build TextureTools library" ON "NOT WITH_TEXT;NOT WITH_DISTANCEFIELDCONVERTER" ON) -# EGL context, available everywhere except on platforms which don't support extension loading +# EGL context and windowless EGL application, available everywhere except on +# platforms which don't support extension loading if(NOT CORRADE_TARGET_EMSCRIPTEN AND NOT CORRADE_TARGET_NACL) option(WITH_EGLCONTEXT "Build EglContext library" OFF) + option(WITH_WINDOWLESSEGLAPPLICATION "Build WindowlessEglApplication library" OFF) endif() # NaCl-specific application libraries diff --git a/doc/building.dox b/doc/building.dox index 70a2c70e1..7890e2968 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -207,6 +207,7 @@ platform best: - `WITH_SDL2APPLICATION` - @ref Platform::Sdl2Application "Sdl2Application" - `WITH_XEGLAPPLICATION` - @ref Platform::XEglApplication "XEglApplication" - `WITH_WINDOWLESSCGLAPPLICATION` - @ref Platform::WindowlessCglApplication "WindowlessCglApplication" +- `WITH_WINDOWLESSEGLAPPLICATION` - @ref Platform::WindowlessEglApplication "WindowlessEglApplication" - `WITH_WINDOWLESSGLXAPPLICATION` - @ref Platform::WindowlessGlxApplication "WindowlessGlxApplication" - `WITH_WINDOWLESSNACLAPPLICATION` - @ref Platform::WindowlessNaClApplication "WindowlessNaClApplication" - `WITH_WINDOWLESSWGLAPPLICATION` - @ref Platform::WindowlessWglApplication "WindowlessWglApplication" diff --git a/doc/cmake.dox b/doc/cmake.dox index 32fae0679..73892ee0f 100644 --- a/doc/cmake.dox +++ b/doc/cmake.dox @@ -100,6 +100,7 @@ Platform namespace is split into more components: - `Sdl2Application` -- @ref Platform::Sdl2Application "Sdl2Application" - `XEglApplication` -- @ref Platform::XEglApplication "XEglApplication" - `WindowlessCglApplication` -- @ref Platform::WindowlessCglApplication "WindowlessCglApplication" +- `WindowlessEglApplication` -- @ref Platform::WindowlessEglApplication "WindowlessEglApplication" - `WindowlessGlxApplication` -- @ref Platform::WindowlessGlxApplication "WindowlessGlxApplication" - `WindowlessNaClApplication` -- @ref Platform::WindowlessNaClApplication "WindowlessNaClApplication" - `WindowlessWglApplication` -- @ref Platform::WindowlessWglApplication "WindowlessWglApplication" diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 0a8eea56a..11aa63e0e 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -53,6 +53,7 @@ # Sdl2Application - SDL2 application # XEglApplication - X/EGL application # WindowlessCglApplication - Windowless CGL application +# WindowlessEglApplication - Windowless EGL application # WindowlessGlxApplication - Windowless GLX application # WindowlessNaClApplication - Windowless NaCl application # WindowlessWglApplication - Windowless WGL application @@ -334,7 +335,7 @@ endif() # Component distinction (listing them explicitly to avoid mistakes with finding # components from other repositories) -set(_MAGNUM_LIBRARY_COMPONENTS "^(Audio|DebugTools|MeshTools|Primitives|SceneGraph|Shaders|Shapes|Text|TextureTools|GlutApplication|GlxApplication|NaClApplication|Sdl2Application|XEglApplication|WindowlessCglApplication|WindowlessGlxApplication|WindowlessNaClApplication|WindowlessWglApplication|WindowlessWindowsEglApplication|CglContext|EglContext|GlxContext|WglContext)$") +set(_MAGNUM_LIBRARY_COMPONENTS "^(Audio|DebugTools|MeshTools|Primitives|SceneGraph|Shaders|Shapes|Text|TextureTools|GlutApplication|GlxApplication|NaClApplication|Sdl2Application|XEglApplication|WindowlessCglApplication|WindowlessEglApplication|WindowlessGlxApplication|WindowlessNaClApplication|WindowlessWglApplication|WindowlessWindowsEglApplication|CglContext|EglContext|GlxContext|WglContext)$") set(_MAGNUM_PLUGIN_COMPONENTS "^(MagnumFont|MagnumFontConverter|ObjImporter|TgaImageConverter|TgaImporter|WavAudioImporter)$") set(_MAGNUM_EXECUTABLE_COMPONENTS "^(distancefieldconverter|fontconverter|info)$") @@ -490,6 +491,14 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) INTERFACE_LINK_LIBRARIES ${X11_LIBRARIES}) # Windowless CGL application has no additional dependencies + + # Windowless EGL application dependencies + elseif(_component STREQUAL WindowlessEglApplication) + find_package(EGL) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES EGL::EGL) + endif() + # Windowless WGL application has no additional dependencies # Windowless Windows/EGL application dependencies diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index 2fc4b0f5c..520eefeed 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -295,6 +295,38 @@ if(WITH_WINDOWLESSGLXAPPLICATION OR NEED_ABSTRACTXAPPLICATION) endif() endif() +# Windowless EGL application +if(WITH_WINDOWLESSEGLAPPLICATION) + set(NEED_EGLCONTEXT 1) + + set(MagnumWindowlessEglApplication_SRCS + WindowlessEglApplication.cpp + Implementation/Egl.cpp + $) + set(MagnumWindowlessEglApplication_HEADERS + WindowlessEglApplication.h) + set(MagnumWindowlessEglApplication_PRIVATE_HEADERS + Implementation/Egl.h) + + add_library(MagnumWindowlessEglApplication STATIC + ${MagnumWindowlessEglApplication_SRCS} + ${MagnumWindowlessEglApplication_HEADERS} + ${MagnumWindowlessEglApplication_PRIVATE_HEADERS}) + set_target_properties(MagnumWindowlessEglApplication PROPERTIES DEBUG_POSTFIX "-d") + target_link_libraries(MagnumWindowlessEglApplication Magnum EGL::EGL) + # Assuming that PIC is not needed because the Application lib is always + # linked to the executable and not to any intermediate shared lib + + install(FILES ${MagnumWindowlessEglApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) + install(TARGETS MagnumWindowlessEglApplication + RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} + LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} + ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) + + # Magnum WindowlessEglApplication target alias for superprojects + add_library(Magnum::WindowlessEglApplication ALIAS MagnumWindowlessEglApplication) +endif() + # Windowless GLX application if(WITH_WINDOWLESSGLXAPPLICATION) set(NEED_GLXCONTEXT 1) diff --git a/src/Magnum/Platform/WindowlessEglApplication.cpp b/src/Magnum/Platform/WindowlessEglApplication.cpp new file mode 100644 index 000000000..61d61ce22 --- /dev/null +++ b/src/Magnum/Platform/WindowlessEglApplication.cpp @@ -0,0 +1,137 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + 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. +*/ + +#include "WindowlessEglApplication.h" + +#include +#include + +#include "Magnum/Version.h" +#include "Magnum/Platform/Context.h" + +#include "Implementation/Egl.h" + +namespace Magnum { namespace Platform { + +#ifndef DOXYGEN_GENERATING_OUTPUT +WindowlessEglApplication::WindowlessEglApplication(const Arguments& arguments): WindowlessEglApplication{arguments, Configuration{}} {} +#endif + +WindowlessEglApplication::WindowlessEglApplication(const Arguments& arguments, const Configuration& configuration): WindowlessEglApplication{arguments, nullptr} { + createContext(configuration); +} + +WindowlessEglApplication::WindowlessEglApplication(const Arguments& arguments, std::nullptr_t): _context{new Context{NoCreate, arguments.argc, arguments.argv}} {} + +void WindowlessEglApplication::createContext() { createContext({}); } + +void WindowlessEglApplication::createContext(const Configuration& configuration) { + if(!tryCreateContext(configuration)) std::exit(1); +} + +bool WindowlessEglApplication::tryCreateContext(const Configuration& configuration) { + CORRADE_ASSERT(_context->version() == Version::None, "Platform::WindowlessEglApplication::tryCreateContext(): context already created", false); + + /* Initialize */ + _display = eglGetDisplay(EGL_DEFAULT_DISPLAY); + if(!eglInitialize(_display, nullptr, nullptr)) { + Error() << "Platform::WindowlessEglApplication::tryCreateContext(): cannot initialize EGL:" << Implementation::eglErrorString(eglGetError()); + return false; + } + + const EGLenum api = + #ifndef MAGNUM_TARGET_GLES + EGL_OPENGL_API + #else + EGL_OPENGL_ES_API + #endif + ; + if(!eglBindAPI(api)) { + Error() << "Platform::WindowlessEglApplication::tryCreateContext(): cannot bind EGL API:" << Implementation::eglErrorString(eglGetError()); + return false; + } + + /* Choose EGL config */ + static const EGLint attribs[] = { + EGL_SURFACE_TYPE, EGL_PBUFFER_BIT, + #ifndef MAGNUM_TARGET_GLES + EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, + #elif defined(MAGNUM_TARGET_GLES3) + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES3_BIT_KHR, + #elif defined(MAGNUM_TARGET_GLES2) + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + #else + #error unsupported OpenGL edition + #endif + EGL_NONE + }; + EGLint configCount; + if(!eglChooseConfig(_display, attribs, &_config, 1, &configCount)) { + Error() << "Platform::WindowlessEglApplication::tryCreateContext(): cannot get EGL visual config:" << Implementation::eglErrorString(eglGetError()); + return false; + } + + if(!configCount) { + Error() << "Platform::WindowlessEglApplication::tryCreateContext(): no matching EGL visual config available"; + return false; + } + + const EGLint attributes[] = { + #ifdef MAGNUM_TARGET_GLES + EGL_CONTEXT_CLIENT_VERSION, + #ifdef MAGNUM_TARGET_GLES3 + 3, + #elif defined(MAGNUM_TARGET_GLES2) + 2, + #else + #error unsupported OpenGL ES version + #endif + #endif + EGL_CONTEXT_FLAGS_KHR, EGLint(configuration.flags()), + EGL_NONE + }; + + if(!(_glContext = eglCreateContext(_display, _config, EGL_NO_CONTEXT, attributes))) { + Error() << "Platform::WindowlessEglApplication::tryCreateContext(): cannot create EGL context:" << Implementation::eglErrorString(eglGetError()); + return false; + } + if(!eglMakeCurrent(_display, EGL_NO_SURFACE, EGL_NO_SURFACE, _glContext)) { + Error() << "Platform::WindowlessEglApplication::tryCreateContext(): cannot make context current:" << Implementation::eglErrorString(eglGetError()); + return false; + } + + /* Return true if the initialization succeeds */ + return _context->tryCreate(); +} + +WindowlessEglApplication::~WindowlessEglApplication() { + _context.reset(); + + eglDestroyContext(_display, _glContext); + eglDestroySurface(_display, EGL_NO_SURFACE); + eglTerminate(_display); +} + +}} diff --git a/src/Magnum/Platform/WindowlessEglApplication.h b/src/Magnum/Platform/WindowlessEglApplication.h new file mode 100644 index 000000000..034e66b0d --- /dev/null +++ b/src/Magnum/Platform/WindowlessEglApplication.h @@ -0,0 +1,242 @@ +#ifndef Magnum_Platform_WindowlessEglApplication_h +#define Magnum_Platform_WindowlessEglApplication_h +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + 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 + * @brief Class @ref Magnum::Platform::WindowlessEglApplication, macro @ref MAGNUM_WINDOWLESSEGLAPPLICATION_MAIN() + */ + +#include +#include +#include +#include +/* undef Xlib nonsense to avoid conflicts */ +#undef Always +#undef Complex +#undef None +#undef Status + +#include "Magnum/Magnum.h" +#include "Magnum/OpenGL.h" +#include "Magnum/Platform/Platform.h" + +namespace Magnum { namespace Platform { + +/** +@brief Windowless EGL application + +Application for offscreen rendering using EGL without any windowing system. +Does not have any default framebuffer. Supported mainly on OpenGL ES drivers, +for desktop OpenGL the only driver that supports this configuration is +NVidia >= 355. See other `Windowless*Application` classes for an alternative. + +It is built if `WITH_WINDOWLESSEGLAPPLICATION` is enabled in CMake. + +## Bootstrap application + +Fully contained windowless application using @ref WindowlessEglApplication +along with CMake setup is available in `windowless` branch of +[Magnum Bootstrap](https://github.com/mosra/magnum-bootstrap) repository, +download it as [tar.gz](https://github.com/mosra/magnum-bootstrap/archive/windowless.tar.gz) +or [zip](https://github.com/mosra/magnum-bootstrap/archive/windowless.zip) +file. After extracting the downloaded archive you can build and run the +application with these four commands: + + mkdir build && cd build + cmake .. + cmake --build . + ./src/MyApplication # or ./src/Debug/MyApplication + +See @ref cmake for more information. + +## General usage + +In CMake you need to request `WindowlessEglApplication` component and link to +`Magnum::WindowlessEglApplication` target. If no other windowless application +is requested, you can also use generic `Magnum::WindowlessApplication` alias to +simplify porting. Again, see @ref building and @ref cmake for more information. + +Place your code into @ref exec(). The subclass can be then used in main +function using @ref MAGNUM_WINDOWLESSEGLAPPLICATION_MAIN() macro. See +@ref platform for more information. +@code +class MyApplication: public Platform::WindowlessEglApplication { + // implement required methods... +}; +MAGNUM_WINDOWLESSEGLAPPLICATION_MAIN(MyApplication) +@endcode + +If no other application header is included, this class is also aliased to +`Platform::WindowlessApplication` and the macro is aliased to +`MAGNUM_WINDOWLESSAPPLICATION_MAIN()` to simplify porting. +*/ +class WindowlessEglApplication { + 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; + + /** @copydoc Sdl2Application::Sdl2Application(const Arguments&, const Configuration&) */ + #ifdef DOXYGEN_GENERATING_OUTPUT + explicit WindowlessEglApplication(const Arguments& arguments, const Configuration& configuration = Configuration()); + #else + /* To avoid "invalid use of incomplete type" */ + explicit WindowlessEglApplication(const Arguments& arguments, const Configuration& configuration); + explicit WindowlessEglApplication(const Arguments& arguments); + #endif + + /** @copydoc Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) */ + explicit WindowlessEglApplication(const Arguments& arguments, std::nullptr_t); + + /** @brief Copying is not allowed */ + WindowlessEglApplication(const WindowlessEglApplication&) = delete; + + /** @brief Moving is not allowed */ + WindowlessEglApplication(WindowlessEglApplication&&) = delete; + + /** @brief Copying is not allowed */ + WindowlessEglApplication& operator=(const WindowlessEglApplication&) = delete; + + /** @brief Moving is not allowed */ + WindowlessEglApplication& operator=(WindowlessEglApplication&&) = delete; + + /** + * @brief Execute application + * @return Value for returning from `main()` + * + * See @ref MAGNUM_WINDOWLESSEGLAPPLICATION_MAIN() for usage + * information. + */ + virtual int exec() = 0; + + protected: + /* Nobody will need to have (and delete) WindowlessEglApplication*, + thus this is faster than public pure virtual destructor */ + ~WindowlessEglApplication(); + + /** @copydoc Sdl2Application::createContext() */ + #ifdef DOXYGEN_GENERATING_OUTPUT + void createContext(const Configuration& configuration = Configuration()); + #else + /* To avoid "invalid use of incomplete type" */ + void createContext(const Configuration& configuration); + void createContext(); + #endif + + /** @copydoc Sdl2Application::tryCreateContext() */ + bool tryCreateContext(const Configuration& configuration); + + private: + EGLDisplay _display; + EGLConfig _config; + EGLContext _glContext; + + std::unique_ptr _context; +}; + +/** +@brief Configuration + +@see @ref WindowlessEglApplication(), @ref createContext(), + @ref tryCreateContext() +*/ +class WindowlessEglApplication::Configuration { + public: + /** + * @brief Context flag + * + * @see @ref Flags, @ref setFlags(), @ref Context::Flag + */ + enum class Flag: int { + Debug = EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR /**< Create debug context */ + }; + + /** + * @brief Context flags + * + * @see @ref setFlags(), @ref Context::Flags + */ + #ifndef DOXYGEN_GENERATING_OUTPUT + typedef Containers::EnumSet Flags; + #else + typedef Containers::EnumSet Flags; + #endif + + constexpr /*implicit*/ Configuration() {} + + /** @brief Context flags */ + Flags flags() const { return _flags; } + + /** + * @brief Set context flags + * @return Reference to self (for method chaining) + * + * Default is no flag. See also @ref Context::flags(). + */ + Configuration& setFlags(Flags flags) { + _flags = flags; + return *this; + } + + private: + Flags _flags; +}; + +/** @hideinitializer +@brief Entry point for windowless EGL application +@param className Class name + +See @ref Magnum::Platform::WindowlessEglApplication "Platform::WindowlessEglApplication" +for usage information. This macro abstracts out platform-specific entry point +code, see @ref portability-applications for more information. When no other +windowless application header is included this macro is also aliased to +`MAGNUM_WINDOWLESSAPPLICATION_MAIN()`. +*/ +#define MAGNUM_WINDOWLESSEGLAPPLICATION_MAIN(className) \ + int main(int argc, char** argv) { \ + className app({argc, argv}); \ + return app.exec(); \ + } + +#ifndef DOXYGEN_GENERATING_OUTPUT +#ifndef MAGNUM_WINDOWLESSAPPLICATION_MAIN +typedef WindowlessEglApplication WindowlessApplication; +#define MAGNUM_WINDOWLESSAPPLICATION_MAIN(className) MAGNUM_WINDOWLESSEGLAPPLICATION_MAIN(className) +#else +#undef MAGNUM_WINDOWLESSAPPLICATION_MAIN +#endif +#endif + +}} + +#endif From 4f94c264679a25b598758cf721653ad180109a49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 5 Feb 2016 17:47:47 +0100 Subject: [PATCH 176/258] Added TARGET_HEADLESS option. Toggles between using CGL/GLX/WGL (requiring running graphical desktop environment) or EGL (without display attachment) for command-line utilities and GL tests. Also exposed to the user through MAGNUM_TARGET_HEADLESS CMake and preprocessor variables. --- CMakeLists.txt | 9 ++++++++- doc/building.dox | 5 +++++ doc/cmake.dox | 4 +++- modules/FindMagnum.cmake | 4 +++- src/Magnum/Magnum.h | 12 ++++++++++++ src/Magnum/Platform/CMakeLists.txt | 4 +++- src/Magnum/Platform/magnum-info.cpp | 11 +++++++++-- src/Magnum/Test/AbstractOpenGLTester.h | 4 +++- src/Magnum/Text/CMakeLists.txt | 4 +++- src/Magnum/Text/fontconverter.cpp | 4 +++- src/Magnum/TextureTools/CMakeLists.txt | 4 +++- src/Magnum/TextureTools/distancefieldconverter.cpp | 4 +++- src/Magnum/configure.h.cmake | 1 + 13 files changed, 59 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a88557da1..117d4a8a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,6 +52,7 @@ endif() cmake_dependent_option(TARGET_GLES2 "Build for OpenGL ES 2 / WebGL 1.0" ON "TARGET_GLES" OFF) cmake_dependent_option(TARGET_DESKTOP_GLES "Build for OpenGL ES on desktop" OFF "TARGET_GLES" OFF) +option(TARGET_HEADLESS "Build command-line utilities for use on a headless machines" OFF) # Magnum Info (currently only using GLX, CGL, WGL/EGL on Windows or on NaCl) if(CORRADE_TARGET_UNIX OR CORRADE_TARGET_NACL OR CORRADE_TARGET_WINDOWS) @@ -194,9 +195,15 @@ endif() if(TARGET_DESKTOP_GLES) set(MAGNUM_TARGET_DESKTOP_GLES 1) endif() +if(TARGET_HEADLESS) + set(MAGNUM_TARGET_HEADLESS 1) +endif() if(BUILD_GL_TESTS) - if(CORRADE_TARGET_APPLE) + if(MAGNUM_TARGET_HEADLESS) + set(WITH_WINDOWLESSEGLAPPLICATION ON) + set(GL_TEST_LIBRARIES Magnum MagnumWindowlessEglApplication) + elseif(CORRADE_TARGET_APPLE) set(WITH_WINDOWLESSCGLAPPLICATION ON) set(GL_TEST_LIBRARIES Magnum MagnumWindowlessCglApplication) elseif(CORRADE_TARGET_UNIX AND (NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES)) diff --git a/doc/building.dox b/doc/building.dox index 7890e2968..b6d2092d3 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -167,6 +167,11 @@ available for desktop OpenGL only, see @ref requires-gl. `TARGET_GLES` is set. - `TARGET_DESKTOP_GLES` -- Target OpenGL ES on desktop, i.e. use OpenGL ES emulation in desktop OpenGL library. Might not be supported in all drivers. +- `TARGET_HEADLESS` -- Build command-line utilities for use on a headless + machine. Basically it means that EGL with no display attachment is being + used everywhere instead of platform-specific toolkits like CGL, GLX or WGL. + Supported mainly on OpenGL ES drivers, for desktop OpenGL the only driver + that supports this configuration is NVidia >= 355. The features used can be conveniently detected in depending projects both in CMake and C++ sources, see @ref cmake and @ref Magnum/Magnum.h for more diff --git a/doc/cmake.dox b/doc/cmake.dox index 73892ee0f..dd4d9fe62 100644 --- a/doc/cmake.dox +++ b/doc/cmake.dox @@ -183,7 +183,9 @@ are also available as preprocessor variables if including - `MAGNUM_TARGET_GLES3` -- Defined if compiled for OpenGL ES 3.0 - `MAGNUM_TARGET_DESKTOP_GLES` -- Defined if compiled with OpenGL ES emulation on desktop OpenGL -- `MAGNUM_TARGET_WEBGL` --- Defined if compiled for WebGL +- `MAGNUM_TARGET_WEBGL` -- Defined if compiled for WebGL +- `MAGNUM_TARGET_HEADLESS` -- Defined if compiled for headless machines. See + @ref MAGNUM_TARGET_HEADLESS documentation for more information. Workflows without imported targets are deprecated and the following variables are included just for backwards compatibility and only if diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 11aa63e0e..ae7b4fd4e 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -109,6 +109,7 @@ # MAGNUM_TARGET_DESKTOP_GLES - Defined if compiled with OpenGL ES # emulation on desktop OpenGL # MAGNUM_TARGET_WEBGL - Defined if compiled for WebGL +# MAGNUM_TARGET_HEADLESS - Defined if compiled for headless machines # # Additionally these variables are defined for internal usage: # @@ -207,7 +208,8 @@ set(_magnumFlags TARGET_GLES2 TARGET_GLES3 TARGET_DESKTOP_GLES - TARGET_WEBGL) + TARGET_WEBGL + TARGET_HEADLESS) foreach(_magnumFlag ${_magnumFlags}) string(FIND "${_magnumConfigure}" "#define MAGNUM_${_magnumFlag}" _magnum_${_magnumFlag}) if(NOT _magnum_${_magnumFlag} EQUAL -1) diff --git a/src/Magnum/Magnum.h b/src/Magnum/Magnum.h index 39652c3ac..3461be9c3 100644 --- a/src/Magnum/Magnum.h +++ b/src/Magnum/Magnum.h @@ -143,6 +143,18 @@ which you might want to be aware of. Implies also @ref MAGNUM_TARGET_GLES and */ #define MAGNUM_TARGET_WEBGL #undef MAGNUM_TARGET_WEBGL + +/** +@brief Headless target + +Defined if the engine is built for use on a headless machine (without any +graphical desktop environment). Basically it means that EGL with no display +attachment is being used everywhere instead of platform-specific toolkits like +CGL, GLX or WGL. Note that this might not be supported on all platforms, see +@ref Platform::WindowlessEglApplication for more information. +*/ +#define MAGNUM_TARGET_HEADLESS +#undef MAGNUM_TARGET_HEADLESS #endif /** @{ @name Basic type definitions diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index 520eefeed..f9e870a60 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -657,7 +657,9 @@ endif() if(WITH_MAGNUMINFO) add_executable(magnum-info magnum-info.cpp) target_link_libraries(magnum-info Magnum) - if(CORRADE_TARGET_APPLE) + if(MAGNUM_TARGET_HEADLESS) + target_link_libraries(magnum-info MagnumWindowlessEglApplication) + elseif(CORRADE_TARGET_APPLE) target_link_libraries(magnum-info MagnumWindowlessCglApplication) elseif(CORRADE_TARGET_NACL) target_link_libraries(magnum-info MagnumWindowlessNaClApplication) diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index a3854cbe3..7d2895e61 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -56,7 +56,9 @@ #include "Magnum/TransformFeedback.h" #endif -#ifdef CORRADE_TARGET_NACL +#ifdef MAGNUM_TARGET_HEADLESS +#include "Magnum/Platform/WindowlessEglApplication.h" +#elif defined(CORRADE_TARGET_NACL) #include "Magnum/Platform/WindowlessNaClApplication.h" #elif defined(CORRADE_TARGET_APPLE) #include "Magnum/Platform/WindowlessCglApplication.h" @@ -168,7 +170,9 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat Debug() << " +---------------------------------------------------------+"; Debug() << ""; - #ifdef MAGNUM_WINDOWLESSNACLAPPLICATION_MAIN + #ifdef MAGNUM_WINDOWLESSEGLAPPLICATION_MAIN + Debug() << "Used application: Platform::WindowlessEglApplication"; + #elif defined(MAGNUM_WINDOWLESSNACLAPPLICATION_MAIN) Debug() << "Used application: Platform::WindowlessNaClApplication"; #elif defined(MAGNUM_WINDOWLESSCGLAPPLICATION_MAIN) Debug() << "Used application: Platform::WindowlessCglApplication"; @@ -245,6 +249,9 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #ifdef MAGNUM_TARGET_WEBGL Debug() << " MAGNUM_TARGET_WEBGL"; #endif + #ifdef MAGNUM_TARGET_HEADLESS + Debug() << " MAGNUM_TARGET_HEADLESS"; + #endif Debug() << ""; /* Create context here, so the context creation info is displayed at proper diff --git a/src/Magnum/Test/AbstractOpenGLTester.h b/src/Magnum/Test/AbstractOpenGLTester.h index 54a1f5ef3..b8778334d 100644 --- a/src/Magnum/Test/AbstractOpenGLTester.h +++ b/src/Magnum/Test/AbstractOpenGLTester.h @@ -32,7 +32,9 @@ #include "Magnum/DebugOutput.h" #include "Magnum/Renderer.h" -#if defined(CORRADE_TARGET_APPLE) +#ifdef MAGNUM_TARGET_HEADLESS +#include "Magnum/Platform/WindowlessEglApplication.h" +#elif defined(CORRADE_TARGET_APPLE) #include "Magnum/Platform/WindowlessCglApplication.h" #elif defined(CORRADE_TARGET_UNIX) && (!defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_DESKTOP_GLES)) #include "Magnum/Platform/WindowlessGlxApplication.h" diff --git a/src/Magnum/Text/CMakeLists.txt b/src/Magnum/Text/CMakeLists.txt index 7c6579de9..0f97736d9 100644 --- a/src/Magnum/Text/CMakeLists.txt +++ b/src/Magnum/Text/CMakeLists.txt @@ -63,7 +63,9 @@ if(WITH_FONTCONVERTER) add_executable(magnum-fontconverter fontconverter.cpp) target_include_directories(magnum-fontconverter PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(magnum-fontconverter Magnum MagnumText) - if(CORRADE_TARGET_APPLE) + if(MAGNUM_TARGET_HEADLESS) + target_link_libraries(magnum-fontconverter MagnumWindowlessEglApplication) + elseif(CORRADE_TARGET_APPLE) target_link_libraries(magnum-fontconverter MagnumWindowlessCglApplication) elseif(CORRADE_TARGET_UNIX AND NOT TARGET_GLES) target_link_libraries(magnum-fontconverter MagnumWindowlessGlxApplication) diff --git a/src/Magnum/Text/fontconverter.cpp b/src/Magnum/Text/fontconverter.cpp index cc5007139..78a90dbf4 100644 --- a/src/Magnum/Text/fontconverter.cpp +++ b/src/Magnum/Text/fontconverter.cpp @@ -32,7 +32,9 @@ #include "Magnum/Text/DistanceFieldGlyphCache.h" #include "Magnum/Trade/AbstractImageConverter.h" -#ifdef CORRADE_TARGET_APPLE +#ifdef MAGNUM_TARGET_HEADLESS +#include "Magnum/Platform/WindowlessEglApplication.h" +#elif defined(CORRADE_TARGET_APPLE) #include "Magnum/Platform/WindowlessCglApplication.h" #elif defined(CORRADE_TARGET_UNIX) #include "Magnum/Platform/WindowlessGlxApplication.h" diff --git a/src/Magnum/TextureTools/CMakeLists.txt b/src/Magnum/TextureTools/CMakeLists.txt index bb74b0957..e93c999c6 100644 --- a/src/Magnum/TextureTools/CMakeLists.txt +++ b/src/Magnum/TextureTools/CMakeLists.txt @@ -53,7 +53,9 @@ if(WITH_DISTANCEFIELDCONVERTER) add_executable(magnum-distancefieldconverter distancefieldconverter.cpp) target_include_directories(magnum-distancefieldconverter PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(magnum-distancefieldconverter Magnum MagnumTextureTools) - if(CORRADE_TARGET_APPLE) + if(MAGNUM_TARGET_HEADLESS) + target_link_libraries(magnum-distancefieldconverter MagnumWindowlessEglApplication) + elseif(CORRADE_TARGET_APPLE) target_link_libraries(magnum-distancefieldconverter MagnumWindowlessCglApplication) elseif(CORRADE_TARGET_UNIX AND NOT TARGET_GLES) target_link_libraries(magnum-distancefieldconverter MagnumWindowlessGlxApplication) diff --git a/src/Magnum/TextureTools/distancefieldconverter.cpp b/src/Magnum/TextureTools/distancefieldconverter.cpp index 2c55c73b9..bded817b8 100644 --- a/src/Magnum/TextureTools/distancefieldconverter.cpp +++ b/src/Magnum/TextureTools/distancefieldconverter.cpp @@ -38,7 +38,9 @@ #include "Magnum/Trade/AbstractImageConverter.h" #include "Magnum/Trade/ImageData.h" -#ifdef CORRADE_TARGET_APPLE +#ifdef MAGNUM_TARGET_HEADLESS +#include "Magnum/Platform/WindowlessEglApplication.h" +#elif defined(CORRADE_TARGET_APPLE) #include "Magnum/Platform/WindowlessCglApplication.h" #elif defined(CORRADE_TARGET_UNIX) #include "Magnum/Platform/WindowlessGlxApplication.h" diff --git a/src/Magnum/configure.h.cmake b/src/Magnum/configure.h.cmake index 0a4e7da66..54abfa21d 100644 --- a/src/Magnum/configure.h.cmake +++ b/src/Magnum/configure.h.cmake @@ -30,3 +30,4 @@ #cmakedefine MAGNUM_TARGET_GLES3 #cmakedefine MAGNUM_TARGET_DESKTOP_GLES #cmakedefine MAGNUM_TARGET_WEBGL +#cmakedefine MAGNUM_TARGET_HEADLESS From 60eab7e4fd13957b25ee47663f90257d727a3daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 25 Mar 2016 19:24:10 +0100 Subject: [PATCH 177/258] modules: guess what I screwed up this time! --- modules/FindMagnum.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index ae7b4fd4e..6d9637c97 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -499,7 +499,6 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) find_package(EGL) set_property(TARGET Magnum::${_component} APPEND PROPERTY INTERFACE_LINK_LIBRARIES EGL::EGL) - endif() # Windowless WGL application has no additional dependencies From c25c6031e241deaaef66756db90ca749b3e64e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 25 Mar 2016 19:24:28 +0100 Subject: [PATCH 178/258] modules: and what now! --- modules/FindMagnum.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 6d9637c97..b87a4e0da 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -337,7 +337,7 @@ endif() # Component distinction (listing them explicitly to avoid mistakes with finding # components from other repositories) -set(_MAGNUM_LIBRARY_COMPONENTS "^(Audio|DebugTools|MeshTools|Primitives|SceneGraph|Shaders|Shapes|Text|TextureTools|GlutApplication|GlxApplication|NaClApplication|Sdl2Application|XEglApplication|WindowlessCglApplication|WindowlessEglApplication|WindowlessGlxApplication|WindowlessNaClApplication|WindowlessWglApplication|WindowlessWindowsEglApplication|CglContext|EglContext|GlxContext|WglContext)$") +set(_MAGNUM_LIBRARY_COMPONENTS "^(Audio|DebugTools|MeshTools|Primitives|SceneGraph|Shaders|Shapes|Text|TextureTools|AndroidApplication|GlutApplication|GlxApplication|NaClApplication|Sdl2Application|XEglApplication|WindowlessCglApplication|WindowlessEglApplication|WindowlessGlxApplication|WindowlessNaClApplication|WindowlessWglApplication|WindowlessWindowsEglApplication|CglContext|EglContext|GlxContext|WglContext)$") set(_MAGNUM_PLUGIN_COMPONENTS "^(MagnumFont|MagnumFontConverter|ObjImporter|TgaImageConverter|TgaImporter|WavAudioImporter)$") set(_MAGNUM_EXECUTABLE_COMPONENTS "^(distancefieldconverter|fontconverter|info)$") From 45439ef9f6c17e43f793754f796558bd1c6bc199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 6 Apr 2016 10:29:36 +0200 Subject: [PATCH 179/258] doc: finally mention CMAKE_FIND_ROOT_PATH. A lot of people asked this, not sure why I didn't put this in already. --- doc/building.dox | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/building.dox b/doc/building.dox index b6d2092d3..1d9e5cd2a 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -376,6 +376,10 @@ contents in `toolchains/` subdirectory. git submodule init git submodule update +Note that CMake for some reason treats `CMAKE_PREFIX_PATH` and +`CMAKE_INSTALL_PREFIX` differently while crosscompiling and you may need to set +also `CMAKE_FIND_ROOT_PATH` to make it able to find the dependencies. + @subsection building-cross-winrt Crosscompiling for Windows RT As said above, you need native build of `corrade-rc` executable. The below From 05903fcad92f4613e752dfece4660adb547a2781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 6 Apr 2016 12:11:01 +0200 Subject: [PATCH 180/258] Clarify that it is possible to read UnsignedInt from framebuffer in ES3. --- src/Magnum/PixelFormat.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Magnum/PixelFormat.h b/src/Magnum/PixelFormat.h index 118c1af45..1c891fb96 100644 --- a/src/Magnum/PixelFormat.h +++ b/src/Magnum/PixelFormat.h @@ -355,10 +355,10 @@ enum class PixelType: GLenum { /** * Each component unsigned int. - * @requires_gles30 For texture data only, extension @es_extension{OES,depth_texture} - * or @es_extension{ANGLE,depth_texture} in OpenGL ES 2.0. - * @requires_webgl20 For texture data only, extension - * @webgl_extension{WEBGL,depth_texture} in WebGL 1.0. + * @requires_gles30 In OpenGL ES 2.0 for texture data only, using extension + * @es_extension{OES,depth_texture} or @es_extension{ANGLE,depth_texture} + * @requires_webgl20 In WebGL 1.0 for texture data only, using extension + * @webgl_extension{WEBGL,depth_texture} */ UnsignedInt = GL_UNSIGNED_INT, From 122cdd228200810f3530b265e6f9d94d1a0d6ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 6 Apr 2016 15:51:11 +0200 Subject: [PATCH 181/258] Simplify BufferGLTest. --- src/Magnum/Test/BufferGLTest.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/Magnum/Test/BufferGLTest.cpp b/src/Magnum/Test/BufferGLTest.cpp index 858e57f43..55129e983 100644 --- a/src/Magnum/Test/BufferGLTest.cpp +++ b/src/Magnum/Test/BufferGLTest.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include "Magnum/Buffer.h" #include "Magnum/Context.h" @@ -247,12 +248,9 @@ void BufferGLTest::data() { #ifndef MAGNUM_TARGET_GLES const Containers::Array contents = buffer.data(); MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(contents.size(), 5); - CORRADE_COMPARE(contents[0], 2); - CORRADE_COMPARE(contents[1], 7); - CORRADE_COMPARE(contents[2], 5); - CORRADE_COMPARE(contents[3], 13); - CORRADE_COMPARE(contents[4], 25); + CORRADE_COMPARE_AS(contents, + Containers::ArrayView{data}, + TestSuite::Compare::Container); #endif /* Plain array */ @@ -277,10 +275,9 @@ void BufferGLTest::data() { #ifndef MAGNUM_TARGET_GLES const Containers::Array subContents = buffer.subData(4, 3); MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(subContents.size(), 3); - CORRADE_COMPARE(subContents[0], 125); - CORRADE_COMPARE(subContents[1], 3); - CORRADE_COMPARE(subContents[2], 15); + CORRADE_COMPARE_AS(subContents, + Containers::ArrayView{subData}, + TestSuite::Compare::Container); #endif } @@ -427,10 +424,9 @@ void BufferGLTest::copy() { /** @todo How to verify the contents in ES? */ #ifndef MAGNUM_TARGET_GLES const Containers::Array subContents = buffer2.subData(2, 3); - CORRADE_COMPARE(subContents.size(), 3); - CORRADE_COMPARE(subContents[0], 7); - CORRADE_COMPARE(subContents[1], 5); - CORRADE_COMPARE(subContents[2], 13); + CORRADE_COMPARE_AS(subContents, + Containers::ArrayView{data}.slice(1, 4), + TestSuite::Compare::Container); #endif } #endif From f0a57a1a86576e6d69f8616a9c50dd75cdbedd8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 6 Apr 2016 16:15:40 +0200 Subject: [PATCH 182/258] doc: fix typo. --- Doxyfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doxyfile b/Doxyfile index 2a9f9a10d..63a53ee51 100644 --- a/Doxyfile +++ b/Doxyfile @@ -266,7 +266,7 @@ ALIASES = \ "extension{2}=\1_\2" \ "extension2{2}=\1_\2" \ "extension3{3}=\1_\2" \ - "requires_gles20=@xrefitem requires-gles20 \"Requires OpenGL ES 2.0 / WebGL 1.%\" \"Functionality requiring OpenGL ES 2.0 or WebGL 1.0\"" \ + "requires_gles20=@xrefitem requires-gles20 \"Requires OpenGL ES 2.0 / WebGL 1.0\" \"Functionality requiring OpenGL ES 2.0 or WebGL 1.0\"" \ "requires_gles30=@xrefitem requires-gles30 \"Requires OpenGL ES 3.0\" \"Functionality requiring OpenGL ES 3.0\"" \ "requires_gles31=@xrefitem requires-gles31 \"Requires OpenGL ES 3.1\" \"Functionality requiring OpenGL ES 3.1\"" \ "requires_es_extension=@xrefitem requires-es-extension \"Requires OpenGL ES extension\" \"Functionality requiring specific OpenGL ES extension\"" \ From cff718b92c8af57c9dd2f0d38c830dcb50dbb26d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Apr 2016 11:05:34 +0200 Subject: [PATCH 183/258] modules: proper bug link. --- modules/FindSDL2.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/FindSDL2.cmake b/modules/FindSDL2.cmake index afc8efdab..fe1435eb7 100644 --- a/modules/FindSDL2.cmake +++ b/modules/FindSDL2.cmake @@ -96,7 +96,7 @@ if(NOT TARGET SDL2::SDL2) add_library(SDL2::SDL2 UNKNOWN IMPORTED) # Work around BUGGY framework support on OSX - # https://cmake.org/Bug/view.php?id=13765 + # https://cmake.org/Bug/view.php?id=14105 if(CORRADE_TARGET_APPLE AND ${SDL2_LIBRARY} MATCHES "\\.framework$") set_property(TARGET SDL2::SDL2 PROPERTY IMPORTED_LOCATION ${SDL2_LIBRARY}/SDL2) else() From 1d587f5200e65a8eb49bf72009555c3e7614f52a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Apr 2016 11:05:45 +0200 Subject: [PATCH 184/258] modules: find EGL before linking to it. --- modules/FindSDL2.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/FindSDL2.cmake b/modules/FindSDL2.cmake index fe1435eb7..172965181 100644 --- a/modules/FindSDL2.cmake +++ b/modules/FindSDL2.cmake @@ -111,6 +111,7 @@ if(NOT TARGET SDL2::SDL2) # Link also EGL library, if on ES (and not on WebGL) if(MAGNUM_TARGET_GLES AND NOT MAGNUM_TARGET_DESKTOP_GLES AND NOT MAGNUM_TARGET_WEBGL) + find_package(EGL REQUIRED) set_property(TARGET SDL2::SDL2 APPEND PROPERTY INTERFACE_LINK_LIBRARIES EGL::EGL) endif() From 26ba9aed286956fe42c360b2d1bc4159b381d452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Apr 2016 11:49:17 +0200 Subject: [PATCH 185/258] modules: work around buggy framework support for OpenGLES on iOS. --- modules/FindEGL.cmake | 14 +++++++++++++- modules/FindOpenGLES3.cmake | 14 +++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/modules/FindEGL.cmake b/modules/FindEGL.cmake index 14ea3baf6..d38ccbf52 100644 --- a/modules/FindEGL.cmake +++ b/modules/FindEGL.cmake @@ -62,7 +62,19 @@ find_package_handle_standard_args(EGL DEFAULT_MSG if(NOT TARGET EGL::EGL) add_library(EGL::EGL UNKNOWN IMPORTED) + + # Work around BUGGY framework support on OSX + # http://public.kitware.com/pipermail/cmake/2016-April/063179.html + if(APPLE AND ${EGL_LIBRARY} MATCHES "\\.framework$") + add_library(EGL::EGL INTERFACE IMPORTED) + set_property(TARGET EGL::EGL APPEND PROPERTY + INTERFACE_LINK_LIBRARIES ${EGL_LIBRARY}) + else() + add_library(EGL::EGL UNKNOWN IMPORTED) + set_property(TARGET EGL::EGL PROPERTY + IMPORTED_LOCATION ${EGL_LIBRARY}) + endif() + set_target_properties(EGL::EGL PROPERTIES - IMPORTED_LOCATION ${EGL_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES ${EGL_INCLUDE_DIR}) endif() diff --git a/modules/FindOpenGLES3.cmake b/modules/FindOpenGLES3.cmake index 51b476a4e..3ae2c4e74 100644 --- a/modules/FindOpenGLES3.cmake +++ b/modules/FindOpenGLES3.cmake @@ -70,9 +70,17 @@ find_package_handle_standard_args("OpenGLES3" DEFAULT_MSG if(NOT TARGET OpenGLES3::OpenGLES3) if(OPENGLES3_LIBRARY_NEEDED) - add_library(OpenGLES3::OpenGLES3 UNKNOWN IMPORTED) - set_property(TARGET OpenGLES3::OpenGLES3 PROPERTY - IMPORTED_LOCATION ${OPENGLES3_LIBRARY}) + # Work around BUGGY framework support on OSX + # http://public.kitware.com/pipermail/cmake/2016-April/063179.html + if(CORRADE_TARGET_APPLE AND ${OPENGLES3_LIBRARY} MATCHES "\\.framework$") + add_library(OpenGLES3::OpenGLES3 INTERFACE IMPORTED) + set_property(TARGET OpenGLES3::OpenGLES3 APPEND PROPERTY + INTERFACE_LINK_LIBRARIES ${OPENGLES3_LIBRARY}) + else() + add_library(OpenGLES3::OpenGLES3 UNKNOWN IMPORTED) + set_property(TARGET OpenGLES3::OpenGLES3 PROPERTY + IMPORTED_LOCATION ${OPENGLES3_LIBRARY}) + endif() else() # This won't work in CMake 2.8.12, but that affects Emscripten only so # I assume people building for that are not on that crap old Ubuntu From 082ca911abc31c968adf4af2bb6016d1cff12c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Apr 2016 12:00:50 +0200 Subject: [PATCH 186/258] Platform: fix building of EglContext with Xcode. The dreaded OBJECT libraries again. Reported the inconvenience here: http://public.kitware.com/pipermail/cmake/2016-April/063178.html --- src/Magnum/CMakeLists.txt | 2 +- src/Magnum/Platform/CMakeLists.txt | 4 +++- src/Magnum/{Math => }/dummy.cpp | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) rename src/Magnum/{Math => }/dummy.cpp (94%) diff --git a/src/Magnum/CMakeLists.txt b/src/Magnum/CMakeLists.txt index f973fc170..52257c48f 100644 --- a/src/Magnum/CMakeLists.txt +++ b/src/Magnum/CMakeLists.txt @@ -323,7 +323,7 @@ if(BUILD_TESTS) # Library with graceful assert for testing add_library(MagnumMathTestLib ${SHARED_OR_STATIC} $ - Math/dummy.cpp) # XCode workaround, see file comment for details + dummy.cpp) # XCode workaround, see file comment for details target_include_directories(MagnumMathTestLib PUBLIC $) target_compile_definitions(MagnumMathTestLib PRIVATE "CORRADE_GRACEFUL_ASSERT") set_target_properties(MagnumMathTestLib PROPERTIES DEBUG_POSTFIX "-d") diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index f9e870a60..a22eb719d 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -578,7 +578,9 @@ if(NEED_EGLCONTEXT OR WITH_EGLCONTEXT) # Also create proper static library, if requested if(WITH_EGLCONTEXT) - add_library(MagnumEglContext STATIC $) + add_library(MagnumEglContext STATIC + $ + dummy.cpp) # XCode workaround, see file comment for details set_target_properties(MagnumEglContext PROPERTIES DEBUG_POSTFIX "-d") if(BUILD_STATIC_PIC) set_target_properties(MagnumEglContext PROPERTIES POSITION_INDEPENDENT_CODE ON) diff --git a/src/Magnum/Math/dummy.cpp b/src/Magnum/dummy.cpp similarity index 94% rename from src/Magnum/Math/dummy.cpp rename to src/Magnum/dummy.cpp index 454fc1bd7..02a434d1f 100644 --- a/src/Magnum/Math/dummy.cpp +++ b/src/Magnum/dummy.cpp @@ -26,5 +26,5 @@ /* XCode-generated project files have a limitation that you can't create a library target from OBJECT sources only and you have to provide at least one file. Otherwise the generated library gets replaced with self-pointing - symlink and the build then obviously fails with "File not found" error. That - affected the MagnumMathTestLib library and this file should fix it. */ + symlink and the build then obviously fails with "File not found" error. + Related: http://public.kitware.com/pipermail/cmake/2016-April/063178.html */ From 144b0c2b8e7ed06d796865aab651962a6de14247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Apr 2016 16:09:20 +0200 Subject: [PATCH 187/258] modules: did I mention already that I'm producing only crap today? --- modules/FindEGL.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/FindEGL.cmake b/modules/FindEGL.cmake index d38ccbf52..b45a09f10 100644 --- a/modules/FindEGL.cmake +++ b/modules/FindEGL.cmake @@ -61,8 +61,6 @@ find_package_handle_standard_args(EGL DEFAULT_MSG EGL_INCLUDE_DIR) if(NOT TARGET EGL::EGL) - add_library(EGL::EGL UNKNOWN IMPORTED) - # Work around BUGGY framework support on OSX # http://public.kitware.com/pipermail/cmake/2016-April/063179.html if(APPLE AND ${EGL_LIBRARY} MATCHES "\\.framework$") From 9f9a8baf105a7f9280851ea36d848270e6be553e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Apr 2016 16:13:06 +0200 Subject: [PATCH 188/258] Platform: apparently there was't a single change that worked right away. Ugh. --- src/Magnum/Platform/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index a22eb719d..89f348dfc 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -580,7 +580,7 @@ if(NEED_EGLCONTEXT OR WITH_EGLCONTEXT) if(WITH_EGLCONTEXT) add_library(MagnumEglContext STATIC $ - dummy.cpp) # XCode workaround, see file comment for details + ../dummy.cpp) # XCode workaround, see file comment for details set_target_properties(MagnumEglContext PROPERTIES DEBUG_POSTFIX "-d") if(BUILD_STATIC_PIC) set_target_properties(MagnumEglContext PROPERTIES POSITION_INDEPENDENT_CODE ON) From c54818b91bac585623e76e9db67296ef370599bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 8 Apr 2016 12:19:22 +0200 Subject: [PATCH 189/258] Updated toolchains submodule. --- toolchains | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains b/toolchains index 30104c2c9..db1c8163e 160000 --- a/toolchains +++ b/toolchains @@ -1 +1 @@ -Subproject commit 30104c2c9388c5825380febbf6e25bb487912da6 +Subproject commit db1c8163e6a43bd8a77029b7080d3a802870b57d From a5941ac3ea5f2d97a2ee53957d70bd034d7996e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 8 Apr 2016 12:19:43 +0200 Subject: [PATCH 190/258] No need to set CMAKE_MODULE_PATH explicitly when crosscompiling anymore. --- doc/building.dox | 6 ------ package/archlinux/PKGBUILD-android-arm | 1 - package/archlinux/PKGBUILD-android-x86 | 1 - package/archlinux/PKGBUILD-emscripten | 1 - package/archlinux/PKGBUILD-emscripten-webgl2 | 1 - package/archlinux/PKGBUILD-nacl-glibc | 2 -- package/archlinux/PKGBUILD-nacl-newlib | 2 -- package/ci/jenkins-android.xml | 1 - package/ci/jenkins-emscripten.xml | 1 - package/ci/jenkins-nacl.xml | 1 - src/Magnum/Platform/AndroidApplication.h | 8 ++------ src/Magnum/Platform/NaClApplication.h | 2 -- src/Magnum/Platform/Sdl2Application.h | 2 -- 13 files changed, 2 insertions(+), 27 deletions(-) diff --git a/doc/building.dox b/doc/building.dox index 1d9e5cd2a..c454b6e00 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -462,7 +462,6 @@ in `CMAKE_PREFIX_PATH`. mkdir build-nacl-x86-32 && cd build-nacl-x86-32 cmake .. \ - -DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/NaCl-newlib-x86-32.cmake" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH=/usr/nacl \ @@ -473,7 +472,6 @@ in `CMAKE_PREFIX_PATH`. mkdir build-nacl-x86-64 && cd build-nacl-x86-64 cmake .. \ - -DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/NaCl-newlib-x86-64.cmake" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH=/usr/nacl \ @@ -512,7 +510,6 @@ equivalent) by disabling `TARGET_GLES2`. mkdir build-emscripten && cd build-emscripten cmake .. \ - -DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten.cmake" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH=/usr/lib/emscripten/system \ @@ -551,7 +548,6 @@ enabled by default, switch to 3.0 by disabling `TARGET_GLES2`. mkdir build-ios && cd build-ios cmake .. \ - -DCMAKE_MODULE_PATH=/absolute/path/to/toolchains/modules/ \ -DCMAKE_TOOLCHAIN_FILE=../toolchains/generic/iOS.cmake \ -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk \ -DCMAKE_OSX_ARCHITECTURES="arm64;armv7;armv7s" \ @@ -590,7 +586,6 @@ built for OpenGL ES 2.0 by default, switch to 3.0 by disabling `TARGET_GLES2`. mkdir build-android-arm && cd build-android-arm cmake .. \ - -DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Android-ARM.cmake" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH=/opt/android-ndk/platforms/android-19/arch-arm/usr \ @@ -601,7 +596,6 @@ built for OpenGL ES 2.0 by default, switch to 3.0 by disabling `TARGET_GLES2`. mkdir build-android-x86 && cd build-android-x86 cmake .. \ - -DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Android-x86.cmake" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH=/opt/android-ndk/platforms/android-19/arch-x86/usr \ diff --git a/package/archlinux/PKGBUILD-android-arm b/package/archlinux/PKGBUILD-android-arm index 272043844..01b7a6154 100644 --- a/package/archlinux/PKGBUILD-android-arm +++ b/package/archlinux/PKGBUILD-android-arm @@ -18,7 +18,6 @@ build() { cd "$_rootdir/build-android-arm" cmake .. \ - -DCMAKE_MODULE_PATH="$_rootdir/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE="$_rootdir/toolchains/generic/Android-ARM.cmake" \ -DTARGET_GLES=ON \ -DTARGET_GLES2=ON \ diff --git a/package/archlinux/PKGBUILD-android-x86 b/package/archlinux/PKGBUILD-android-x86 index d8225212a..5862419ef 100644 --- a/package/archlinux/PKGBUILD-android-x86 +++ b/package/archlinux/PKGBUILD-android-x86 @@ -18,7 +18,6 @@ build() { cd "$_rootdir/build-android-x86" cmake .. \ - -DCMAKE_MODULE_PATH="$_rootdir/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE="$_rootdir/toolchains/generic/Android-x86.cmake" \ -DTARGET_GLES=ON \ -DTARGET_GLES2=ON \ diff --git a/package/archlinux/PKGBUILD-emscripten b/package/archlinux/PKGBUILD-emscripten index ba6c218bc..12445e06c 100644 --- a/package/archlinux/PKGBUILD-emscripten +++ b/package/archlinux/PKGBUILD-emscripten @@ -18,7 +18,6 @@ build() { cd "$_rootdir/build-emscripten" cmake .. \ - -DCMAKE_MODULE_PATH="$_rootdir/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE="$_rootdir/toolchains/generic/Emscripten.cmake" \ -DCMAKE_PREFIX_PATH=/usr/lib/emscripten/system fi diff --git a/package/archlinux/PKGBUILD-emscripten-webgl2 b/package/archlinux/PKGBUILD-emscripten-webgl2 index 2ccc843ed..5025f842d 100644 --- a/package/archlinux/PKGBUILD-emscripten-webgl2 +++ b/package/archlinux/PKGBUILD-emscripten-webgl2 @@ -18,7 +18,6 @@ build() { cd "$_rootdir/build-emscripten-webgl2" cmake .. \ - -DCMAKE_MODULE_PATH="$_rootdir/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE="$_rootdir/toolchains/generic/Emscripten.cmake" \ -DCMAKE_PREFIX_PATH=/usr/lib/emscripten/system fi diff --git a/package/archlinux/PKGBUILD-nacl-glibc b/package/archlinux/PKGBUILD-nacl-glibc index 16f035e9c..045c4387d 100644 --- a/package/archlinux/PKGBUILD-nacl-glibc +++ b/package/archlinux/PKGBUILD-nacl-glibc @@ -18,7 +18,6 @@ build() { cd "$_rootdir/build-nacl-glibc-x86-32" cmake .. \ - -DCMAKE_MODULE_PATH="$_rootdir/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE="$_rootdir/toolchains/generic/NaCl-glibc-x86-32.cmake" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/nacl \ @@ -39,7 +38,6 @@ build() { cd "$_rootdir/build-nacl-glibc-x86-64" cmake .. \ - -DCMAKE_MODULE_PATH="$_rootdir/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE="$_rootdir/toolchains/generic/NaCl-glibc-x86-64.cmake" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/nacl \ diff --git a/package/archlinux/PKGBUILD-nacl-newlib b/package/archlinux/PKGBUILD-nacl-newlib index 1821e61f0..58acf01a3 100644 --- a/package/archlinux/PKGBUILD-nacl-newlib +++ b/package/archlinux/PKGBUILD-nacl-newlib @@ -18,7 +18,6 @@ build() { cd "$_rootdir/build-nacl-newlib-x86-32" cmake .. \ - -DCMAKE_MODULE_PATH="$_rootdir/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE="$_rootdir/toolchains/generic/NaCl-newlib-x86-32.cmake" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/nacl \ @@ -40,7 +39,6 @@ build() { cd "$_rootdir/build-nacl-newlib-x86-64" cmake .. \ - -DCMAKE_MODULE_PATH="$_rootdir/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE="$_rootdir/toolchains/generic/NaCl-newlib-x86-64.cmake" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/nacl \ diff --git a/package/ci/jenkins-android.xml b/package/ci/jenkins-android.xml index 1194044d1..845e228a4 100644 --- a/package/ci/jenkins-android.xml +++ b/package/ci/jenkins-android.xml @@ -85,7 +85,6 @@ cd build-android-${gl}-${toolchain}-${compatibility} cmake .. \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_MODULE_PATH="${WORKSPACE}/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE=../toolchains/generic/Android-${toolchain}.cmake \ -DCMAKE_FIND_ROOT_PATH=${JENKINS_HOME}/filesystem/android-${toolchain}-${compatibility} \ -DCMAKE_PREFIX_PATH=${JENKINS_HOME}/filesystem/android-${toolchain}-${compatibility} \ diff --git a/package/ci/jenkins-emscripten.xml b/package/ci/jenkins-emscripten.xml index 916941224..aa9aa6317 100644 --- a/package/ci/jenkins-emscripten.xml +++ b/package/ci/jenkins-emscripten.xml @@ -78,7 +78,6 @@ cd build-emscripten-${compatibility}-${gl} cmake .. \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_MODULE_PATH="${WORKSPACE}/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten.cmake" \ -DCMAKE_FIND_ROOT_PATH=${JENKINS_HOME}/filesystem/emscripten-${compatibility} \ -DCMAKE_PREFIX_PATH=${JENKINS_HOME}/filesystem/emscripten-${compatibility} \ diff --git a/package/ci/jenkins-nacl.xml b/package/ci/jenkins-nacl.xml index 2cccbe67b..16f970324 100644 --- a/package/ci/jenkins-nacl.xml +++ b/package/ci/jenkins-nacl.xml @@ -72,7 +72,6 @@ cd build-nacl-${toolchain}-${compatibility} cmake .. \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_MODULE_PATH="${WORKSPACE}/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE=../toolchains/generic/NaCl-${toolchain}.cmake \ -DCMAKE_FIND_ROOT_PATH=${JENKINS_HOME}/filesystem/nacl-${toolchain}-${compatibility} \ -DCMAKE_INSTALL_PREFIX=${JENKINS_HOME}/filesystem/nacl-${toolchain}-${compatibility} \ diff --git a/src/Magnum/Platform/AndroidApplication.h b/src/Magnum/Platform/AndroidApplication.h index 0927d1956..5a9b5c39e 100644 --- a/src/Magnum/Platform/AndroidApplication.h +++ b/src/Magnum/Platform/AndroidApplication.h @@ -87,15 +87,11 @@ properly set **absolute** path to `toolchains/modules/` directory containing `Platform/Android.cmake`. mkdir build-android-arm && cd build-android-arm - cmake .. \ - -DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \ - -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Android-ARM.cmake" + cmake .. -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Android-ARM.cmake" cmake --build . mkdir build-android-x86 && cd build-android-x86 - cmake .. \ - -DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \ - -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Android-x86.cmake" + cmake .. -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Android-x86.cmake" cmake --build . See @ref cmake for more information. diff --git a/src/Magnum/Platform/NaClApplication.h b/src/Magnum/Platform/NaClApplication.h index 352c8f2de..488b4e742 100644 --- a/src/Magnum/Platform/NaClApplication.h +++ b/src/Magnum/Platform/NaClApplication.h @@ -96,7 +96,6 @@ location of your webserver to have the files installed in proper location (e.g. mkdir build-nacl-x86-32 && cd build-nacl-x86-32 cmake .. \ - -DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/NaCl-newlib-x86-32.cmake" \ -DCMAKE_INSTALL_PREFIX=/srv/http/nacl cmake --build . @@ -104,7 +103,6 @@ location of your webserver to have the files installed in proper location (e.g. mkdir build-nacl-x86-64 && cd build-nacl-x86-64 cmake .. \ - -DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/NaCl-newlib-x86-64.cmake" \ -DCMAKE_INSTALL_PREFIX=/srv/http/nacl cmake --build . diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index 7f39f7086..0086aafa2 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -101,7 +101,6 @@ webserver, e.g. `/srv/http/emscripten`). mkdir build-emscripten && cd build-emscripten cmake .. \ - -DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \ -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten.cmake" -DCMAKE_INSTALL_PREFIX=/srv/http/emscripten cmake --build . @@ -131,7 +130,6 @@ you have all the dependencies. mkdir build-ios && cd build-ios cmake .. \ - -DCMAKE_MODULE_PATH=/absolute/path/to/toolchains/modules/ \ -DCMAKE_TOOLCHAIN_FILE=../toolchains/generic/iOS.cmake \ -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk \ -DCMAKE_OSX_ARCHITECTURES="arm64;armv7;armv7s" \ From 01e02923618477dec18993b5cff8aea934f67ed6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 6 Apr 2016 11:12:06 +0200 Subject: [PATCH 191/258] Extracted CubeMapTexture::Coordinate enum into CubeMapCoordinate. Allows to break the dependency on the header in Framebuffer, TextureState and elsewhere. The old CubeMapTexture::Coordinate enum is now just an alias, is marked as deprecated and will be removed in a future release. --- src/Magnum/CubeMapTexture.cpp | 52 ++++---- src/Magnum/CubeMapTexture.h | 116 +++++++++-------- src/Magnum/Framebuffer.cpp | 3 +- src/Magnum/Framebuffer.h | 6 +- src/Magnum/Implementation/TextureState.cpp | 1 + src/Magnum/Implementation/TextureState.h | 12 +- src/Magnum/Magnum.h | 1 + src/Magnum/Platform/magnum-info.cpp | 1 + src/Magnum/Test/CubeMapTextureGLTest.cpp | 144 ++++++++++----------- src/Magnum/Test/FramebufferGLTest.cpp | 11 +- 10 files changed, 184 insertions(+), 163 deletions(-) diff --git a/src/Magnum/CubeMapTexture.cpp b/src/Magnum/CubeMapTexture.cpp index 0be4305a5..db18b10b1 100644 --- a/src/Magnum/CubeMapTexture.cpp +++ b/src/Magnum/CubeMapTexture.cpp @@ -157,7 +157,7 @@ CompressedBufferImage3D CubeMapTexture::compressedImage(const Int level, Compres return std::move(image); } -void CubeMapTexture::image(const Coordinate coordinate, const Int level, Image2D& image) { +void CubeMapTexture::image(const CubeMapCoordinate coordinate, const Int level, Image2D& image) { const Vector2i size = imageSize(level); const std::size_t dataSize = Implementation::imageDataSizeFor(image, size); @@ -172,12 +172,12 @@ void CubeMapTexture::image(const Coordinate coordinate, const Int level, Image2D image.setData(image.storage(), image.format(), image.type(), size, std::move(data)); } -Image2D CubeMapTexture::image(const Coordinate coordinate, const Int level, Image2D&& image) { +Image2D CubeMapTexture::image(const CubeMapCoordinate coordinate, const Int level, Image2D&& image) { this->image(coordinate, level, image); return std::move(image); } -void CubeMapTexture::image(const Coordinate coordinate, const Int level, BufferImage2D& image, const BufferUsage usage) { +void CubeMapTexture::image(const CubeMapCoordinate coordinate, const Int level, BufferImage2D& image, const BufferUsage usage) { const Vector2i size = imageSize(level); const std::size_t dataSize = Implementation::imageDataSizeFor(image, size); @@ -192,12 +192,12 @@ void CubeMapTexture::image(const Coordinate coordinate, const Int level, BufferI (this->*Context::current().state().texture->getCubeImageImplementation)(coordinate, level, size, image.format(), image.type(), dataSize, nullptr); } -BufferImage2D CubeMapTexture::image(const Coordinate coordinate, const Int level, BufferImage2D&& image, const BufferUsage usage) { +BufferImage2D CubeMapTexture::image(const CubeMapCoordinate coordinate, const Int level, BufferImage2D&& image, const BufferUsage usage) { this->image(coordinate, level, image, usage); return std::move(image); } -void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int level, CompressedImage2D& image) { +void CubeMapTexture::compressedImage(const CubeMapCoordinate coordinate, const Int level, CompressedImage2D& image) { const Vector2i size = imageSize(level); /* The function returns size of all six faces, divide the result to get size of one face */ @@ -217,12 +217,12 @@ void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int leve image.setData(image.storage(), CompressedPixelFormat(format), size, std::move(data)); } -CompressedImage2D CubeMapTexture::compressedImage(const Coordinate coordinate, const Int level, CompressedImage2D&& image) { +CompressedImage2D CubeMapTexture::compressedImage(const CubeMapCoordinate coordinate, const Int level, CompressedImage2D&& image) { compressedImage(coordinate, level, image); return std::move(image); } -void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int level, CompressedBufferImage2D& image, const BufferUsage usage) { +void CubeMapTexture::compressedImage(const CubeMapCoordinate coordinate, const Int level, CompressedBufferImage2D& image, const BufferUsage usage) { const Vector2i size = imageSize(level); /* The function returns size of all six faces, divide the result to get size of one face */ @@ -242,7 +242,7 @@ void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int leve (this->*Context::current().state().texture->getCompressedCubeImageImplementation)(coordinate, level, size, dataSize, nullptr); } -CompressedBufferImage2D CubeMapTexture::compressedImage(const Coordinate coordinate, const Int level, CompressedBufferImage2D&& image, const BufferUsage usage) { +CompressedBufferImage2D CubeMapTexture::compressedImage(const CubeMapCoordinate coordinate, const Int level, CompressedBufferImage2D&& image, const BufferUsage usage) { compressedImage(coordinate, level, image, usage); return std::move(image); } @@ -304,7 +304,7 @@ CubeMapTexture& CubeMapTexture::setCompressedSubImage(const Int level, const Vec } #endif -CubeMapTexture& CubeMapTexture::setSubImage(const Coordinate coordinate, const Int level, const Vector2i& offset, const ImageView2D& image) { +CubeMapTexture& CubeMapTexture::setSubImage(const CubeMapCoordinate coordinate, const Int level, const Vector2i& offset, const ImageView2D& image) { #ifndef MAGNUM_TARGET_GLES2 Buffer::unbindInternal(Buffer::TargetHint::PixelUnpack); #endif @@ -318,7 +318,7 @@ CubeMapTexture& CubeMapTexture::setSubImage(const Coordinate coordinate, const I } #ifndef MAGNUM_TARGET_GLES2 -CubeMapTexture& CubeMapTexture::setSubImage(const Coordinate coordinate, const Int level, const Vector2i& offset, BufferImage2D& image) { +CubeMapTexture& CubeMapTexture::setSubImage(const CubeMapCoordinate coordinate, const Int level, const Vector2i& offset, BufferImage2D& image) { image.buffer().bindInternal(Buffer::TargetHint::PixelUnpack); image.storage().applyUnpack(); (this->*Context::current().state().texture->cubeSubImageImplementation)(coordinate, level, offset, image.size(), image.format(), image.type(), nullptr); @@ -326,7 +326,7 @@ CubeMapTexture& CubeMapTexture::setSubImage(const Coordinate coordinate, const I } #endif -CubeMapTexture& CubeMapTexture::setCompressedSubImage(const Coordinate coordinate, const Int level, const Vector2i& offset, const CompressedImageView2D& image) { +CubeMapTexture& CubeMapTexture::setCompressedSubImage(const CubeMapCoordinate coordinate, const Int level, const Vector2i& offset, const CompressedImageView2D& image) { #ifndef MAGNUM_TARGET_GLES2 Buffer::unbindInternal(Buffer::TargetHint::PixelUnpack); #endif @@ -340,7 +340,7 @@ CubeMapTexture& CubeMapTexture::setCompressedSubImage(const Coordinate coordinat } #ifndef MAGNUM_TARGET_GLES2 -CubeMapTexture& CubeMapTexture::setCompressedSubImage(const Coordinate coordinate, const Int level, const Vector2i& offset, CompressedBufferImage2D& image) { +CubeMapTexture& CubeMapTexture::setCompressedSubImage(const CubeMapCoordinate coordinate, const Int level, const Vector2i& offset, CompressedBufferImage2D& image) { image.buffer().bindInternal(Buffer::TargetHint::PixelUnpack); #ifndef MAGNUM_TARGET_GLES /* Pixel storage is completely ignored for compressed images on ES, no need @@ -440,70 +440,70 @@ void CubeMapTexture::getCompressedImageImplementationDSASingleSliceWorkaround(co glGetCompressedTextureSubImage(_id, level, 0, 0, face, size.x(), size.y(), 1, dataOffset + dataSize/6, static_cast(data) + dataSize*face/6); } -void CubeMapTexture::getImageImplementationDefault(const Coordinate coordinate, const GLint level, const Vector2i&, const PixelFormat format, const PixelType type, std::size_t, GLvoid* const data) { +void CubeMapTexture::getImageImplementationDefault(const CubeMapCoordinate coordinate, const GLint level, const Vector2i&, const PixelFormat format, const PixelType type, std::size_t, GLvoid* const data) { bindInternal(); glGetTexImage(GLenum(coordinate), level, GLenum(format), GLenum(type), data); } -void CubeMapTexture::getCompressedImageImplementationDefault(const Coordinate coordinate, const GLint level, const Vector2i&, std::size_t, GLvoid* const data) { +void CubeMapTexture::getCompressedImageImplementationDefault(const CubeMapCoordinate coordinate, const GLint level, const Vector2i&, std::size_t, GLvoid* const data) { bindInternal(); glGetCompressedTexImage(GLenum(coordinate), level, data); } -void CubeMapTexture::getImageImplementationDSA(const Coordinate coordinate, const GLint level, const Vector2i& size, const PixelFormat format, const PixelType type, const std::size_t dataSize, GLvoid* const data) { +void CubeMapTexture::getImageImplementationDSA(const CubeMapCoordinate coordinate, const GLint level, const Vector2i& size, const PixelFormat format, const PixelType type, const std::size_t dataSize, GLvoid* const data) { glGetTextureSubImage(_id, level, 0, 0, GLenum(coordinate) - GL_TEXTURE_CUBE_MAP_POSITIVE_X, size.x(), size.y(), 1, GLenum(format), GLenum(type), dataSize, data); } -void CubeMapTexture::getCompressedImageImplementationDSA(const Coordinate coordinate, const GLint level, const Vector2i& size, const std::size_t dataSize, GLvoid* const data) { +void CubeMapTexture::getCompressedImageImplementationDSA(const CubeMapCoordinate coordinate, const GLint level, const Vector2i& size, const std::size_t dataSize, GLvoid* const data) { glGetCompressedTextureSubImage(_id, level, 0, 0, GLenum(coordinate) - GL_TEXTURE_CUBE_MAP_POSITIVE_X, size.x(), size.y(), 1, dataSize, data); } -void CubeMapTexture::getImageImplementationDSAEXT(const Coordinate coordinate, const GLint level, const Vector2i&, const PixelFormat format, const PixelType type, std::size_t, GLvoid* const data) { +void CubeMapTexture::getImageImplementationDSAEXT(const CubeMapCoordinate coordinate, const GLint level, const Vector2i&, const PixelFormat format, const PixelType type, std::size_t, GLvoid* const data) { _flags |= ObjectFlag::Created; glGetTextureImageEXT(_id, GLenum(coordinate), level, GLenum(format), GLenum(type), data); } -void CubeMapTexture::getCompressedImageImplementationDSAEXT(const Coordinate coordinate, const GLint level, const Vector2i&, std::size_t, GLvoid* const data) { +void CubeMapTexture::getCompressedImageImplementationDSAEXT(const CubeMapCoordinate coordinate, const GLint level, const Vector2i&, std::size_t, GLvoid* const data) { _flags |= ObjectFlag::Created; glGetCompressedTextureImageEXT(_id, GLenum(coordinate), level, data); } -void CubeMapTexture::getImageImplementationRobustness(const Coordinate coordinate, const GLint level, const Vector2i&, const PixelFormat format, const PixelType type, const std::size_t dataSize, GLvoid* const data) { +void CubeMapTexture::getImageImplementationRobustness(const CubeMapCoordinate coordinate, const GLint level, const Vector2i&, const PixelFormat format, const PixelType type, const std::size_t dataSize, GLvoid* const data) { bindInternal(); glGetnTexImageARB(GLenum(coordinate), level, GLenum(format), GLenum(type), dataSize, data); } -void CubeMapTexture::getCompressedImageImplementationRobustness(const Coordinate coordinate, const GLint level, const Vector2i&, const std::size_t dataSize, GLvoid* const data) { +void CubeMapTexture::getCompressedImageImplementationRobustness(const CubeMapCoordinate coordinate, const GLint level, const Vector2i&, const std::size_t dataSize, GLvoid* const data) { bindInternal(); glGetnCompressedTexImageARB(GLenum(coordinate), level, dataSize, data); } #endif -void CubeMapTexture::subImageImplementationDefault(const Coordinate coordinate, const GLint level, const Vector2i& offset, const Vector2i& size, const PixelFormat format, const PixelType type, const GLvoid* const data) { +void CubeMapTexture::subImageImplementationDefault(const CubeMapCoordinate coordinate, const GLint level, const Vector2i& offset, const Vector2i& size, const PixelFormat format, const PixelType type, const GLvoid* const data) { bindInternal(); glTexSubImage2D(GLenum(coordinate), level, offset.x(), offset.y(), size.x(), size.y(), GLenum(format), GLenum(type), data); } -void CubeMapTexture::compressedSubImageImplementationDefault(const Coordinate coordinate, const GLint level, const Vector2i& offset, const Vector2i& size, const CompressedPixelFormat format, const GLvoid* const data, const GLsizei dataSize) { +void CubeMapTexture::compressedSubImageImplementationDefault(const CubeMapCoordinate coordinate, const GLint level, const Vector2i& offset, const Vector2i& size, const CompressedPixelFormat format, const GLvoid* const data, const GLsizei dataSize) { bindInternal(); glCompressedTexSubImage2D(GLenum(coordinate), level, offset.x(), offset.y(), size.x(), size.y(), GLenum(format), dataSize, data); } #ifndef MAGNUM_TARGET_GLES -void CubeMapTexture::subImageImplementationDSA(const Coordinate coordinate, const GLint level, const Vector2i& offset, const Vector2i& size, const PixelFormat format, const PixelType type, const GLvoid* const data) { +void CubeMapTexture::subImageImplementationDSA(const CubeMapCoordinate coordinate, const GLint level, const Vector2i& offset, const Vector2i& size, const PixelFormat format, const PixelType type, const GLvoid* const data) { glTextureSubImage3D(_id, level, offset.x(), offset.y(), GLenum(coordinate) - GL_TEXTURE_CUBE_MAP_POSITIVE_X, size.x(), size.y(), 1, GLenum(format), GLenum(type), data); } -void CubeMapTexture::compressedSubImageImplementationDSA(const Coordinate coordinate, const GLint level, const Vector2i& offset, const Vector2i& size, const CompressedPixelFormat format, const GLvoid* const data, const GLsizei dataSize) { +void CubeMapTexture::compressedSubImageImplementationDSA(const CubeMapCoordinate coordinate, const GLint level, const Vector2i& offset, const Vector2i& size, const CompressedPixelFormat format, const GLvoid* const data, const GLsizei dataSize) { glCompressedTextureSubImage3D(_id, level, offset.x(), offset.y(), GLenum(coordinate) - GL_TEXTURE_CUBE_MAP_POSITIVE_X, size.x(), size.y(), 1, GLenum(format), dataSize, data); } -void CubeMapTexture::subImageImplementationDSAEXT(const Coordinate coordinate, const GLint level, const Vector2i& offset, const Vector2i& size, const PixelFormat format, const PixelType type, const GLvoid* const data) { +void CubeMapTexture::subImageImplementationDSAEXT(const CubeMapCoordinate coordinate, const GLint level, const Vector2i& offset, const Vector2i& size, const PixelFormat format, const PixelType type, const GLvoid* const data) { _flags |= ObjectFlag::Created; glTextureSubImage2DEXT(_id, GLenum(coordinate), level, offset.x(), offset.y(), size.x(), size.y(), GLenum(format), GLenum(type), data); } -void CubeMapTexture::compressedSubImageImplementationDSAEXT(const Coordinate coordinate, const GLint level, const Vector2i& offset, const Vector2i& size, const CompressedPixelFormat format, const GLvoid* const data, const GLsizei dataSize) { +void CubeMapTexture::compressedSubImageImplementationDSAEXT(const CubeMapCoordinate coordinate, const GLint level, const Vector2i& offset, const Vector2i& size, const CompressedPixelFormat format, const GLvoid* const data, const GLsizei dataSize) { _flags |= ObjectFlag::Created; glCompressedTextureSubImage2DEXT(_id, GLenum(coordinate), level, offset.x(), offset.y(), size.x(), size.y(), GLenum(format), dataSize, data); } diff --git a/src/Magnum/CubeMapTexture.h b/src/Magnum/CubeMapTexture.h index 17b32b0c4..9f89993a6 100644 --- a/src/Magnum/CubeMapTexture.h +++ b/src/Magnum/CubeMapTexture.h @@ -26,7 +26,7 @@ */ /** @file - * @brief Class @ref Magnum::CubeMapTexture + * @brief Class @ref Magnum::CubeMapTexture, enum @ref Magnum::CubeMapCoordinate */ #include "Magnum/AbstractTexture.h" @@ -35,6 +35,20 @@ namespace Magnum { +/** +@brief Cube map coordinate + +@see @ref CubeMapTexture +*/ +enum class CubeMapCoordinate: GLenum { + PositiveX = GL_TEXTURE_CUBE_MAP_POSITIVE_X, /**< +X cube side */ + NegativeX = GL_TEXTURE_CUBE_MAP_NEGATIVE_X, /**< -X cube side */ + PositiveY = GL_TEXTURE_CUBE_MAP_POSITIVE_Y, /**< +Y cube side */ + NegativeY = GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, /**< -Y cube side */ + PositiveZ = GL_TEXTURE_CUBE_MAP_POSITIVE_Z, /**< +Z cube side */ + NegativeZ = GL_TEXTURE_CUBE_MAP_NEGATIVE_Z /**< -Z cube side */ +}; + /** @brief Cube map texture @@ -64,8 +78,8 @@ CubeMapTexture texture; texture.setMagnificationFilter(Sampler::Filter::Linear) // ... .setStorage(Math::log2(256)+1, TextureFormat::RGBA8, {256, 256}) - .setSubImage(CubeMapTexture::Coordinate::PositiveX, 0, {}, positiveX) - .setSubImage(CubeMapTexture::Coordinate::NegativeX, 0, {}, negativeX) + .setSubImage(CubeMapCoordinate::PositiveX, 0, {}, positiveX) + .setSubImage(CubeMapCoordinate::NegativeX, 0, {}, negativeX) // ... @endcode @@ -83,15 +97,13 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { friend Implementation::TextureState; public: - /** @brief Cube map coordinate */ - enum class Coordinate: GLenum { - PositiveX = GL_TEXTURE_CUBE_MAP_POSITIVE_X, /**< +X cube side */ - NegativeX = GL_TEXTURE_CUBE_MAP_NEGATIVE_X, /**< -X cube side */ - PositiveY = GL_TEXTURE_CUBE_MAP_POSITIVE_Y, /**< +Y cube side */ - NegativeY = GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, /**< -Y cube side */ - PositiveZ = GL_TEXTURE_CUBE_MAP_POSITIVE_Z, /**< +Z cube side */ - NegativeZ = GL_TEXTURE_CUBE_MAP_NEGATIVE_Z /**< -Z cube side */ - }; + #ifdef MAGNUM_BUILD_DEPRECATED + /** + * @copybrief CubeMapCoordinate + * @deprecated Use @ref CubeMapCoordinate instead. + */ + typedef CORRADE_DEPRECATED("use CubeMapCoordinate instead") CubeMapCoordinate Coordinate; + #endif /** * @brief Max supported size of one side of cube map texture @@ -187,7 +199,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * ES 3.0 and older. * @requires_gles Shader image load/store is not available in WebGL. */ - void bindImage(Int imageUnit, Int level, Coordinate coordinate, ImageAccess access, ImageFormat format) { + void bindImage(Int imageUnit, Int level, CubeMapCoordinate coordinate, ImageAccess access, ImageFormat format) { bindImageInternal(imageUnit, level, false, GLenum(coordinate) - GL_TEXTURE_CUBE_MAP_POSITIVE_X, access, format); } @@ -505,7 +517,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @copybrief imageSize() * @deprecated Use @ref imageSize(Int) instead. */ - CORRADE_DEPRECATED("use imageSize(Int) instead") Vector2i imageSize(Coordinate, Int level) { + CORRADE_DEPRECATED("use imageSize(Int) instead") Vector2i imageSize(CubeMapCoordinate, Int level) { return imageSize(level); } #endif @@ -635,16 +647,16 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @requires_gl Texture image queries are not available in OpenGL ES or * WebGL. See @ref Framebuffer::read() for possible workaround. */ - void image(Coordinate coordinate, Int level, Image2D& image); + void image(CubeMapCoordinate coordinate, Int level, Image2D& image); /** @overload * * Convenience alternative to the above, example usage: * @code - * Image2D image = texture.image(CubeMapTexture::Coordinate::PositiveX, 0, {PixelFormat::RGBA, PixelType::UnsignedByte}); + * Image2D image = texture.image(CubeMapCoordinate::PositiveX, 0, {PixelFormat::RGBA, PixelType::UnsignedByte}); * @endcode */ - Image2D image(Coordinate coordinate, Int level, Image2D&& image); + Image2D image(CubeMapCoordinate coordinate, Int level, Image2D&& image); /** * @brief Read given mip level and coordinate of texture to buffer image @@ -655,16 +667,16 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @requires_gl Texture image queries are not available in OpenGL ES or * WebGL. See @ref Framebuffer::read() for possible workaround. */ - void image(Coordinate coordinate, Int level, BufferImage2D& image, BufferUsage usage); + void image(CubeMapCoordinate coordinate, Int level, BufferImage2D& image, BufferUsage usage); /** @overload * * Convenience alternative to the above, example usage: * @code - * BufferImage2D image = texture.image(CubeMapTexture::Coordinate::PositiveX, 0, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); + * BufferImage2D image = texture.image(CubeMapCoordinate::PositiveX, 0, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); * @endcode */ - BufferImage2D image(Coordinate coordinate, Int level, BufferImage2D&& image, BufferUsage usage); + BufferImage2D image(CubeMapCoordinate coordinate, Int level, BufferImage2D&& image, BufferUsage usage); /** * @brief Read given mip level and coordinate of compressed texture to image @@ -695,16 +707,16 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @requires_gl Texture image queries are not available in OpenGL ES or * WebGL. See @ref Framebuffer::read() for possible workaround. */ - void compressedImage(Coordinate coordinate, Int level, CompressedImage2D& image); + void compressedImage(CubeMapCoordinate coordinate, Int level, CompressedImage2D& image); /** @overload * * Convenience alternative to the above, example usage: * @code - * CompressedImage2D image = texture.compressedImage(CubeMapTexture::Coordinate::PositiveX, 0, {}); + * CompressedImage2D image = texture.compressedImage(CubeMapCoordinate::PositiveX, 0, {}); * @endcode */ - CompressedImage2D compressedImage(Coordinate coordinate, Int level, CompressedImage2D&& image); + CompressedImage2D compressedImage(CubeMapCoordinate coordinate, Int level, CompressedImage2D&& image); /** * @brief Read given mip level and coordinate of compressed texture to buffer image @@ -716,16 +728,16 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @requires_gl Texture image queries are not available in OpenGL ES or * WebGL. See @ref Framebuffer::read() for possible workaround. */ - void compressedImage(Coordinate coordinate, Int level, CompressedBufferImage2D& image, BufferUsage usage); + void compressedImage(CubeMapCoordinate coordinate, Int level, CompressedBufferImage2D& image, BufferUsage usage); /** @overload * * Convenience alternative to the above, example usage: * @code - * CompressedBufferImage2D image = texture.compressedImage(CubeMapTexture::Coordinate::PositiveX, 0, {}, BufferUsage::StaticRead); + * CompressedBufferImage2D image = texture.compressedImage(CubeMapCoordinate::PositiveX, 0, {}, BufferUsage::StaticRead); * @endcode */ - CompressedBufferImage2D compressedImage(Coordinate coordinate, Int level, CompressedBufferImage2D&& image, BufferUsage usage); + CompressedBufferImage2D compressedImage(CubeMapCoordinate coordinate, Int level, CompressedBufferImage2D&& image, BufferUsage usage); /** * @copybrief Texture::subImage(Int, const RangeTypeFor&, Image&) @@ -825,7 +837,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @deprecated_gl Prefer to use @ref setStorage() and @ref setSubImage() * instead. */ - CubeMapTexture& setImage(Coordinate coordinate, Int level, TextureFormat internalFormat, const ImageView2D& image) { + CubeMapTexture& setImage(CubeMapCoordinate coordinate, Int level, TextureFormat internalFormat, const ImageView2D& image) { DataHelper<2>::setImage(*this, GLenum(coordinate), level, internalFormat, image); return *this; } @@ -839,7 +851,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @deprecated_gl Prefer to use @ref setStorage() and @ref setSubImage() * instead. */ - CubeMapTexture& setImage(Coordinate coordinate, Int level, TextureFormat internalFormat, BufferImage2D& image) { + CubeMapTexture& setImage(CubeMapCoordinate coordinate, Int level, TextureFormat internalFormat, BufferImage2D& image) { DataHelper<2>::setImage(*this, GLenum(coordinate), level, internalFormat, image); return *this; } @@ -852,7 +864,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @deprecated_gl Prefer to use @ref setStorage() and @ref setSubImage() * instead. */ - CubeMapTexture& setImage(Coordinate coordinate, Int level, TextureFormat internalFormat, BufferImage2D&& image) { + CubeMapTexture& setImage(CubeMapCoordinate coordinate, Int level, TextureFormat internalFormat, BufferImage2D&& image) { return setImage(coordinate, level, internalFormat, image); } #endif @@ -866,7 +878,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @deprecated_gl Prefer to use @ref setStorage() and * @ref setCompressedSubImage() instead. */ - CubeMapTexture& setCompressedImage(Coordinate coordinate, Int level, const CompressedImageView2D& image) { + CubeMapTexture& setCompressedImage(CubeMapCoordinate coordinate, Int level, const CompressedImageView2D& image) { DataHelper<2>::setCompressedImage(*this, GLenum(coordinate), level, image); return *this; } @@ -880,7 +892,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @deprecated_gl Prefer to use @ref setStorage() and * @ref setCompressedSubImage() instead. */ - CubeMapTexture& setCompressedImage(Coordinate coordinate, Int level, CompressedBufferImage2D& image) { + CubeMapTexture& setCompressedImage(CubeMapCoordinate coordinate, Int level, CompressedBufferImage2D& image) { DataHelper<2>::setCompressedImage(*this, GLenum(coordinate), level, image); return *this; } @@ -893,7 +905,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @deprecated_gl Prefer to use @ref setStorage() and * @ref setCompressedSubImage() instead. */ - CubeMapTexture& setCompressedImage(Coordinate coordinate, Int level, CompressedBufferImage2D&& image) { + CubeMapTexture& setCompressedImage(CubeMapCoordinate coordinate, Int level, CompressedBufferImage2D&& image) { return setCompressedImage(coordinate, level, image); } #endif @@ -968,7 +980,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * * See @ref Texture::setSubImage() for more information. */ - CubeMapTexture& setSubImage(Coordinate coordinate, Int level, const Vector2i& offset, const ImageView2D& image); + CubeMapTexture& setSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, const ImageView2D& image); #ifndef MAGNUM_TARGET_GLES2 /** @overload @@ -977,7 +989,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @requires_webgl20 Pixel buffer objects are not available in WebGL * 1.0. */ - CubeMapTexture& setSubImage(Coordinate coordinate, Int level, const Vector2i& offset, BufferImage2D& image); + CubeMapTexture& setSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, BufferImage2D& image); /** @overload * @requires_gles30 Pixel buffer objects are not available in OpenGL ES @@ -985,7 +997,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @requires_webgl20 Pixel buffer objects are not available in WebGL * 1.0. */ - CubeMapTexture& setSubImage(Coordinate coordinate, Int level, const Vector2i& offset, BufferImage2D&& image) { + CubeMapTexture& setSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, BufferImage2D&& image) { return setSubImage(coordinate, level, offset, image); } #endif @@ -996,7 +1008,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * * See @ref Texture::setCompressedSubImage() for more information. */ - CubeMapTexture& setCompressedSubImage(Coordinate coordinate, Int level, const Vector2i& offset, const CompressedImageView2D& image); + CubeMapTexture& setCompressedSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, const CompressedImageView2D& image); #ifndef MAGNUM_TARGET_GLES2 /** @overload @@ -1005,7 +1017,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @requires_webgl20 Pixel buffer objects are not available in WebGL * 1.0. */ - CubeMapTexture& setCompressedSubImage(Coordinate coordinate, Int level, const Vector2i& offset, CompressedBufferImage2D& image); + CubeMapTexture& setCompressedSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, CompressedBufferImage2D& image); /** @overload * @requires_gles30 Pixel buffer objects are not available in OpenGL ES @@ -1013,7 +1025,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @requires_webgl20 Pixel buffer objects are not available in WebGL * 1.0. */ - CubeMapTexture& setCompressedSubImage(Coordinate coordinate, Int level, const Vector2i& offset, CompressedBufferImage2D&& image) { + CubeMapTexture& setCompressedSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, CompressedBufferImage2D&& image) { return setCompressedSubImage(coordinate, level, offset, image); } #endif @@ -1086,27 +1098,27 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { void MAGNUM_LOCAL getCompressedImageImplementationDSA(GLint level, const Vector2i& size, std::size_t dataOffset, std::size_t dataSize, GLvoid* data); void MAGNUM_LOCAL getCompressedImageImplementationDSASingleSliceWorkaround(GLint level, const Vector2i& size, std::size_t dataOffset, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getImageImplementationDefault(Coordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getImageImplementationDSA(Coordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getImageImplementationDSAEXT(Coordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getImageImplementationRobustness(Coordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); + void MAGNUM_LOCAL getImageImplementationDefault(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); + void MAGNUM_LOCAL getImageImplementationDSA(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); + void MAGNUM_LOCAL getImageImplementationDSAEXT(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); + void MAGNUM_LOCAL getImageImplementationRobustness(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getCompressedImageImplementationDefault(Coordinate coordinate, GLint level, const Vector2i& size, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getCompressedImageImplementationDSA(Coordinate coordinate, GLint level, const Vector2i& size, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getCompressedImageImplementationDSAEXT(Coordinate coordinate, GLint level, const Vector2i& size, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getCompressedImageImplementationRobustness(Coordinate coordinate, GLint level, const Vector2i& size, std::size_t dataSize, GLvoid* data); + void MAGNUM_LOCAL getCompressedImageImplementationDefault(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, std::size_t dataSize, GLvoid* data); + void MAGNUM_LOCAL getCompressedImageImplementationDSA(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, std::size_t dataSize, GLvoid* data); + void MAGNUM_LOCAL getCompressedImageImplementationDSAEXT(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, std::size_t dataSize, GLvoid* data); + void MAGNUM_LOCAL getCompressedImageImplementationRobustness(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, std::size_t dataSize, GLvoid* data); #endif - void MAGNUM_LOCAL subImageImplementationDefault(Coordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data); + void MAGNUM_LOCAL subImageImplementationDefault(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL subImageImplementationDSA(Coordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data); - void MAGNUM_LOCAL subImageImplementationDSAEXT(Coordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data); + void MAGNUM_LOCAL subImageImplementationDSA(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data); + void MAGNUM_LOCAL subImageImplementationDSAEXT(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data); #endif - void MAGNUM_LOCAL compressedSubImageImplementationDefault(Coordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); + void MAGNUM_LOCAL compressedSubImageImplementationDefault(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL compressedSubImageImplementationDSA(Coordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); - void MAGNUM_LOCAL compressedSubImageImplementationDSAEXT(Coordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); + void MAGNUM_LOCAL compressedSubImageImplementationDSA(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); + void MAGNUM_LOCAL compressedSubImageImplementationDSAEXT(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); #endif }; diff --git a/src/Magnum/Framebuffer.cpp b/src/Magnum/Framebuffer.cpp index 116ea4e9d..096e47620 100644 --- a/src/Magnum/Framebuffer.cpp +++ b/src/Magnum/Framebuffer.cpp @@ -28,6 +28,7 @@ #include #include "Magnum/Context.h" +#include "Magnum/CubeMapTexture.h" #include "Magnum/DefaultFramebuffer.h" #include "Magnum/Extensions.h" #include "Magnum/Image.h" @@ -236,7 +237,7 @@ Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, Multi } #endif -Framebuffer& Framebuffer::attachCubeMapTexture(const BufferAttachment attachment, CubeMapTexture& texture, CubeMapTexture::Coordinate coordinate, const Int level) { +Framebuffer& Framebuffer::attachCubeMapTexture(const BufferAttachment attachment, CubeMapTexture& texture, CubeMapCoordinate coordinate, const Int level) { (this->*Context::current().state().framebuffer->textureCubeMapImplementation)(attachment, GLenum(coordinate), texture.id(), level); return *this; } diff --git a/src/Magnum/Framebuffer.h b/src/Magnum/Framebuffer.h index cd5f11373..196fa63d3 100644 --- a/src/Magnum/Framebuffer.h +++ b/src/Magnum/Framebuffer.h @@ -29,8 +29,10 @@ * @brief Class @ref Magnum::Framebuffer */ +#include + #include "Magnum/AbstractFramebuffer.h" -#include "Magnum/CubeMapTexture.h" +#include "Magnum/Tags.h" #ifdef _X11_XLIB_H_ /* Xlib.h, I hate you sincerely */ #undef Status @@ -658,7 +660,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje * @fn_gl_extension{NamedFramebufferTexture2D,EXT,direct_state_access}, * eventually @fn_gl{BindFramebuffer} and @fn_gl2{FramebufferTexture2D,FramebufferTexture} */ - Framebuffer& attachCubeMapTexture(BufferAttachment attachment, CubeMapTexture& texture, CubeMapTexture::Coordinate coordinate, Int level); + Framebuffer& attachCubeMapTexture(BufferAttachment attachment, CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level); #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) /** diff --git a/src/Magnum/Implementation/TextureState.cpp b/src/Magnum/Implementation/TextureState.cpp index 2e424dfb0..2afc9e037 100644 --- a/src/Magnum/Implementation/TextureState.cpp +++ b/src/Magnum/Implementation/TextureState.cpp @@ -28,6 +28,7 @@ #include #include "Magnum/AbstractTexture.h" +#include "Magnum/CubeMapTexture.h" #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #include "Magnum/BufferTexture.h" #endif diff --git a/src/Magnum/Implementation/TextureState.h b/src/Magnum/Implementation/TextureState.h index ed1dfcc88..c68f5ee45 100644 --- a/src/Magnum/Implementation/TextureState.h +++ b/src/Magnum/Implementation/TextureState.h @@ -29,13 +29,15 @@ #include #include -#include "Magnum/CubeMapTexture.h" +#include "Magnum/Magnum.h" +#include "Magnum/OpenGL.h" #if defined(_MSC_VER) && !defined(MAGNUM_TARGET_GLES2) /* Otherwise the member function pointers will have different size based on whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */ #include "Magnum/BufferTexture.h" +#include "Magnum/CubeMapTexture.h" #endif namespace Magnum { namespace Implementation { @@ -104,12 +106,12 @@ struct TextureState { #endif #ifndef MAGNUM_TARGET_GLES GLint(CubeMapTexture::*getCubeLevelCompressedImageSizeImplementation)(GLint); - void(CubeMapTexture::*getCubeImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, PixelFormat, PixelType, std::size_t, GLvoid*); + void(CubeMapTexture::*getCubeImageImplementation)(CubeMapCoordinate, GLint, const Vector2i&, PixelFormat, PixelType, std::size_t, GLvoid*); void(CubeMapTexture::*getFullCompressedCubeImageImplementation)(GLint, const Vector2i&, std::size_t, std::size_t, GLvoid*); - void(CubeMapTexture::*getCompressedCubeImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, std::size_t, GLvoid*); + void(CubeMapTexture::*getCompressedCubeImageImplementation)(CubeMapCoordinate, GLint, const Vector2i&, std::size_t, GLvoid*); #endif - void(CubeMapTexture::*cubeSubImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, const Vector2i&, PixelFormat, PixelType, const GLvoid*); - void(CubeMapTexture::*cubeCompressedSubImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, const Vector2i&, CompressedPixelFormat, const GLvoid*, GLsizei); + void(CubeMapTexture::*cubeSubImageImplementation)(CubeMapCoordinate, GLint, const Vector2i&, const Vector2i&, PixelFormat, PixelType, const GLvoid*); + void(CubeMapTexture::*cubeCompressedSubImageImplementation)(CubeMapCoordinate, GLint, const Vector2i&, const Vector2i&, CompressedPixelFormat, const GLvoid*, GLsizei); GLint maxSize, #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) diff --git a/src/Magnum/Magnum.h b/src/Magnum/Magnum.h index 3461be9c3..2519a5e59 100644 --- a/src/Magnum/Magnum.h +++ b/src/Magnum/Magnum.h @@ -487,6 +487,7 @@ template using BasicColor4 CORRADE_DEPRECATED_ALIAS("use Math::Color4 i class Context; class CubeMapTexture; +enum class CubeMapCoordinate: GLenum; #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) class CubeMapTextureArray; #endif diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index 7d2895e61..074f348a8 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -35,6 +35,7 @@ #include "Magnum/BufferTexture.h" #endif #include "Magnum/Context.h" +#include "Magnum/CubeMapTexture.h" #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #include "Magnum/CubeMapTextureArray.h" #endif diff --git a/src/Magnum/Test/CubeMapTextureGLTest.cpp b/src/Magnum/Test/CubeMapTextureGLTest.cpp index 08b3ad83e..80bfe2911 100644 --- a/src/Magnum/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureGLTest.cpp @@ -289,7 +289,7 @@ void CubeMapTextureGLTest::bindImage() { CubeMapTexture texture; texture.setStorage(1, TextureFormat::RGBA8, Vector2i{32}) - .bindImage(2, 0, CubeMapTexture::Coordinate::NegativeX, ImageAccess::ReadWrite, ImageFormat::RGBA8); + .bindImage(2, 0, CubeMapCoordinate::NegativeX, ImageAccess::ReadWrite, ImageFormat::RGBA8); MAGNUM_VERIFY_NO_ERROR(); @@ -482,14 +482,14 @@ namespace { void CubeMapTextureGLTest::image() { CubeMapTexture texture; - texture.setImage(CubeMapTexture::Coordinate::PositiveX, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::PositiveX, 0, TextureFormat::RGBA8, ImageView2D{_dataStorage, PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(2), unsafeSuffix(Data, _dataOffset)}); MAGNUM_VERIFY_NO_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES - Image2D image = texture.image(CubeMapTexture::Coordinate::PositiveX, 0, + Image2D image = texture.image(CubeMapCoordinate::PositiveX, 0, {_dataStorage, PixelFormat::RGBA, PixelType::UnsignedByte}); MAGNUM_VERIFY_NO_ERROR(); @@ -517,17 +517,17 @@ void CubeMapTextureGLTest::compressedImage() { CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, unsafeSuffix(CompressedData, _compressedDataOffset)}; CubeMapTexture texture; - texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveX, 0, view) - .setCompressedImage(CubeMapTexture::Coordinate::NegativeX, 0, view) - .setCompressedImage(CubeMapTexture::Coordinate::PositiveY, 0, view) - .setCompressedImage(CubeMapTexture::Coordinate::NegativeY, 0, view) - .setCompressedImage(CubeMapTexture::Coordinate::PositiveZ, 0, view) - .setCompressedImage(CubeMapTexture::Coordinate::NegativeZ, 0, view); + texture.setCompressedImage(CubeMapCoordinate::PositiveX, 0, view) + .setCompressedImage(CubeMapCoordinate::NegativeX, 0, view) + .setCompressedImage(CubeMapCoordinate::PositiveY, 0, view) + .setCompressedImage(CubeMapCoordinate::NegativeY, 0, view) + .setCompressedImage(CubeMapCoordinate::PositiveZ, 0, view) + .setCompressedImage(CubeMapCoordinate::NegativeZ, 0, view); MAGNUM_VERIFY_NO_ERROR(); #ifndef MAGNUM_TARGET_GLES - CompressedImage2D image = texture.compressedImage(CubeMapTexture::Coordinate::PositiveX, 0, {_compressedDataStorage}); + CompressedImage2D image = texture.compressedImage(CubeMapCoordinate::PositiveX, 0, {_compressedDataStorage}); MAGNUM_VERIFY_NO_ERROR(); @@ -541,14 +541,14 @@ void CubeMapTextureGLTest::compressedImage() { #ifndef MAGNUM_TARGET_GLES2 void CubeMapTextureGLTest::imageBuffer() { CubeMapTexture texture; - texture.setImage(CubeMapTexture::Coordinate::PositiveX, 0, TextureFormat::RGBA8, BufferImage2D{ + texture.setImage(CubeMapCoordinate::PositiveX, 0, TextureFormat::RGBA8, BufferImage2D{ _dataStorage, PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(2), unsafeSuffix(Data, _dataOffset), BufferUsage::StaticDraw}); MAGNUM_VERIFY_NO_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES - BufferImage2D image = texture.image(CubeMapTexture::Coordinate::PositiveX, 0, + BufferImage2D image = texture.image(CubeMapCoordinate::PositiveX, 0, {_dataStorage, PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); @@ -576,17 +576,17 @@ void CubeMapTextureGLTest::compressedImageBuffer() { CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, unsafeSuffix(CompressedData, _compressedDataOffset), BufferUsage::StaticDraw}; CubeMapTexture texture; - texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveX, 0, buffer) - .setCompressedImage(CubeMapTexture::Coordinate::NegativeX, 0, buffer) - .setCompressedImage(CubeMapTexture::Coordinate::PositiveY, 0, buffer) - .setCompressedImage(CubeMapTexture::Coordinate::NegativeY, 0, buffer) - .setCompressedImage(CubeMapTexture::Coordinate::PositiveZ, 0, buffer) - .setCompressedImage(CubeMapTexture::Coordinate::NegativeZ, 0, buffer); + texture.setCompressedImage(CubeMapCoordinate::PositiveX, 0, buffer) + .setCompressedImage(CubeMapCoordinate::NegativeX, 0, buffer) + .setCompressedImage(CubeMapCoordinate::PositiveY, 0, buffer) + .setCompressedImage(CubeMapCoordinate::NegativeY, 0, buffer) + .setCompressedImage(CubeMapCoordinate::PositiveZ, 0, buffer) + .setCompressedImage(CubeMapCoordinate::NegativeZ, 0, buffer); MAGNUM_VERIFY_NO_ERROR(); #ifndef MAGNUM_TARGET_GLES - CompressedBufferImage2D image = texture.compressedImage(CubeMapTexture::Coordinate::PositiveX, 0, + CompressedBufferImage2D image = texture.compressedImage(CubeMapCoordinate::PositiveX, 0, {_compressedDataStorage}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); @@ -625,17 +625,17 @@ void CubeMapTextureGLTest::immutableCompressedImage() { CubeMapTexture texture; texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, Vector2i{4}) - .setCompressedSubImage(CubeMapTexture::Coordinate::PositiveX, 0, {}, view) - .setCompressedSubImage(CubeMapTexture::Coordinate::NegativeX, 0, {}, view) - .setCompressedSubImage(CubeMapTexture::Coordinate::PositiveY, 0, {}, view) - .setCompressedSubImage(CubeMapTexture::Coordinate::NegativeY, 0, {}, view) - .setCompressedSubImage(CubeMapTexture::Coordinate::PositiveZ, 0, {}, view) - .setCompressedSubImage(CubeMapTexture::Coordinate::NegativeZ, 0, {}, view); + .setCompressedSubImage(CubeMapCoordinate::PositiveX, 0, {}, view) + .setCompressedSubImage(CubeMapCoordinate::NegativeX, 0, {}, view) + .setCompressedSubImage(CubeMapCoordinate::PositiveY, 0, {}, view) + .setCompressedSubImage(CubeMapCoordinate::NegativeY, 0, {}, view) + .setCompressedSubImage(CubeMapCoordinate::PositiveZ, 0, {}, view) + .setCompressedSubImage(CubeMapCoordinate::NegativeZ, 0, {}, view); MAGNUM_VERIFY_NO_ERROR(); #ifndef MAGNUM_TARGET_GLES - CompressedImage2D image = texture.compressedImage(CubeMapTexture::Coordinate::NegativeY, 0, {}); + CompressedImage2D image = texture.compressedImage(CubeMapCoordinate::NegativeY, 0, {}); MAGNUM_VERIFY_NO_ERROR(); @@ -827,26 +827,26 @@ namespace { void CubeMapTextureGLTest::subImage() { CubeMapTexture texture; - texture.setImage(CubeMapTexture::Coordinate::PositiveX, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::PositiveX, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); - texture.setImage(CubeMapTexture::Coordinate::NegativeX, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::NegativeX, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); - texture.setImage(CubeMapTexture::Coordinate::PositiveY, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::PositiveY, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); - texture.setImage(CubeMapTexture::Coordinate::NegativeY, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::NegativeY, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); - texture.setImage(CubeMapTexture::Coordinate::PositiveZ, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::PositiveZ, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); - texture.setImage(CubeMapTexture::Coordinate::NegativeZ, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::NegativeZ, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); - texture.setSubImage(CubeMapTexture::Coordinate::PositiveX, 0, Vector2i(1), ImageView2D{ + texture.setSubImage(CubeMapCoordinate::PositiveX, 0, Vector2i(1), ImageView2D{ _dataStorage, PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(2), unsafeSuffix(Data, _dataOffset)}); MAGNUM_VERIFY_NO_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES - Image2D image = texture.image(CubeMapTexture::Coordinate::PositiveX, 0, {PixelFormat::RGBA, PixelType::UnsignedByte}); + Image2D image = texture.image(CubeMapCoordinate::PositiveX, 0, {PixelFormat::RGBA, PixelType::UnsignedByte}); MAGNUM_VERIFY_NO_ERROR(); @@ -872,24 +872,24 @@ void CubeMapTextureGLTest::compressedSubImage() { not that far off, then continue as usual */ if(Context::current().isExtensionSupported()) { CubeMapTexture texture; - texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveX, 0, + texture.setCompressedImage(CubeMapCoordinate::PositiveX, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeX, 0, + texture.setCompressedImage(CubeMapCoordinate::NegativeX, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveY, 0, + texture.setCompressedImage(CubeMapCoordinate::PositiveY, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeY, 0, + texture.setCompressedImage(CubeMapCoordinate::NegativeY, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveZ, 0, + texture.setCompressedImage(CubeMapCoordinate::PositiveZ, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeZ, 0, + texture.setCompressedImage(CubeMapCoordinate::NegativeZ, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedSubImage(CubeMapTexture::Coordinate::PositiveX, 0, Vector2i{4}, CompressedImageView2D{ + texture.setCompressedSubImage(CubeMapCoordinate::PositiveX, 0, Vector2i{4}, CompressedImageView2D{ CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, CompressedData}); MAGNUM_VERIFY_NO_ERROR(); - CompressedImage2D image = texture.compressedImage(CubeMapTexture::Coordinate::PositiveX, 0, {}); + CompressedImage2D image = texture.compressedImage(CubeMapCoordinate::PositiveX, 0, {}); MAGNUM_VERIFY_NO_ERROR(); @@ -901,19 +901,19 @@ void CubeMapTextureGLTest::compressedSubImage() { #endif CubeMapTexture texture; - texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveX, 0, + texture.setCompressedImage(CubeMapCoordinate::PositiveX, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeX, 0, + texture.setCompressedImage(CubeMapCoordinate::NegativeX, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveY, 0, + texture.setCompressedImage(CubeMapCoordinate::PositiveY, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeY, 0, + texture.setCompressedImage(CubeMapCoordinate::NegativeY, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveZ, 0, + texture.setCompressedImage(CubeMapCoordinate::PositiveZ, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeZ, 0, + texture.setCompressedImage(CubeMapCoordinate::NegativeZ, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedSubImage(CubeMapTexture::Coordinate::PositiveX, 0, Vector2i{4}, CompressedImageView2D{ + texture.setCompressedSubImage(CubeMapCoordinate::PositiveX, 0, Vector2i{4}, CompressedImageView2D{ #ifndef MAGNUM_TARGET_GLES _compressedDataStorage, #endif @@ -922,7 +922,7 @@ void CubeMapTextureGLTest::compressedSubImage() { MAGNUM_VERIFY_NO_ERROR(); #ifndef MAGNUM_TARGET_GLES - CompressedImage2D image = texture.compressedImage(CubeMapTexture::Coordinate::PositiveX, 0, {}); + CompressedImage2D image = texture.compressedImage(CubeMapCoordinate::PositiveX, 0, {}); MAGNUM_VERIFY_NO_ERROR(); @@ -942,26 +942,26 @@ void CubeMapTextureGLTest::compressedSubImage() { #ifndef MAGNUM_TARGET_GLES2 void CubeMapTextureGLTest::subImageBuffer() { CubeMapTexture texture; - texture.setImage(CubeMapTexture::Coordinate::PositiveX, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::PositiveX, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); - texture.setImage(CubeMapTexture::Coordinate::NegativeX, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::NegativeX, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); - texture.setImage(CubeMapTexture::Coordinate::PositiveY, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::PositiveY, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); - texture.setImage(CubeMapTexture::Coordinate::NegativeY, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::NegativeY, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); - texture.setImage(CubeMapTexture::Coordinate::PositiveZ, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::PositiveZ, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); - texture.setImage(CubeMapTexture::Coordinate::NegativeZ, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::NegativeZ, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(4), Zero)); - texture.setSubImage(CubeMapTexture::Coordinate::PositiveX, 0, Vector2i(1), BufferImage2D{ + texture.setSubImage(CubeMapCoordinate::PositiveX, 0, Vector2i(1), BufferImage2D{ _dataStorage, PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(2), unsafeSuffix(Data, _dataOffset), BufferUsage::StaticDraw}); MAGNUM_VERIFY_NO_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES - BufferImage2D image = texture.image(CubeMapTexture::Coordinate::PositiveX, 0, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); + BufferImage2D image = texture.image(CubeMapCoordinate::PositiveX, 0, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); MAGNUM_VERIFY_NO_ERROR(); @@ -981,19 +981,19 @@ void CubeMapTextureGLTest::compressedSubImageBuffer() { #endif CubeMapTexture texture; - texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveX, 0, + texture.setCompressedImage(CubeMapCoordinate::PositiveX, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeX, 0, + texture.setCompressedImage(CubeMapCoordinate::NegativeX, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveY, 0, + texture.setCompressedImage(CubeMapCoordinate::PositiveY, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeY, 0, + texture.setCompressedImage(CubeMapCoordinate::NegativeY, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveZ, 0, + texture.setCompressedImage(CubeMapCoordinate::PositiveZ, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedImage(CubeMapTexture::Coordinate::NegativeZ, 0, + texture.setCompressedImage(CubeMapCoordinate::NegativeZ, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); - texture.setCompressedSubImage(CubeMapTexture::Coordinate::PositiveX, 0, Vector2i{4}, CompressedBufferImage2D{ + texture.setCompressedSubImage(CubeMapCoordinate::PositiveX, 0, Vector2i{4}, CompressedBufferImage2D{ #ifndef MAGNUM_TARGET_GLES _compressedDataStorage, #endif @@ -1002,7 +1002,7 @@ void CubeMapTextureGLTest::compressedSubImageBuffer() { MAGNUM_VERIFY_NO_ERROR(); #ifndef MAGNUM_TARGET_GLES - CompressedBufferImage2D image = texture.compressedImage(CubeMapTexture::Coordinate::PositiveX, 0, + CompressedBufferImage2D image = texture.compressedImage(CubeMapCoordinate::PositiveX, 0, {}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); @@ -1139,17 +1139,17 @@ void CubeMapTextureGLTest::compressedSubImageQueryBuffer() { void CubeMapTextureGLTest::generateMipmap() { CubeMapTexture texture; - texture.setImage(CubeMapTexture::Coordinate::PositiveX, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::PositiveX, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(32))); - texture.setImage(CubeMapTexture::Coordinate::PositiveY, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::PositiveY, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(32))); - texture.setImage(CubeMapTexture::Coordinate::PositiveZ, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::PositiveZ, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(32))); - texture.setImage(CubeMapTexture::Coordinate::NegativeX, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::NegativeX, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(32))); - texture.setImage(CubeMapTexture::Coordinate::NegativeY, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::NegativeY, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(32))); - texture.setImage(CubeMapTexture::Coordinate::NegativeZ, 0, TextureFormat::RGBA8, + texture.setImage(CubeMapCoordinate::NegativeZ, 0, TextureFormat::RGBA8, ImageView2D(PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(32))); /** @todo How to test this on ES? */ diff --git a/src/Magnum/Test/FramebufferGLTest.cpp b/src/Magnum/Test/FramebufferGLTest.cpp index bf882a5df..fbe32f287 100644 --- a/src/Magnum/Test/FramebufferGLTest.cpp +++ b/src/Magnum/Test/FramebufferGLTest.cpp @@ -25,6 +25,7 @@ #include "Magnum/configure.h" #include "Magnum/Context.h" +#include "Magnum/CubeMapTexture.h" #include "Magnum/Extensions.h" #include "Magnum/Framebuffer.h" #include "Magnum/Image.h" @@ -618,7 +619,7 @@ void FramebufferGLTest::attachCubeMapTexture() { #else color.setStorage(1, rgbaFormatES2, Vector2i(128)); #endif - framebuffer.attachCubeMapTexture(Framebuffer::ColorAttachment(0), color, CubeMapTexture::Coordinate::NegativeZ, 0); + framebuffer.attachCubeMapTexture(Framebuffer::ColorAttachment(0), color, CubeMapCoordinate::NegativeZ, 0); CubeMapTexture depthStencil; @@ -632,11 +633,11 @@ void FramebufferGLTest::attachCubeMapTexture() { #ifndef MAGNUM_TARGET_GLES2 depthStencil.setStorage(1, TextureFormat::Depth24Stencil8, Vector2i(128)); - framebuffer.attachCubeMapTexture(Framebuffer::BufferAttachment::DepthStencil, depthStencil, CubeMapTexture::Coordinate::NegativeZ, 0); + framebuffer.attachCubeMapTexture(Framebuffer::BufferAttachment::DepthStencil, depthStencil, CubeMapCoordinate::NegativeZ, 0); #else depthStencil.setStorage(1, depthStencilFormatES2, Vector2i(128)); - framebuffer.attachCubeMapTexture(Framebuffer::BufferAttachment::Depth, depthStencil, CubeMapTexture::Coordinate::NegativeZ, 0) - .attachCubeMapTexture(Framebuffer::BufferAttachment::Stencil, depthStencil, CubeMapTexture::Coordinate::NegativeZ, 0); + framebuffer.attachCubeMapTexture(Framebuffer::BufferAttachment::Depth, depthStencil, CubeMapCoordinate::NegativeZ, 0) + .attachCubeMapTexture(Framebuffer::BufferAttachment::Stencil, depthStencil, CubeMapCoordinate::NegativeZ, 0); #endif } @@ -645,7 +646,7 @@ void FramebufferGLTest::attachCubeMapTexture() { Debug() << "Using" << Extensions::GL::OES::depth_texture::string(); depthStencil.setStorage(1, TextureFormat::DepthComponent16, Vector2i(128)); - framebuffer.attachCubeMapTexture(Framebuffer::BufferAttachment::Depth, depthStencil, CubeMapTexture::Coordinate::NegativeZ, 0); + framebuffer.attachCubeMapTexture(Framebuffer::BufferAttachment::Depth, depthStencil, CubeMapCoordinate::NegativeZ, 0); } #endif From 31f24474b6cd76271f68e05d26214ecbeafe415b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 6 Apr 2016 16:18:09 +0200 Subject: [PATCH 192/258] DebugTools: utility to get buffer data on OpenGL ES. --- src/Magnum/Buffer.h | 6 +- src/Magnum/DebugTools/BufferData.cpp | 38 +++++++++ src/Magnum/DebugTools/BufferData.h | 81 +++++++++++++++++++ src/Magnum/DebugTools/CMakeLists.txt | 8 ++ .../DebugTools/Test/BufferDataGLTest.cpp | 71 ++++++++++++++++ src/Magnum/DebugTools/Test/CMakeLists.txt | 4 + 6 files changed, 206 insertions(+), 2 deletions(-) create mode 100644 src/Magnum/DebugTools/BufferData.cpp create mode 100644 src/Magnum/DebugTools/BufferData.h create mode 100644 src/Magnum/DebugTools/Test/BufferDataGLTest.cpp diff --git a/src/Magnum/Buffer.h b/src/Magnum/Buffer.h index 3d070148b..a288276f9 100644 --- a/src/Magnum/Buffer.h +++ b/src/Magnum/Buffer.h @@ -1066,7 +1066,8 @@ class MAGNUM_EXPORT Buffer: public AbstractObject { * @fn_gl_extension{GetNamedBufferSubData,EXT,direct_state_access}, * eventually @fn_gl{GetBufferSubData} * @requires_gl Buffer data queries are not available in OpenGL ES and - * WebGL. Use @ref map() in OpenGL ES instead. + * WebGL. Use @ref map() or @ref DebugTools::bufferData() in + * OpenGL ES instead. */ /* MinGW complains loudly if the declaration doesn't also have inline */ template inline Containers::Array data(); @@ -1085,7 +1086,8 @@ class MAGNUM_EXPORT Buffer: public AbstractObject { * @fn_gl_extension{GetNamedBufferSubData,EXT,direct_state_access}, * eventually @fn_gl{BindBuffer} and @fn_gl{GetBufferSubData} * @requires_gl Buffer data queries are not available in OpenGL ES and - * WebGL. Use @ref map() in OpenGL ES instead. + * WebGL. Use @ref map() or @ref DebugTools::bufferData() in + * OpenGL ES instead. */ /* MinGW complains loudly if the declaration doesn't also have inline */ template inline Containers::Array subData(GLintptr offset, GLsizeiptr size); diff --git a/src/Magnum/DebugTools/BufferData.cpp b/src/Magnum/DebugTools/BufferData.cpp new file mode 100644 index 000000000..aff18c731 --- /dev/null +++ b/src/Magnum/DebugTools/BufferData.cpp @@ -0,0 +1,38 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + 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. +*/ + +#include "BufferData.h" + +#ifndef MAGNUM_TARGET_WEBGL +namespace Magnum { namespace DebugTools { namespace Implementation { + +void bufferSubData(Buffer& buffer, GLintptr offset, GLsizeiptr size, void* output) { + const char* data = buffer.map(offset, size, Buffer::MapFlag::Read); + std::copy(data, data + size, reinterpret_cast(output)); + buffer.unmap(); +} + +}}} +#endif diff --git a/src/Magnum/DebugTools/BufferData.h b/src/Magnum/DebugTools/BufferData.h new file mode 100644 index 000000000..4cf6a55b2 --- /dev/null +++ b/src/Magnum/DebugTools/BufferData.h @@ -0,0 +1,81 @@ +#ifndef Magnum_DebugTools_BufferData_h +#define Magnum_DebugTools_BufferData_h +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + 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. +*/ + +#ifndef MAGNUM_TARGET_WEBGL +/** @file + * @brief Function @ref Magnum::DebugTools::bufferData(), @ref Magnum::DebugTools::bufferSubData() + */ +#endif + +#include + +#include "Magnum/Buffer.h" +#include "Magnum/DebugTools/visibility.h" + +#ifndef MAGNUM_TARGET_WEBGL +namespace Magnum { namespace DebugTools { + +namespace Implementation { + MAGNUM_DEBUGTOOLS_EXPORT void bufferSubData(Buffer& buffer, GLintptr offset, GLsizeiptr size, void* output); +} + +/** +@brief Buffer subdata + +Emulates @ref Buffer::subData() call on platforms that don't support it (such +as OpenGL ES) by using @ref Buffer::map(). +@requires_gles30 Extension @es_extension{EXT,map_buffer_range} in OpenGL ES + 2.0. +@requires_gles Buffer mapping is not available in WebGL. +*/ +template Containers::Array inline bufferSubData(Buffer& buffer, GLintptr offset, GLsizeiptr size) { + Containers::Array data{std::size_t(size)}; + if(size) Implementation::bufferSubData(buffer, offset, size*sizeof(T), data); + return data; +} + +/** +@brief Buffer data + +Emulates @ref Buffer::data() call on platforms that don't support it (such as +OpenGL ES) by using @ref Buffer::map(). +@requires_gles30 Extension @es_extension{EXT,map_buffer_range} in OpenGL ES + 2.0. +@requires_gles Buffer mapping is not available in WebGL. +*/ +template Containers::Array inline bufferData(Buffer& buffer) { + const Int bufferSize = buffer.size(); + CORRADE_ASSERT(bufferSize%sizeof(T) == 0, "Buffer::data(): the buffer size is" << bufferSize << "bytes, which can't be expressed as array of types with size" << sizeof(T), nullptr); + return bufferSubData(buffer, 0, bufferSize/sizeof(T)); +} + +}} +#else +#error this header is not available in WebGL build +#endif + +#endif diff --git a/src/Magnum/DebugTools/CMakeLists.txt b/src/Magnum/DebugTools/CMakeLists.txt index f7caa6ae4..978e68a26 100644 --- a/src/Magnum/DebugTools/CMakeLists.txt +++ b/src/Magnum/DebugTools/CMakeLists.txt @@ -36,6 +36,14 @@ set(MagnumDebugTools_HEADERS # Header files to display in project view of IDEs only set(MagnumDebugTools_PRIVATE_HEADERS ) +if(NOT MAGNUM_TARGET_WEBGL) + list(APPEND MagnumDebugTools_SRCS + BufferData.cpp) + + list(APPEND MagnumDebugTools_HEADERS + BufferData.h) +endif() + if(WITH_SCENEGRAPH) list(APPEND MagnumDebugTools_SRCS ForceRenderer.cpp diff --git a/src/Magnum/DebugTools/Test/BufferDataGLTest.cpp b/src/Magnum/DebugTools/Test/BufferDataGLTest.cpp new file mode 100644 index 000000000..c9985ae26 --- /dev/null +++ b/src/Magnum/DebugTools/Test/BufferDataGLTest.cpp @@ -0,0 +1,71 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + 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. +*/ + +#include + +#include "Magnum/DebugTools/BufferData.h" +#include "Magnum/Test/AbstractOpenGLTester.h" + +namespace Magnum { namespace DebugTools { namespace Test { + +struct BufferDataGLTest: Magnum::Test::AbstractOpenGLTester { + explicit BufferDataGLTest(); + + void data(); + void subData(); +}; + +BufferDataGLTest::BufferDataGLTest() { + addTests({&BufferDataGLTest::data, + &BufferDataGLTest::subData}); +} + +namespace { + constexpr Int Data[] = {2, 7, 5, 13, 25}; +} + +void BufferDataGLTest::data() { + Buffer buffer; + buffer.setData(Data, BufferUsage::StaticDraw); + const Containers::Array contents = bufferData(buffer); + MAGNUM_VERIFY_NO_ERROR(); + CORRADE_COMPARE_AS(contents, + Containers::ArrayView{Data}, + TestSuite::Compare::Container); +} + +void BufferDataGLTest::subData() { + Buffer buffer; + buffer.setData(Data, BufferUsage::StaticDraw); + const Containers::Array contents = bufferSubData(buffer, 4, 3); + MAGNUM_VERIFY_NO_ERROR(); + CORRADE_COMPARE_AS(contents, + Containers::ArrayView{Data}.slice(1, 4), + TestSuite::Compare::Container); +} + +}}} + +MAGNUM_GL_TEST_MAIN(Magnum::DebugTools::Test::BufferDataGLTest) diff --git a/src/Magnum/DebugTools/Test/CMakeLists.txt b/src/Magnum/DebugTools/Test/CMakeLists.txt index 824ab777d..d1b2654a2 100644 --- a/src/Magnum/DebugTools/Test/CMakeLists.txt +++ b/src/Magnum/DebugTools/Test/CMakeLists.txt @@ -27,3 +27,7 @@ corrade_add_test(DebugToolsCapsuleRendererTest CapsuleRendererTest.cpp LIBRARIES corrade_add_test(DebugToolsCylinderRendererTest CylinderRendererTest.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(DebugToolsForceRendererTest ForceRendererTest.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(DebugToolsLineSegmentRendererTest LineSegmentRendererTest.cpp LIBRARIES MagnumMathTestLib) + +if(BUILD_GL_TESTS) + corrade_add_test(DebugToolsBufferDataGLTest BufferDataGLTest.cpp LIBRARIES MagnumDebugTools ${GL_TEST_LIBRARIES}) +endif() From 78d73fa98e4dc553d9aa2233f68cafcb632335de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 6 Apr 2016 16:32:49 +0200 Subject: [PATCH 193/258] DebugTools: utility to get texture image on OpenGL ES. --- src/Magnum/DebugTools/CMakeLists.txt | 4 +- src/Magnum/DebugTools/Test/CMakeLists.txt | 1 + .../DebugTools/Test/TextureImageGLTest.cpp | 147 ++++++++++++++++++ src/Magnum/DebugTools/TextureImage.cpp | 83 ++++++++++ src/Magnum/DebugTools/TextureImage.h | 95 +++++++++++ 5 files changed, 329 insertions(+), 1 deletion(-) create mode 100644 src/Magnum/DebugTools/Test/TextureImageGLTest.cpp create mode 100644 src/Magnum/DebugTools/TextureImage.cpp create mode 100644 src/Magnum/DebugTools/TextureImage.h diff --git a/src/Magnum/DebugTools/CMakeLists.txt b/src/Magnum/DebugTools/CMakeLists.txt index 978e68a26..1eaf37f50 100644 --- a/src/Magnum/DebugTools/CMakeLists.txt +++ b/src/Magnum/DebugTools/CMakeLists.txt @@ -25,12 +25,14 @@ set(MagnumDebugTools_SRCS Profiler.cpp - ResourceManager.cpp) + ResourceManager.cpp + TextureImage.cpp) set(MagnumDebugTools_HEADERS DebugTools.h Profiler.h ResourceManager.h + TextureImage.h visibility.h) # Header files to display in project view of IDEs only diff --git a/src/Magnum/DebugTools/Test/CMakeLists.txt b/src/Magnum/DebugTools/Test/CMakeLists.txt index d1b2654a2..e46197d97 100644 --- a/src/Magnum/DebugTools/Test/CMakeLists.txt +++ b/src/Magnum/DebugTools/Test/CMakeLists.txt @@ -30,4 +30,5 @@ corrade_add_test(DebugToolsLineSegmentRendererTest LineSegmentRendererTest.cpp L if(BUILD_GL_TESTS) corrade_add_test(DebugToolsBufferDataGLTest BufferDataGLTest.cpp LIBRARIES MagnumDebugTools ${GL_TEST_LIBRARIES}) + corrade_add_test(DebugToolsTextureImageGLTest TextureImageGLTest.cpp LIBRARIES MagnumDebugTools ${GL_TEST_LIBRARIES}) endif() diff --git a/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp new file mode 100644 index 000000000..a948ed968 --- /dev/null +++ b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp @@ -0,0 +1,147 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + 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. +*/ + +#include + +#include "Magnum/BufferImage.h" +#include "Magnum/CubeMapTexture.h" +#include "Magnum/Image.h" +#include "Magnum/PixelFormat.h" +#include "Magnum/Texture.h" +#include "Magnum/TextureFormat.h" +#include "Magnum/DebugTools/BufferData.h" +#include "Magnum/DebugTools/TextureImage.h" +#include "Magnum/Math/Range.h" +#include "Magnum/Test/AbstractOpenGLTester.h" + +namespace Magnum { namespace DebugTools { namespace Test { + +struct TextureImageGLTest: Magnum::Test::AbstractOpenGLTester { + explicit TextureImageGLTest(); + + void subImage2D(); + #ifndef MAGNUM_TARGET_GLES2 + void subImage2DBuffer(); + #endif + + void subImageCube(); + #ifndef MAGNUM_TARGET_GLES2 + void subImageCubeBuffer(); + #endif +}; + +TextureImageGLTest::TextureImageGLTest() { + addTests({&TextureImageGLTest::subImage2D, + #ifndef MAGNUM_TARGET_GLES2 + &TextureImageGLTest::subImage2DBuffer, + #endif + + &TextureImageGLTest::subImageCube, + #ifndef MAGNUM_TARGET_GLES2 + &TextureImageGLTest::subImageCubeBuffer + #endif + }); +} + +namespace { + constexpr UnsignedByte Data2D[] = { 0x00, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f }; +} + +void TextureImageGLTest::subImage2D() { + Texture2D texture; + texture.setImage(0, TextureFormat::RGBA8, ImageView2D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i{2}, Data2D}); + + Image2D image = textureSubImage(texture, 0, {{}, Vector2i{2}}, {PixelFormat::RGBA, PixelType::UnsignedByte}); + MAGNUM_VERIFY_NO_ERROR(); + CORRADE_COMPARE(image.size(), Vector2i{2}); + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}), + Containers::ArrayView{Data2D}, + TestSuite::Compare::Container); +} + +#ifndef MAGNUM_TARGET_GLES2 +void TextureImageGLTest::subImage2DBuffer() { + Texture2D texture; + texture.setImage(0, TextureFormat::RGBA8, ImageView2D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i{2}, Data2D}); + + BufferImage2D image = textureSubImage(texture, 0, {{}, Vector2i{2}}, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); + Containers::Array data = bufferData(image.buffer()); + MAGNUM_VERIFY_NO_ERROR(); + CORRADE_COMPARE(image.size(), Vector2i{2}); + CORRADE_COMPARE_AS(data, + Containers::ArrayView{Data2D}, + TestSuite::Compare::Container); +} +#endif + +void TextureImageGLTest::subImageCube() { + ImageView2D view{PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i{2}, Data2D}; + + CubeMapTexture texture; + texture.setImage(CubeMapCoordinate::PositiveX, 0, TextureFormat::RGBA8, view) + .setImage(CubeMapCoordinate::NegativeX, 0, TextureFormat::RGBA8, view) + .setImage(CubeMapCoordinate::PositiveY, 0, TextureFormat::RGBA8, view) + .setImage(CubeMapCoordinate::NegativeY, 0, TextureFormat::RGBA8, view) + .setImage(CubeMapCoordinate::PositiveZ, 0, TextureFormat::RGBA8, view) + .setImage(CubeMapCoordinate::NegativeZ, 0, TextureFormat::RGBA8, view); + + Image2D image = textureSubImage(texture, CubeMapCoordinate::PositiveX, 0, {{}, Vector2i{2}}, {PixelFormat::RGBA, PixelType::UnsignedByte}); + MAGNUM_VERIFY_NO_ERROR(); + CORRADE_COMPARE(image.size(), Vector2i{2}); + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()}), + Containers::ArrayView{Data2D}, + TestSuite::Compare::Container); +} + +#ifndef MAGNUM_TARGET_GLES2 +void TextureImageGLTest::subImageCubeBuffer() { + ImageView2D view{PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i{2}, Data2D}; + + CubeMapTexture texture; + texture.setImage(CubeMapCoordinate::PositiveX, 0, TextureFormat::RGBA8, view) + .setImage(CubeMapCoordinate::NegativeX, 0, TextureFormat::RGBA8, view) + .setImage(CubeMapCoordinate::PositiveY, 0, TextureFormat::RGBA8, view) + .setImage(CubeMapCoordinate::NegativeY, 0, TextureFormat::RGBA8, view) + .setImage(CubeMapCoordinate::PositiveZ, 0, TextureFormat::RGBA8, view) + .setImage(CubeMapCoordinate::NegativeZ, 0, TextureFormat::RGBA8, view); + + BufferImage2D image = textureSubImage(texture, CubeMapCoordinate::PositiveX, 0, {{}, Vector2i{2}}, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); + Containers::Array data = bufferData(image.buffer()); + MAGNUM_VERIFY_NO_ERROR(); + CORRADE_COMPARE(image.size(), Vector2i{2}); + CORRADE_COMPARE_AS(data, + Containers::ArrayView{Data2D}, + TestSuite::Compare::Container); +} +#endif + +}}} + +MAGNUM_GL_TEST_MAIN(Magnum::DebugTools::Test::TextureImageGLTest) diff --git a/src/Magnum/DebugTools/TextureImage.cpp b/src/Magnum/DebugTools/TextureImage.cpp new file mode 100644 index 000000000..22725bf2e --- /dev/null +++ b/src/Magnum/DebugTools/TextureImage.cpp @@ -0,0 +1,83 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + 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. +*/ + +#include "TextureImage.h" + +#include "Magnum/BufferImage.h" +#include "Magnum/Framebuffer.h" +#include "Magnum/Texture.h" +#include "Magnum/Image.h" + +namespace Magnum { namespace DebugTools { + +void textureSubImage(Texture2D& texture, const Int level, const Range2Di& range, Image2D& image) { + Framebuffer fb{range}; + fb.attachTexture(Framebuffer::ColorAttachment{0}, texture, level) + .read(range, image); +} + +void textureSubImage(CubeMapTexture& texture, const CubeMapCoordinate coordinate, const Int level, const Range2Di& range, Image2D& image) { + Framebuffer fb{range}; + fb.attachCubeMapTexture(Framebuffer::ColorAttachment{0}, texture, coordinate, level) + .read(range, image); +} + +#ifndef MAGNUM_TARGET_GLES2 +void textureSubImage(Texture2D& texture, const Int level, const Range2Di& range, BufferImage2D& image, const BufferUsage usage) { + Framebuffer fb{range}; + fb.attachTexture(Framebuffer::ColorAttachment{0}, texture, level) + .read(range, image, usage); +} + +void textureSubImage(CubeMapTexture& texture, const CubeMapCoordinate coordinate, const Int level, const Range2Di& range, BufferImage2D& image, const BufferUsage usage) { + Framebuffer fb{range}; + fb.attachCubeMapTexture(Framebuffer::ColorAttachment{0}, texture, coordinate, level) + .read(range, image, usage); +} +#endif + +Image2D textureSubImage(Texture2D& texture, const Int level, const Range2Di& range, Image2D&& image) { + textureSubImage(texture, level, range, image); + return std::move(image); +} + +Image2D textureSubImage(CubeMapTexture& texture, const CubeMapCoordinate coordinate, const Int level, const Range2Di& range, Image2D&& image) { + textureSubImage(texture, coordinate, level, range, image); + return std::move(image); +} + +#ifndef MAGNUM_TARGET_GLES2 +BufferImage2D textureSubImage(Texture2D& texture, const Int level, const Range2Di& range, BufferImage2D&& image, const BufferUsage usage) { + textureSubImage(texture, level, range, image, usage); + return std::move(image); +} + +BufferImage2D textureSubImage(CubeMapTexture& texture, const CubeMapCoordinate coordinate, const Int level, const Range2Di& range, BufferImage2D&& image, const BufferUsage usage) { + textureSubImage(texture, coordinate, level, range, image, usage); + return std::move(image); +} +#endif + +}} diff --git a/src/Magnum/DebugTools/TextureImage.h b/src/Magnum/DebugTools/TextureImage.h new file mode 100644 index 000000000..c6d67fa01 --- /dev/null +++ b/src/Magnum/DebugTools/TextureImage.h @@ -0,0 +1,95 @@ +#ifndef Magnum_DebugTools_TextureImage_h +#define Magnum_DebugTools_TextureImage_h +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + 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 + * @brief Function @ref Magnum::DebugTools::textureSubImage() + */ + +#include "Magnum/Magnum.h" +#include "Magnum/DebugTools/visibility.h" + +namespace Magnum { namespace DebugTools { + +/** +@brief Read range of given texture mip level to image + +Emulates @ref Texture::subImage() "*Texture::subImage()" call on platforms that +don't support it (such as OpenGL ES) by creating a framebuffer object and using +@ref Framebuffer::read(). Note that only @ref PixelFormat and @ref PixelType +values that are marked as framebuffer readable are supported. +*/ +MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(Texture2D& texture, Int level, const Range2Di& range, Image2D& image); + +/** @overload */ +MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, Image2D& image); + +/** +@brief Read range of given texture mip level to image + +Convenience alternative to the above, example usage: +@code +Image2D image = DebugTools::textureSubImage(texture, 0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte}); +@endcode +*/ +MAGNUM_DEBUGTOOLS_EXPORT Image2D textureSubImage(Texture2D& texture, Int level, const Range2Di& range, Image2D&& image); + +/** @overload */ +MAGNUM_DEBUGTOOLS_EXPORT Image2D textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, Image2D&& image); + +#ifndef MAGNUM_TARGET_GLES2 +/** +@brief Read range of given texture mip level to buffer image + +Emulates @ref Texture::subImage() "*Texture::subImage()" call on platforms that +don't support it (such as OpenGL ES) by creating a framebuffer object and using +@ref Framebuffer::read(). Note that only @ref PixelFormat and @ref PixelType +values that are marked as framebuffer readable are supported. +@requires_gles30 Pixel buffer objects are not available in OpenGL ES 2.0. +@requires_webgl20 Pixel buffer objects are not available in WebGL 1.0. +*/ +MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(Texture2D& texture, Int level, const Range2Di& range, BufferImage2D& image, BufferUsage usage); + +/** @overload */ +MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, BufferImage2D& image, BufferUsage usage); + +/** +@brief Read range of given texture mip level to buffer image + +Convenience alternative to the above, example usage: +@code +BufferImage2D image = DebugTools::textureSubImage(texture, 0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); +@endcode +*/ +MAGNUM_DEBUGTOOLS_EXPORT BufferImage2D textureSubImage(Texture2D& texture, Int level, const Range2Di& range, BufferImage2D&& image, BufferUsage usage); + +/** @overload */ +MAGNUM_DEBUGTOOLS_EXPORT BufferImage2D textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, BufferImage2D&& image, BufferUsage usage); +#endif + +}} + +#endif From c9271da28c3c49357fb5ad196dbfb141c9f1ae98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 9 Apr 2016 11:13:46 +0200 Subject: [PATCH 194/258] DebugTools: support reading float textures in textureImage() on ES3. --- src/Magnum/DebugTools/CMakeLists.txt | 5 + .../DebugTools/Test/TextureImageGLTest.cpp | 53 +++++++- src/Magnum/DebugTools/TextureImage.cpp | 121 +++++++++++++++++- src/Magnum/DebugTools/TextureImage.frag | 12 ++ src/Magnum/DebugTools/TextureImage.h | 16 ++- src/Magnum/DebugTools/TextureImage.vert | 4 + src/Magnum/DebugTools/resources.conf | 7 + 7 files changed, 212 insertions(+), 6 deletions(-) create mode 100644 src/Magnum/DebugTools/TextureImage.frag create mode 100644 src/Magnum/DebugTools/TextureImage.vert create mode 100644 src/Magnum/DebugTools/resources.conf diff --git a/src/Magnum/DebugTools/CMakeLists.txt b/src/Magnum/DebugTools/CMakeLists.txt index 1eaf37f50..76ca9163d 100644 --- a/src/Magnum/DebugTools/CMakeLists.txt +++ b/src/Magnum/DebugTools/CMakeLists.txt @@ -38,6 +38,11 @@ set(MagnumDebugTools_HEADERS # Header files to display in project view of IDEs only set(MagnumDebugTools_PRIVATE_HEADERS ) +if(MAGNUM_TARGET_GLES AND NOT MAGNUM_TARGET_GLES2) + corrade_add_resource(MagnumDebugTools_RESOURCES resources.conf) + list(APPEND MagnumDebugTools_SRCS ${MagnumDebugTools_RESOURCES}) +endif() + if(NOT MAGNUM_TARGET_WEBGL) list(APPEND MagnumDebugTools_SRCS BufferData.cpp) diff --git a/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp index a948ed968..7781e9077 100644 --- a/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp +++ b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp @@ -50,6 +50,11 @@ struct TextureImageGLTest: Magnum::Test::AbstractOpenGLTester { #ifndef MAGNUM_TARGET_GLES2 void subImageCubeBuffer(); #endif + + #ifndef MAGNUM_TARGET_GLES2 + void subImage2DUInt(); + void subImage2DFloat(); + #endif }; TextureImageGLTest::TextureImageGLTest() { @@ -60,7 +65,12 @@ TextureImageGLTest::TextureImageGLTest() { &TextureImageGLTest::subImageCube, #ifndef MAGNUM_TARGET_GLES2 - &TextureImageGLTest::subImageCubeBuffer + &TextureImageGLTest::subImageCubeBuffer, + #endif + + #ifndef MAGNUM_TARGET_GLES2 + &TextureImageGLTest::subImage2DUInt, + &TextureImageGLTest::subImage2DFloat, #endif }); } @@ -142,6 +152,47 @@ void TextureImageGLTest::subImageCubeBuffer() { } #endif +namespace { + constexpr UnsignedInt Data2DUInt[] = { 0xcafebabe, + 0xdeadbeef, + 0xbadf00d, + 0xdeadbabe }; +} + +void TextureImageGLTest::subImage2DUInt() { + Texture2D texture; + texture.setImage(0, TextureFormat::R32UI, ImageView2D{PixelFormat::RedInteger, PixelType::UnsignedInt, Vector2i{2}, Data2DUInt}); + + Image2D image = textureSubImage(texture, 0, {{}, Vector2i{2}}, {PixelFormat::RedInteger, PixelType::UnsignedInt}); + MAGNUM_VERIFY_NO_ERROR(); + CORRADE_COMPARE(image.size(), Vector2i{2}); + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()/4}), + Containers::ArrayView{Data2DUInt}, + TestSuite::Compare::Container); +} + +namespace { + constexpr Float Data2DFloat[] = { 1.0f, + 0.14159f, + 0.71828f, + 0.41421f }; +} + +void TextureImageGLTest::subImage2DFloat() { + Texture2D texture; + texture.setStorage(1, TextureFormat::R32F, Vector2i{2}) + .setSubImage(0, {}, ImageView2D{PixelFormat::Red, PixelType::Float, Vector2i{2}, Data2DFloat}); + + Image2D image = textureSubImage(texture, 0, {{}, Vector2i{2}}, {PixelFormat::Red, PixelType::Float}); + MAGNUM_VERIFY_NO_ERROR(); + CORRADE_COMPARE(image.size(), Vector2i{2}); + CORRADE_COMPARE_AS( + (Containers::ArrayView{image.data(), image.data().size()/4}), + Containers::ArrayView{Data2DFloat}, + TestSuite::Compare::Container); +} + }}} MAGNUM_GL_TEST_MAIN(Magnum::DebugTools::Test::TextureImageGLTest) diff --git a/src/Magnum/DebugTools/TextureImage.cpp b/src/Magnum/DebugTools/TextureImage.cpp index 22725bf2e..6515f678e 100644 --- a/src/Magnum/DebugTools/TextureImage.cpp +++ b/src/Magnum/DebugTools/TextureImage.cpp @@ -27,12 +27,131 @@ #include "Magnum/BufferImage.h" #include "Magnum/Framebuffer.h" -#include "Magnum/Texture.h" #include "Magnum/Image.h" +#include "Magnum/Texture.h" + +#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_GLES2) +#include + +#include "Magnum/AbstractShaderProgram.h" +#include "Magnum/Mesh.h" +#include "Magnum/PixelFormat.h" +#include "Magnum/Shader.h" +#include "Magnum/TextureFormat.h" +#include "Magnum/Version.h" + +#ifdef MAGNUM_BUILD_STATIC +static void importDebugToolsResources() { + CORRADE_RESOURCE_INITIALIZE(MagnumDebugTools_RESOURCES) +} +#endif +#endif namespace Magnum { namespace DebugTools { +#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_GLES2) +namespace { + +class FloatReinterpretShader: public AbstractShaderProgram { + public: + explicit FloatReinterpretShader(); + + FloatReinterpretShader& setTexture(Texture2D& texture, Int level) { + texture.bind(0); + setUniform(levelUniform, level); + return *this; + } + + private: + Int levelUniform; +}; + +FloatReinterpretShader::FloatReinterpretShader() { + #ifdef MAGNUM_BUILD_STATIC + /* Import resources on static build, if not already */ + if(!Utility::Resource::hasGroup("MagnumDebugTools")) + importShaderResources(); + #endif + Utility::Resource rs{"MagnumDebugTools"}; + + Shader vert{Version::GLES300, Shader::Type::Vertex}; + Shader frag{Version::GLES300, Shader::Type::Fragment}; + vert.addSource(rs.get("TextureImage.vert")); + frag.addSource(rs.get("TextureImage.frag")); + + CORRADE_INTERNAL_ASSERT(Shader::compile({vert, frag})); + attachShaders({vert, frag}); + + CORRADE_INTERNAL_ASSERT(link()); + + levelUniform = uniformLocation("level"); + setUniform(uniformLocation("textureData"), 0); +} + +} +#endif + void textureSubImage(Texture2D& texture, const Int level, const Range2Di& range, Image2D& image) { + #ifdef MAGNUM_TARGET_GLES + if(image.type() == PixelType::Float) { + const PixelFormat imageFormat = image.format(); + TextureFormat textureFormat; + PixelFormat reinterpretFormat; + switch(imageFormat) { + case PixelFormat::Red: + textureFormat = TextureFormat::R32UI; + reinterpretFormat = PixelFormat::RedInteger; + break; + case PixelFormat::RG: + textureFormat = TextureFormat::RG32UI; + reinterpretFormat = PixelFormat::RGInteger; + break; + case PixelFormat::RGB: + textureFormat = TextureFormat::RGB32UI; + reinterpretFormat = PixelFormat::RGBInteger; + break; + case PixelFormat::RGBA: + textureFormat = TextureFormat::RGBA32UI; + reinterpretFormat = PixelFormat::RGBAInteger; + break; + default: + CORRADE_ASSERT(false, "DebugTools::textureSubImage(): unsupported pixel format" << image.format(), ); + } + + Texture2D output; + output.setStorage(1, textureFormat, range.max()); + + Framebuffer fb{range}; + fb.attachTexture(Framebuffer::ColorAttachment{0}, output, 0) + .bind(); + + CORRADE_INTERNAL_ASSERT(fb.checkStatus(FramebufferTarget::Draw) == Framebuffer::Status::Complete); + CORRADE_INTERNAL_ASSERT(fb.checkStatus(FramebufferTarget::Read) == Framebuffer::Status::Complete); + + FloatReinterpretShader shader; + shader.setTexture(texture, level); + + Mesh mesh; + mesh.setCount(3) + .draw(shader); + + /* release() needs to be called after querying the size to avoid zeroing it out */ + { + Vector2i imageSize = image.size(); + image.setData(image.storage(), reinterpretFormat, PixelType::UnsignedInt, imageSize, image.release()); + } + + fb.read(range, image); + + /* release() needs to be called after querying the size to avoid zeroing it out */ + { + Vector2i imageSize = image.size(); + image.setData(image.storage(), imageFormat, PixelType::Float, imageSize, image.release()); + } + return; + } + #endif + Framebuffer fb{range}; fb.attachTexture(Framebuffer::ColorAttachment{0}, texture, level) .read(range, image); diff --git a/src/Magnum/DebugTools/TextureImage.frag b/src/Magnum/DebugTools/TextureImage.frag new file mode 100644 index 000000000..836a03aa1 --- /dev/null +++ b/src/Magnum/DebugTools/TextureImage.frag @@ -0,0 +1,12 @@ +uniform highp int level; +uniform highp sampler2D textureData; + +layout(pixel_center_integer) in highp vec4 gl_FragCoord; + +out highp uvec4 fragmentOutput; + +void main() { + ivec2 pos = ivec2(gl_FragCoord.xy); + + fragmentOutput = floatBitsToUint(texelFetch(textureData, pos, level)); +} diff --git a/src/Magnum/DebugTools/TextureImage.h b/src/Magnum/DebugTools/TextureImage.h index c6d67fa01..54c1895f3 100644 --- a/src/Magnum/DebugTools/TextureImage.h +++ b/src/Magnum/DebugTools/TextureImage.h @@ -39,8 +39,14 @@ namespace Magnum { namespace DebugTools { Emulates @ref Texture::subImage() "*Texture::subImage()" call on platforms that don't support it (such as OpenGL ES) by creating a framebuffer object and using -@ref Framebuffer::read(). Note that only @ref PixelFormat and @ref PixelType -values that are marked as framebuffer readable are supported. +@ref Framebuffer::read(). + +Note that only @ref PixelFormat and @ref PixelType values that are marked as +framebuffer readable are supported. In addition, on OpenGL ES 3.0, images with +@ref PixelType::Float are supported -- they are reinterpreted as +@ref PixelType::UnsignedInt using additional shader and `floatBitsToUint()` +GLSL function and then reinterpreted back to @ref PixelType::Float when read to +client memory. */ MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(Texture2D& texture, Int level, const Range2Di& range, Image2D& image); @@ -66,8 +72,10 @@ MAGNUM_DEBUGTOOLS_EXPORT Image2D textureSubImage(CubeMapTexture& texture, CubeMa Emulates @ref Texture::subImage() "*Texture::subImage()" call on platforms that don't support it (such as OpenGL ES) by creating a framebuffer object and using -@ref Framebuffer::read(). Note that only @ref PixelFormat and @ref PixelType -values that are marked as framebuffer readable are supported. +@ref Framebuffer::read(). + +Note that only @ref PixelFormat and @ref PixelType values that are marked as +framebuffer readable are supported. @requires_gles30 Pixel buffer objects are not available in OpenGL ES 2.0. @requires_webgl20 Pixel buffer objects are not available in WebGL 1.0. */ diff --git a/src/Magnum/DebugTools/TextureImage.vert b/src/Magnum/DebugTools/TextureImage.vert new file mode 100644 index 000000000..325b2e733 --- /dev/null +++ b/src/Magnum/DebugTools/TextureImage.vert @@ -0,0 +1,4 @@ +void main() { + gl_Position = vec4((gl_VertexID == 2) ? 3.0 : -1.0, + (gl_VertexID == 1) ? -3.0 : 1.0, 0.0, 1.0); +} diff --git a/src/Magnum/DebugTools/resources.conf b/src/Magnum/DebugTools/resources.conf new file mode 100644 index 000000000..f9d480144 --- /dev/null +++ b/src/Magnum/DebugTools/resources.conf @@ -0,0 +1,7 @@ +group=MagnumDebugTools + +[file] +filename=TextureImage.vert + +[file] +filename=TextureImage.frag From 4bc1841c2d3d9588ad090e21da159103e452bcd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 9 Apr 2016 11:32:57 +0200 Subject: [PATCH 195/258] Doxygen workarounds. WHYYYY. --- src/Magnum/DebugTools/TextureImage.h | 16 ++++++++-------- src/Magnum/Magnum.h | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Magnum/DebugTools/TextureImage.h b/src/Magnum/DebugTools/TextureImage.h index 54c1895f3..ad9297746 100644 --- a/src/Magnum/DebugTools/TextureImage.h +++ b/src/Magnum/DebugTools/TextureImage.h @@ -41,12 +41,12 @@ Emulates @ref Texture::subImage() "*Texture::subImage()" call on platforms that don't support it (such as OpenGL ES) by creating a framebuffer object and using @ref Framebuffer::read(). -Note that only @ref PixelFormat and @ref PixelType values that are marked as -framebuffer readable are supported. In addition, on OpenGL ES 3.0, images with -@ref PixelType::Float are supported -- they are reinterpreted as -@ref PixelType::UnsignedInt using additional shader and `floatBitsToUint()` -GLSL function and then reinterpreted back to @ref PixelType::Float when read to -client memory. +Note that only @ref Magnum::PixelFormat "PixelFormat" and @ref PixelType values +that are marked as framebuffer readable are supported. In addition, on OpenGL +ES 3.0, images with @ref PixelType::Float are supported -- they are +reinterpreted as @ref PixelType::UnsignedInt using additional shader and +`floatBitsToUint()` GLSL function and then reinterpreted back to +@ref PixelType::Float when read to client memory. */ MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(Texture2D& texture, Int level, const Range2Di& range, Image2D& image); @@ -74,8 +74,8 @@ Emulates @ref Texture::subImage() "*Texture::subImage()" call on platforms that don't support it (such as OpenGL ES) by creating a framebuffer object and using @ref Framebuffer::read(). -Note that only @ref PixelFormat and @ref PixelType values that are marked as -framebuffer readable are supported. +Note that only @ref Magnum::PixelFormat "PixelFormat" and @ref PixelType values +that are marked as framebuffer readable are supported. @requires_gles30 Pixel buffer objects are not available in OpenGL ES 2.0. @requires_webgl20 Pixel buffer objects are not available in WebGL 1.0. */ diff --git a/src/Magnum/Magnum.h b/src/Magnum/Magnum.h index 2519a5e59..45e1dd5df 100644 --- a/src/Magnum/Magnum.h +++ b/src/Magnum/Magnum.h @@ -151,7 +151,8 @@ Defined if the engine is built for use on a headless machine (without any graphical desktop environment). Basically it means that EGL with no display attachment is being used everywhere instead of platform-specific toolkits like CGL, GLX or WGL. Note that this might not be supported on all platforms, see -@ref Platform::WindowlessEglApplication for more information. +@ref Magnum::Platform::WindowlessEglApplication "Platform::WindowlessEglApplication" +for more information. */ #define MAGNUM_TARGET_HEADLESS #undef MAGNUM_TARGET_HEADLESS From ce3b78672b69dcb6b2d22c700ce7c6d22a56e76e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 9 Apr 2016 15:18:21 +0200 Subject: [PATCH 196/258] DebugTools: I knew I would forget to revert some of the debug shit. --- src/Magnum/DebugTools/Test/TextureImageGLTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp index 7781e9077..8184a41b8 100644 --- a/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp +++ b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp @@ -174,9 +174,9 @@ void TextureImageGLTest::subImage2DUInt() { namespace { constexpr Float Data2DFloat[] = { 1.0f, - 0.14159f, - 0.71828f, - 0.41421f }; + 3.14159f, + 2.71828f, + 1.41421f }; } void TextureImageGLTest::subImage2DFloat() { From 9cbbd21416976c9efdf59912b2386eec6b01f1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 10 Apr 2016 17:57:47 +0200 Subject: [PATCH 197/258] DebugTools: fix static build on ES. --- src/Magnum/DebugTools/TextureImage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/DebugTools/TextureImage.cpp b/src/Magnum/DebugTools/TextureImage.cpp index 6515f678e..0f3c8ffb0 100644 --- a/src/Magnum/DebugTools/TextureImage.cpp +++ b/src/Magnum/DebugTools/TextureImage.cpp @@ -70,7 +70,7 @@ FloatReinterpretShader::FloatReinterpretShader() { #ifdef MAGNUM_BUILD_STATIC /* Import resources on static build, if not already */ if(!Utility::Resource::hasGroup("MagnumDebugTools")) - importShaderResources(); + importDebugToolsResources(); #endif Utility::Resource rs{"MagnumDebugTools"}; From 628201946b1cc633226c3623c8bf951baa989326 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 12 Apr 2016 13:40:09 +0200 Subject: [PATCH 198/258] Made the version() functions constexpr. Not sure why it wasn't like that before. --- src/Magnum/Test/VersionTest.cpp | 12 ++++++++---- src/Magnum/Version.h | 5 ++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Magnum/Test/VersionTest.cpp b/src/Magnum/Test/VersionTest.cpp index 0f691c6d5..a2121dde9 100644 --- a/src/Magnum/Test/VersionTest.cpp +++ b/src/Magnum/Test/VersionTest.cpp @@ -50,17 +50,21 @@ VersionTest::VersionTest() { void VersionTest::fromNumber() { #ifndef MAGNUM_TARGET_GLES - CORRADE_COMPARE(version(4, 3), Version::GL430); + constexpr const Version v = version(4, 3); + CORRADE_COMPARE(v, Version::GL430); #else - CORRADE_COMPARE(version(3, 0), Version::GLES300); + constexpr const Version v = version(3, 0); + CORRADE_COMPARE(v, Version::GLES300); #endif } void VersionTest::toNumber() { #ifndef MAGNUM_TARGET_GLES - CORRADE_COMPARE(version(Version::GL430), std::make_pair(4, 3)); + constexpr const auto v = version(Version::GL430); + CORRADE_COMPARE(v, std::make_pair(4, 3)); #else - CORRADE_COMPARE(version(Version::GLES300), std::make_pair(3, 0)); + constexpr const auto v = version(Version::GLES300); + CORRADE_COMPARE(v, std::make_pair(3, 0)); #endif } diff --git a/src/Magnum/Version.h b/src/Magnum/Version.h index f7bbf990c..1cb6f62f2 100644 --- a/src/Magnum/Version.h +++ b/src/Magnum/Version.h @@ -100,12 +100,11 @@ enum class Version: Int { }; /** @brief Enum value from major and minor version number */ -inline Version version(Int major, Int minor) { +constexpr Version version(Int major, Int minor) { return Version(major*100 + minor*10); } -/** @brief Major and minor version number from enum value */ -inline std::pair version(Version version) { +constexpr std::pair version(Version version) { return {Int(version)/100, (Int(version)%100)/10}; } From 5ff451791a27efefee7528afef8914b4b7469c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 12 Apr 2016 14:02:17 +0200 Subject: [PATCH 199/258] Make the ES versions first-class on desktop OpenGL. What this changes: * Before, a Version::GLES310 shader was created with `#version 450` directive, which is wrong, because an implementation might support GLES 3.1 but not GL 4.5 so this was not working and also the syntax is a bit different so this wasn't helpful at all. * Similarly, Context::isVersionSupported(Version::GLES310) was checking for support of OpenGL 4.5. Now it just checks for `ARB_ES3_1_compatibility` extension. * Added a small isVersionES() utility that just tells whether given version is ES or not. --- src/Magnum/Context.cpp | 18 +++++++++-- src/Magnum/Context.h | 4 +-- src/Magnum/Shader.cpp | 4 +-- src/Magnum/Test/ContextGLTest.cpp | 16 +++++++++ src/Magnum/Test/VersionTest.cpp | 36 ++++++++++++++++++++- src/Magnum/Version.cpp | 3 +- src/Magnum/Version.h | 54 +++++++++++++++++++++++-------- 7 files changed, 113 insertions(+), 22 deletions(-) diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index 3eca63356..e0973b764 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/Context.cpp @@ -377,13 +377,14 @@ const std::vector& Extension::extensions(Version version) { case Version::GL320: return extensions320; case Version::GL330: return extensions330; case Version::GL400: return extensions400; - /* case Version::GLES200: */ case Version::GL410: return extensions410; case Version::GL420: return extensions420; - /* case Version::GLES300: */ case Version::GL430: return extensions430; case Version::GL440: return extensions440; case Version::GL450: return extensions450; + case Version::GLES200: + case Version::GLES300: + case Version::GLES310: return empty; #else case Version::GLES200: return empty; case Version::GLES300: @@ -748,6 +749,19 @@ std::vector Context::extensionStrings() const { return extensions; } +bool Context::isVersionSupported(Version version) const { + #ifndef MAGNUM_TARGET_GLES + if(version == Version::GLES200) + return isExtensionSupported(); + if(version == Version::GLES300) + return isExtensionSupported(); + if(version == Version::GLES310) + return isExtensionSupported(); + #endif + + return _version >= version; +} + Version Context::supportedVersion(std::initializer_list versions) const { for(auto version: versions) if(isVersionSupported(version)) return version; diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index 99a602282..d9821ff92 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -362,9 +362,7 @@ class MAGNUM_EXPORT Context { * * @see @ref supportedVersion(), @ref MAGNUM_ASSERT_VERSION_SUPPORTED() */ - bool isVersionSupported(Version version) const { - return _version >= version; - } + bool isVersionSupported(Version version) const; /** * @brief Get supported OpenGL version diff --git a/src/Magnum/Shader.cpp b/src/Magnum/Shader.cpp index 694b60e36..eba5bb1ad 100644 --- a/src/Magnum/Shader.cpp +++ b/src/Magnum/Shader.cpp @@ -733,13 +733,13 @@ Shader::Shader(const Version version, const Type type): _type(type), _id(0) { case Version::GL430: _sources.push_back("#version 430\n"); return; case Version::GL440: _sources.push_back("#version 440\n"); return; case Version::GL450: _sources.push_back("#version 450\n"); return; - #else + #endif + /* `#version 100` really is GLSL ES 1.00 and *not* GLSL 1.00. What a mess. */ case Version::GLES200: _sources.push_back("#version 100\n"); return; case Version::GLES300: _sources.push_back("#version 300 es\n"); return; #ifndef MAGNUM_TARGET_WEBGL case Version::GLES310: _sources.push_back("#version 310 es\n"); return; #endif - #endif /* The user is responsible for (not) adding #version directive */ case Version::None: return; diff --git a/src/Magnum/Test/ContextGLTest.cpp b/src/Magnum/Test/ContextGLTest.cpp index cef1210a0..7f0986a0f 100644 --- a/src/Magnum/Test/ContextGLTest.cpp +++ b/src/Magnum/Test/ContextGLTest.cpp @@ -37,6 +37,9 @@ struct ContextGLTest: AbstractOpenGLTester { void constructCopyMove(); void isVersionSupported(); + #ifndef MAGNUM_TARGET_GLES + void isVersionSupportedES(); + #endif void supportedVersion(); void isExtensionSupported(); void isExtensionDisabled(); @@ -46,6 +49,9 @@ ContextGLTest::ContextGLTest() { addTests({&ContextGLTest::constructCopyMove, &ContextGLTest::isVersionSupported, + #ifndef MAGNUM_TARGET_GLES + &ContextGLTest::isVersionSupportedES, + #endif &ContextGLTest::supportedVersion, &ContextGLTest::isExtensionSupported, &ContextGLTest::isExtensionDisabled}); @@ -70,6 +76,16 @@ void ContextGLTest::isVersionSupported() { MAGNUM_ASSERT_VERSION_SUPPORTED(Version(Int(v)-1)); } +#ifndef MAGNUM_TARGET_GLES +void ContextGLTest::isVersionSupportedES() { + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::ARB::ES2_compatibility::string() + std::string(" extension should not be supported, can't test")); + + /* No assertions should be fired */ + CORRADE_VERIFY(Context::current().isVersionSupported(Version::GLES200)); +} +#endif + void ContextGLTest::supportedVersion() { const Version v = Context::current().version(); diff --git a/src/Magnum/Test/VersionTest.cpp b/src/Magnum/Test/VersionTest.cpp index a2121dde9..2fe3e4e82 100644 --- a/src/Magnum/Test/VersionTest.cpp +++ b/src/Magnum/Test/VersionTest.cpp @@ -35,17 +35,32 @@ struct VersionTest: TestSuite::Tester { void fromNumber(); void toNumber(); + #ifndef MAGNUM_TARGET_GLES + void toNumberES(); + #endif + void isES(); void compare(); void debug(); + #ifndef MAGNUM_TARGET_GLES + void debugES(); + #endif }; VersionTest::VersionTest() { addTests({&VersionTest::fromNumber, &VersionTest::toNumber, + #ifndef MAGNUM_TARGET_GLES + &VersionTest::toNumberES, + #endif + &VersionTest::isES, &VersionTest::compare, - &VersionTest::debug}); + &VersionTest::debug, + #ifndef MAGNUM_TARGET_GLES + &VersionTest::debugES + #endif + }); } void VersionTest::fromNumber() { @@ -68,6 +83,16 @@ void VersionTest::toNumber() { #endif } +#ifndef MAGNUM_TARGET_GLES +void VersionTest::toNumberES() { + CORRADE_COMPARE(version(Version::GLES310), std::make_pair(3, 1)); +} +#endif + +void VersionTest::isES() { + CORRADE_VERIFY(isVersionES(Version::GLES200)); +} + void VersionTest::compare() { #ifndef MAGNUM_TARGET_GLES CORRADE_VERIFY(version(1, 1) < Version::GL210); @@ -92,6 +117,15 @@ void VersionTest::debug() { #endif } +#ifndef MAGNUM_TARGET_GLES +void VersionTest::debugES() { + std::ostringstream out; + + Debug{&out} << Version::GLES310; + CORRADE_COMPARE(out.str(), "OpenGL ES 3.1\n"); +} +#endif + }} CORRADE_TEST_MAIN(Magnum::Test::VersionTest) diff --git a/src/Magnum/Version.cpp b/src/Magnum/Version.cpp index be628069d..c0853dff7 100644 --- a/src/Magnum/Version.cpp +++ b/src/Magnum/Version.cpp @@ -46,7 +46,8 @@ Debug& operator<<(Debug& debug, Version value) { _c(GL430, "OpenGL 4.3") _c(GL440, "OpenGL 4.4") _c(GL450, "OpenGL 4.5") - #elif defined(MAGNUM_TARGET_WEBGL) + #endif + #ifdef MAGNUM_TARGET_WEBGL _c(GLES200, "WebGL 1.0") _c(GLES300, "WebGL 2.0") #else diff --git a/src/Magnum/Version.h b/src/Magnum/Version.h index 1cb6f62f2..936210a5c 100644 --- a/src/Magnum/Version.h +++ b/src/Magnum/Version.h @@ -36,6 +36,12 @@ namespace Magnum { +#ifndef MAGNUM_TARGET_GLES +namespace Implementation { + enum: Int { VersionESMask = 0x10000 }; +} +#endif + /** @brief OpenGL version @@ -60,12 +66,13 @@ enum class Version: Int { /** * @brief OpenGL ES 2.0 or WebGL 1.0, GLSL ES 1.00 * - * All the functionality is present in OpenGL 4.2 (extension - * @extension{ARB,ES2_compatibility}), so on desktop OpenGL this is - * equivalent to @ref Version::GL410. + * On desktop OpenGL, all related functionality is present in extension + * @extension{ARB,ES2_compatibility} (OpenGL 4.1), so testing for this + * version using @ref Context::isVersionSupported() is equivalent to + * testing for availability of that extension. */ #ifndef MAGNUM_TARGET_GLES - GLES200 = 410, + GLES200 = Implementation::VersionESMask|200, #else GLES200 = 200, #endif @@ -73,12 +80,13 @@ enum class Version: Int { /** * @brief OpenGL ES 3.0 or WebGL 2.0, GLSL ES 3.00 * - * All the functionality is present in OpenGL 4.3 (extension - * @extension{ARB,ES3_compatibility}), so on desktop OpenGL this is the - * equivalent to @ref Version::GL430. + * On desktop OpenGL, all related functionality is present in extension + * @extension{ARB,ES3_compatibility} (OpenGL 4.3), so testing for this + * version using @ref Context::isVersionSupported() is equivalent to + * testing for availability of that extension. */ #ifndef MAGNUM_TARGET_GLES - GLES300 = 430, + GLES300 = Implementation::VersionESMask|300, #else GLES300 = 300, #endif @@ -87,12 +95,13 @@ enum class Version: Int { /** * @brief OpenGL ES 3.1, GLSL ES 3.10 * - * All the functionality is present in OpenGL 4.5 (extension - * @extension{ARB,ES3_1_compatibility}), so on desktop OpenGL this is the - * equivalent to @ref Version::GL450. + * On desktop OpenGL, all related functionality is present in extension + * @extension{ARB,ES3_1_compatibility} (OpenGL 4.5), so testing for this + * version using @ref Context::isVersionSupported() is equivalent to + * testing for availability of that extension. */ #ifndef MAGNUM_TARGET_GLES - GLES310 = 450 + GLES310 = Implementation::VersionESMask|310, #else GLES310 = 310 #endif @@ -104,8 +113,27 @@ constexpr Version version(Int major, Int minor) { return Version(major*100 + minor*10); } +/** +@brief Major and minor version number from enum value + +@see @ref isVersionES() +*/ constexpr std::pair version(Version version) { - return {Int(version)/100, (Int(version)%100)/10}; + return {(Int(version) & ~Implementation::VersionESMask)/100, + ((Int(version) & ~Implementation::VersionESMask)%100)/10}; +} + +/** +@brief Whether given version is OpenGL ES or WebGL + +Always `true` on @ref MAGNUM_TARGET_GLES "OpenGL ES" and WebGL build. +*/ +constexpr bool isVersionES(Version version) { + #ifndef MAGNUM_TARGET_GLES + return Int(version) & Implementation::VersionESMask; + #else + return true; + #endif } /** @debugoperatorenum{Magnum::Version} */ From a02135b6994079a7a72af0ff532aedc57990b001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 12 Apr 2016 14:12:34 +0200 Subject: [PATCH 200/258] Platform: ability to query raw extension string list in magnum-info. --- src/Magnum/Platform/magnum-info.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index 074f348a8..9b81a22d5 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -141,12 +141,10 @@ class MagnumInfo: public Platform::WindowlessApplication { MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplication(arguments, nullptr) { Utility::Arguments args; - args.addBooleanOption('s', "short") - .setHelp("short", "display just essential info and exit") - .addBooleanOption("all-extensions") - .setHelp("all-extensions", "display extensions also for fully supported versions") - .addBooleanOption("limits") - .setHelp("limits", "display also limits and implementation-defined values") + args.addBooleanOption('s', "short").setHelp("short", "display just essential info and exit") + .addBooleanOption("extension-strings").setHelp("extension-strings", "list all extension strings provided by the driver (implies --short)") + .addBooleanOption("all-extensions").setHelp("all-extensions", "display extensions also for fully supported versions") + .addBooleanOption("limits").setHelp("limits", "display also limits and implementation-defined values") .addSkippedPrefix("magnum", "engine-specific options") .setHelp("Displays information about Magnum engine and OpenGL capabilities."); @@ -273,6 +271,12 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat for(const auto& version: shadingLanguageVersions) Debug() << " " << version; + if(args.isSet("extension-strings")) { + Debug() << "Extension strings:" << Debug::newline + << c.extensionStrings(); + return; + } + if(args.isSet("short")) return; Debug() << ""; From 74e43a4f312d36f54baf92c6e9f3ed023ebfe7be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 12 Apr 2016 14:27:16 +0200 Subject: [PATCH 201/258] DebugTools: fallback to Texture::subImage() on desktop. I still have to fill up the missing parts to make it orthogonal, but NO DAMN TIME. --- src/Magnum/DebugTools/TextureImage.cpp | 16 ++++++++++++++++ src/Magnum/DebugTools/TextureImage.h | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Magnum/DebugTools/TextureImage.cpp b/src/Magnum/DebugTools/TextureImage.cpp index 0f3c8ffb0..516dd69f3 100644 --- a/src/Magnum/DebugTools/TextureImage.cpp +++ b/src/Magnum/DebugTools/TextureImage.cpp @@ -26,6 +26,8 @@ #include "TextureImage.h" #include "Magnum/BufferImage.h" +#include "Magnum/Context.h" +#include "Magnum/Extensions.h" #include "Magnum/Framebuffer.h" #include "Magnum/Image.h" #include "Magnum/Texture.h" @@ -92,6 +94,13 @@ FloatReinterpretShader::FloatReinterpretShader() { #endif void textureSubImage(Texture2D& texture, const Int level, const Range2Di& range, Image2D& image) { + #ifndef MAGNUM_TARGET_GLES + if(Context::current().isExtensionSupported()) { + texture.subImage(level, range, image); + return; + } + #endif + #ifdef MAGNUM_TARGET_GLES if(image.type() == PixelType::Float) { const PixelFormat imageFormat = image.format(); @@ -165,6 +174,13 @@ void textureSubImage(CubeMapTexture& texture, const CubeMapCoordinate coordinate #ifndef MAGNUM_TARGET_GLES2 void textureSubImage(Texture2D& texture, const Int level, const Range2Di& range, BufferImage2D& image, const BufferUsage usage) { + #ifndef MAGNUM_TARGET_GLES + if(Context::current().isExtensionSupported()) { + texture.subImage(level, range, image, usage); + return; + } + #endif + Framebuffer fb{range}; fb.attachTexture(Framebuffer::ColorAttachment{0}, texture, level) .read(range, image, usage); diff --git a/src/Magnum/DebugTools/TextureImage.h b/src/Magnum/DebugTools/TextureImage.h index ad9297746..591c63d79 100644 --- a/src/Magnum/DebugTools/TextureImage.h +++ b/src/Magnum/DebugTools/TextureImage.h @@ -39,7 +39,8 @@ namespace Magnum { namespace DebugTools { Emulates @ref Texture::subImage() "*Texture::subImage()" call on platforms that don't support it (such as OpenGL ES) by creating a framebuffer object and using -@ref Framebuffer::read(). +@ref Framebuffer::read(). On desktop OpenGL, if @extension{ARB,get_texture_sub_image} +is available, it's just an alias to @ref Texture::subImage() "*Texture::subImage()". Note that only @ref Magnum::PixelFormat "PixelFormat" and @ref PixelType values that are marked as framebuffer readable are supported. In addition, on OpenGL From da8bf1a1847c0d4641efeb1aa67109e1daca59c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 12 Apr 2016 14:32:18 +0200 Subject: [PATCH 202/258] DebugTools: reorder and document to make the non-orthogonality obvious. Also apparently ordering of the functions in the *source* file is important for Doxygen and the header order gets ignored completely. What the hell. --- src/Magnum/DebugTools/TextureImage.cpp | 28 ++++++------ src/Magnum/DebugTools/TextureImage.h | 63 ++++++++++++++++++++------ 2 files changed, 63 insertions(+), 28 deletions(-) diff --git a/src/Magnum/DebugTools/TextureImage.cpp b/src/Magnum/DebugTools/TextureImage.cpp index 516dd69f3..b77074867 100644 --- a/src/Magnum/DebugTools/TextureImage.cpp +++ b/src/Magnum/DebugTools/TextureImage.cpp @@ -166,10 +166,9 @@ void textureSubImage(Texture2D& texture, const Int level, const Range2Di& range, .read(range, image); } -void textureSubImage(CubeMapTexture& texture, const CubeMapCoordinate coordinate, const Int level, const Range2Di& range, Image2D& image) { - Framebuffer fb{range}; - fb.attachCubeMapTexture(Framebuffer::ColorAttachment{0}, texture, coordinate, level) - .read(range, image); +Image2D textureSubImage(Texture2D& texture, const Int level, const Range2Di& range, Image2D&& image) { + textureSubImage(texture, level, range, image); + return std::move(image); } #ifndef MAGNUM_TARGET_GLES2 @@ -186,16 +185,16 @@ void textureSubImage(Texture2D& texture, const Int level, const Range2Di& range, .read(range, image, usage); } -void textureSubImage(CubeMapTexture& texture, const CubeMapCoordinate coordinate, const Int level, const Range2Di& range, BufferImage2D& image, const BufferUsage usage) { - Framebuffer fb{range}; - fb.attachCubeMapTexture(Framebuffer::ColorAttachment{0}, texture, coordinate, level) - .read(range, image, usage); +BufferImage2D textureSubImage(Texture2D& texture, const Int level, const Range2Di& range, BufferImage2D&& image, const BufferUsage usage) { + textureSubImage(texture, level, range, image, usage); + return std::move(image); } #endif -Image2D textureSubImage(Texture2D& texture, const Int level, const Range2Di& range, Image2D&& image) { - textureSubImage(texture, level, range, image); - return std::move(image); +void textureSubImage(CubeMapTexture& texture, const CubeMapCoordinate coordinate, const Int level, const Range2Di& range, Image2D& image) { + Framebuffer fb{range}; + fb.attachCubeMapTexture(Framebuffer::ColorAttachment{0}, texture, coordinate, level) + .read(range, image); } Image2D textureSubImage(CubeMapTexture& texture, const CubeMapCoordinate coordinate, const Int level, const Range2Di& range, Image2D&& image) { @@ -204,9 +203,10 @@ Image2D textureSubImage(CubeMapTexture& texture, const CubeMapCoordinate coordin } #ifndef MAGNUM_TARGET_GLES2 -BufferImage2D textureSubImage(Texture2D& texture, const Int level, const Range2Di& range, BufferImage2D&& image, const BufferUsage usage) { - textureSubImage(texture, level, range, image, usage); - return std::move(image); +void textureSubImage(CubeMapTexture& texture, const CubeMapCoordinate coordinate, const Int level, const Range2Di& range, BufferImage2D& image, const BufferUsage usage) { + Framebuffer fb{range}; + fb.attachCubeMapTexture(Framebuffer::ColorAttachment{0}, texture, coordinate, level) + .read(range, image, usage); } BufferImage2D textureSubImage(CubeMapTexture& texture, const CubeMapCoordinate coordinate, const Int level, const Range2Di& range, BufferImage2D&& image, const BufferUsage usage) { diff --git a/src/Magnum/DebugTools/TextureImage.h b/src/Magnum/DebugTools/TextureImage.h index 591c63d79..57c202f91 100644 --- a/src/Magnum/DebugTools/TextureImage.h +++ b/src/Magnum/DebugTools/TextureImage.h @@ -37,10 +37,10 @@ namespace Magnum { namespace DebugTools { /** @brief Read range of given texture mip level to image -Emulates @ref Texture::subImage() "*Texture::subImage()" call on platforms that -don't support it (such as OpenGL ES) by creating a framebuffer object and using +Emulates @ref Texture2D::subImage() call on platforms that don't support it +(such as OpenGL ES) by creating a framebuffer object and using @ref Framebuffer::read(). On desktop OpenGL, if @extension{ARB,get_texture_sub_image} -is available, it's just an alias to @ref Texture::subImage() "*Texture::subImage()". +is available, it's just an alias to @ref Texture2D::subImage(). Note that only @ref Magnum::PixelFormat "PixelFormat" and @ref PixelType values that are marked as framebuffer readable are supported. In addition, on OpenGL @@ -51,9 +51,6 @@ reinterpreted as @ref PixelType::UnsignedInt using additional shader and */ MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(Texture2D& texture, Int level, const Range2Di& range, Image2D& image); -/** @overload */ -MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, Image2D& image); - /** @brief Read range of given texture mip level to image @@ -64,16 +61,36 @@ Image2D image = DebugTools::textureSubImage(texture, 0, rect, {PixelFormat::RGBA */ MAGNUM_DEBUGTOOLS_EXPORT Image2D textureSubImage(Texture2D& texture, Int level, const Range2Di& range, Image2D&& image); -/** @overload */ +/** +@brief Read range of given cube map texture coordinate mip level to image + +Emulates @ref CubeMapTexture::subImage() call on platforms that don't support +it (such as OpenGL ES) by creating a framebuffer object and using +@ref Framebuffer::read(). + +Note that only @ref Magnum::PixelFormat "PixelFormat" and @ref PixelType values +that are marked as framebuffer readable are supported. +*/ +MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, Image2D& image); + +/** +@brief Read range of given cube map texture coordinate mip level to image + +Convenience alternative to the above, example usage: +@code +Image2D image = DebugTools::textureSubImage(texture, CubeMapCoordinate::PositiveX, 0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte}); +@endcode +*/ MAGNUM_DEBUGTOOLS_EXPORT Image2D textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, Image2D&& image); #ifndef MAGNUM_TARGET_GLES2 /** @brief Read range of given texture mip level to buffer image -Emulates @ref Texture::subImage() "*Texture::subImage()" call on platforms that -don't support it (such as OpenGL ES) by creating a framebuffer object and using -@ref Framebuffer::read(). +Emulates @ref Texture2D::subImage() call on platforms that don't support it +(such as OpenGL ES) by creating a framebuffer object and using +@ref Framebuffer::read(). On desktop OpenGL, if @extension{ARB,get_texture_sub_image} +is available, it's just an alias to @ref Texture2D::subImage(). Note that only @ref Magnum::PixelFormat "PixelFormat" and @ref PixelType values that are marked as framebuffer readable are supported. @@ -82,9 +99,6 @@ that are marked as framebuffer readable are supported. */ MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(Texture2D& texture, Int level, const Range2Di& range, BufferImage2D& image, BufferUsage usage); -/** @overload */ -MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, BufferImage2D& image, BufferUsage usage); - /** @brief Read range of given texture mip level to buffer image @@ -95,7 +109,28 @@ BufferImage2D image = DebugTools::textureSubImage(texture, 0, rect, {PixelFormat */ MAGNUM_DEBUGTOOLS_EXPORT BufferImage2D textureSubImage(Texture2D& texture, Int level, const Range2Di& range, BufferImage2D&& image, BufferUsage usage); -/** @overload */ +/** +@brief Read range of given cube map texture coordinate mip level to buffer image + +Emulates @ref CubeMapTexture::subImage() call on platforms that don't support +it (such as OpenGL ES) by creating a framebuffer object and using +@ref Framebuffer::read(). + +Note that only @ref Magnum::PixelFormat "PixelFormat" and @ref PixelType values +that are marked as framebuffer readable are supported. +@requires_gles30 Pixel buffer objects are not available in OpenGL ES 2.0. +@requires_webgl20 Pixel buffer objects are not available in WebGL 1.0. +*/ +MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, BufferImage2D& image, BufferUsage usage); + +/** +@brief Read range of given cube map texture coordinate mip level to buffer image + +Convenience alternative to the above, example usage: +@code +BufferImage2D image = DebugTools::textureSubImage(texture, CubeMapCoordinate::PositiveX, 0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); +@endcode +*/ MAGNUM_DEBUGTOOLS_EXPORT BufferImage2D textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, BufferImage2D&& image, BufferUsage usage); #endif From 7ffe30c676bdce3aaa448ee2a4f978557074ab84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 12 Apr 2016 14:55:50 +0200 Subject: [PATCH 203/258] Oh, std::pair is not constexpr in C++11. That's why. This partially reverts commit 628201946b1cc633226c3623c8bf951baa989326. --- src/Magnum/Test/VersionTest.cpp | 6 ++---- src/Magnum/Version.h | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Magnum/Test/VersionTest.cpp b/src/Magnum/Test/VersionTest.cpp index 2fe3e4e82..d439b7b02 100644 --- a/src/Magnum/Test/VersionTest.cpp +++ b/src/Magnum/Test/VersionTest.cpp @@ -75,11 +75,9 @@ void VersionTest::fromNumber() { void VersionTest::toNumber() { #ifndef MAGNUM_TARGET_GLES - constexpr const auto v = version(Version::GL430); - CORRADE_COMPARE(v, std::make_pair(4, 3)); + CORRADE_COMPARE(version(Version::GL430), std::make_pair(4, 3)); #else - constexpr const auto v = version(Version::GLES300); - CORRADE_COMPARE(v, std::make_pair(3, 0)); + CORRADE_COMPARE(version(Version::GLES300), std::make_pair(3, 0)); #endif } diff --git a/src/Magnum/Version.h b/src/Magnum/Version.h index 936210a5c..3b2271f5f 100644 --- a/src/Magnum/Version.h +++ b/src/Magnum/Version.h @@ -118,9 +118,9 @@ constexpr Version version(Int major, Int minor) { @see @ref isVersionES() */ -constexpr std::pair version(Version version) { - return {(Int(version) & ~Implementation::VersionESMask)/100, - ((Int(version) & ~Implementation::VersionESMask)%100)/10}; +inline std::pair version(Version version) { + const Int v = Int(version) & ~Implementation::VersionESMask; + return {v/100, (v%100)/10}; } /** From 59af7e1920393239a1e506a8e82fdc06bb23408b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 12 Apr 2016 14:58:42 +0200 Subject: [PATCH 204/258] Fix compilation on ES. --- src/Magnum/Version.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Version.h b/src/Magnum/Version.h index 3b2271f5f..40f86ed07 100644 --- a/src/Magnum/Version.h +++ b/src/Magnum/Version.h @@ -119,7 +119,11 @@ constexpr Version version(Int major, Int minor) { @see @ref isVersionES() */ inline std::pair version(Version version) { - const Int v = Int(version) & ~Implementation::VersionESMask; + const Int v = Int(version) + #ifndef MAGNUM_TARGET_GLES + & ~Implementation::VersionESMask + #endif + ; return {v/100, (v%100)/10}; } From 2c223c8dcba319dbaa85b07fab6716f11afec14f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Apr 2016 16:19:06 +0200 Subject: [PATCH 205/258] modules: minor cleanup. --- modules/FindMagnum.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index b87a4e0da..67895a17c 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -530,10 +530,9 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) INTERFACE_INCLUDE_DIRECTORIES ${X11_INCLUDE_DIR}) set_property(TARGET Magnum::${_component} APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${X11_LIBRARIES}) - endif() # EGL context dependencies - if(_component STREQUAL EglContext) + elseif(_component STREQUAL EglContext) find_package(EGL) set_property(TARGET Magnum::${_component} APPEND PROPERTY INTERFACE_LINK_LIBRARIES EGL::EGL) From 6379f8a616742de5517ea53ae9832244a7f4da21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Apr 2016 16:52:29 +0200 Subject: [PATCH 206/258] Platform: added WindowlessIosApplication. --- CMakeLists.txt | 4 + doc/building.dox | 1 + doc/cmake.dox | 1 + modules/FindMagnum.cmake | 12 +- src/Magnum/Platform/CMakeLists.txt | 35 +++ .../Platform/WindowlessIosApplication.h | 230 ++++++++++++++++++ .../Platform/WindowlessIosApplication.mm | 89 +++++++ 7 files changed, 371 insertions(+), 1 deletion(-) create mode 100644 src/Magnum/Platform/WindowlessIosApplication.h create mode 100644 src/Magnum/Platform/WindowlessIosApplication.mm diff --git a/CMakeLists.txt b/CMakeLists.txt index 117d4a8a7..5777e8f3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,6 +100,10 @@ if(CORRADE_TARGET_NACL) elseif(CORRADE_TARGET_ANDROID) option(WITH_ANDROIDAPPLICATION "Build AndroidApplication library" OFF) +# iOS-specific application libraries +elseif(CORRADE_TARGET_IOS) + option(WITH_WINDOWLESSIOSAPPLICATION "Build WindowlessIosApplication library" OFF) + # OS X-specific application libraries elseif(CORRADE_TARGET_APPLE) cmake_dependent_option(WITH_WINDOWLESSCGLAPPLICATION "Build WindowlessCglApplication library" OFF "NOT WITH_MAGNUMINFO;NOT WITH_FONTCONVERTER;NOT WITH_DISTANCEFIELDCONVERTER" ON) diff --git a/doc/building.dox b/doc/building.dox index c454b6e00..3f24cecf9 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -214,6 +214,7 @@ platform best: - `WITH_WINDOWLESSCGLAPPLICATION` - @ref Platform::WindowlessCglApplication "WindowlessCglApplication" - `WITH_WINDOWLESSEGLAPPLICATION` - @ref Platform::WindowlessEglApplication "WindowlessEglApplication" - `WITH_WINDOWLESSGLXAPPLICATION` - @ref Platform::WindowlessGlxApplication "WindowlessGlxApplication" +- `WITH_WINDOWLESSIOSAPPLICATION` - @ref Platform::WindowlessIosApplication "WindowlessIosApplication" - `WITH_WINDOWLESSNACLAPPLICATION` - @ref Platform::WindowlessNaClApplication "WindowlessNaClApplication" - `WITH_WINDOWLESSWGLAPPLICATION` - @ref Platform::WindowlessWglApplication "WindowlessWglApplication" - `WITH_WINDOWLESSWINDOWSEGLAPPLICATION` - @ref Platform::WindowlessWindowsEglApplication "WindowlessWindowsEglApplication" diff --git a/doc/cmake.dox b/doc/cmake.dox index dd4d9fe62..daede57fc 100644 --- a/doc/cmake.dox +++ b/doc/cmake.dox @@ -102,6 +102,7 @@ Platform namespace is split into more components: - `WindowlessCglApplication` -- @ref Platform::WindowlessCglApplication "WindowlessCglApplication" - `WindowlessEglApplication` -- @ref Platform::WindowlessEglApplication "WindowlessEglApplication" - `WindowlessGlxApplication` -- @ref Platform::WindowlessGlxApplication "WindowlessGlxApplication" +- `WindowlessIosApplication` -- @ref Platform::WindowlessIosApplication "WindowlessIosApplication" - `WindowlessNaClApplication` -- @ref Platform::WindowlessNaClApplication "WindowlessNaClApplication" - `WindowlessWglApplication` -- @ref Platform::WindowlessWglApplication "WindowlessWglApplication" - `WindowlessWindowsEglApplication` -- @ref Platform::WindowlessWindowsEglApplication "WindowlessWindowsEglApplication" diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 67895a17c..e360fce05 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -55,6 +55,7 @@ # WindowlessCglApplication - Windowless CGL application # WindowlessEglApplication - Windowless EGL application # WindowlessGlxApplication - Windowless GLX application +# WindowlessIosApplication - Windowless iOS application # WindowlessNaClApplication - Windowless NaCl application # WindowlessWglApplication - Windowless WGL application # WindowlessWindowsEglApplication - Windowless Windows/EGL application @@ -337,7 +338,7 @@ endif() # Component distinction (listing them explicitly to avoid mistakes with finding # components from other repositories) -set(_MAGNUM_LIBRARY_COMPONENTS "^(Audio|DebugTools|MeshTools|Primitives|SceneGraph|Shaders|Shapes|Text|TextureTools|AndroidApplication|GlutApplication|GlxApplication|NaClApplication|Sdl2Application|XEglApplication|WindowlessCglApplication|WindowlessEglApplication|WindowlessGlxApplication|WindowlessNaClApplication|WindowlessWglApplication|WindowlessWindowsEglApplication|CglContext|EglContext|GlxContext|WglContext)$") +set(_MAGNUM_LIBRARY_COMPONENTS "^(Audio|DebugTools|MeshTools|Primitives|SceneGraph|Shaders|Shapes|Text|TextureTools|AndroidApplication|GlutApplication|GlxApplication|NaClApplication|Sdl2Application|XEglApplication|WindowlessCglApplication|WindowlessEglApplication|WindowlessGlxApplication|WindowlessIosApplication|WindowlessNaClApplication|WindowlessWglApplication|WindowlessWindowsEglApplication|CglContext|EglContext|GlxContext|WglContext)$") set(_MAGNUM_PLUGIN_COMPONENTS "^(MagnumFont|MagnumFontConverter|ObjImporter|TgaImageConverter|TgaImporter|WavAudioImporter)$") set(_MAGNUM_EXECUTABLE_COMPONENTS "^(distancefieldconverter|fontconverter|info)$") @@ -500,6 +501,15 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) set_property(TARGET Magnum::${_component} APPEND PROPERTY INTERFACE_LINK_LIBRARIES EGL::EGL) + # Windowless iOS application dependencies + elseif(_component STREQUAL WindowlessIosApplication) + # We need to link to Foundation framework to use ObjC + find_library(_MAGNUM_IOS_FOUNDATION_FRAMEWORK_LIBRARY Foundation) + mark_as_advanced(_MAGNUM_IOS_FOUNDATION_FRAMEWORK_LIBRARY) + find_package(EGL) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES EGL::EGL ${_MAGNUM_IOS_FOUNDATION_FRAMEWORK_LIBRARY}) + # Windowless WGL application has no additional dependencies # Windowless Windows/EGL application dependencies diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index 89f348dfc..43fc624b0 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -357,6 +357,41 @@ if(WITH_WINDOWLESSGLXAPPLICATION) add_library(Magnum::WindowlessGlxApplication ALIAS MagnumWindowlessGlxApplication) endif() +# Windowless iOS application +if(WITH_WINDOWLESSIOSAPPLICATION) + set(NEED_EGLCONTEXT 1) + + # We need to link to Foundation framework to use ObjC + find_library(_MAGNUM_IOS_FOUNDATION_FRAMEWORK_LIBRARY Foundation) + mark_as_advanced(_MAGNUM_IOS_FOUNDATION_FRAMEWORK_LIBRARY) + + set(MagnumWindowlessIosApplication_SRCS + WindowlessIosApplication.mm + $) + set(MagnumWindowlessIosApplication_HEADERS + WindowlessIosApplication.h) + + add_library(MagnumWindowlessIosApplication STATIC + ${MagnumWindowlessIosApplication_SRCS} + ${MagnumWindowlessIosApplication_HEADERS}) + set_target_properties(MagnumWindowlessIosApplication PROPERTIES DEBUG_POSTFIX "-d") + target_link_libraries(MagnumWindowlessIosApplication + Magnum + EGL::EGL + ${_MAGNUM_IOS_FOUNDATION_FRAMEWORK_LIBRARY}) + # Assuming that PIC is not needed because the Application lib is always + # linked to the executable and not to any intermediate shared lib + + install(FILES ${MagnumWindowlessIosApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) + install(TARGETS MagnumWindowlessIosApplication + RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} + LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} + ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) + + # Magnum WindowlessIosApplication target alias for superprojects + add_library(Magnum::WindowlessIosApplication ALIAS MagnumWindowlessIosApplication) +endif() + # Windowless WGL application if(WITH_WINDOWLESSWGLAPPLICATION) set(NEED_WGLCONTEXT 1) diff --git a/src/Magnum/Platform/WindowlessIosApplication.h b/src/Magnum/Platform/WindowlessIosApplication.h new file mode 100644 index 000000000..aa08accdb --- /dev/null +++ b/src/Magnum/Platform/WindowlessIosApplication.h @@ -0,0 +1,230 @@ +#ifndef Magnum_Platform_WindowlessIosApplication_h +#define Magnum_Platform_WindowlessIosApplication_h +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + 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 + * @brief Class @ref Magnum::Platform::WindowlessIosApplication, macro @ref MAGNUM_WINDOWLESSIOSAPPLICATION_MAIN() + */ + +#include +#include + +#include "Magnum/Magnum.h" +#include "Magnum/OpenGL.h" +#include "Magnum/Platform/Platform.h" + +#ifdef __OBJC__ +@class EAGLContext; +#else +struct EAGLContext; +#endif + +namespace Magnum { namespace Platform { + +/** +@brief Windowless iOS application + +Application for offscreen rendering using EAGL on iOS. Does not have any +default framebuffer. It is built if `WITH_WINDOWLESSIOSAPPLICATION` is enabled +in CMake. + +## Bootstrap application + +Fully contained windowless application using @ref WindowlessIosApplication +along with CMake setup is available in `windowless` branch of +[Magnum Bootstrap](https://github.com/mosra/magnum-bootstrap) repository, +download it as [tar.gz](https://github.com/mosra/magnum-bootstrap/archive/windowless.tar.gz) +or [zip](https://github.com/mosra/magnum-bootstrap/archive/windowless.zip) +file. After extracting the downloaded archive you can build and run the +application with these four commands: + + mkdir build && cd build + cmake .. + cmake --build . + ./src/MyApplication # or ./src/Debug/MyApplication + +See @ref cmake for more information. + +## General usage + +In CMake you need to request `WindowlessIosApplication` component and link to +`Magnum::WindowlessIosApplication` target. If no other windowless application +is requested, you can also use generic `Magnum::WindowlessApplication` alias to +simplify porting. Again, see @ref building and @ref cmake for more information. + +Place your code into @ref exec(). The subclass can be then used in main +function using @ref MAGNUM_WINDOWLESSIOSAPPLICATION_MAIN() macro. See +@ref platform for more information. +@code +class MyApplication: public Platform::WindowlessIosApplication { + // implement required methods... +}; +MAGNUM_WINDOWLESSIOSAPPLICATION_MAIN(MyApplication) +@endcode + +If no other application header is included, this class is also aliased to +`Platform::WindowlessApplication` and the macro is aliased to +`MAGNUM_WINDOWLESSAPPLICATION_MAIN()` to simplify porting. +*/ +class WindowlessIosApplication { + 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; + + /** @copydoc Sdl2Application::Sdl2Application(const Arguments&, const Configuration&) */ + #ifdef DOXYGEN_GENERATING_OUTPUT + explicit WindowlessIosApplication(const Arguments& arguments, const Configuration& configuration = Configuration()); + #else + /* To avoid "invalid use of incomplete type" */ + explicit WindowlessIosApplication(const Arguments& arguments, const Configuration& configuration); + explicit WindowlessIosApplication(const Arguments& arguments); + #endif + + /** @copydoc Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) */ + explicit WindowlessIosApplication(const Arguments& arguments, std::nullptr_t); + + /** @brief Copying is not allowed */ + WindowlessIosApplication(const WindowlessIosApplication&) = delete; + + /** @brief Moving is not allowed */ + WindowlessIosApplication(WindowlessIosApplication&&) = delete; + + /** @brief Copying is not allowed */ + WindowlessIosApplication& operator=(const WindowlessIosApplication&) = delete; + + /** @brief Moving is not allowed */ + WindowlessIosApplication& operator=(WindowlessIosApplication&&) = delete; + + /** + * @brief Execute application + * @return Value for returning from `main()` + * + * See @ref MAGNUM_WINDOWLESSIOSAPPLICATION_MAIN() for usage + * information. + */ + virtual int exec() = 0; + + protected: + /* Nobody will need to have (and delete) WindowlessIosApplication*, + thus this is faster than public pure virtual destructor */ + ~WindowlessIosApplication(); + + /** @copydoc Sdl2Application::createContext() */ + #ifdef DOXYGEN_GENERATING_OUTPUT + void createContext(const Configuration& configuration = Configuration()); + #else + /* To avoid "invalid use of incomplete type" */ + void createContext(const Configuration& configuration); + void createContext(); + #endif + + /** @copydoc Sdl2Application::tryCreateContext() */ + bool tryCreateContext(const Configuration& configuration); + + private: + EAGLContext* _glContext; + + std::unique_ptr _context; +}; + +/** +@brief Configuration + +@see @ref WindowlessIosApplication(), @ref createContext(), + @ref tryCreateContext() +*/ +class WindowlessIosApplication::Configuration { + public: + /** + * @brief Context flag + * + * @see @ref Flags, @ref setFlags(), @ref Context::Flag + */ + enum class Flag: int {}; + + /** + * @brief Context flags + * + * @see @ref setFlags(), @ref Context::Flags + */ + typedef Containers::EnumSet Flags; + + constexpr /*implicit*/ Configuration() {} + + /** @brief Context flags */ + Flags flags() const { return _flags; } + + /** + * @brief Set context flags + * @return Reference to self (for method chaining) + * + * Default is no flag. See also @ref Context::flags(). + */ + Configuration& setFlags(Flags flags) { + _flags = flags; + return *this; + } + + private: + Flags _flags; +}; + +/** @hideinitializer +@brief Entry point for windowless EGL application +@param className Class name + +See @ref Magnum::Platform::WindowlessIosApplication "Platform::WindowlessIosApplication" +for usage information. This macro abstracts out platform-specific entry point +code, see @ref portability-applications for more information. When no other +windowless application header is included this macro is also aliased to +`MAGNUM_WINDOWLESSAPPLICATION_MAIN()`. +*/ +#define MAGNUM_WINDOWLESSIOSAPPLICATION_MAIN(className) \ + int main(int argc, char** argv) { \ + className app({argc, argv}); \ + return app.exec(); \ + } + +#ifndef DOXYGEN_GENERATING_OUTPUT +#ifndef MAGNUM_WINDOWLESSAPPLICATION_MAIN +typedef WindowlessIosApplication WindowlessApplication; +#define MAGNUM_WINDOWLESSAPPLICATION_MAIN(className) MAGNUM_WINDOWLESSIOSAPPLICATION_MAIN(className) +#else +#undef MAGNUM_WINDOWLESSAPPLICATION_MAIN +#endif +#endif + +}} + +#endif diff --git a/src/Magnum/Platform/WindowlessIosApplication.mm b/src/Magnum/Platform/WindowlessIosApplication.mm new file mode 100644 index 000000000..921f5d261 --- /dev/null +++ b/src/Magnum/Platform/WindowlessIosApplication.mm @@ -0,0 +1,89 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + 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. +*/ + +#include "WindowlessIosApplication.h" + +#include +#include + +#include "Magnum/Version.h" +#include "Magnum/Platform/Context.h" + +#import "EAGL.h" + +#if __has_feature(objc_arc) +#error no, we want to use manual memory management +#endif + +namespace Magnum { namespace Platform { + +#ifndef DOXYGEN_GENERATING_OUTPUT +WindowlessIosApplication::WindowlessIosApplication(const Arguments& arguments): WindowlessIosApplication{arguments, Configuration{}} {} +#endif + +WindowlessIosApplication::WindowlessIosApplication(const Arguments& arguments, const Configuration& configuration): WindowlessIosApplication{arguments, nullptr} { + createContext(configuration); +} + +WindowlessIosApplication::WindowlessIosApplication(const Arguments& arguments, std::nullptr_t): _context{new Context{NoCreate, arguments.argc, arguments.argv}} {} + +void WindowlessIosApplication::createContext() { createContext({}); } + +void WindowlessIosApplication::createContext(const Configuration& configuration) { + if(!tryCreateContext(configuration)) std::exit(1); +} + +bool WindowlessIosApplication::tryCreateContext(const Configuration&) { + CORRADE_ASSERT(_context->version() == Version::None, "Platform::WindowlessIosApplication::tryCreateContext(): context already created", false); + + /* Initialize */ + if(!(_glContext = [[EAGLContext alloc] + #ifdef MAGNUM_TARGET_GLES2 + initWithAPI:kEAGLRenderingAPIOpenGLES2 + #else + initWithAPI:kEAGLRenderingAPIOpenGLES3 + #endif + ])) + { + Error() << "Platform::WindowlessIosApplication::tryCreateContext(): cannot create EAGL context"; + return false; + } + + if(![EAGLContext setCurrentContext:_glContext]) { + Error() << "Platform::WindowlessIosApplication::tryCreateContext(): cannot make context current"; + return false; + } + + /* Return true if the initialization succeeds */ + return _context->tryCreate(); +} + +WindowlessIosApplication::~WindowlessIosApplication() { + _context.reset(); + + [_glContext dealloc]; +} + +}} From 16943e644f3d9e9111a70a714d82e6f19eb95c59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Apr 2016 17:44:58 +0200 Subject: [PATCH 207/258] Test: reorder preprocessor branches. --- src/Magnum/Test/AbstractOpenGLTester.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Magnum/Test/AbstractOpenGLTester.h b/src/Magnum/Test/AbstractOpenGLTester.h index b8778334d..ab212290b 100644 --- a/src/Magnum/Test/AbstractOpenGLTester.h +++ b/src/Magnum/Test/AbstractOpenGLTester.h @@ -92,15 +92,7 @@ std::optional AbstractOpenGLTester:: #define MAGNUM_VERIFY_NO_ERROR() CORRADE_COMPARE(Magnum::Renderer::error(), Magnum::Renderer::Error::NoError) -#ifndef CORRADE_TARGET_WINDOWS -#define MAGNUM_GL_TEST_MAIN(Class) \ - int main(int argc, char** argv) { \ - Magnum::Test::AbstractOpenGLTester::_windowlessApplicationArguments.emplace(argc, argv); \ - Class t; \ - t.registerTest(__FILE__, #Class); \ - return t.exec(argc, argv); \ - } -#else +#ifdef CORRADE_TARGET_WINDOWS #define MAGNUM_GL_TEST_MAIN(Class) \ LRESULT CALLBACK windowProcedure(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); \ LRESULT CALLBACK windowProcedure(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { \ @@ -124,6 +116,14 @@ std::optional AbstractOpenGLTester:: Magnum::Test::AbstractOpenGLTester::_windowlessApplicationArguments.emplace(argc, argv, nullptr); \ return Magnum::Platform::WindowlessApplication::create(windowProcedure); \ } +#else +#define MAGNUM_GL_TEST_MAIN(Class) \ + int main(int argc, char** argv) { \ + Magnum::Test::AbstractOpenGLTester::_windowlessApplicationArguments.emplace(argc, argv); \ + Class t; \ + t.registerTest(__FILE__, #Class); \ + return t.exec(argc, argv); \ + } #endif }} From 35da9ebfa01275c6eb3fbaca8628efe52e0728f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Apr 2016 17:48:56 +0200 Subject: [PATCH 208/258] Support iOS in GL tests. --- CMakeLists.txt | 3 +++ src/Magnum/Test/AbstractOpenGLTester.h | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5777e8f3c..58abee0bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -207,6 +207,9 @@ if(BUILD_GL_TESTS) if(MAGNUM_TARGET_HEADLESS) set(WITH_WINDOWLESSEGLAPPLICATION ON) set(GL_TEST_LIBRARIES Magnum MagnumWindowlessEglApplication) + elseif(CORRADE_TARGET_IOS) + set(WITH_WINDOWLESSIOSAPPLICATION ON) + set(GL_TEST_LIBRARIES Magnum MagnumWindowlessIosApplication) elseif(CORRADE_TARGET_APPLE) set(WITH_WINDOWLESSCGLAPPLICATION ON) set(GL_TEST_LIBRARIES Magnum MagnumWindowlessCglApplication) diff --git a/src/Magnum/Test/AbstractOpenGLTester.h b/src/Magnum/Test/AbstractOpenGLTester.h index ab212290b..9e2450d57 100644 --- a/src/Magnum/Test/AbstractOpenGLTester.h +++ b/src/Magnum/Test/AbstractOpenGLTester.h @@ -34,6 +34,8 @@ #ifdef MAGNUM_TARGET_HEADLESS #include "Magnum/Platform/WindowlessEglApplication.h" +#elif defined(CORRADE_TARGET_IOS) +#include "Magnum/Platform/WindowlessIosApplication.h" #elif defined(CORRADE_TARGET_APPLE) #include "Magnum/Platform/WindowlessCglApplication.h" #elif defined(CORRADE_TARGET_UNIX) && (!defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_DESKTOP_GLES)) @@ -70,7 +72,7 @@ class AbstractOpenGLTester: public TestSuite::Tester { AbstractOpenGLTester::AbstractOpenGLTester(): TestSuite::Tester{TestSuite::Tester::TesterConfiguration{}.setSkippedArgumentPrefixes({"magnum"})}, _windowlessApplication{*_windowlessApplicationArguments} { /* Try to create debug context, fallback to normal one if not possible. No - such thing on OSX. */ + such thing on OSX or iOS. */ #ifndef CORRADE_TARGET_APPLE if(!_windowlessApplication.tryCreateContext(Platform::WindowlessApplication::Configuration{}.setFlags(Platform::WindowlessApplication::Configuration::Flag::Debug))) _windowlessApplication.createContext(); @@ -116,6 +118,14 @@ std::optional AbstractOpenGLTester:: Magnum::Test::AbstractOpenGLTester::_windowlessApplicationArguments.emplace(argc, argv, nullptr); \ return Magnum::Platform::WindowlessApplication::create(windowProcedure); \ } +#elif defined(CORRADE_TESTSUITE_TARGET_XCTEST) +#define MAGNUM_GL_TEST_MAIN(Class) \ + int CORRADE_VISIBILITY_EXPORT corradeTestMain(int argc, char** argv) { \ + Magnum::Test::AbstractOpenGLTester::_windowlessApplicationArguments.emplace(argc, argv); \ + Class t; \ + t.registerTest(__FILE__, #Class); \ + return t.exec(argc, argv); \ + } #else #define MAGNUM_GL_TEST_MAIN(Class) \ int main(int argc, char** argv) { \ From 7878d039ec682a5feea572a8919b50c29df56bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Apr 2016 17:49:22 +0200 Subject: [PATCH 209/258] Platform: support iOS in magnum-info. --- src/Magnum/Platform/CMakeLists.txt | 2 ++ src/Magnum/Platform/magnum-info.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index 43fc624b0..d87ceafff 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -696,6 +696,8 @@ if(WITH_MAGNUMINFO) target_link_libraries(magnum-info Magnum) if(MAGNUM_TARGET_HEADLESS) target_link_libraries(magnum-info MagnumWindowlessEglApplication) + elseif(CORRADE_TARGET_IOS) + target_link_libraries(magnum-info MagnumWindowlessIosApplication) elseif(CORRADE_TARGET_APPLE) target_link_libraries(magnum-info MagnumWindowlessCglApplication) elseif(CORRADE_TARGET_NACL) diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index 9b81a22d5..067de69c1 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -61,6 +61,8 @@ #include "Magnum/Platform/WindowlessEglApplication.h" #elif defined(CORRADE_TARGET_NACL) #include "Magnum/Platform/WindowlessNaClApplication.h" +#elif defined(CORRADE_TARGET_IOS) +#include "Magnum/Platform/WindowlessIosApplication.h" #elif defined(CORRADE_TARGET_APPLE) #include "Magnum/Platform/WindowlessCglApplication.h" #elif defined(CORRADE_TARGET_UNIX) From f89b92dcec7df0d4b4f7463a60605f7c6484ae9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 14 Apr 2016 09:56:10 +0200 Subject: [PATCH 210/258] doc: mention the tap in Homebrew installation instructions. --- doc/building.dox | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/building.dox b/doc/building.dox index 3f24cecf9..6948575d5 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -339,11 +339,10 @@ features, for example), modify the last entry in `debian/rules`. @subsection building-packages-brew Homebrew formulas -OS X Homebrew formulas are in `package/homebrew` directory. Download the `*.rb` -file, put it into your Formulas directory and install it using the following -command: +OS X Homebrew formulas are in `package/homebrew` directory. Either use the +`*.rb` files directly or use the tap at https://github.com/mosra/homebrew-magnum: - brew install --HEAD magnum + brew install --HEAD mosra/magnum/magnum @section building-windows-angle Building for ANGLE on Windows From 9500040f8e3fb4724889e6fc338cddc7530d2cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 14 Apr 2016 10:53:59 +0200 Subject: [PATCH 211/258] Added KHR_no_error desktop and ES extension. --- doc/opengl-support.dox | 2 ++ src/Magnum/Context.cpp | 4 +++- src/Magnum/Extensions.h | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index 364420ba3..51882e1e0 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -248,6 +248,7 @@ Extension | Status @extension{ARB,transform_feedback_overflow_query} | | @extension{KHR,blend_equation_advanced} | done @extension3{KHR,blend_equation_advanced_coherent,blend_equation_advanced} | done +@extension{KHR,no_error} | | @subsection opengl-support-extensions-vendor Vendor OpenGL extensions @@ -380,6 +381,7 @@ Extension | Status @es_extension{KHR,robustness} | | @es_extension{KHR,robust_buffer_access_behavior} | done (nothing to do) @es_extension{KHR,context_flush_control} | | +@es_extension2{KHR,no_error,no_error} | | @es_extension2{NV,read_buffer_front,NV_read_buffer} | done @es_extension2{NV,read_depth,NV_read_depth_stencil} | done @es_extension2{NV,read_stencil,NV_read_depth_stencil} | done diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index e0973b764..d1ccf9235 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/Context.cpp @@ -93,7 +93,8 @@ const std::vector& Extension::extensions(Version version) { _extension(GL,KHR,texture_compression_astc_ldr), _extension(GL,KHR,texture_compression_astc_hdr), _extension(GL,KHR,blend_equation_advanced), - _extension(GL,KHR,blend_equation_advanced_coherent)}; + _extension(GL,KHR,blend_equation_advanced_coherent), + _extension(GL,KHR,no_error)}; static const std::vector extensions300{ _extension(GL,ARB,map_buffer_range), _extension(GL,ARB,color_buffer_float), @@ -291,6 +292,7 @@ const std::vector& Extension::extensions(Version version) { _extension(GL,KHR,robustness), _extension(GL,KHR,robust_buffer_access_behavior), _extension(GL,KHR,context_flush_control), + _extension(GL,KHR,no_error), _extension(GL,NV,read_buffer_front), _extension(GL,NV,read_depth), _extension(GL,NV,read_stencil), diff --git a/src/Magnum/Extensions.h b/src/Magnum/Extensions.h index 478bff6e9..a36c4f5d4 100644 --- a/src/Magnum/Extensions.h +++ b/src/Magnum/Extensions.h @@ -232,6 +232,7 @@ namespace GL { _extension(GL,KHR,robustness, GL320, GL450) // #170 _extension(GL,KHR,blend_equation_advanced, GL210, None) // #174 _extension(GL,KHR,blend_equation_advanced_coherent, GL210, None) // #174 + _extension(GL,KHR,no_error, GL210, None) // #175 } namespace NV { _extension(GL,NV,primitive_restart, GL210, GL310) // #285 _extension(GL,NV,depth_buffer_float, GL210, GL300) // #334 @@ -371,6 +372,7 @@ namespace GL { _extension(GL,KHR,robustness, GLES200, None) // #170 _extension(GL,KHR,robust_buffer_access_behavior, GLES200, None) // #189 _extension(GL,KHR,context_flush_control, GLES200, None) // #191 + _extension(GL,KHR,no_error, GLES200, None) // #243 } namespace NV { #ifdef MAGNUM_TARGET_GLES2 _extension(GL,NV,draw_buffers, GLES200, GLES300) // #91 From 58c98cae3e7772ec9bdb6fa8a964d2fb00a044aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 14 Apr 2016 11:18:18 +0200 Subject: [PATCH 212/258] Added EXT_shader_framebuffer_fetch ES extension to the list. And also ARM_shader_framebuffer_fetch and ARM_shader_framebuffer_fetch_depth_stencil. --- doc/opengl-support.dox | 5 ++++- src/Magnum/Context.cpp | 3 +++ src/Magnum/Extensions.h | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index 51882e1e0..f643712ff 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -338,7 +338,7 @@ Extension | Status @es_extension{OES,required_internalformat} | done (desktop-compatible subset) @es_extension{OES,surfaceless_context} | done -@subsection opengl-support-es-extensions OpenGL ES extensions to match desktop functionality +@subsection opengl-support-es-extensions OpenGL ES extensions @todo @es_extension{NV,non_square_matrices} @todo Support also IMG_multisampled_render_to_texture? It has different enum @@ -348,6 +348,8 @@ Extension | Status ------------------------------------------- | ------ @es_extension{ANDROID,extension_pack_es31a} | done (nothing to do) @es_extension{APPLE,texture_format_BGRA8888} | done +@es_extension{ARM,shader_framebuffer_fetch} | | +@es_extension{ARM,shader_framebuffer_fetch_depth_stencil} | | @es_extension{CHROMIUM,map_sub} (NaCl only) | only buffer mapping @es_extension{EXT,texture_filter_anisotropic} | done @es_extension{EXT,texture_format_BGRA8888} | done @@ -358,6 +360,7 @@ Extension | Status @es_extension{EXT,separate_shader_objects} | only direct uniform binding @es_extension{EXT,multisampled_render_to_texture} | only renderbuffer storage @es_extension{EXT,robustness} | done +@es_extension{EXT,shader_framebuffer_fetch} | | @es_extension{EXT,disjoint_timer_query} | only time elapsed query @es_extension{EXT,texture_sRGB_decode} | done @es_extension{EXT,sRGB_write_control} | done diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index d1ccf9235..aa5cdd51c 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/Context.cpp @@ -251,6 +251,8 @@ const std::vector& Extension::extensions(Version version) { _extension(GL,ANDROID,extension_pack_es31a), #endif _extension(GL,APPLE,texture_format_BGRA8888), + _extension(GL,ARM,shader_framebuffer_fetch), + _extension(GL,ARM,shader_framebuffer_fetch_depth_stencil), #ifdef CORRADE_TARGET_NACL _extension(GL,CHROMIUM,map_sub), #endif @@ -260,6 +262,7 @@ const std::vector& Extension::extensions(Version version) { _extension(GL,EXT,multi_draw_arrays), _extension(GL,EXT,debug_label), _extension(GL,EXT,debug_marker), + _extension(GL,EXT,shader_framebuffer_fetch), _extension(GL,EXT,disjoint_timer_query), _extension(GL,EXT,texture_sRGB_decode), _extension(GL,EXT,sRGB_write_control), diff --git a/src/Magnum/Extensions.h b/src/Magnum/Extensions.h index a36c4f5d4..a9ef8042f 100644 --- a/src/Magnum/Extensions.h +++ b/src/Magnum/Extensions.h @@ -298,6 +298,8 @@ namespace GL { #ifdef MAGNUM_TARGET_GLES2 _extension(GL,ARM,rgba8, GLES200, GLES300) // #82 #endif + _extension(GL,ARM,shader_framebuffer_fetch, GLES200, None) // #165 + _extension(GL,ARM,shader_framebuffer_fetch_depth_stencil, GLES200, None) // #166 } namespace CHROMIUM { #ifdef CORRADE_TARGET_NACL _extension(GL,CHROMIUM,map_sub, GLES200, None) @@ -335,6 +337,7 @@ namespace GL { _extension(GL,EXT,texture_storage, GLES200, GLES300) // #108 _extension(GL,EXT,map_buffer_range, GLES200, GLES300) // #121 #endif + _extension(GL,EXT,shader_framebuffer_fetch, GLES200, None) // #122 _extension(GL,EXT,disjoint_timer_query, GLES200, None) // #150 #ifdef MAGNUM_TARGET_GLES2 _extension(GL,EXT,draw_buffers, GLES200, GLES300) // #151 From 23074760f35a5772a98ce933853d92b4d7476ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 14 Apr 2016 11:42:53 +0200 Subject: [PATCH 213/258] Platform: make magnum-info actually useful on iOS. --- src/Magnum/Platform/CMakeLists.txt | 5 ++++ src/Magnum/Platform/MacOSXBundleInfo.plist.in | 25 +++++++++++++++++++ src/Magnum/Platform/magnum-info.cpp | 10 +++++++- 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/Magnum/Platform/MacOSXBundleInfo.plist.in diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index d87ceafff..e1abc2ecc 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -719,6 +719,11 @@ if(WITH_MAGNUMINFO) install(FILES magnum-info-nacl.html DESTINATION ${MAGNUM_DATA_INSTALL_DIR} RENAME magnum-info.html) install(FILES magnum-info-nacl.nmf DESTINATION ${MAGNUM_DATA_INSTALL_DIR} RENAME magnum-info.nmf) list(APPEND MagnumPlatform_FILES magnum-info-nacl.html magnum-info-nacl.nmf) + elseif(CORRADE_TARGET_IOS) + set_target_properties(magnum-info PROPERTIES + MACOSX_BUNDLE ON + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/MacOSXBundleInfo.plist.in + XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES") endif() # Magnum info target alias for superprojects diff --git a/src/Magnum/Platform/MacOSXBundleInfo.plist.in b/src/Magnum/Platform/MacOSXBundleInfo.plist.in new file mode 100644 index 000000000..eaac87c6a --- /dev/null +++ b/src/Magnum/Platform/MacOSXBundleInfo.plist.in @@ -0,0 +1,25 @@ + + + + + CFBundleDevelopmentRegion + en-US + CFBundleExecutable + ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleIdentifier + cz.mosra.magnum.magnum-info + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + magnum-info + CFBundlePackageType + APPL + + UIRequiredDeviceCapabilities + + opengles-2 + + NSHighResolutionCapable + + + diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index 067de69c1..47c1f5d7b 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -154,7 +154,13 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat * @todo Make this work in NaCl, somehow the arguments aren't passed to * constructor but to Init() or whatnot */ - #ifndef CORRADE_TARGET_NACL + #ifdef CORRADE_TARGET_IOS + { + static_cast(arguments); + const char* iosArguments[] = { "", "--limits" }; + args.parse(2, iosArguments); + } + #elif !defined(CORRADE_TARGET_NACL) args.parse(arguments.argc, arguments.argv); #endif @@ -175,6 +181,8 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat Debug() << "Used application: Platform::WindowlessEglApplication"; #elif defined(MAGNUM_WINDOWLESSNACLAPPLICATION_MAIN) Debug() << "Used application: Platform::WindowlessNaClApplication"; + #elif defined(MAGNUM_WINDOWLESSIOSAPPLICATION_MAIN) + Debug() << "Used application: Platform::WindowlessIosApplication"; #elif defined(MAGNUM_WINDOWLESSCGLAPPLICATION_MAIN) Debug() << "Used application: Platform::WindowlessCglApplication"; #elif defined(MAGNUM_WINDOWLESSGLXAPPLICATION_MAIN) From f5483fb4a8e3f3196d3f8baff89d33e1b333bcb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Apr 2016 23:04:36 +0200 Subject: [PATCH 214/258] modules: updated FindCorrade.cmake. --- modules/FindCorrade.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/FindCorrade.cmake b/modules/FindCorrade.cmake index eba78cfc5..c4af7f726 100644 --- a/modules/FindCorrade.cmake +++ b/modules/FindCorrade.cmake @@ -124,9 +124,14 @@ # # Test name is also executable name. You can also specify libraries to link # with instead of using :command:`target_link_libraries()`. -# ``Corrade::TestSuite`` library is linked automatically to each test. Note +# ``Corrade::TestSuite`` target is linked automatically to each test. Note # that the :command:`enable_testing()` function must be called explicitly. # +# Unless :variable:`CORRADE_TESTSUITE_TARGET_XCTEST` is set, test cases on iOS +# targets are created as bundles with bundle identifier set to CMake project +# name by default. Use the cache variable :variable:`CORRADE_TESTSUITE_BUNDLE_IDENTIFIER_PREFIX` +# to change it to something else. +# # .. command:: corrade_add_resource # # Compile data resources into application binary:: From 144939e5c26c6b8221b5a2b2eca37a2fcdf8870f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Apr 2016 23:04:52 +0200 Subject: [PATCH 215/258] modules: put the OSX framework workaround also into FindOpenGLES2.cmake. --- modules/FindOpenGLES2.cmake | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/FindOpenGLES2.cmake b/modules/FindOpenGLES2.cmake index edccd9c22..c99e976fb 100644 --- a/modules/FindOpenGLES2.cmake +++ b/modules/FindOpenGLES2.cmake @@ -69,9 +69,17 @@ find_package_handle_standard_args(OpenGLES2 DEFAULT_MSG if(NOT TARGET OpenGLES2::OpenGLES2) if(OPENGLES2_LIBRARY_NEEDED) - add_library(OpenGLES2::OpenGLES2 UNKNOWN IMPORTED) - set_property(TARGET OpenGLES2::OpenGLES2 PROPERTY - IMPORTED_LOCATION ${OPENGLES2_LIBRARY}) + # Work around BUGGY framework support on OSX + # http://public.kitware.com/pipermail/cmake/2016-April/063179.html + if(CORRADE_TARGET_APPLE AND ${OPENGLES2_LIBRARY} MATCHES "\\.framework$") + add_library(OpenGLES2::OpenGLES2 INTERFACE IMPORTED) + set_property(TARGET OpenGLES2::OpenGLES2 APPEND PROPERTY + INTERFACE_LINK_LIBRARIES ${OPENGLES2_LIBRARY}) + else() + add_library(OpenGLES2::OpenGLES2 UNKNOWN IMPORTED) + set_property(TARGET OpenGLES2::OpenGLES2 PROPERTY + IMPORTED_LOCATION ${OPENGLES2_LIBRARY}) + endif() else() # This won't work in CMake 2.8.12, but that affects Emscripten only so # I assume people building for that are not on that crap old Ubuntu From d0cc5c97592a9f8f508fd61f0a7b169384ab0ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 18 Apr 2016 21:09:32 +0200 Subject: [PATCH 216/258] Added \experimental Doxygen tag. --- Doxyfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doxyfile b/Doxyfile index 63a53ee51..3b466f962 100644 --- a/Doxyfile +++ b/Doxyfile @@ -282,7 +282,8 @@ ALIASES = \ "def_alc{1}=`ALC_\1`" \ "requires_al_extension=@xrefitem requires-al-extension \"Requires OpenAL extension\" \"Functionality requiring specific OpenAL extension\"" \ "al_extension{2}=AL_\1_\2" \ - "alc_extension{2}=ALC_\1_\2" + "alc_extension{2}=ALC_\1_\2" \ + "experimental=@note This functionality is still experimental and may change in the future without keeping full backwards compatibility." # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" From 769415767964a8347498ee3c7d9d4956d0ddb5a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 21 Apr 2016 12:14:48 +0200 Subject: [PATCH 217/258] Fix annoying unused variable warning on ES. --- src/Magnum/Version.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Version.h b/src/Magnum/Version.h index 40f86ed07..a329c43f7 100644 --- a/src/Magnum/Version.h +++ b/src/Magnum/Version.h @@ -132,13 +132,13 @@ inline std::pair version(Version version) { Always `true` on @ref MAGNUM_TARGET_GLES "OpenGL ES" and WebGL build. */ +#ifndef MAGNUM_TARGET_GLES constexpr bool isVersionES(Version version) { - #ifndef MAGNUM_TARGET_GLES return Int(version) & Implementation::VersionESMask; - #else - return true; - #endif } +#else +constexpr bool isVersionES(Version) { return true; } +#endif /** @debugoperatorenum{Magnum::Version} */ MAGNUM_EXPORT Debug& operator<<(Debug& debug, Version value); From 8f9918ea0d3fdfd539d04bcd8465696343948ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 21 Apr 2016 12:15:17 +0200 Subject: [PATCH 218/258] DebugTools, TextureTools: no pixel_center_integer in GLSL ES. This seems like yet another pointless restriction. Aargh. --- src/Magnum/DebugTools/TextureImage.frag | 6 ++++++ src/Magnum/TextureTools/DistanceFieldShader.frag | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/Magnum/DebugTools/TextureImage.frag b/src/Magnum/DebugTools/TextureImage.frag index 836a03aa1..e7c5f67f3 100644 --- a/src/Magnum/DebugTools/TextureImage.frag +++ b/src/Magnum/DebugTools/TextureImage.frag @@ -1,12 +1,18 @@ uniform highp int level; uniform highp sampler2D textureData; +#ifndef GL_ES layout(pixel_center_integer) in highp vec4 gl_FragCoord; +#endif out highp uvec4 fragmentOutput; void main() { + #ifndef GL_ES ivec2 pos = ivec2(gl_FragCoord.xy); + #else + ivec2 pos = ivec2(gl_FragCoord.xy - vec2(0.5)); + #endif fragmentOutput = floatBitsToUint(texelFetch(textureData, pos, level)); } diff --git a/src/Magnum/TextureTools/DistanceFieldShader.frag b/src/Magnum/TextureTools/DistanceFieldShader.frag index 14be6d217..448213855 100644 --- a/src/Magnum/TextureTools/DistanceFieldShader.frag +++ b/src/Magnum/TextureTools/DistanceFieldShader.frag @@ -52,7 +52,9 @@ uniform lowp sampler2D textureData; #endif #ifdef TEXELFETCH_USABLE +#ifndef GL_ES layout(pixel_center_integer) in mediump vec4 gl_FragCoord; +#endif #else #ifdef EXPLICIT_UNIFORM_LOCATION layout(location = 2) uniform vec2 imageSizeInverted; @@ -85,8 +87,12 @@ bool hasValue(const mediump vec2 position, const mediump vec2 offset) { void main() { #ifdef TEXELFETCH_USABLE + #ifndef GL_ES const mediump ivec2 position = ivec2(gl_FragCoord.xy*scaling); #else + const mediump ivec2 position = ivec2((gl_FragCoord.xy - vec2(0.5))*scaling); + #endif + #else const mediump vec2 position = (gl_FragCoord.xy - vec2(0.5))*scaling*imageSizeInverted; #endif From de81184dba516cd1b9d19b2267211686b3d5bc4e Mon Sep 17 00:00:00 2001 From: Squareys Date: Mon, 18 Apr 2016 12:39:56 +0200 Subject: [PATCH 219/258] modules: Add FindGLFW.cmake Signed-off-by: Squareys --- modules/FindGLFW.cmake | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 modules/FindGLFW.cmake diff --git a/modules/FindGLFW.cmake b/modules/FindGLFW.cmake new file mode 100644 index 000000000..c6b6d9996 --- /dev/null +++ b/modules/FindGLFW.cmake @@ -0,0 +1,67 @@ +#.rst: +# Find GLFW +# --------- +# +# Finds the GLFW library. This module defines: +# +# GLFW_FOUND - True if GLFW library is found +# GLFW::GLFW - GLFW imported target +# +# Additionally these variables are defined for internal usage: +# +# GLFW_LIBRARY - GLFW library +# GLFW_INCLUDE_DIR - Root include dir +# + +# +# This file is part of Magnum. +# +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 +# Vladimír Vondruš +# Copyright © 2016 Jonathan Hale +# +# 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. +# + +find_library(GLFW_LIBRARY NAMES glfw glfw3) + +# Include dir +find_path(GLFW_INCLUDE_DIR + NAMES glfw3.h + PATH_SUFFIXES GLFW) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args("GLFW" DEFAULT_MSG + GLFW_LIBRARY + GLFW_INCLUDE_DIR) + +if(NOT TARGET GLFW::GLFW) + add_library(GLFW::GLFW UNKNOWN IMPORTED) + + # Work around BUGGY framework support on OSX + # https://cmake.org/Bug/view.php?id=14105 + if(CORRADE_TARGET_APPLE AND ${GLFW_LIBRARY} MATCHES "\\.framework$") + set_property(TARGET GLFW::GLFW PROPERTY IMPORTED_LOCATION ${GLFW_LIBRARY}/GLFW) + else() + set_property(TARGET GLFW::GLFW PROPERTY IMPORTED_LOCATION ${GLFW_LIBRARY}) + endif() + + set_property(TARGET GLFW::GLFW PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${GLFW_INCLUDE_DIR}) +endif() From e451b6dfdbce4964bd1b9ec908fa660ab2899c9d Mon Sep 17 00:00:00 2001 From: Squareys Date: Mon, 18 Apr 2016 12:41:35 +0200 Subject: [PATCH 220/258] Platform: Add GlfwApplication Signed-off-by: Squareys --- CMakeLists.txt | 1 + src/Magnum/Platform/CMakeLists.txt | 32 +- src/Magnum/Platform/GlfwApplication.cpp | 208 +++++++ src/Magnum/Platform/GlfwApplication.h | 753 ++++++++++++++++++++++++ 4 files changed, 993 insertions(+), 1 deletion(-) create mode 100644 src/Magnum/Platform/GlfwApplication.cpp create mode 100644 src/Magnum/Platform/GlfwApplication.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 58abee0bf..76873776f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,6 +128,7 @@ endif() # Platform-independent (almost) application libraries if(NOT CORRADE_TARGET_NACL AND NOT CORRADE_TARGET_ANDROID) + option(WITH_GLFWAPPLICATION "Build GlfwApplication library") cmake_dependent_option(WITH_GLUTAPPLICATION "Build GlutApplication library" OFF "NOT TARGET_GLES" OFF) option(WITH_SDL2APPLICATION "Build Sdl2Application library" OFF) endif() diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index e1abc2ecc..1a1dbca71 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -37,7 +37,7 @@ set(MagnumPlatform_FILES ) install(FILES ${MagnumPlatform_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) # Decide about platform-specific context for cross-platform toolkits -if(WITH_GLUTAPPLICATION OR WITH_SDL2APPLICATION) +if(WITH_GLFWAPPLICATION OR WITH_GLUTAPPLICATION OR WITH_SDL2APPLICATION) if(CORRADE_TARGET_APPLE AND NOT MAGNUM_TARGET_GLES) set(NEED_CGLCONTEXT 1) set(MagnumSomeContext_OBJECTS $) @@ -91,6 +91,36 @@ if(WITH_ANDROIDAPPLICATION) add_library(Magnum::AndroidApplication ALIAS MagnumAndroidApplication) endif() +# GLFW application +if(WITH_GLFWAPPLICATION) + find_package(GLFW) + if(NOT GLFW_FOUND) + message(FATAL_ERROR "GLFW library, required by GlfwApplication, was not found. Set WITH_GLFWAPPLICATION to OFF to skip building it.") + endif() + + set(MagnumGlfwApplication_SRCS + GlfwApplication.cpp + ${MagnumSomeContext_OBJECTS}) + set(MagnumGlfwApplication_HEADERS GlfwApplication.h) + + add_library(MagnumGlfwApplication STATIC + ${MagnumGlfwApplication_SRCS} + ${MagnumGlfwApplication_HEADERS}) + set_target_properties(MagnumGlfwApplication PROPERTIES DEBUG_POSTFIX "-d") + # Assuming that PIC is not needed because the Application lib is always + # linked to the executable and not to any intermediate shared lib + target_link_libraries(MagnumGlfwApplication Magnum GLFW::GLFW) + + install(FILES ${MagnumGlfwApplication_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) + install(TARGETS MagnumGlfwApplication + RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} + LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} + ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) + + # Magnum GlfwApplication target alias for superprojects + add_library(Magnum::GlfwApplication ALIAS MagnumGlfwApplication) +endif() + # GLUT application if(WITH_GLUTAPPLICATION) find_package(GLUT) diff --git a/src/Magnum/Platform/GlfwApplication.cpp b/src/Magnum/Platform/GlfwApplication.cpp new file mode 100644 index 000000000..5d751fecb --- /dev/null +++ b/src/Magnum/Platform/GlfwApplication.cpp @@ -0,0 +1,208 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + 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. +*/ + +#include "GlfwApplication.h" + +#include + +#include "Magnum/Version.h" +#include "Magnum/Platform/Context.h" +#include "Magnum/Platform/ScreenedApplication.hpp" + +namespace Magnum { namespace Platform { + +GlfwApplication* GlfwApplication::_instance = nullptr; + +#ifndef DOXYGEN_GENERATING_OUTPUT +GlfwApplication::GlfwApplication(const Arguments& arguments): GlfwApplication{arguments, Configuration{}} {} +#endif + +GlfwApplication::GlfwApplication(const Arguments& arguments, const Configuration& configuration): GlfwApplication{arguments, nullptr} { + createContext(configuration); +} + +GlfwApplication::GlfwApplication(const Arguments& arguments, std::nullptr_t) + : _context{new Context{NoCreate, arguments.argc, arguments.argv}}, + _needsRedraw(true) +{ + /* Save global instance */ + _instance = this; + + /* Init GLFW */ + glfwSetErrorCallback(staticErrorCallback); + + if(!glfwInit()) { + Error() << "Could not initialize GLFW"; + std::exit(8); + } +} + +void GlfwApplication::createContext() { createContext({}); } + +void GlfwApplication::createContext(const Configuration& configuration) { + if(!tryCreateContext(configuration)) std::exit(1); +} + +bool GlfwApplication::tryCreateContext(const Configuration& configuration) { + CORRADE_ASSERT(_context->version() == Version::None, "Platform::GlfwApplication::tryCreateContext(): context already created", false); + + static_assert(GLFW_TRUE == true && GLFW_FALSE == false, "GLFW does not have sane bool values."); + + /* Window flags */ + GLFWmonitor* monitor = nullptr; /* Needed for setting fullscreen */ + if (configuration.windowFlags() >= Configuration::WindowFlag::Fullscreen) { + monitor = glfwGetPrimaryMonitor(); + glfwWindowHint(GLFW_AUTO_ICONIFY, configuration.windowFlags() >= Configuration::WindowFlag::AutoIconify); + } else { + const Configuration::WindowFlags& flags = configuration.windowFlags(); + glfwWindowHint(GLFW_RESIZABLE, flags >= Configuration::WindowFlag::Resizeable); + glfwWindowHint(GLFW_VISIBLE, !(flags >= Configuration::WindowFlag::Hidden)); + glfwWindowHint(GLFW_MAXIMIZED, flags >= Configuration::WindowFlag::Maximized); + glfwWindowHint(GLFW_ICONIFIED, flags >= Configuration::WindowFlag::Minimized); + glfwWindowHint(GLFW_FLOATING, flags >= Configuration::WindowFlag::Floating); + } + glfwWindowHint(GLFW_FLOATING, configuration.windowFlags() >= Configuration::WindowFlag::Focused); + + /* Context window hints */ + glfwWindowHint(GLFW_SAMPLES, configuration.sampleCount()); + glfwWindowHint(GLFW_SRGB_CAPABLE, configuration.isSRGBCapable()); + + const Configuration::Flags& flags = configuration.flags(); + glfwWindowHint(GLFW_CONTEXT_NO_ERROR, flags >= Configuration::Flag::NoError); + glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, flags >= Configuration::Flag::Debug); + glfwWindowHint(GLFW_STEREO, flags >= Configuration::Flag::Stereo); + + /* Cursor flags */ + glfwWindowHint(GLFW_CURSOR, Int(configuration.cursorMode())); + + /* Set context version, if requested */ + if(configuration.version() != Version::None) { + Int major, minor; + std::tie(major, minor) = version(configuration.version()); + glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, major); + glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, minor); + #ifndef MAGNUM_TARGET_GLES + if(configuration.version() >= Version::GL310) { + glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE); + glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); + } + #else + glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API); + #endif + } + + /* Set context flags */ + _window = glfwCreateWindow(configuration.size().x(), configuration.size().y(), configuration.title().c_str(), monitor, nullptr); + if(!_window) { + Error() << "Platform::GlfwApplication::tryCreateContext(): cannot create context"; + glfwTerminate(); + return false; + } + + /* Set callbacks */ + glfwSetFramebufferSizeCallback(_window, staticViewportEvent); + glfwSetKeyCallback(_window, staticKeyEvent); + glfwSetCursorPosCallback(_window, staticMouseMoveEvent); + glfwSetMouseButtonCallback(_window, staticMouseEvent); + glfwSetScrollCallback(_window, staticMouseScrollEvent); + + glfwMakeContextCurrent(_window); + glfwSwapInterval(1); + + /* Return true if the initialization succeeds */ + return _context->tryCreate(); +} + +GlfwApplication::~GlfwApplication() { + glfwDestroyWindow(_window); + glfwTerminate(); +} + +int GlfwApplication::exec() { + while(!glfwWindowShouldClose(_window)) { + if(_needsRedraw) { + drawEvent(); + } + glfwPollEvents(); + } + return 0; +} + +void GlfwApplication::staticKeyEvent(GLFWwindow*, int key, int, int action, int) { + KeyEvent e(static_cast(key)); + + if(action == GLFW_PRESS) { + _instance->keyPressEvent(e); + } else if(action == GLFW_RELEASE) { + _instance->keyReleaseEvent(e); + } /* we don't handle GLFW_REPEAT */ +} + +void GlfwApplication::staticMouseMoveEvent(GLFWwindow*, double x, double y) { + MouseMoveEvent e{Vector2i{Int(x), Int(y)}}; + _instance->mouseMoveEvent(e); +} + +void GlfwApplication::staticMouseEvent(GLFWwindow*, int button, int action, int) { + MouseEvent e(static_cast(button)); + + if(action == GLFW_PRESS) { + _instance->mousePressEvent(e); + } else if(action == GLFW_RELEASE) { + _instance->mouseReleaseEvent(e); + } /* we don't handle GLFW_REPEAT */ +} + +void GlfwApplication::staticMouseScrollEvent(GLFWwindow*, double xoffset, double yoffset) { + MouseScrollEvent e(Vector2d{xoffset, yoffset}); + _instance->mouseScrollEvent(e); +} + +void GlfwApplication::staticErrorCallback(int, const char* description) { + Error() << description; +} + +void GlfwApplication::viewportEvent(const Vector2i&) {} +void GlfwApplication::keyPressEvent(KeyEvent&) {} +void GlfwApplication::keyReleaseEvent(KeyEvent&) {} +void GlfwApplication::mousePressEvent(MouseEvent&) {} +void GlfwApplication::mouseReleaseEvent(MouseEvent&) {} +void GlfwApplication::mouseMoveEvent(MouseMoveEvent&) {} +void GlfwApplication::mouseScrollEvent(MouseScrollEvent&) {} + +GlfwApplication::Configuration::Configuration() + : _title("Magnum GLFW Application"), + _size(800, 600), _sampleCount(0), + _version(Version::None), + _windowFlags(WindowFlag::Focused), + _cursorMode(CursorMode::Normal) +{} + +GlfwApplication::Configuration::~Configuration() = default; + +template class BasicScreen; +template class BasicScreenedApplication; + +}} diff --git a/src/Magnum/Platform/GlfwApplication.h b/src/Magnum/Platform/GlfwApplication.h new file mode 100644 index 000000000..9e821588d --- /dev/null +++ b/src/Magnum/Platform/GlfwApplication.h @@ -0,0 +1,753 @@ +#ifndef Magnum_Platform_GlfwApplication_h +#define Magnum_Platform_GlfwApplication_h +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + 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 + * @brief Class @ref Magnum::Platform::GlfwApplication, macro @ref MAGNUM_GLFWAPPLICATION_MAIN() + */ + +#include +#include + +#include "Magnum/Magnum.h" +#include "Magnum/Math/Vector2.h" +#include "Magnum/Platform/Platform.h" + +/* We must include our own GL headers first to avoid conflicts */ +#include "Magnum/OpenGL.h" + +#include + +namespace Magnum { namespace Platform { + +/** @nosubgrouping +@brief GLFW application + +Application using GLFW 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, +OS X). It depends on **GLFW** library and is built if `WITH_GLFWAPPLICATION` is +enabled in CMake. + +## Bootstrap application + +Fully contained base application using @ref GlfwApplication along with +CMake setup is available in `base-glfw` branch of +[Magnum Bootstrap](https://github.com/mosra/magnum-bootstrap) repository, +download it as [tar.gz](https://github.com/mosra/magnum-bootstrap/archive/base-glfw.tar.gz) +or [zip](https://github.com/mosra/magnum-bootstrap/archive/base-glfw.zip) file. +After extracting the downloaded archive you can build and run the application +with these four commands: + + mkdir build && cd build + cmake .. + cmake --build . + ./src/MyApplication # or ./src/Debug/MyApplication + +See @ref cmake for more information. + +## General usage + +In CMake you need to request `GlfwApplication` component of `Magnum` package +and link to `Magnum::GlfwApplication` target. If no other application is +requested, you can also use 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 `main()` -- see +convenience macro @ref MAGNUM_GLFWAPPLICATION_MAIN(). See @ref platform for +more information. +@code +class MyApplication: public Platform::GlfwApplication { + // implement required methods... +}; +MAGNUM_GLFWAPPLICATION_MAIN(MyApplication) +@endcode + +If no other application header is included, this class is also aliased to +`Platform::Application` and the macro is aliased to `MAGNUM_APPLICATION_MAIN()` +to simplify porting. +*/ +class GlfwApplication { + 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 InputEvent; + class KeyEvent; + class MouseEvent; + class MouseMoveEvent; + class MouseScrollEvent; + + /** @copydoc Sdl2Application::Sdl2Application(const Arguments&, const Configuration&) */ + #ifdef DOXYGEN_GENERATING_OUTPUT + explicit GlfwApplication(const Arguments& arguments, const Configuration& configuration = Configuration()); + #else + /* To avoid "invalid use of incomplete type" */ + explicit GlfwApplication(const Arguments& arguments, const Configuration& configuration); + explicit GlfwApplication(const Arguments& arguments); + #endif + + /** @copydoc Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) */ + explicit GlfwApplication(const Arguments& arguments, std::nullptr_t); + + /** @brief Copying is not allowed */ + GlfwApplication(const GlfwApplication&) = delete; + + /** @brief Moving is not allowed */ + GlfwApplication(GlfwApplication&&) = delete; + + /** @brief Copying is not allowed */ + GlfwApplication& operator=(const GlfwApplication&) = delete; + + /** @brief Moving is not allowed */ + GlfwApplication& operator=(GlfwApplication&&) = delete; + + /** + * @brief Execute main loop + * @return Value for returning from `main()` + * + * See @ref MAGNUM_GLFWAPPLICATION_MAIN() for usage information. + */ + int exec(); + + /** @brief Exit application main loop */ + void exit() { + glfwSetWindowShouldClose(_window, GLFW_TRUE); + } + + protected: + /* Nobody will need to have (and delete) GlfwApplication*, thus this is + faster than public pure virtual destructor */ + ~GlfwApplication(); + + /** @copydoc Sdl2Application::createContext() */ + #ifdef DOXYGEN_GENERATING_OUTPUT + void createContext(const Configuration& configuration = Configuration()); + #else + /* To avoid "invalid use of incomplete type" */ + void createContext(const Configuration& configuration); + void createContext(); + #endif + + /** @copydoc Sdl2Application::tryCreateContext() */ + bool tryCreateContext(const Configuration& configuration); + + /** @{ @name Screen handling */ + + /** + * @brief Swap buffers + * + * Paints currently rendered framebuffer on screen. + */ + void swapBuffers() { glfwSwapBuffers(_window); } + + /** @copydoc Sdl2Application::redraw() */ + void redraw() { _needsRedraw = true; } + + #ifdef DOXYGEN_GENERATING_OUTPUT + protected: + #else + private: + #endif + /** @copydoc Sdl2Application::viewportEvent() */ + virtual void viewportEvent(const Vector2i& size); + + /** @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 = GLFW_CURSOR_NORMAL, /**< Default cursor provided by parent window */ + Hidden = GLFW_CURSOR_HIDDEN, /**< Hidden cursor */ + None = GLFW_CURSOR_DISABLED /**< No cursor */ + }; + + /** @brief Warp mouse cursor to given coordinates */ + void warpCursor(const Vector2i& position) { + glfwSetCursorPos(_window, Double(position.x()), Double(position.y())); + } + + #ifdef DOXYGEN_GENERATING_OUTPUT + protected: + #else + private: + #endif + /** @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); + + /** + * @brief Mouse scroll event + * + * Called when a scrolling device is used (mouse wheel or scrolling area + * on touchpad). Default implementation does nothing. + */ + virtual void mouseScrollEvent(MouseScrollEvent& event); + + /*@}*/ + + private: + static void staticViewportEvent(GLFWwindow*, int w, int h) { + _instance->viewportEvent({w, h}); + } + + static void staticKeyEvent(GLFWwindow* window, int key, int scancode, int action, int mod); + + static void staticMouseEvent(GLFWwindow* window, int button, int action, int mods); + + static void staticMouseMoveEvent(GLFWwindow* window, double x, double y); + + static void staticMouseScrollEvent(GLFWwindow* window, double xoffset, double yoffset); + + static void staticErrorCallback(int error, const char* description); + + static GlfwApplication* _instance; + + GLFWwindow* _window; + + std::unique_ptr _context; + + bool _needsRedraw; +}; + +/** +@brief Configuration + +Double-buffered RGBA window with depth and stencil buffers. +@see @ref GlfwApplication(), @ref createContext(), @ref tryCreateContext() +*/ +class GlfwApplication::Configuration { + public: + /** + * @brief Context flag + * + * @see @ref Flags, @ref setFlags() + */ + enum class Flag: Int { + /** + * Specifies whether errors should be generated by the context. + * If enabled, situations that would have generated errors instead + * cause undefined behavior. + */ + NoError = GLFW_CONTEXT_NO_ERROR, + Debug = GLFW_OPENGL_DEBUG_CONTEXT, /**< Debug context */ + Stereo = GLFW_STEREO, /**< Stereo rendering */ + }; + + /** + * @brief Context flags + * + * @see @ref setFlags() + */ + typedef Containers::EnumSet Flags; + + /** + * @brief Window flag + * + * @see @ref WindowFlags, @ref setWindowFlags() + */ + enum class WindowFlag: UnsignedShort { + Fullscreen = 1 << 0, /**< Fullscreen window */ + Resizeable = 1 << 1, /**< Resizeable window */ + Hidden = 1 << 2, /**< Hidden window */ + Maximized = 1 << 3, /**< Maximized window */ + Minimized = 1 << 4, /**< Minimized window */ + Floating = 1 << 5, /**< Window floating above others, top-most */ + AutoIconify = 1 << 6, /**< Automatically iconify (minimize) if fullscreen window loses input focus */ + Focused = 1 << 7, /**< Window has input focus */ + }; + + /** + * @brief Window flags + * + * @see @ref setWindowFlags() + */ + typedef Containers::EnumSet WindowFlags; + + enum class CursorMode: Int { + Normal = GLFW_CURSOR_NORMAL, /**< Visible unconstrained cursor */ + Hidden = GLFW_CURSOR_HIDDEN, /**< Hidden cursor */ + Diabled = GLFW_CURSOR_DISABLED, /**< Cursor hidden and locked window */ + }; + + /*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 `"Magnum GLFW Application"`. + */ + 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 `{800, 600}`. + */ + Configuration& setSize(const Vector2i& size) { + _size = size; + return *this; + } + + /** @brief Context flags */ + Flags flags() const { return _flags; } + + /** + * @brief Set context flags + * @return Reference to self (for method chaining) + * + * Default is no flag. + */ + Configuration& setFlags(Flags flags) { + _flags = flags; + return *this; + } + + /** @brief Window flags */ + WindowFlags windowFlags() const { + return _windowFlags; + } + + /** + * @brief Set window flags + * @return Reference to self (for method chaining) + * + * Default is @ref WindowFlag::Focused. + */ + Configuration& setWindowFlags(WindowFlags windowFlags) { + _windowFlags = windowFlags; + return *this; + } + + /** @brief Cursor mode */ + CursorMode cursorMode() const { + return _cursorMode; + } + + /** + * @brief Set cursor flags + * @return Reference to self (for method chaining) + * + * Default is @ref CursorMode::Normal. + */ + Configuration& setCursorMode(CursorMode cursorMode) { + _cursorMode = cursorMode; + return *this; + } + + /** @brief Context version */ + 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 Version::None, i.e. any provided version is used. + */ + Configuration& setVersion(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 `0`, thus no multisampling. The actual sample count is + * ignored, GLFW either enables it or disables. See also + * @ref Renderer::Feature::Multisampling. + */ + Configuration& setSampleCount(Int count) { + _sampleCount = count; + return *this; + } + + /** @brief sRGB-capable default framebuffer */ + bool isSRGBCapable() const { + return _srgbCapable; + } + + /** + * @brief Set sRGB-capable default framebuffer + * @return Reference to self (for method chaining) + */ + Configuration& setSRGBCapable(bool enabled) { + _srgbCapable = enabled; + return *this; + } + + private: + std::string _title; + Vector2i _size; + Int _sampleCount; + Version _version; + Flags _flags; + WindowFlags _windowFlags; + CursorMode _cursorMode; + bool _srgbCapable; +}; + +CORRADE_ENUMSET_OPERATORS(GlfwApplication::Configuration::Flags) +CORRADE_ENUMSET_OPERATORS(GlfwApplication::Configuration::WindowFlags) + +/** +@brief Base for input events + +@see @ref KeyEvent, @ref MouseEvent, @ref MouseMoveEvent, @ref keyPressEvent(), + @ref mousePressEvent(), @ref mouseReleaseEvent(), @ref mouseMoveEvent() +*/ +class GlfwApplication::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() */ + constexpr bool isAccepted() const { return _accepted; } + + protected: + constexpr InputEvent(): _accepted(false) {} + + ~InputEvent() = default; + + private: + bool _accepted; +}; + +/** +@brief Key event + +@see @ref keyPressEvent() +*/ +class GlfwApplication::KeyEvent: public GlfwApplication::InputEvent { + friend GlfwApplication; + + public: + /** + * @brief Key + * + * @see @ref key() + */ + enum class Key: Int { + Unknown = GLFW_KEY_UNKNOWN, /**< Unknown key */ + + Up = GLFW_KEY_UP, /**< Up arrow */ + Down = GLFW_KEY_DOWN, /**< Down arrow */ + Left = GLFW_KEY_LEFT, /**< Left arrow */ + Right = GLFW_KEY_RIGHT, /**< Right arrow */ + F1 = GLFW_KEY_F1, /**< F1 */ + F2 = GLFW_KEY_F2, /**< F2 */ + F3 = GLFW_KEY_F3, /**< F3 */ + F4 = GLFW_KEY_F4, /**< F4 */ + F5 = GLFW_KEY_F5, /**< F5 */ + F6 = GLFW_KEY_F6, /**< F6 */ + F7 = GLFW_KEY_F7, /**< F7 */ + F8 = GLFW_KEY_F8, /**< F8 */ + F9 = GLFW_KEY_F9, /**< F9 */ + F10 = GLFW_KEY_F10, /**< F10 */ + F11 = GLFW_KEY_F11, /**< F11 */ + F12 = GLFW_KEY_F12, /**< F12 */ + Home = GLFW_KEY_HOME, /**< Home */ + End = GLFW_KEY_END, /**< End */ + PageUp = GLFW_KEY_PAGE_UP, /**< Page up */ + PageDown = GLFW_KEY_PAGE_DOWN, /**< Page down */ + + Space = ' ', /**< Space */ + Comma = ',', /**< Comma */ + Period = '.', /**< Period */ + Minus = '-', /**< Minus */ + Plus = '+', /**< Plus */ + Slash = '/', /**< Slash */ + Percent = '%', /**< Percent */ + Smicolon = ';', /**< Semicolon */ + 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 */ + + /* Function keys */ + Esc = GLFW_KEY_ESCAPE, /**< Escape */ + Enter = GLFW_KEY_ENTER, /**< Enter */ + Tab = GLFW_KEY_TAB, /**< Tab */ + Backspace = GLFW_KEY_BACKSPACE, /**< Backspace */ + Insert = GLFW_KEY_INSERT, /**< Insert */ + Delete = GLFW_KEY_DELETE, /**< Delete */ + CapsLock = GLFW_KEY_CAPS_LOCK, /**< Caps lock */ + ScrollLock = GLFW_KEY_SCROLL_LOCK, /**< Scroll lock */ + NumLock = GLFW_KEY_NUM_LOCK, /**< Num lock */ + PrintScreen = GLFW_KEY_PRINT_SCREEN,/**< Print screen */ + Pause = GLFW_KEY_PAUSE, /**< Pause */ + NumZero = GLFW_KEY_KP_0, /**< Numpad zero */ + NumOne = GLFW_KEY_KP_1, /**< Numpad one */ + NumTwo = GLFW_KEY_KP_2, /**< Numpad two */ + NumThree = GLFW_KEY_KP_3, /**< Numpad three */ + NumFour = GLFW_KEY_KP_4, /**< Numpad four */ + NumFive = GLFW_KEY_KP_5, /**< Numpad five */ + NumSix = GLFW_KEY_KP_6, /**< Numpad six */ + NumSeven = GLFW_KEY_KP_7, /**< Numpad seven */ + NumEight = GLFW_KEY_KP_8, /**< Numpad eight */ + NumNine = GLFW_KEY_KP_9, /**< Numpad nine */ + NumDecimal = GLFW_KEY_KP_DECIMAL, /**< Numpad decimal */ + NumDivide = GLFW_KEY_KP_DIVIDE, /**< Numpad divide */ + NumMultiply = GLFW_KEY_KP_MULTIPLY, /**< Numpad multiply */ + NumSubtract = GLFW_KEY_KP_SUBTRACT, /**< Numpad subtract */ + NumAdd = GLFW_KEY_KP_ADD, /**< Numpad add */ + NumEnter = GLFW_KEY_KP_ENTER, /**< Numpad enter */ + NumEqual = GLFW_KEY_KP_EQUAL, /**< Numpad equal */ + LeftShift = GLFW_KEY_LEFT_SHIFT, /**< Left shift */ + LeftCtrl = GLFW_KEY_LEFT_CONTROL, /**< Left control */ + LeftAlt = GLFW_KEY_LEFT_ALT, /**< Left alt */ + LeftSuper = GLFW_KEY_LEFT_SUPER, /**< Left super */ + RightShift = GLFW_KEY_RIGHT_SHIFT, /**< Right shift */ + RightCtrl = GLFW_KEY_RIGHT_CONTROL, /**< Right control */ + RightAlt = GLFW_KEY_RIGHT_ALT, /**< Right alt */ + RightSuper = GLFW_KEY_RIGHT_SUPER, /**< Right super */ + Menu = GLFW_KEY_MENU, /**< Menu */ + }; + + /** @brief Key */ + constexpr Key key() const { return _key; } + + private: + constexpr KeyEvent(Key key): _key(key) {} + + const Key _key; +}; + +/** +@brief Mouse event + +@see @ref MouseMoveEvent, @ref MouseScrollEvent, @ref mousePressEvent(), @ref mouseReleaseEvent() +*/ +class GlfwApplication::MouseEvent: public GlfwApplication::InputEvent { + friend GlfwApplication; + + public: + /** + * @brief Mouse button + * + * @see @ref button() + */ + enum class Button: int { + Left = GLFW_MOUSE_BUTTON_LEFT, /**< Left button */ + Middle = GLFW_MOUSE_BUTTON_MIDDLE, /**< Middle button */ + Right = GLFW_MOUSE_BUTTON_RIGHT, /**< Right button */ + Button1 = GLFW_MOUSE_BUTTON_1, /**< Mouse button 1 */ + Button2 = GLFW_MOUSE_BUTTON_2, /**< Mouse button 2 */ + Button3 = GLFW_MOUSE_BUTTON_3, /**< Mouse button 3 */ + Button4 = GLFW_MOUSE_BUTTON_4, /**< Mouse button 4 */ + Button5 = GLFW_MOUSE_BUTTON_5, /**< Mouse button 5 */ + Button6 = GLFW_MOUSE_BUTTON_6, /**< Mouse button 6 */ + Button7 = GLFW_MOUSE_BUTTON_7, /**< Mouse button 7 */ + Button8 = GLFW_MOUSE_BUTTON_8, /**< Mouse button 8 */ + }; + + /** @brief Button */ + constexpr Button button() const { return _button; } + + private: + constexpr MouseEvent(Button button): _button(button) {} + + const Button _button; +}; + +/** +@brief Mouse move event + +@see @ref MouseEvent, @ref MouseScrollEvent, @ref mouseMoveEvent() +*/ +class GlfwApplication::MouseMoveEvent: public GlfwApplication::InputEvent { + friend GlfwApplication; + + public: + + /** @brief Position */ + constexpr Vector2i position() const { return _position; } + + private: + constexpr MouseMoveEvent(const Vector2i& position): _position(position) {} + + const Vector2i _position; +}; + +/** +@brief Mouse scroll event + +@see @ref MouseEvent, @ref MouseMoveEvent, @ref mouseScrollEvent() +*/ +class GlfwApplication::MouseScrollEvent: public GlfwApplication::InputEvent { + friend GlfwApplication; + + public: + + /** @brief Scroll offset */ + constexpr Vector2d offset() const { return _offset; } + + private: + constexpr MouseScrollEvent(const Vector2d& offset): _offset(offset) {} + + const Vector2d _offset; +}; + +/** @hideinitializer +@brief Entry point for GLFW-based applications +@param className Class name + +See @ref Magnum::Platform::GlfwApplication "Platform::GlfwApplication" 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 +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 +`MAGNUM_APPLICATION_MAIN()`. +*/ +#define MAGNUM_GLFWAPPLICATION_MAIN(className) \ + int main(int argc, char** argv) { \ + className app({argc, argv}); \ + return app.exec(); \ + } + +#ifndef DOXYGEN_GENERATING_OUTPUT +#ifndef MAGNUM_APPLICATION_MAIN +typedef GlfwApplication Application; +typedef BasicScreen Screen; +typedef BasicScreenedApplication ScreenedApplication; +#define MAGNUM_APPLICATION_MAIN(className) MAGNUM_GLFWAPPLICATION_MAIN(className) +#else +#undef MAGNUM_APPLICATION_MAIN +#endif +#endif + +}} + +#endif From d34f14012bd9a3b49a24bcad8d809076770fa7f0 Mon Sep 17 00:00:00 2001 From: Squareys Date: Mon, 18 Apr 2016 12:41:49 +0200 Subject: [PATCH 221/258] modules: Add GlfwApplication to FindMagnum.cmake Signed-off-by: Squareys --- modules/FindMagnum.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index e360fce05..5c88350fe 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -47,6 +47,7 @@ # Shapes - Shapes library # Text - Text library # TextureTools - TextureTools library +# GlfwApplication - GLFW application # GlutApplication - GLUT application # GlxApplication - GLX application # NaClApplication - NaCl application @@ -338,7 +339,7 @@ endif() # Component distinction (listing them explicitly to avoid mistakes with finding # components from other repositories) -set(_MAGNUM_LIBRARY_COMPONENTS "^(Audio|DebugTools|MeshTools|Primitives|SceneGraph|Shaders|Shapes|Text|TextureTools|AndroidApplication|GlutApplication|GlxApplication|NaClApplication|Sdl2Application|XEglApplication|WindowlessCglApplication|WindowlessEglApplication|WindowlessGlxApplication|WindowlessIosApplication|WindowlessNaClApplication|WindowlessWglApplication|WindowlessWindowsEglApplication|CglContext|EglContext|GlxContext|WglContext)$") +set(_MAGNUM_LIBRARY_COMPONENTS "^(Audio|DebugTools|MeshTools|Primitives|SceneGraph|Shaders|Shapes|Text|TextureTools|AndroidApplication|GlfwApplication|GlutApplication|GlxApplication|NaClApplication|Sdl2Application|XEglApplication|WindowlessCglApplication|WindowlessEglApplication|WindowlessGlxApplication|WindowlessIosApplication|WindowlessNaClApplication|WindowlessWglApplication|WindowlessWindowsEglApplication|CglContext|EglContext|GlxContext|WglContext)$") set(_MAGNUM_PLUGIN_COMPONENTS "^(MagnumFont|MagnumFontConverter|ObjImporter|TgaImageConverter|TgaImporter|WavAudioImporter)$") set(_MAGNUM_EXECUTABLE_COMPONENTS "^(distancefieldconverter|fontconverter|info)$") @@ -466,6 +467,12 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) set_property(TARGET Magnum::${_component} APPEND PROPERTY INTERFACE_LINK_LIBRARIES android EGL::EGL) + # GLFW application dependencies + elseif(_component STREQUAL GlfwApplication) + find_package(GLFW) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES GLFW::GLFW) + # GLUT application dependencies elseif(_component STREQUAL GlutApplication) find_package(GLUT) From 42cfa6565a2f126649780e5a9a68ee782d5ca2b5 Mon Sep 17 00:00:00 2001 From: Squareys Date: Mon, 18 Apr 2016 12:42:08 +0200 Subject: [PATCH 222/258] doc: Add GlfwApplication to *.dox Signed-off-by: Squareys --- doc/building.dox | 1 + doc/cmake.dox | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/building.dox b/doc/building.dox index 6948575d5..ccc908569 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -206,6 +206,7 @@ need at least one). Choose the one which suits your requirements and your platform best: - `WITH_ANDROIDAPPLICATION` - @ref Platform::AndroidApplication "AndroidApplication" +- `WITH_GLFWAPPLICATION` - @ref Platform::GlfwApplication "GlfwApplication" - `WITH_GLUTAPPLICATION` - @ref Platform::GlutApplication "GlutApplication" - `WITH_GLXAPPLICATION` - @ref Platform::GlxApplication "GlxApplication" - `WITH_NACLAPPLICATION` - @ref Platform::NaClApplication "NaClApplication" diff --git a/doc/cmake.dox b/doc/cmake.dox index daede57fc..972858b2c 100644 --- a/doc/cmake.dox +++ b/doc/cmake.dox @@ -94,6 +94,7 @@ The optional components are: Platform namespace is split into more components: +- `GlfwApplication` -- @ref Platform::GlfwApplication "GlfwApplication" - `GlutApplication` -- @ref Platform::GlutApplication "GlutApplication" - `GlxApplication` -- @ref Platform::GlxApplication "GlxApplication" - `NaClApplication` -- @ref Platform::NaClApplication "NaClApplication" From accf8380f0ada550cc73125251521d13af17bbef Mon Sep 17 00:00:00 2001 From: Squareys Date: Tue, 19 Apr 2016 15:00:10 +0200 Subject: [PATCH 223/258] Platform: Implement WheelUp/Down analog to Sdl2Application ... for better portability. Signed-off-by: Squareys --- src/Magnum/Platform/GlfwApplication.cpp | 6 ++++++ src/Magnum/Platform/GlfwApplication.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/Magnum/Platform/GlfwApplication.cpp b/src/Magnum/Platform/GlfwApplication.cpp index 5d751fecb..b0c2e5ba2 100644 --- a/src/Magnum/Platform/GlfwApplication.cpp +++ b/src/Magnum/Platform/GlfwApplication.cpp @@ -178,6 +178,12 @@ void GlfwApplication::staticMouseEvent(GLFWwindow*, int button, int action, int) void GlfwApplication::staticMouseScrollEvent(GLFWwindow*, double xoffset, double yoffset) { MouseScrollEvent e(Vector2d{xoffset, yoffset}); _instance->mouseScrollEvent(e); + + if(yoffset != 0.0) { + MouseEvent e1((yoffset > 0.0) ? MouseEvent::Button::WheelUp : MouseEvent::Button::WheelDown); + _instance->mousePressEvent(e); + _instance->mousePressEvent(e1); + } } void GlfwApplication::staticErrorCallback(int, const char* description) { diff --git a/src/Magnum/Platform/GlfwApplication.h b/src/Magnum/Platform/GlfwApplication.h index 9e821588d..45f6ed24b 100644 --- a/src/Magnum/Platform/GlfwApplication.h +++ b/src/Magnum/Platform/GlfwApplication.h @@ -665,6 +665,9 @@ class GlfwApplication::MouseEvent: public GlfwApplication::InputEvent { Button6 = GLFW_MOUSE_BUTTON_6, /**< Mouse button 6 */ Button7 = GLFW_MOUSE_BUTTON_7, /**< Mouse button 7 */ Button8 = GLFW_MOUSE_BUTTON_8, /**< Mouse button 8 */ + + WheelUp = GLFW_MOUSE_BUTTON_LAST + 1, /**< Mouse wheel up */ + WheelDown = GLFW_MOUSE_BUTTON_LAST + 2, /**< Mouse wheel down */ }; /** @brief Button */ From 725e726c1e84840f41ae08541315d71a1824e8db Mon Sep 17 00:00:00 2001 From: Squareys Date: Thu, 21 Apr 2016 09:44:50 +0200 Subject: [PATCH 224/258] Platform: Implement modifiers for GlfwApplication Signed-off-by: Squareys --- src/Magnum/Platform/GlfwApplication.cpp | 37 ++++++++++++++----- src/Magnum/Platform/GlfwApplication.h | 49 +++++++++++++++++++++++-- 2 files changed, 72 insertions(+), 14 deletions(-) diff --git a/src/Magnum/Platform/GlfwApplication.cpp b/src/Magnum/Platform/GlfwApplication.cpp index b0c2e5ba2..48dcc7890 100644 --- a/src/Magnum/Platform/GlfwApplication.cpp +++ b/src/Magnum/Platform/GlfwApplication.cpp @@ -150,8 +150,8 @@ int GlfwApplication::exec() { return 0; } -void GlfwApplication::staticKeyEvent(GLFWwindow*, int key, int, int action, int) { - KeyEvent e(static_cast(key)); +void GlfwApplication::staticKeyEvent(GLFWwindow*, int key, int, int action, int mods) { + KeyEvent e(static_cast(key), {static_cast(mods)}); if(action == GLFW_PRESS) { _instance->keyPressEvent(e); @@ -160,13 +160,13 @@ void GlfwApplication::staticKeyEvent(GLFWwindow*, int key, int, int action, int) } /* we don't handle GLFW_REPEAT */ } -void GlfwApplication::staticMouseMoveEvent(GLFWwindow*, double x, double y) { - MouseMoveEvent e{Vector2i{Int(x), Int(y)}}; +void GlfwApplication::staticMouseMoveEvent(GLFWwindow* window, double x, double y) { + MouseMoveEvent e{Vector2i{Int(x), Int(y)}, KeyEvent::getCurrentGlfwModifiers(window)}; _instance->mouseMoveEvent(e); } -void GlfwApplication::staticMouseEvent(GLFWwindow*, int button, int action, int) { - MouseEvent e(static_cast(button)); +void GlfwApplication::staticMouseEvent(GLFWwindow*, int button, int action, int mods) { + MouseEvent e(static_cast(button), {static_cast(mods)}); if(action == GLFW_PRESS) { _instance->mousePressEvent(e); @@ -175,13 +175,12 @@ void GlfwApplication::staticMouseEvent(GLFWwindow*, int button, int action, int) } /* we don't handle GLFW_REPEAT */ } -void GlfwApplication::staticMouseScrollEvent(GLFWwindow*, double xoffset, double yoffset) { - MouseScrollEvent e(Vector2d{xoffset, yoffset}); +void GlfwApplication::staticMouseScrollEvent(GLFWwindow* window, double xoffset, double yoffset) { + MouseScrollEvent e(Vector2d{xoffset, yoffset}, KeyEvent::getCurrentGlfwModifiers(window)); _instance->mouseScrollEvent(e); if(yoffset != 0.0) { - MouseEvent e1((yoffset > 0.0) ? MouseEvent::Button::WheelUp : MouseEvent::Button::WheelDown); - _instance->mousePressEvent(e); + MouseEvent e1((yoffset > 0.0) ? MouseEvent::Button::WheelUp : MouseEvent::Button::WheelDown, KeyEvent::getCurrentGlfwModifiers(window)); _instance->mousePressEvent(e1); } } @@ -190,6 +189,24 @@ void GlfwApplication::staticErrorCallback(int, const char* description) { Error() << description; } +GlfwApplication::InputEvent::Modifiers GlfwApplication::KeyEvent::getCurrentGlfwModifiers(GLFWwindow* window) { + static_assert(GLFW_PRESS == true && GLFW_RELEASE == false, "GLFW press and release constants do not correspond to bool values."); + + Modifiers mods = (glfwGetKey(window, Int(Key::LeftShift)) || glfwGetKey(window, Int(Key::RightShift))) + ? Modifiers{Modifier::Shift} : Modifiers{}; + if(glfwGetKey(window, Int(Key::LeftAlt)) || glfwGetKey(window, Int(Key::RightAlt))) { + mods |= Modifier::Alt; + } + if(glfwGetKey(window, Int(Key::LeftCtrl)) || glfwGetKey(window, Int(Key::RightCtrl))) { + mods |= Modifier::Ctrl; + } + if(glfwGetKey(window, Int(Key::RightSuper))) { + mods |= Modifier::AltGr; + } + + return mods; +} + void GlfwApplication::viewportEvent(const Vector2i&) {} void GlfwApplication::keyPressEvent(KeyEvent&) {} void GlfwApplication::keyReleaseEvent(KeyEvent&) {} diff --git a/src/Magnum/Platform/GlfwApplication.h b/src/Magnum/Platform/GlfwApplication.h index 45f6ed24b..17e882e8d 100644 --- a/src/Magnum/Platform/GlfwApplication.h +++ b/src/Magnum/Platform/GlfwApplication.h @@ -477,6 +477,27 @@ CORRADE_ENUMSET_OPERATORS(GlfwApplication::Configuration::WindowFlags) */ class GlfwApplication::InputEvent { public: + /** + * @brief Modifier + * + * @see @ref Modifiers, @ref KeyEvent::modifiers(), + * @ref MouseEvent::modifiers() + */ + enum class Modifier: Int { + Shift = GLFW_MOD_SHIFT, /**< Shift */ + Ctrl = GLFW_MOD_CONTROL, /**< Ctrl */ + Alt = GLFW_MOD_ALT, /**< Alt */ + AltGr = GLFW_MOD_SUPER, /**< AltGr */ + }; + + /** + * @brief Set of modifiers + * + * @see @ref KeyEvent::modifiers(), @ref MouseEvent::modifiers(), + * @ref MouseMoveEvent::modifiers() + */ + typedef Containers::EnumSet Modifiers; + /** @brief Copying is not allowed */ InputEvent(const InputEvent&) = delete; @@ -504,6 +525,8 @@ class GlfwApplication::InputEvent { bool _accepted; }; +CORRADE_ENUMSET_OPERATORS(GlfwApplication::InputEvent::Modifiers) + /** @brief Key event @@ -633,10 +656,16 @@ class GlfwApplication::KeyEvent: public GlfwApplication::InputEvent { /** @brief Key */ constexpr Key key() const { return _key; } + /** @brief Modifiers */ + constexpr Modifiers modifiers() const { return _modifiers; } + private: - constexpr KeyEvent(Key key): _key(key) {} + static Modifiers getCurrentGlfwModifiers(GLFWwindow* window); + + constexpr KeyEvent(Key key, Modifiers modifiers): _key(key), _modifiers(modifiers) {} const Key _key; + const Modifiers _modifiers; }; /** @@ -673,10 +702,14 @@ class GlfwApplication::MouseEvent: public GlfwApplication::InputEvent { /** @brief Button */ constexpr Button button() const { return _button; } + /** @brief Modifiers */ + constexpr Modifiers modifiers() const { return _modifiers; } + private: - constexpr MouseEvent(Button button): _button(button) {} + constexpr MouseEvent(Button button, Modifiers modifiers): _button(button), _modifiers(modifiers) {} const Button _button; + const Modifiers _modifiers; }; /** @@ -692,10 +725,14 @@ class GlfwApplication::MouseMoveEvent: public GlfwApplication::InputEvent { /** @brief Position */ constexpr Vector2i position() const { return _position; } + /** @brief Modifiers */ + constexpr Modifiers modifiers() const { return _modifiers; } + private: - constexpr MouseMoveEvent(const Vector2i& position): _position(position) {} + constexpr MouseMoveEvent(const Vector2i& position, Modifiers modifiers): _position(position), _modifiers(modifiers) {} const Vector2i _position; + const Modifiers _modifiers; }; /** @@ -711,10 +748,14 @@ class GlfwApplication::MouseScrollEvent: public GlfwApplication::InputEvent { /** @brief Scroll offset */ constexpr Vector2d offset() const { return _offset; } + /** @brief Modifiers */ + constexpr Modifiers modifiers() const { return _modifiers; } + private: - constexpr MouseScrollEvent(const Vector2d& offset): _offset(offset) {} + constexpr MouseScrollEvent(const Vector2d& offset, Modifiers modifiers): _offset(offset), _modifiers(modifiers) {} const Vector2d _offset; + const Modifiers _modifiers; }; /** @hideinitializer From 9a20dc2a70bead52a158e1a27508b22c292b5521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 11:05:42 +0200 Subject: [PATCH 225/258] Platform: backport GlfwApplication to GLFW 3.1. So one can use it without compiling latest master. --- src/Magnum/Platform/GlfwApplication.cpp | 13 ++++++++++--- src/Magnum/Platform/GlfwApplication.h | 18 ++++++++++++++++-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/Magnum/Platform/GlfwApplication.cpp b/src/Magnum/Platform/GlfwApplication.cpp index 48dcc7890..5ad36466d 100644 --- a/src/Magnum/Platform/GlfwApplication.cpp +++ b/src/Magnum/Platform/GlfwApplication.cpp @@ -35,6 +35,11 @@ namespace Magnum { namespace Platform { GlfwApplication* GlfwApplication::_instance = nullptr; +#ifdef GLFW_TRUE +/* The docs say that it's the same, verify that just in case */ +static_assert(GLFW_TRUE == true && GLFW_FALSE == false, "GLFW does not have sane bool values"); +#endif + #ifndef DOXYGEN_GENERATING_OUTPUT GlfwApplication::GlfwApplication(const Arguments& arguments): GlfwApplication{arguments, Configuration{}} {} #endif @@ -68,8 +73,6 @@ void GlfwApplication::createContext(const Configuration& configuration) { bool GlfwApplication::tryCreateContext(const Configuration& configuration) { CORRADE_ASSERT(_context->version() == Version::None, "Platform::GlfwApplication::tryCreateContext(): context already created", false); - static_assert(GLFW_TRUE == true && GLFW_FALSE == false, "GLFW does not have sane bool values."); - /* Window flags */ GLFWmonitor* monitor = nullptr; /* Needed for setting fullscreen */ if (configuration.windowFlags() >= Configuration::WindowFlag::Fullscreen) { @@ -79,7 +82,9 @@ bool GlfwApplication::tryCreateContext(const Configuration& configuration) { const Configuration::WindowFlags& flags = configuration.windowFlags(); glfwWindowHint(GLFW_RESIZABLE, flags >= Configuration::WindowFlag::Resizeable); glfwWindowHint(GLFW_VISIBLE, !(flags >= Configuration::WindowFlag::Hidden)); + #ifdef GLFW_MAXIMIZED glfwWindowHint(GLFW_MAXIMIZED, flags >= Configuration::WindowFlag::Maximized); + #endif glfwWindowHint(GLFW_ICONIFIED, flags >= Configuration::WindowFlag::Minimized); glfwWindowHint(GLFW_FLOATING, flags >= Configuration::WindowFlag::Floating); } @@ -90,7 +95,9 @@ bool GlfwApplication::tryCreateContext(const Configuration& configuration) { glfwWindowHint(GLFW_SRGB_CAPABLE, configuration.isSRGBCapable()); const Configuration::Flags& flags = configuration.flags(); + #ifdef GLFW_CONTEXT_NO_ERROR glfwWindowHint(GLFW_CONTEXT_NO_ERROR, flags >= Configuration::Flag::NoError); + #endif glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, flags >= Configuration::Flag::Debug); glfwWindowHint(GLFW_STEREO, flags >= Configuration::Flag::Stereo); @@ -105,7 +112,7 @@ bool GlfwApplication::tryCreateContext(const Configuration& configuration) { glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, minor); #ifndef MAGNUM_TARGET_GLES if(configuration.version() >= Version::GL310) { - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE); + glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, true); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); } #else diff --git a/src/Magnum/Platform/GlfwApplication.h b/src/Magnum/Platform/GlfwApplication.h index 17e882e8d..6974b3038 100644 --- a/src/Magnum/Platform/GlfwApplication.h +++ b/src/Magnum/Platform/GlfwApplication.h @@ -144,7 +144,7 @@ class GlfwApplication { /** @brief Exit application main loop */ void exit() { - glfwSetWindowShouldClose(_window, GLFW_TRUE); + glfwSetWindowShouldClose(_window, true); } protected: @@ -286,12 +286,17 @@ class GlfwApplication::Configuration { * @see @ref Flags, @ref setFlags() */ enum class Flag: Int { + #ifdef GLFW_CONTEXT_NO_ERROR /** * Specifies whether errors should be generated by the context. * If enabled, situations that would have generated errors instead * cause undefined behavior. + * + * @note Supported since GLFW 3.2. */ NoError = GLFW_CONTEXT_NO_ERROR, + #endif + Debug = GLFW_OPENGL_DEBUG_CONTEXT, /**< Debug context */ Stereo = GLFW_STEREO, /**< Stereo rendering */ }; @@ -312,7 +317,16 @@ class GlfwApplication::Configuration { Fullscreen = 1 << 0, /**< Fullscreen window */ Resizeable = 1 << 1, /**< Resizeable window */ Hidden = 1 << 2, /**< Hidden window */ - Maximized = 1 << 3, /**< Maximized window */ + + #ifdef GLFW_MAXIMIZED + /** + * Maximized window + * + * @note Supported since GLFW 3.2. + */ + Maximized = 1 << 3, + #endif + Minimized = 1 << 4, /**< Minimized window */ Floating = 1 << 5, /**< Window floating above others, top-most */ AutoIconify = 1 << 6, /**< Automatically iconify (minimize) if fullscreen window loses input focus */ From dc41cbbdb28ab8062b5cef48be57e4edd867cf3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 11:15:48 +0200 Subject: [PATCH 226/258] Platform: minor formatting updates. --- src/Magnum/Platform/GlfwApplication.cpp | 38 ++++++------- src/Magnum/Platform/GlfwApplication.h | 74 +++++++++++++------------ 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/src/Magnum/Platform/GlfwApplication.cpp b/src/Magnum/Platform/GlfwApplication.cpp index 5ad36466d..cad349cb0 100644 --- a/src/Magnum/Platform/GlfwApplication.cpp +++ b/src/Magnum/Platform/GlfwApplication.cpp @@ -48,9 +48,9 @@ GlfwApplication::GlfwApplication(const Arguments& arguments, const Configuration createContext(configuration); } -GlfwApplication::GlfwApplication(const Arguments& arguments, std::nullptr_t) - : _context{new Context{NoCreate, arguments.argc, arguments.argv}}, - _needsRedraw(true) +GlfwApplication::GlfwApplication(const Arguments& arguments, std::nullptr_t): + _context{new Context{NoCreate, arguments.argc, arguments.argv}}, + _needsRedraw(true) { /* Save global instance */ _instance = this; @@ -196,20 +196,19 @@ void GlfwApplication::staticErrorCallback(int, const char* description) { Error() << description; } -GlfwApplication::InputEvent::Modifiers GlfwApplication::KeyEvent::getCurrentGlfwModifiers(GLFWwindow* window) { - static_assert(GLFW_PRESS == true && GLFW_RELEASE == false, "GLFW press and release constants do not correspond to bool values."); +auto GlfwApplication::KeyEvent::getCurrentGlfwModifiers(GLFWwindow* window) -> Modifiers { + static_assert(GLFW_PRESS == true && GLFW_RELEASE == false, + "GLFW press and release constants do not correspond to bool values"); - Modifiers mods = (glfwGetKey(window, Int(Key::LeftShift)) || glfwGetKey(window, Int(Key::RightShift))) - ? Modifiers{Modifier::Shift} : Modifiers{}; - if(glfwGetKey(window, Int(Key::LeftAlt)) || glfwGetKey(window, Int(Key::RightAlt))) { + Modifiers mods; + if(glfwGetKey(window, Int(Key::LeftShift)) || glfwGetKey(window, Int(Key::RightShift))) + mods |= Modifier::Shift; + if(glfwGetKey(window, Int(Key::LeftAlt)) || glfwGetKey(window, Int(Key::RightAlt))) mods |= Modifier::Alt; - } - if(glfwGetKey(window, Int(Key::LeftCtrl)) || glfwGetKey(window, Int(Key::RightCtrl))) { + if(glfwGetKey(window, Int(Key::LeftCtrl)) || glfwGetKey(window, Int(Key::RightCtrl))) mods |= Modifier::Ctrl; - } - if(glfwGetKey(window, Int(Key::RightSuper))) { + if(glfwGetKey(window, Int(Key::RightSuper))) mods |= Modifier::AltGr; - } return mods; } @@ -222,13 +221,12 @@ void GlfwApplication::mouseReleaseEvent(MouseEvent&) {} void GlfwApplication::mouseMoveEvent(MouseMoveEvent&) {} void GlfwApplication::mouseScrollEvent(MouseScrollEvent&) {} -GlfwApplication::Configuration::Configuration() - : _title("Magnum GLFW Application"), - _size(800, 600), _sampleCount(0), - _version(Version::None), - _windowFlags(WindowFlag::Focused), - _cursorMode(CursorMode::Normal) -{} +GlfwApplication::Configuration::Configuration(): + _title{"Magnum GLFW Application"}, + _size{800, 600}, _sampleCount{0}, + _version{Version::None}, + _windowFlags{WindowFlag::Focused}, + _cursorMode{CursorMode::Normal} {} GlfwApplication::Configuration::~Configuration() = default; diff --git a/src/Magnum/Platform/GlfwApplication.h b/src/Magnum/Platform/GlfwApplication.h index 6974b3038..fff11ee14 100644 --- a/src/Magnum/Platform/GlfwApplication.h +++ b/src/Magnum/Platform/GlfwApplication.h @@ -49,14 +49,14 @@ namespace Magnum { namespace Platform { Application using GLFW 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, -OS X). It depends on **GLFW** library and is built if `WITH_GLFWAPPLICATION` is -enabled in CMake. +This application library is available on all platforms where GLFW is ported. It +depends on **GLFW** library and is built if `WITH_GLFWAPPLICATION` is enabled +in CMake. ## Bootstrap application -Fully contained base application using @ref GlfwApplication along with -CMake setup is available in `base-glfw` branch of +Fully contained base application using @ref GlfwApplication along with CMake +setup is available in `base-glfw` branch of [Magnum Bootstrap](https://github.com/mosra/magnum-bootstrap) repository, download it as [tar.gz](https://github.com/mosra/magnum-bootstrap/archive/base-glfw.tar.gz) or [zip](https://github.com/mosra/magnum-bootstrap/archive/base-glfw.zip) file. @@ -266,9 +266,7 @@ class GlfwApplication { static GlfwApplication* _instance; GLFWwindow* _window; - std::unique_ptr _context; - bool _needsRedraw; }; @@ -297,8 +295,8 @@ class GlfwApplication::Configuration { NoError = GLFW_CONTEXT_NO_ERROR, #endif - Debug = GLFW_OPENGL_DEBUG_CONTEXT, /**< Debug context */ - Stereo = GLFW_STEREO, /**< Stereo rendering */ + Debug = GLFW_OPENGL_DEBUG_CONTEXT, /**< Debug context */ + Stereo = GLFW_STEREO, /**< Stereo rendering */ }; /** @@ -329,8 +327,14 @@ class GlfwApplication::Configuration { Minimized = 1 << 4, /**< Minimized window */ Floating = 1 << 5, /**< Window floating above others, top-most */ - AutoIconify = 1 << 6, /**< Automatically iconify (minimize) if fullscreen window loses input focus */ - Focused = 1 << 7, /**< Window has input focus */ + + /** + * Automatically iconify (minimize) if fullscreen window loses + * input focus + */ + AutoIconify = 1 << 6, + + Focused = 1 << 7 /**< Window has input focus */ }; /** @@ -343,7 +347,7 @@ class GlfwApplication::Configuration { enum class CursorMode: Int { Normal = GLFW_CURSOR_NORMAL, /**< Visible unconstrained cursor */ Hidden = GLFW_CURSOR_HIDDEN, /**< Hidden cursor */ - Diabled = GLFW_CURSOR_DISABLED, /**< Cursor hidden and locked window */ + Diabled = GLFW_CURSOR_DISABLED /**< Cursor hidden and locked window */ }; /*implicit*/ Configuration(); @@ -501,7 +505,7 @@ class GlfwApplication::InputEvent { Shift = GLFW_MOD_SHIFT, /**< Shift */ Ctrl = GLFW_MOD_CONTROL, /**< Ctrl */ Alt = GLFW_MOD_ALT, /**< Alt */ - AltGr = GLFW_MOD_SUPER, /**< AltGr */ + AltGr = GLFW_MOD_SUPER /**< AltGr */ }; /** @@ -558,25 +562,25 @@ class GlfwApplication::KeyEvent: public GlfwApplication::InputEvent { enum class Key: Int { Unknown = GLFW_KEY_UNKNOWN, /**< Unknown key */ - Up = GLFW_KEY_UP, /**< Up arrow */ - Down = GLFW_KEY_DOWN, /**< Down arrow */ - Left = GLFW_KEY_LEFT, /**< Left arrow */ - Right = GLFW_KEY_RIGHT, /**< Right arrow */ - F1 = GLFW_KEY_F1, /**< F1 */ - F2 = GLFW_KEY_F2, /**< F2 */ - F3 = GLFW_KEY_F3, /**< F3 */ - F4 = GLFW_KEY_F4, /**< F4 */ - F5 = GLFW_KEY_F5, /**< F5 */ - F6 = GLFW_KEY_F6, /**< F6 */ - F7 = GLFW_KEY_F7, /**< F7 */ - F8 = GLFW_KEY_F8, /**< F8 */ - F9 = GLFW_KEY_F9, /**< F9 */ - F10 = GLFW_KEY_F10, /**< F10 */ - F11 = GLFW_KEY_F11, /**< F11 */ - F12 = GLFW_KEY_F12, /**< F12 */ - Home = GLFW_KEY_HOME, /**< Home */ - End = GLFW_KEY_END, /**< End */ - PageUp = GLFW_KEY_PAGE_UP, /**< Page up */ + Up = GLFW_KEY_UP, /**< Up arrow */ + Down = GLFW_KEY_DOWN, /**< Down arrow */ + Left = GLFW_KEY_LEFT, /**< Left arrow */ + Right = GLFW_KEY_RIGHT, /**< Right arrow */ + F1 = GLFW_KEY_F1, /**< F1 */ + F2 = GLFW_KEY_F2, /**< F2 */ + F3 = GLFW_KEY_F3, /**< F3 */ + F4 = GLFW_KEY_F4, /**< F4 */ + F5 = GLFW_KEY_F5, /**< F5 */ + F6 = GLFW_KEY_F6, /**< F6 */ + F7 = GLFW_KEY_F7, /**< F7 */ + F8 = GLFW_KEY_F8, /**< F8 */ + F9 = GLFW_KEY_F9, /**< F9 */ + F10 = GLFW_KEY_F10, /**< F10 */ + F11 = GLFW_KEY_F11, /**< F11 */ + F12 = GLFW_KEY_F12, /**< F12 */ + Home = GLFW_KEY_HOME, /**< Home */ + End = GLFW_KEY_END, /**< End */ + PageUp = GLFW_KEY_PAGE_UP, /**< Page up */ PageDown = GLFW_KEY_PAGE_DOWN, /**< Page down */ Space = ' ', /**< Space */ @@ -664,7 +668,7 @@ class GlfwApplication::KeyEvent: public GlfwApplication::InputEvent { RightCtrl = GLFW_KEY_RIGHT_CONTROL, /**< Right control */ RightAlt = GLFW_KEY_RIGHT_ALT, /**< Right alt */ RightSuper = GLFW_KEY_RIGHT_SUPER, /**< Right super */ - Menu = GLFW_KEY_MENU, /**< Menu */ + Menu = GLFW_KEY_MENU /**< Menu */ }; /** @brief Key */ @@ -710,7 +714,7 @@ class GlfwApplication::MouseEvent: public GlfwApplication::InputEvent { Button8 = GLFW_MOUSE_BUTTON_8, /**< Mouse button 8 */ WheelUp = GLFW_MOUSE_BUTTON_LAST + 1, /**< Mouse wheel up */ - WheelDown = GLFW_MOUSE_BUTTON_LAST + 2, /**< Mouse wheel down */ + WheelDown = GLFW_MOUSE_BUTTON_LAST + 2 /**< Mouse wheel down */ }; /** @brief Button */ @@ -735,7 +739,6 @@ class GlfwApplication::MouseMoveEvent: public GlfwApplication::InputEvent { friend GlfwApplication; public: - /** @brief Position */ constexpr Vector2i position() const { return _position; } @@ -758,7 +761,6 @@ class GlfwApplication::MouseScrollEvent: public GlfwApplication::InputEvent { friend GlfwApplication; public: - /** @brief Scroll offset */ constexpr Vector2d offset() const { return _offset; } From 5061d29926e54cdf7c02d1f92eec9193edbfcee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 11:19:30 +0200 Subject: [PATCH 227/258] Platform: don't set swap inteval implicitly in GlfwApplication. --- src/Magnum/Platform/GlfwApplication.cpp | 5 ++++- src/Magnum/Platform/GlfwApplication.h | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Platform/GlfwApplication.cpp b/src/Magnum/Platform/GlfwApplication.cpp index cad349cb0..9bcd6dbe1 100644 --- a/src/Magnum/Platform/GlfwApplication.cpp +++ b/src/Magnum/Platform/GlfwApplication.cpp @@ -136,7 +136,6 @@ bool GlfwApplication::tryCreateContext(const Configuration& configuration) { glfwSetScrollCallback(_window, staticMouseScrollEvent); glfwMakeContextCurrent(_window); - glfwSwapInterval(1); /* Return true if the initialization succeeds */ return _context->tryCreate(); @@ -147,6 +146,10 @@ GlfwApplication::~GlfwApplication() { glfwTerminate(); } +void GlfwApplication::setSwapInterval(const Int interval) { + glfwSwapInterval(interval); +} + int GlfwApplication::exec() { while(!glfwWindowShouldClose(_window)) { if(_needsRedraw) { diff --git a/src/Magnum/Platform/GlfwApplication.h b/src/Magnum/Platform/GlfwApplication.h index fff11ee14..3315a4185 100644 --- a/src/Magnum/Platform/GlfwApplication.h +++ b/src/Magnum/Platform/GlfwApplication.h @@ -173,6 +173,14 @@ class GlfwApplication { */ void swapBuffers() { glfwSwapBuffers(_window); } + /** + * @brief Set swap interval + * + * Set `0` for no VSync, `1` for enabled VSync. Some platforms support + * `-1` for late swap tearing. Default is driver-dependent. + */ + void setSwapInterval(Int interval); + /** @copydoc Sdl2Application::redraw() */ void redraw() { _needsRedraw = true; } From 5f15ea74e921e9132de93f3acaeec50474afbcfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 11:06:58 +0200 Subject: [PATCH 228/258] package: enable GlfwApplication in development and Jenkins CI packages. --- doc/building.dox | 4 ++-- package/archlinux/PKGBUILD | 3 ++- package/archlinux/PKGBUILD-clang | 3 ++- package/archlinux/PKGBUILD-clang-libc++ | 3 ++- package/archlinux/PKGBUILD-es2desktop | 3 ++- package/archlinux/PKGBUILD-es3desktop | 3 ++- package/archlinux/PKGBUILD-gcc47 | 3 ++- package/archlinux/PKGBUILD-release | 3 ++- package/ci/jenkins-clang-analyzer.xml | 1 + package/ci/jenkins-clang-sanitizer.xml | 1 + package/ci/jenkins.xml | 1 + 11 files changed, 19 insertions(+), 9 deletions(-) diff --git a/doc/building.dox b/doc/building.dox index ccc908569..fc853a21e 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -645,8 +645,8 @@ replace `localhost:8080` with your server name, replace `update-job` with java -jar ~/jenkins-cli.jar -s http://localhost:8080 update-job Magnum-GLTests < package/ci/jenkins-gltests.xml Build is done using **Ninja** build system and everything possible is enabled, -thus you need also **SDL2**, **GLUT** and **OpenAL** libraries. It expects -that **GCC** >= 4.9, 4.8, 4.7 and **Clang** are installed and there +thus you need also **SDL2**, **GLFW**, **GLUT** and **OpenAL** libraries. It +expects that **GCC** >= 4.9, 4.8, 4.7 and **Clang** are installed and there are **OpenGL**, **OpenGL ES 2.0** and **OpenGL ES 3.0** librares as it tries to compile the library with every combination of them. You can add/remove the axes in `axes/hudson.matrix.TextAxis` or via the web interface later. diff --git a/package/archlinux/PKGBUILD b/package/archlinux/PKGBUILD index 802d0e050..428e6bb08 100644 --- a/package/archlinux/PKGBUILD +++ b/package/archlinux/PKGBUILD @@ -6,7 +6,7 @@ pkgdesc="C++11/C++14 and OpenGL 2D/3D graphics engine" arch=('i686' 'x86_64') url="http://mosra.cz/blog/magnum.php" license=('MIT') -depends=('corrade' 'openal' 'freeglut' 'sdl2') +depends=('corrade' 'openal' 'freeglut' 'sdl2' 'glfw') makedepends=('cmake' 'ninja') options=('!strip') provides=('magnum-git') @@ -25,6 +25,7 @@ build() { -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=/usr \ -DWITH_AUDIO=ON \ + -DWITH_GLFWAPPLICATION=ON \ -DWITH_GLUTAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ diff --git a/package/archlinux/PKGBUILD-clang b/package/archlinux/PKGBUILD-clang index 2d8bee6a8..29a127c45 100644 --- a/package/archlinux/PKGBUILD-clang +++ b/package/archlinux/PKGBUILD-clang @@ -6,7 +6,7 @@ pkgdesc="C++11/C++14 and OpenGL 2D/3D graphics engine (built with clang)" arch=('i686' 'x86_64') url="http://mosra.cz/blog/magnum.php" license=('MIT') -depends=('corrade' 'openal' 'freeglut' 'sdl2') +depends=('corrade' 'openal' 'freeglut' 'sdl2' 'glfw') makedepends=('cmake' 'clang' 'ninja') options=('!strip') provides=('magnum-git') @@ -30,6 +30,7 @@ build() { -DCMAKE_INSTALL_PREFIX=/usr \ -DWITH_AUDIO=ON \ -DWITH_GLUTAPPLICATION=ON \ + -DWITH_GLFWAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ -DWITH_WINDOWLESSGLXAPPLICATION=ON \ diff --git a/package/archlinux/PKGBUILD-clang-libc++ b/package/archlinux/PKGBUILD-clang-libc++ index d8aa8f7e0..bcbef4df6 100644 --- a/package/archlinux/PKGBUILD-clang-libc++ +++ b/package/archlinux/PKGBUILD-clang-libc++ @@ -6,7 +6,7 @@ pkgdesc="C++11/C++14 and OpenGL 2D/3D graphics engine (built with clang and libc arch=('i686' 'x86_64') url="http://mosra.cz/blog/magnum.php" license=('MIT') -depends=('corrade' 'openal' 'freeglut' 'sdl2' 'libc++') +depends=('corrade' 'openal' 'freeglut' 'sdl2' 'glfw' 'libc++') makedepends=('cmake' 'clang' 'ninja') options=('!strip') provides=('magnum-git') @@ -31,6 +31,7 @@ build() { -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=/usr \ -DWITH_AUDIO=ON \ + -DWITH_GLFWAPPLICATION=ON \ -DWITH_GLUTAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ diff --git a/package/archlinux/PKGBUILD-es2desktop b/package/archlinux/PKGBUILD-es2desktop index 48db9b46d..6642f10a1 100644 --- a/package/archlinux/PKGBUILD-es2desktop +++ b/package/archlinux/PKGBUILD-es2desktop @@ -6,7 +6,7 @@ pkgdesc="C++11/C++14 and OpenGL 2D/3D graphics engine (desktop OpenGL ES 2.0 ver arch=('i686' 'x86_64') url="http://mosra.cz/blog/magnum.php" license=('MIT') -depends=('corrade' 'openal') +depends=('corrade' 'openal' 'sdl2' 'glfw') makedepends=('cmake' 'ninja') options=('!strip') provides=('magnum-git') @@ -24,6 +24,7 @@ build() { -DTARGET_GLES2=ON \ -DTARGET_DESKTOP_GLES=ON \ -DWITH_AUDIO=ON \ + -DWITH_GLFWAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ -DWITH_XEGLAPPLICATION=ON \ diff --git a/package/archlinux/PKGBUILD-es3desktop b/package/archlinux/PKGBUILD-es3desktop index 1978c0f7a..31e7254ff 100644 --- a/package/archlinux/PKGBUILD-es3desktop +++ b/package/archlinux/PKGBUILD-es3desktop @@ -6,7 +6,7 @@ pkgdesc="C++11/C++14 and OpenGL 2D/3D graphics engine (desktop OpenGL ES 3.0 ver arch=('i686' 'x86_64') url="http://mosra.cz/blog/magnum.php" license=('MIT') -depends=('corrade' 'openal') +depends=('corrade' 'openal' 'sdl2' 'glfw') makedepends=('cmake' 'ninja') options=('!strip') provides=('magnum-git') @@ -24,6 +24,7 @@ build() { -DTARGET_GLES2=OFF \ -DTARGET_DESKTOP_GLES=ON \ -DWITH_AUDIO=ON \ + -DWITH_GLFWAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ -DWITH_XEGLAPPLICATION=ON \ diff --git a/package/archlinux/PKGBUILD-gcc47 b/package/archlinux/PKGBUILD-gcc47 index c77ca4da1..cdb125d4c 100644 --- a/package/archlinux/PKGBUILD-gcc47 +++ b/package/archlinux/PKGBUILD-gcc47 @@ -6,7 +6,7 @@ pkgdesc="C++11/C++14 and OpenGL 2D/3D graphics engine (built with GCC 4.7)" arch=('i686' 'x86_64') url="http://mosra.cz/blog/magnum.php" license=('MIT') -depends=('corrade' 'openal' 'freeglut' 'sdl2') +depends=('corrade' 'openal' 'freeglut' 'sdl2' 'glfw') makedepends=('cmake' 'ninja' 'gcc47') options=('!strip') provides=('magnum-git') @@ -33,6 +33,7 @@ build() { -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=/usr \ -DWITH_AUDIO=ON \ + -DWITH_GLFWAPPLICATION=ON \ -DWITH_GLUTAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ diff --git a/package/archlinux/PKGBUILD-release b/package/archlinux/PKGBUILD-release index adf57f9b5..6886a63fe 100644 --- a/package/archlinux/PKGBUILD-release +++ b/package/archlinux/PKGBUILD-release @@ -6,7 +6,7 @@ pkgdesc="C++11/C++14 and OpenGL 2D/3D graphics engine (debug+release libs)" arch=('i686' 'x86_64') url="http://mosra.cz/blog/magnum.php" license=('MIT') -depends=('corrade' 'openal' 'sdl2' 'freeglut') +depends=('corrade' 'openal' 'freeglut' 'sdl2' 'glfw') makedepends=('cmake' 'ninja') options=('!strip') provides=('magnum-git') @@ -21,6 +21,7 @@ build() { -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=/usr \ -DWITH_AUDIO=ON \ + -DWITH_GLFWAPPLICATION=ON \ -DWITH_GLUTAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ diff --git a/package/ci/jenkins-clang-analyzer.xml b/package/ci/jenkins-clang-analyzer.xml index 09587fe85..24d4f123c 100644 --- a/package/ci/jenkins-clang-analyzer.xml +++ b/package/ci/jenkins-clang-analyzer.xml @@ -108,6 +108,7 @@ scan-build --use-c++=$(which clang++) cmake .. \ -DBUILD_DEPRECATED=${deprecated_build_flag} \ ${gl_flags} \ -DWITH_AUDIO=ON \ + -DWITH_GLFWAPPLICATION=ON \ -DWITH_GLUTAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ diff --git a/package/ci/jenkins-clang-sanitizer.xml b/package/ci/jenkins-clang-sanitizer.xml index a13fe4343..929a225fe 100644 --- a/package/ci/jenkins-clang-sanitizer.xml +++ b/package/ci/jenkins-clang-sanitizer.xml @@ -116,6 +116,7 @@ cmake .. \ -DBUILD_DEPRECATED=${deprecated_build_flag} \ ${gl_flags} \ -DWITH_AUDIO=ON \ + -DWITH_GLFWAPPLICATION=ON \ -DWITH_GLUTAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ diff --git a/package/ci/jenkins.xml b/package/ci/jenkins.xml index d3a88cfa6..4f76bf63e 100644 --- a/package/ci/jenkins.xml +++ b/package/ci/jenkins.xml @@ -141,6 +141,7 @@ cmake .. \ ${static_build_flag} \ ${gl_flags} \ -DWITH_AUDIO=ON \ + -DWITH_GLFWAPPLICATION=ON \ -DWITH_GLUTAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ From d6a5032271f74c23326a5a780cbe4b92593ce012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 11:27:12 +0200 Subject: [PATCH 229/258] package/ci: build GlfwApplication on Travis CI. --- package/ci/travis.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/package/ci/travis.yml b/package/ci/travis.yml index d37a15461..ee35957c0 100644 --- a/package/ci/travis.yml +++ b/package/ci/travis.yml @@ -31,6 +31,8 @@ cache: - $HOME/sdl2 install: +- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then export CXX=g++-4.7; fi - if [ "$TRAVIS_OS_NAME" == "linux" ]; then export PLATFORM_GL_API=GLX; fi - if [ "$TRAVIS_OS_NAME" == "osx" ]; then export PLATFORM_GL_API=CGL; fi @@ -40,6 +42,10 @@ install: - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install sdl2; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ ! -e "$HOME/sdl2/include" ]; then curl -O http://www.libsdl.org/release/SDL2-2.0.4.tar.gz && tar -xzvf SDL2-2.0.4.tar.gz && cd SDL2-2.0.4 && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/sdl2 -DCMAKE_BUILD_TYPE=Release && cmake --build . --target install && cd ../..; fi +# GLFW (cached) +- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install homebrew/versions/glfw3; fi +- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ ! -e "$HOME/glfw/include" ]; then wget https://github.com/glfw/glfw/releases/download/3.1.2/glfw-3.1.2.zip && unzip glfw-3.1.2.zip && cd glfw-3.1.2 && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/glfw -DCMAKE_BUILD_TYPE=Release -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF && cmake --build . --target install && cd ../..; fi + # Corrade - git clone --depth 1 git://github.com/mosra/corrade.git - cd corrade @@ -53,6 +59,6 @@ install: script: - mkdir build && cd build -- cmake .. -DCMAKE_PREFIX_PATH="$HOME/deps;$HOME/sdl2" -DCMAKE_BUILD_TYPE=Release -DWITH_AUDIO=ON -DWITH_SDL2APPLICATION=ON -DWITH_WINDOWLESS${PLATFORM_GL_API}APPLICATION=ON -DWITH_${PLATFORM_GL_API}CONTEXT=ON -DWITH_MAGNUMFONT=ON -DWITH_MAGNUMFONTCONVERTER=ON -DWITH_OBJIMPORTER=ON -DWITH_TGAIMAGECONVERTER=ON -DWITH_TGAIMPORTER=ON -DWITH_WAVAUDIOIMPORTER=ON -DWITH_DISTANCEFIELDCONVERTER=ON -DWITH_FONTCONVERTER=ON -DWITH_MAGNUMINFO=ON -DBUILD_TESTS=ON -DBUILD_GL_TESTS=ON +- cmake .. -DCMAKE_PREFIX_PATH="$HOME/deps;$HOME/sdl2;$HOME/glfw" -DCMAKE_BUILD_TYPE=Release -DWITH_AUDIO=ON -DWITH_GLFWAPPLICATION=ON -DWITH_SDL2APPLICATION=ON -DWITH_WINDOWLESS${PLATFORM_GL_API}APPLICATION=ON -DWITH_${PLATFORM_GL_API}CONTEXT=ON -DWITH_MAGNUMFONT=ON -DWITH_MAGNUMFONTCONVERTER=ON -DWITH_OBJIMPORTER=ON -DWITH_TGAIMAGECONVERTER=ON -DWITH_TGAIMPORTER=ON -DWITH_WAVAUDIOIMPORTER=ON -DWITH_DISTANCEFIELDCONVERTER=ON -DWITH_FONTCONVERTER=ON -DWITH_MAGNUMINFO=ON -DBUILD_TESTS=ON -DBUILD_GL_TESTS=ON - cmake --build . - ctest --output-on-failure -E GLTest From fe36d2cfa891b41eb8270836ba43258f8b6f0556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 11:29:23 +0200 Subject: [PATCH 230/258] package/ci: remove pointless branch restrictions. --- package/ci/appveyor.yml | 3 --- package/ci/travis.yml | 4 ---- 2 files changed, 7 deletions(-) diff --git a/package/ci/appveyor.yml b/package/ci/appveyor.yml index 802cbb4ad..e91939485 100644 --- a/package/ci/appveyor.yml +++ b/package/ci/appveyor.yml @@ -2,9 +2,6 @@ version: '{branch}-{build}' -branches: - only: - - master skip_tags: true shallow_clone: true clone_depth: 1 diff --git a/package/ci/travis.yml b/package/ci/travis.yml index ee35957c0..b49d85c3b 100644 --- a/package/ci/travis.yml +++ b/package/ci/travis.yml @@ -1,9 +1,5 @@ # kate: indent-width 2; -branches: - only: - - master - os: - linux - osx From 092da1ad84104625dda0fc864cffdc4cddaf3eb5 Mon Sep 17 00:00:00 2001 From: Squareys Date: Thu, 21 Apr 2016 12:19:47 +0200 Subject: [PATCH 231/258] ci: Update version of openal download on AppVeyor Signed-off-by: Squareys --- package/ci/appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/ci/appveyor.yml b/package/ci/appveyor.yml index e91939485..84c42ea88 100644 --- a/package/ci/appveyor.yml +++ b/package/ci/appveyor.yml @@ -27,7 +27,7 @@ install: - cinst ninja # OpenAL -- appveyor DownloadFile http://kcat.strangesoft.net/openal-binaries/openal-soft-1.17.0-bin.zip +- appveyor DownloadFile http://kcat.strangesoft.net/openal-binaries/openal-soft-1.17.2-bin.zip - 7z x openal-soft-1.17.0-bin.zip - ren openal-soft-1.17.0-bin openal - ren openal\bin\Win32\soft_oal.dll OpenAL32.dll From 66e17608e619746cbe5f2ff3c170e320648d0ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 10:41:13 +0200 Subject: [PATCH 232/258] Text: introduce font ascent and descent. It required some ABI-incompatible changes so I bumped the font and font converter plugin interface strings to avoid crashes at runtime. --- src/Magnum/Text/AbstractFont.cpp | 30 +++++-- src/Magnum/Text/AbstractFont.h | 83 +++++++++++++++---- src/Magnum/Text/AbstractFontConverter.h | 4 +- src/Magnum/Text/Test/AbstractFontTest.cpp | 2 +- src/Magnum/Text/Test/RendererGLTest.cpp | 6 +- src/MagnumPlugins/MagnumFont/MagnumFont.cpp | 11 ++- src/MagnumPlugins/MagnumFont/MagnumFont.h | 6 +- .../MagnumFont/Test/MagnumFontGLTest.cpp | 2 + src/MagnumPlugins/MagnumFont/Test/font.conf | 2 + .../MagnumFont/pluginRegistration.cpp | 2 +- .../MagnumFontConverter.cpp | 2 + .../Test/MagnumFontConverterGLTest.cpp | 4 +- .../pluginRegistration.cpp | 2 +- 13 files changed, 114 insertions(+), 42 deletions(-) diff --git a/src/Magnum/Text/AbstractFont.cpp b/src/Magnum/Text/AbstractFont.cpp index 19e1893c8..d0cc4fd44 100644 --- a/src/Magnum/Text/AbstractFont.cpp +++ b/src/Magnum/Text/AbstractFont.cpp @@ -45,12 +45,16 @@ bool AbstractFont::openData(const std::vector AbstractFont::doOpenData(const std::vector>>& data, const Float size) { +auto AbstractFont::doOpenData(const std::vector>>& data, const Float size) -> Metrics { CORRADE_ASSERT(!(features() & Feature::MultiFile), "Text::AbstractFont::openData(): feature advertised but not implemented", {}); CORRADE_ASSERT(data.size() == 1, @@ -67,24 +71,32 @@ bool AbstractFont::openSingleData(const Containers::ArrayView data, "Text::AbstractFont::openSingleData(): the format is not single-file", false); close(); - std::tie(_size, _lineHeight) = doOpenSingleData(data, size); - CORRADE_INTERNAL_ASSERT(isOpened() || (_size == 0.0f && _lineHeight == 0.0f)); + const Metrics metrics = doOpenSingleData(data, size); + _size = metrics.size; + _ascent = metrics.ascent; + _descent = metrics.descent; + _lineHeight = metrics.lineHeight; + CORRADE_INTERNAL_ASSERT(isOpened() || (!_size && !_ascent && !_descent && !_lineHeight)); return isOpened(); } -std::pair AbstractFont::doOpenSingleData(Containers::ArrayView, Float) { +auto AbstractFont::doOpenSingleData(Containers::ArrayView, Float) -> Metrics { CORRADE_ASSERT(false, "Text::AbstractFont::openSingleData(): feature advertised but not implemented", {}); return {}; } bool AbstractFont::openFile(const std::string& filename, const Float size) { close(); - std::tie(_size, _lineHeight) = doOpenFile(filename, size); - CORRADE_INTERNAL_ASSERT(isOpened() || (_size == 0.0f && _lineHeight == 0.0f)); + const Metrics metrics = doOpenFile(filename, size); + _size = metrics.size; + _ascent = metrics.ascent; + _descent = metrics.descent; + _lineHeight = metrics.lineHeight; + CORRADE_INTERNAL_ASSERT(isOpened() || (!_size && !_ascent && !_descent && !_lineHeight)); return isOpened(); } -std::pair AbstractFont::doOpenFile(const std::string& filename, const Float size) { +auto AbstractFont::doOpenFile(const std::string& filename, const Float size) -> Metrics { CORRADE_ASSERT(features() & Feature::OpenData && !(features() & Feature::MultiFile), "Text::AbstractFont::openFile(): not implemented", {}); diff --git a/src/Magnum/Text/AbstractFont.h b/src/Magnum/Text/AbstractFont.h index 55ad1487d..3af3f3ddc 100644 --- a/src/Magnum/Text/AbstractFont.h +++ b/src/Magnum/Text/AbstractFont.h @@ -72,10 +72,10 @@ checked by the implementation: - All `do*()` implementations working on opened file are called only if there is any file opened. -Plugin interface string is `"cz.mosra.magnum.Text.AbstractFont/0.2.3"`. +Plugin interface string is `"cz.mosra.magnum.Text.AbstractFont/0.2.4"`. */ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { - CORRADE_PLUGIN_INTERFACE("cz.mosra.magnum.Text.AbstractFont/0.2.3") + CORRADE_PLUGIN_INTERFACE("cz.mosra.magnum.Text.AbstractFont/0.2.4") public: /** @@ -158,16 +158,33 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { /** * @brief Font size * - * Returns scale in which @ref lineHeight() and @ref glyphAdvance() is - * returned. + * Returns scale in which @ref lineHeight(), @ref ascent(), + * @ref descent() and @ref glyphAdvance() is returned. */ Float size() const { return _size; } + /** + * @brief Font ascent + * + * Distance from baseline to top, scaled to font size. Positive value. + * @see @ref size(), @ref descent(), @ref lineHeight() + */ + Float ascent() const { return _ascent; } + + /** + * @brief Font descent + * + * Distance from baseline to bottom, scalled to font size. Negative + * value. + * @see @ref size(), @ref ascent(), @ref lineHeight() + */ + Float descent() const { return _descent; } + /** * @brief Line height * * Returns line height scaled to font size. - * @see @ref size() + * @see @ref size(), @ref ascent(), @ref descent() */ Float lineHeight() const { return _lineHeight; } @@ -225,6 +242,38 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { */ std::unique_ptr layout(const GlyphCache& cache, Float size, const std::string& text); + protected: + /** + * @brief Font metrics + * + * @see @ref doOpenFile(), @ref doOpenData(), @ref doOpenSingleData() + */ + struct Metrics { + /** + * Font size + * @see @ref size() + */ + Float size; + + /** + * Font ascent + * @see @ref ascent() + */ + Float ascent; + + /** + * Font descent + * @see @ref descent() + */ + Float descent; + + /** + * Line height + * @see @ref lineHeight() + */ + Float lineHeight; + }; + #ifdef DOXYGEN_GENERATING_OUTPUT protected: #else @@ -239,29 +288,29 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { /** * @brief Implementation for @ref openData() * - * Return size and line height of opened font on successful opening, - * zeros otherwise. If the plugin doesn't have @ref Feature::MultiFile, + * Return metrics of opened font on successful opening, zeros + * otherwise. If the plugin doesn't have @ref Feature::MultiFile, * default implementation calls @ref doOpenSingleData(). */ - virtual std::pair doOpenData(const std::vector>>& data, Float size); + virtual Metrics doOpenData(const std::vector>>& data, Float size); /** * @brief Implementation for @ref openSingleData() * - * Return size and line height of opened font on successful opening, - * zeros otherwise. + * Return metrics of opened font on successful opening, zeros + * otherwise. */ - virtual std::pair doOpenSingleData(Containers::ArrayView data, Float size); + virtual Metrics doOpenSingleData(Containers::ArrayView data, Float size); /** * @brief Implementation for @ref openFile() * - * Return size and line height of opened font on successful opening, - * zeros otherwise. If @ref Feature::OpenData is supported and the - * plugin doesn't have @ref Feature::MultiFile, default implementation - * opens the file and calls @ref doOpenSingleData() with its contents. + * Return metrics of opened font on successful opening, zeros + * otherwise. If @ref Feature::OpenData is supported and the plugin + * doesn't have @ref Feature::MultiFile, default implementation opens + * the file and calls @ref doOpenSingleData() with its contents. */ - virtual std::pair doOpenFile(const std::string& filename, Float size); + virtual Metrics doOpenFile(const std::string& filename, Float size); /** @brief Implementation for @ref close() */ virtual void doClose() = 0; @@ -289,7 +338,7 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { #ifdef DOXYGEN_GENERATING_OUTPUT private: #endif - Float _size, _lineHeight; + Float _size, _ascent, _descent, _lineHeight; }; CORRADE_ENUMSET_OPERATORS(AbstractFont::Features) diff --git a/src/Magnum/Text/AbstractFontConverter.h b/src/Magnum/Text/AbstractFontConverter.h index 912aa7fca..22c4c264c 100644 --- a/src/Magnum/Text/AbstractFontConverter.h +++ b/src/Magnum/Text/AbstractFontConverter.h @@ -68,10 +68,10 @@ checked by the implementation: - Function `doImport*FromData()` is called only if there is at least one data array passed. -Plugin interface string is `"cz.mosra.magnum.Text.AbstractFontConverter/0.1.1"`. +Plugin interface string is `"cz.mosra.magnum.Text.AbstractFontConverter/0.1.2"`. */ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPlugin { - CORRADE_PLUGIN_INTERFACE("cz.mosra.magnum.Text.AbstractFontConverter/0.1.1") + CORRADE_PLUGIN_INTERFACE("cz.mosra.magnum.Text.AbstractFontConverter/0.1.2") public: /** diff --git a/src/Magnum/Text/Test/AbstractFontTest.cpp b/src/Magnum/Text/Test/AbstractFontTest.cpp index 8601212b2..fbda4f7ce 100644 --- a/src/Magnum/Text/Test/AbstractFontTest.cpp +++ b/src/Magnum/Text/Test/AbstractFontTest.cpp @@ -56,7 +56,7 @@ class SingleDataFont: public Text::AbstractFont { bool doIsOpened() const override { return opened; } void doClose() override {} - std::pair doOpenSingleData(const Containers::ArrayView data, Float) override { + Metrics doOpenSingleData(const Containers::ArrayView data, Float) override { opened = (data.size() == 1 && data[0] == '\xa5'); return {}; } diff --git a/src/Magnum/Text/Test/RendererGLTest.cpp b/src/Magnum/Text/Test/RendererGLTest.cpp index 73dac9db4..51afbc7e7 100644 --- a/src/Magnum/Text/Test/RendererGLTest.cpp +++ b/src/Magnum/Text/Test/RendererGLTest.cpp @@ -344,9 +344,9 @@ void RendererGLTest::multiline() { bool doIsOpened() const override { return _opened; } void doClose() override { _opened = false; } - std::pair doOpenFile(const std::string&, Float) override { + Metrics doOpenFile(const std::string&, Float) override { _opened = true; - return {0.5f, 0.75f}; + return {0.5f, 0.45f, -0.25f, 0.75f}; } UnsignedInt doGlyphId(char32_t) override { return 0; } @@ -370,6 +370,8 @@ void RendererGLTest::multiline() { /* We're rendering text at 2.0f size and the font is scaled to 0.3f, so the line advance should be 0.75f*2.0f/0.5f = 3.0f */ CORRADE_COMPARE(font.size(), 0.5f); + CORRADE_COMPARE(font.ascent(), 0.45f); + CORRADE_COMPARE(font.descent(), -0.25f); CORRADE_COMPARE(font.lineHeight(), 0.75f); /* Bounds */ diff --git a/src/MagnumPlugins/MagnumFont/MagnumFont.cpp b/src/MagnumPlugins/MagnumFont/MagnumFont.cpp index b9e1648fe..6f1bb04e1 100644 --- a/src/MagnumPlugins/MagnumFont/MagnumFont.cpp +++ b/src/MagnumPlugins/MagnumFont/MagnumFont.cpp @@ -68,7 +68,7 @@ auto MagnumFont::doFeatures() const -> Features { return Feature::OpenData|Featu bool MagnumFont::doIsOpened() const { return _opened; } -std::pair MagnumFont::doOpenData(const std::vector>>& data, const Float) { +auto MagnumFont::doOpenData(const std::vector>>& data, const Float) -> Metrics { /* We need just the configuration file and image file */ if(data.size() != 2) { Error() << "Text::MagnumFont::openData(): wanted two files, got" << data.size(); @@ -112,7 +112,7 @@ std::pair MagnumFont::doOpenData(const std::vector MagnumFont::doOpenFile(const std::string& filename, Float) { +auto MagnumFont::doOpenFile(const std::string& filename, Float) -> Metrics { /* Open the configuration file */ Utility::Configuration conf(filename, Utility::Configuration::Flag::ReadOnly|Utility::Configuration::Flag::SkipComments); if(!conf.isValid() || conf.isEmpty()) { @@ -143,7 +143,7 @@ std::pair MagnumFont::doOpenFile(const std::string& filename, Floa return openInternal(std::move(conf), std::move(*image)); } -std::pair MagnumFont::openInternal(Utility::Configuration&& conf, Trade::ImageData2D&& image) { +auto MagnumFont::openInternal(Utility::Configuration&& conf, Trade::ImageData2D&& image) -> Metrics { /* Everything okay, save the data internally */ _opened = new Data{std::move(conf), std::move(image), std::unordered_map{}, {}}; @@ -161,7 +161,10 @@ std::pair MagnumFont::openInternal(Utility::Configuration&& conf, _opened->glyphId.emplace(c->value("unicode"), glyphId); } - return {_opened->conf.value("fontSize"), _opened->conf.value("lineHeight")}; + return {_opened->conf.value("fontSize"), + _opened->conf.value("ascent"), + _opened->conf.value("descent"), + _opened->conf.value("lineHeight")}; } void MagnumFont::doClose() { diff --git a/src/MagnumPlugins/MagnumFont/MagnumFont.h b/src/MagnumPlugins/MagnumFont/MagnumFont.h index ee46d9389..0496e64a3 100644 --- a/src/MagnumPlugins/MagnumFont/MagnumFont.h +++ b/src/MagnumPlugins/MagnumFont/MagnumFont.h @@ -120,9 +120,9 @@ class MagnumFont: public AbstractFont { bool doIsOpened() const override; - std::pair doOpenData(const std::vector>>& data, Float) override; + Metrics doOpenData(const std::vector>>& data, Float) override; - std::pair doOpenFile(const std::string& filename, Float) override; + Metrics doOpenFile(const std::string& filename, Float) override; void doClose() override; @@ -134,7 +134,7 @@ class MagnumFont: public AbstractFont { std::unique_ptr doLayout(const GlyphCache& cache, Float size, const std::string& text) override; - std::pair openInternal(Utility::Configuration&& conf, Trade::ImageData2D&& image); + Metrics openInternal(Utility::Configuration&& conf, Trade::ImageData2D&& image); Data* _opened; }; diff --git a/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp b/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp index 3e6183d99..36226d297 100644 --- a/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp +++ b/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp @@ -52,6 +52,8 @@ void MagnumFontGLTest::properties() { MagnumFont font; CORRADE_VERIFY(font.openFile(Utility::Directory::join(MAGNUMFONT_TEST_DIR, "font.conf"), 0.0f)); CORRADE_COMPARE(font.size(), 16.0f); + CORRADE_COMPARE(font.ascent(), 25.0f); + CORRADE_COMPARE(font.descent(), -10.0f); CORRADE_COMPARE(font.lineHeight(), 39.7333f); CORRADE_COMPARE(font.glyphAdvance(font.glyphId(U'W')), Vector2(23.0f, 0.0f)); } diff --git a/src/MagnumPlugins/MagnumFont/Test/font.conf b/src/MagnumPlugins/MagnumFont/Test/font.conf index 7cf2c7b9b..b305ba032 100644 --- a/src/MagnumPlugins/MagnumFont/Test/font.conf +++ b/src/MagnumPlugins/MagnumFont/Test/font.conf @@ -3,6 +3,8 @@ image=font.tga originalImageSize=1536 1536 padding=24 24 fontSize=16 +ascent=25 +descent=-10 lineHeight=39.7333 [char] unicode=57 diff --git a/src/MagnumPlugins/MagnumFont/pluginRegistration.cpp b/src/MagnumPlugins/MagnumFont/pluginRegistration.cpp index 34c1b92c6..b7c2ccc55 100644 --- a/src/MagnumPlugins/MagnumFont/pluginRegistration.cpp +++ b/src/MagnumPlugins/MagnumFont/pluginRegistration.cpp @@ -26,4 +26,4 @@ #include "MagnumPlugins/MagnumFont/MagnumFont.h" CORRADE_PLUGIN_REGISTER(MagnumFont, Magnum::Text::MagnumFont, - "cz.mosra.magnum.Text.AbstractFont/0.2.3") + "cz.mosra.magnum.Text.AbstractFont/0.2.4") diff --git a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp index 8ec23908f..ff56e2fe5 100644 --- a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp +++ b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp @@ -53,6 +53,8 @@ std::vector>> MagnumFontConverter configuration.setValue("originalImageSize", cache.textureSize()); configuration.setValue("padding", cache.padding()); configuration.setValue("fontSize", font.size()); + configuration.setValue("ascent", font.ascent()); + configuration.setValue("descent", font.descent()); configuration.setValue("lineHeight", font.lineHeight()); /* Compress glyph IDs so the glyphs are in consecutive array, glyph 0 diff --git a/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp b/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp index d98c69f32..6c34c61aa 100644 --- a/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp +++ b/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp @@ -65,9 +65,9 @@ void MagnumFontConverterGLTest::exportFont() { private: void doClose() { _opened = false; } bool doIsOpened() const { return _opened; } - std::pair doOpenFile(const std::string&, Float) { + Metrics doOpenFile(const std::string&, Float) { _opened = true; - return {16.0f, 39.7333f}; + return {16.0f, 25.0f, -10.0f, 39.7333f}; } Features doFeatures() const { return {}; } std::unique_ptr doLayout(const GlyphCache&, Float, const std::string&) { return nullptr; } diff --git a/src/MagnumPlugins/MagnumFontConverter/pluginRegistration.cpp b/src/MagnumPlugins/MagnumFontConverter/pluginRegistration.cpp index b45853467..dfdca3e24 100644 --- a/src/MagnumPlugins/MagnumFontConverter/pluginRegistration.cpp +++ b/src/MagnumPlugins/MagnumFontConverter/pluginRegistration.cpp @@ -26,4 +26,4 @@ #include "MagnumPlugins/MagnumFontConverter/MagnumFontConverter.h" CORRADE_PLUGIN_REGISTER(MagnumFontConverter, Magnum::Text::MagnumFontConverter, - "cz.mosra.magnum.Text.AbstractFontConverter/0.1.1") + "cz.mosra.magnum.Text.AbstractFontConverter/0.1.2") From 44e1851809f48f0b9d74ff2253eec5bda50ba5da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 13:26:35 +0200 Subject: [PATCH 233/258] Updated credits. --- CREDITS.md | 3 ++- src/Magnum/Platform/GlfwApplication.cpp | 1 + src/Magnum/Platform/GlfwApplication.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CREDITS.md b/CREDITS.md index 03ba78a5a..4cf4d5fb1 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -32,7 +32,8 @@ Contributors to Magnum library * [@wivlaro](https://github.com/wivlaro) -- numerous bug reports, Mac OS X fixes, feature improvements * Jonathan Hale ([@Squareys](https://github.com/Squareys)) -- Audio library - enhancements, bug reports, documentation improvements + enhancements, GlfwApplication implementation, bug reports, documentation + improvements * Gerhard de Clercq -- Windows RT (Store/Phone) port Big thanks to everyone involved! diff --git a/src/Magnum/Platform/GlfwApplication.cpp b/src/Magnum/Platform/GlfwApplication.cpp index 9bcd6dbe1..ff2ffddc7 100644 --- a/src/Magnum/Platform/GlfwApplication.cpp +++ b/src/Magnum/Platform/GlfwApplication.cpp @@ -3,6 +3,7 @@ Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš + Copyright © 2016 Jonathan Hale Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/src/Magnum/Platform/GlfwApplication.h b/src/Magnum/Platform/GlfwApplication.h index 3315a4185..cadf55732 100644 --- a/src/Magnum/Platform/GlfwApplication.h +++ b/src/Magnum/Platform/GlfwApplication.h @@ -5,6 +5,7 @@ Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš + Copyright © 2016 Jonathan Hale Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), From ac21a6d53fde34294ab134b3aaa5b5c63661a9e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 13:42:47 +0200 Subject: [PATCH 234/258] package/ci: now it's me who's merging without looking at the diff. Cc: @Squareys ;) --- package/ci/appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/ci/appveyor.yml b/package/ci/appveyor.yml index 84c42ea88..e8efe86fc 100644 --- a/package/ci/appveyor.yml +++ b/package/ci/appveyor.yml @@ -28,8 +28,8 @@ install: # OpenAL - appveyor DownloadFile http://kcat.strangesoft.net/openal-binaries/openal-soft-1.17.2-bin.zip -- 7z x openal-soft-1.17.0-bin.zip -- ren openal-soft-1.17.0-bin openal +- 7z x openal-soft-1.17.2-bin.zip +- ren openal-soft-1.17.2-bin openal - ren openal\bin\Win32\soft_oal.dll OpenAL32.dll - echo [General] > %APPDATA%/alsoft.ini - echo drivers=null >> %APPDATA%/alsoft.ini From 4ed4cf1b563a686694afb64b9e9cefdbef98df87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 13:43:45 +0200 Subject: [PATCH 235/258] external: updated generated GL headers. Just a single bugfix, hah. --- src/MagnumExternal/OpenGL/GL/flextGL.cpp | 2 +- src/MagnumExternal/OpenGL/GL/flextGL.h | 2 +- src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MagnumExternal/OpenGL/GL/flextGL.cpp b/src/MagnumExternal/OpenGL/GL/flextGL.cpp index 1d7a507d8..80f2cfc35 100644 --- a/src/MagnumExternal/OpenGL/GL/flextGL.cpp +++ b/src/MagnumExternal/OpenGL/GL/flextGL.cpp @@ -837,7 +837,7 @@ FLEXTGL_EXPORT void(APIENTRY *flextglBlitNamedFramebuffer)(GLuint, GLuint, GLint FLEXTGL_EXPORT GLenum(APIENTRY *flextglCheckNamedFramebufferStatus)(GLuint, GLenum) = nullptr; FLEXTGL_EXPORT void(APIENTRY *flextglClearNamedBufferData)(GLuint, GLenum, GLenum, GLenum, const void *) = nullptr; FLEXTGL_EXPORT void(APIENTRY *flextglClearNamedBufferSubData)(GLuint, GLenum, GLintptr, GLsizeiptr, GLenum, GLenum, const void *) = nullptr; -FLEXTGL_EXPORT void(APIENTRY *flextglClearNamedFramebufferfi)(GLuint, GLenum, const GLfloat, GLint) = nullptr; +FLEXTGL_EXPORT void(APIENTRY *flextglClearNamedFramebufferfi)(GLuint, GLenum, GLint, GLfloat, GLint) = nullptr; FLEXTGL_EXPORT void(APIENTRY *flextglClearNamedFramebufferfv)(GLuint, GLenum, GLint, const GLfloat *) = nullptr; FLEXTGL_EXPORT void(APIENTRY *flextglClearNamedFramebufferiv)(GLuint, GLenum, GLint, const GLint *) = nullptr; FLEXTGL_EXPORT void(APIENTRY *flextglClearNamedFramebufferuiv)(GLuint, GLenum, GLint, const GLuint *) = nullptr; diff --git a/src/MagnumExternal/OpenGL/GL/flextGL.h b/src/MagnumExternal/OpenGL/GL/flextGL.h index 8771bddfd..e2ad3f517 100644 --- a/src/MagnumExternal/OpenGL/GL/flextGL.h +++ b/src/MagnumExternal/OpenGL/GL/flextGL.h @@ -3458,7 +3458,7 @@ GLAPI FLEXTGL_EXPORT void(APIENTRY *flextglClearNamedBufferData)(GLuint, GLenum, #define glClearNamedBufferData flextglClearNamedBufferData GLAPI FLEXTGL_EXPORT void(APIENTRY *flextglClearNamedBufferSubData)(GLuint, GLenum, GLintptr, GLsizeiptr, GLenum, GLenum, const void *); #define glClearNamedBufferSubData flextglClearNamedBufferSubData -GLAPI FLEXTGL_EXPORT void(APIENTRY *flextglClearNamedFramebufferfi)(GLuint, GLenum, const GLfloat, GLint); +GLAPI FLEXTGL_EXPORT void(APIENTRY *flextglClearNamedFramebufferfi)(GLuint, GLenum, GLint, GLfloat, GLint); #define glClearNamedFramebufferfi flextglClearNamedFramebufferfi GLAPI FLEXTGL_EXPORT void(APIENTRY *flextglClearNamedFramebufferfv)(GLuint, GLenum, GLint, const GLfloat *); #define glClearNamedFramebufferfv flextglClearNamedFramebufferfv diff --git a/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp b/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp index 49c91d3a9..9396c4a2b 100644 --- a/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp +++ b/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp @@ -841,7 +841,7 @@ void flextGLInit() { flextglCheckNamedFramebufferStatus = reinterpret_cast(loader.load("glCheckNamedFramebufferStatus")); flextglClearNamedBufferData = reinterpret_cast(loader.load("glClearNamedBufferData")); flextglClearNamedBufferSubData = reinterpret_cast(loader.load("glClearNamedBufferSubData")); - flextglClearNamedFramebufferfi = reinterpret_cast(loader.load("glClearNamedFramebufferfi")); + flextglClearNamedFramebufferfi = reinterpret_cast(loader.load("glClearNamedFramebufferfi")); flextglClearNamedFramebufferfv = reinterpret_cast(loader.load("glClearNamedFramebufferfv")); flextglClearNamedFramebufferiv = reinterpret_cast(loader.load("glClearNamedFramebufferiv")); flextglClearNamedFramebufferuiv = reinterpret_cast(loader.load("glClearNamedFramebufferuiv")); From aa721781f15b6084585f7fff902784ba52ead3a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 14:00:51 +0200 Subject: [PATCH 236/258] DebugTools: fixed compilation on GLES2. --- src/Magnum/DebugTools/Test/TextureImageGLTest.cpp | 7 ++++++- src/Magnum/DebugTools/TextureImage.cpp | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp index 8184a41b8..72e77136d 100644 --- a/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp +++ b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp @@ -25,7 +25,6 @@ #include -#include "Magnum/BufferImage.h" #include "Magnum/CubeMapTexture.h" #include "Magnum/Image.h" #include "Magnum/PixelFormat.h" @@ -36,6 +35,10 @@ #include "Magnum/Math/Range.h" #include "Magnum/Test/AbstractOpenGLTester.h" +#ifndef MAGNUM_TARGET_GLES2 +#include "Magnum/BufferImage.h" +#endif + namespace Magnum { namespace DebugTools { namespace Test { struct TextureImageGLTest: Magnum::Test::AbstractOpenGLTester { @@ -152,6 +155,7 @@ void TextureImageGLTest::subImageCubeBuffer() { } #endif +#ifndef MAGNUM_TARGET_GLES2 namespace { constexpr UnsignedInt Data2DUInt[] = { 0xcafebabe, 0xdeadbeef, @@ -192,6 +196,7 @@ void TextureImageGLTest::subImage2DFloat() { Containers::ArrayView{Data2DFloat}, TestSuite::Compare::Container); } +#endif }}} diff --git a/src/Magnum/DebugTools/TextureImage.cpp b/src/Magnum/DebugTools/TextureImage.cpp index b77074867..18ec16bd8 100644 --- a/src/Magnum/DebugTools/TextureImage.cpp +++ b/src/Magnum/DebugTools/TextureImage.cpp @@ -25,7 +25,9 @@ #include "TextureImage.h" +#ifndef MAGNUM_TARGET_GLES2 #include "Magnum/BufferImage.h" +#endif #include "Magnum/Context.h" #include "Magnum/Extensions.h" #include "Magnum/Framebuffer.h" @@ -101,7 +103,7 @@ void textureSubImage(Texture2D& texture, const Int level, const Range2Di& range, } #endif - #ifdef MAGNUM_TARGET_GLES + #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_GLES2) if(image.type() == PixelType::Float) { const PixelFormat imageFormat = image.format(); TextureFormat textureFormat; From d2f8821ce7674680feffa0b5c7c802d5cd2e0b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 14:07:18 +0200 Subject: [PATCH 237/258] Implemented KHR_no_error. --- doc/opengl-support.dox | 4 ++-- src/Magnum/Context.cpp | 1 + src/Magnum/Context.h | 7 +++++++ src/Magnum/Platform/GlfwApplication.h | 2 +- src/Magnum/Platform/magnum-info.cpp | 11 ++++++----- src/MagnumExternal/OpenGL/GL/extensions.txt | 1 + src/MagnumExternal/OpenGL/GL/flextGL.h | 4 ++++ src/MagnumExternal/OpenGL/GLES2/extensions.txt | 1 + src/MagnumExternal/OpenGL/GLES2/flextGL.h | 4 ++++ src/MagnumExternal/OpenGL/GLES3/extensions.txt | 1 + src/MagnumExternal/OpenGL/GLES3/flextGL.h | 4 ++++ 11 files changed, 32 insertions(+), 8 deletions(-) diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index f643712ff..c7c997107 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -248,7 +248,7 @@ Extension | Status @extension{ARB,transform_feedback_overflow_query} | | @extension{KHR,blend_equation_advanced} | done @extension3{KHR,blend_equation_advanced_coherent,blend_equation_advanced} | done -@extension{KHR,no_error} | | +@extension{KHR,no_error} | done @subsection opengl-support-extensions-vendor Vendor OpenGL extensions @@ -384,7 +384,7 @@ Extension | Status @es_extension{KHR,robustness} | | @es_extension{KHR,robust_buffer_access_behavior} | done (nothing to do) @es_extension{KHR,context_flush_control} | | -@es_extension2{KHR,no_error,no_error} | | +@es_extension2{KHR,no_error,no_error} | done @es_extension2{NV,read_buffer_front,NV_read_buffer} | done @es_extension2{NV,read_depth,NV_read_depth_stencil} | done @es_extension2{NV,read_stencil,NV_read_depth_stencil} | done diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index aa5cdd51c..b8bf0590e 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/Context.cpp @@ -812,6 +812,7 @@ Debug& operator<<(Debug& debug, const Context::Flag value) { switch(value) { #define _c(value) case Context::Flag::value: return debug << "Context::Flag::" #value; _c(Debug) + _c(NoError) #ifndef MAGNUM_TARGET_GLES _c(RobustAccess) #endif diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index d9821ff92..8ce3b2521 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -136,6 +136,13 @@ class MAGNUM_EXPORT Context { Debug = GL_CONTEXT_FLAG_DEBUG_BIT_KHR, #endif + /** + * Context without error reporting + * @requires_extension Extension @extension{KHR,no_error} + * @requires_es_extension Extension @es_extension2{KHR,no_error,no_error} + */ + NoError = GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR, + #ifndef MAGNUM_TARGET_GLES /** * Context with robust access diff --git a/src/Magnum/Platform/GlfwApplication.h b/src/Magnum/Platform/GlfwApplication.h index cadf55732..573bdbeab 100644 --- a/src/Magnum/Platform/GlfwApplication.h +++ b/src/Magnum/Platform/GlfwApplication.h @@ -290,7 +290,7 @@ class GlfwApplication::Configuration { /** * @brief Context flag * - * @see @ref Flags, @ref setFlags() + * @see @ref Flags, @ref setFlags(), @ref Context::Flag */ enum class Flag: Int { #ifdef GLFW_CONTEXT_NO_ERROR diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index 47c1f5d7b..68cf49f56 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -269,11 +269,12 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat Context& c = Context::current(); Debug() << "Context flags:"; - #ifndef MAGNUM_TARGET_GLES - for(const auto flag: {Context::Flag::Debug, Context::Flag::RobustAccess}) - #else - for(const auto flag: {Context::Flag::Debug}) - #endif + for(const auto flag: {Context::Flag::Debug, + Context::Flag::NoError, + #ifndef MAGNUM_TARGET_GLES + Context::Flag::RobustAccess + #endif + }) if(c.flags() & flag) Debug() << " " << flag; Debug() << "Supported GLSL versions:"; diff --git a/src/MagnumExternal/OpenGL/GL/extensions.txt b/src/MagnumExternal/OpenGL/GL/extensions.txt index 035c3e478..82b268d8b 100644 --- a/src/MagnumExternal/OpenGL/GL/extensions.txt +++ b/src/MagnumExternal/OpenGL/GL/extensions.txt @@ -33,3 +33,4 @@ extension KHR_texture_compression_astc_ldr optional extension KHR_texture_compression_astc_hdr optional extension KHR_blend_equation_advanced optional extension KHR_blend_equation_advanced_coherent optional +extension KHR_no_error optional diff --git a/src/MagnumExternal/OpenGL/GL/flextGL.h b/src/MagnumExternal/OpenGL/GL/flextGL.h index e2ad3f517..92148bc94 100644 --- a/src/MagnumExternal/OpenGL/GL/flextGL.h +++ b/src/MagnumExternal/OpenGL/GL/flextGL.h @@ -1749,6 +1749,10 @@ typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum #define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 +/* GL_KHR_no_error */ + +#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 + /* Function prototypes */ /* GL_ARB_bindless_texture */ diff --git a/src/MagnumExternal/OpenGL/GLES2/extensions.txt b/src/MagnumExternal/OpenGL/GLES2/extensions.txt index 7fdaedd20..c3b32ba19 100644 --- a/src/MagnumExternal/OpenGL/GLES2/extensions.txt +++ b/src/MagnumExternal/OpenGL/GLES2/extensions.txt @@ -74,6 +74,7 @@ extension KHR_blend_equation_advanced_coherent optional extension KHR_robustness optional extension KHR_robust_buffer_access_behavior optional extension KHR_context_flush_control optional +extension KHR_no_error optional extension NV_read_buffer_front optional extension NV_read_depth optional extension NV_read_stencil optional diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGL.h b/src/MagnumExternal/OpenGL/GLES2/flextGL.h index b7162711e..9c0a50d28 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGL.h +++ b/src/MagnumExternal/OpenGL/GLES2/flextGL.h @@ -981,6 +981,10 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x82FC #define GL_NONE 0 +/* GL_KHR_no_error */ + +#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 + /* GL_NV_texture_border_clamp */ #define GL_TEXTURE_BORDER_COLOR_NV 0x1004 diff --git a/src/MagnumExternal/OpenGL/GLES3/extensions.txt b/src/MagnumExternal/OpenGL/GLES3/extensions.txt index f07c7bb94..5e7d2760a 100644 --- a/src/MagnumExternal/OpenGL/GLES3/extensions.txt +++ b/src/MagnumExternal/OpenGL/GLES3/extensions.txt @@ -36,6 +36,7 @@ extension KHR_blend_equation_advanced_coherent optional extension KHR_robustness optional extension KHR_robust_buffer_access_behavior optional extension KHR_context_flush_control optional +extension KHR_no_error optional extension NV_read_buffer_front optional extension NV_read_depth optional extension NV_read_stencil optional diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGL.h b/src/MagnumExternal/OpenGL/GLES3/flextGL.h index 53fc2d6a5..1286c46dc 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGL.h +++ b/src/MagnumExternal/OpenGL/GLES3/flextGL.h @@ -1280,6 +1280,10 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x82FC #define GL_NONE 0 +/* GL_KHR_no_error */ + +#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 + /* GL_NV_texture_border_clamp */ #define GL_TEXTURE_BORDER_COLOR_NV 0x1004 From 0dbd8a2f8f450d3d72e6f5fb084d18e38a78dfdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 15:28:12 +0200 Subject: [PATCH 238/258] Platform: doc++. Also fixed a minor typo in enum name. --- src/Magnum/Platform/GlfwApplication.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Platform/GlfwApplication.h b/src/Magnum/Platform/GlfwApplication.h index 573bdbeab..3b9dd98b6 100644 --- a/src/Magnum/Platform/GlfwApplication.h +++ b/src/Magnum/Platform/GlfwApplication.h @@ -353,10 +353,16 @@ class GlfwApplication::Configuration { */ typedef Containers::EnumSet WindowFlags; + /** @brief Cursor mode */ enum class CursorMode: Int { - Normal = GLFW_CURSOR_NORMAL, /**< Visible unconstrained cursor */ - Hidden = GLFW_CURSOR_HIDDEN, /**< Hidden cursor */ - Diabled = GLFW_CURSOR_DISABLED /**< Cursor hidden and locked window */ + /** Visible unconstrained cursor */ + Normal = GLFW_CURSOR_NORMAL, + + /** Hidden cursor */ + Hidden = GLFW_CURSOR_HIDDEN, + + /** Cursor hidden and locked window */ + Disabled = GLFW_CURSOR_DISABLED }; /*implicit*/ Configuration(); @@ -426,7 +432,7 @@ class GlfwApplication::Configuration { } /** - * @brief Set cursor flags + * @brief Set cursor mode * @return Reference to self (for method chaining) * * Default is @ref CursorMode::Normal. From 889171303e7a5fe02b9ef8b3a67054516e070b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 15:31:27 +0200 Subject: [PATCH 239/258] Mark EXT_shader_framebuffer_fetch as semi-supported. --- doc/opengl-support.dox | 6 +++--- src/MagnumExternal/OpenGL/GLES2/extensions.txt | 3 +++ src/MagnumExternal/OpenGL/GLES2/flextGL.h | 9 +++++++++ src/MagnumExternal/OpenGL/GLES3/extensions.txt | 3 +++ src/MagnumExternal/OpenGL/GLES3/flextGL.h | 9 +++++++++ 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index c7c997107..2e90d25e8 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -348,8 +348,8 @@ Extension | Status ------------------------------------------- | ------ @es_extension{ANDROID,extension_pack_es31a} | done (nothing to do) @es_extension{APPLE,texture_format_BGRA8888} | done -@es_extension{ARM,shader_framebuffer_fetch} | | -@es_extension{ARM,shader_framebuffer_fetch_depth_stencil} | | +@es_extension{ARM,shader_framebuffer_fetch} | missing renderer setup and limit query +@es_extension{ARM,shader_framebuffer_fetch_depth_stencil} | done (shading language only) @es_extension{CHROMIUM,map_sub} (NaCl only) | only buffer mapping @es_extension{EXT,texture_filter_anisotropic} | done @es_extension{EXT,texture_format_BGRA8888} | done @@ -360,7 +360,7 @@ Extension | Status @es_extension{EXT,separate_shader_objects} | only direct uniform binding @es_extension{EXT,multisampled_render_to_texture} | only renderbuffer storage @es_extension{EXT,robustness} | done -@es_extension{EXT,shader_framebuffer_fetch} | | +@es_extension{EXT,shader_framebuffer_fetch} | missing limit query @es_extension{EXT,disjoint_timer_query} | only time elapsed query @es_extension{EXT,texture_sRGB_decode} | done @es_extension{EXT,sRGB_write_control} | done diff --git a/src/MagnumExternal/OpenGL/GLES2/extensions.txt b/src/MagnumExternal/OpenGL/GLES2/extensions.txt index c3b32ba19..9abbd3b66 100644 --- a/src/MagnumExternal/OpenGL/GLES2/extensions.txt +++ b/src/MagnumExternal/OpenGL/GLES2/extensions.txt @@ -51,12 +51,15 @@ extension OES_required_internalformat optional extension OES_surfaceless_context optional extension APPLE_texture_format_BGRA8888 optional +extension ARM_shader_framebuffer_fetch optional +extension ARM_shader_framebuffer_fetch_depth_stencil optional extension EXT_texture_filter_anisotropic optional extension EXT_texture_format_BGRA8888 optional extension EXT_read_format_bgra optional extension EXT_multi_draw_arrays optional extension EXT_debug_label optional extension EXT_debug_marker optional +extension EXT_shader_framebuffer_fetch optional extension EXT_disjoint_timer_query optional extension EXT_texture_sRGB_decode optional extension EXT_sRGB_write_control optional diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGL.h b/src/MagnumExternal/OpenGL/GLES2/flextGL.h index 9c0a50d28..606c85332 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGL.h +++ b/src/MagnumExternal/OpenGL/GLES2/flextGL.h @@ -720,6 +720,11 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_BGRA_EXT 0x80E1 #define GL_BGRA8_EXT 0x93A1 +/* GL_ARM_shader_framebuffer_fetch */ + +#define GL_FETCH_PER_SAMPLE_ARM 0x8F65 +#define GL_FRAGMENT_SHADER_FRAMEBUFFER_FETCH_MRT_ARM 0x8F66 + /* GL_EXT_texture_filter_anisotropic */ #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE @@ -746,6 +751,10 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_SAMPLER 0x82E6 #define GL_TRANSFORM_FEEDBACK 0x8E22 +/* GL_EXT_shader_framebuffer_fetch */ + +#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 + /* GL_EXT_disjoint_timer_query */ #define GL_QUERY_COUNTER_BITS_EXT 0x8864 diff --git a/src/MagnumExternal/OpenGL/GLES3/extensions.txt b/src/MagnumExternal/OpenGL/GLES3/extensions.txt index 5e7d2760a..8b56b0b6a 100644 --- a/src/MagnumExternal/OpenGL/GLES3/extensions.txt +++ b/src/MagnumExternal/OpenGL/GLES3/extensions.txt @@ -4,12 +4,15 @@ version 3.1 es extension ANDROID_extension_pack_es31a optional extension APPLE_texture_format_BGRA8888 optional +extension ARM_shader_framebuffer_fetch optional +extension ARM_shader_framebuffer_fetch_depth_stencil optional extension EXT_texture_filter_anisotropic optional extension EXT_texture_format_BGRA8888 optional extension EXT_read_format_bgra optional extension EXT_multi_draw_arrays optional extension EXT_debug_label optional extension EXT_debug_marker optional +extension EXT_shader_framebuffer_fetch optional extension EXT_disjoint_timer_query optional extension EXT_texture_sRGB_decode optional extension EXT_sRGB_write_control optional diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGL.h b/src/MagnumExternal/OpenGL/GLES3/flextGL.h index 1286c46dc..865dfd90c 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGL.h +++ b/src/MagnumExternal/OpenGL/GLES3/flextGL.h @@ -900,6 +900,11 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_BGRA_EXT 0x80E1 #define GL_BGRA8_EXT 0x93A1 +/* GL_ARM_shader_framebuffer_fetch */ + +#define GL_FETCH_PER_SAMPLE_ARM 0x8F65 +#define GL_FRAGMENT_SHADER_FRAMEBUFFER_FETCH_MRT_ARM 0x8F66 + /* GL_EXT_texture_filter_anisotropic */ #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE @@ -926,6 +931,10 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_SAMPLER 0x82E6 #define GL_TRANSFORM_FEEDBACK 0x8E22 +/* GL_EXT_shader_framebuffer_fetch */ + +#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 + /* GL_EXT_disjoint_timer_query */ #define GL_QUERY_COUNTER_BITS_EXT 0x8864 From 0078f7a03545e9e29cfadf5adb8f22881ebf0f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 16:44:15 +0200 Subject: [PATCH 240/258] Platform: fix Sdl2Application build on Emscripten. --- src/Magnum/Platform/Sdl2Application.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index be5db2211..08c128ffc 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -252,9 +252,13 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { /* Destroy everything also when the Magnum context creation fails */ if(!_context->tryCreate()) { + #ifndef CORRADE_TARGET_EMSCRIPTEN SDL_GL_DeleteContext(_glContext); SDL_DestroyWindow(_window); _window = nullptr; + #else + SDL_FreeSurface(_glContext); + #endif return false; } From 082e02a013624f75e6ada736c5760fded2eb2a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 16:44:49 +0200 Subject: [PATCH 241/258] Platform: minor code reordering. --- src/Magnum/Platform/Sdl2Application.cpp | 2 +- src/Magnum/Platform/Sdl2Application.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 08c128ffc..37012a120 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -32,8 +32,8 @@ #include #endif -#include "Magnum/Platform/Context.h" #include "Magnum/Version.h" +#include "Magnum/Platform/Context.h" #include "Magnum/Platform/ScreenedApplication.hpp" namespace Magnum { namespace Platform { diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index 0086aafa2..d98d488b8 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -897,6 +897,9 @@ class Sdl2Application::InputEvent { /** @brief Moving is not allowed */ InputEvent& operator=(InputEvent&&) = delete; + /** @brief Whether the event is accepted */ + constexpr bool isAccepted() const { return _accepted; } + /** * @brief Set event as accepted * @@ -907,9 +910,6 @@ class Sdl2Application::InputEvent { */ void setAccepted(bool accepted = true) { _accepted = accepted; } - /** @brief Whether the event is accepted */ - constexpr bool isAccepted() const { return _accepted; } - #ifndef DOXYGEN_GENERATING_OUTPUT protected: constexpr explicit InputEvent(): _accepted(false) {} From 1398ffd24c8e684ac9c464c26bdf86cbb8cc76e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 16:45:06 +0200 Subject: [PATCH 242/258] Platform: text input support for Sdl2Application. --- src/Magnum/Platform/Sdl2Application.cpp | 32 +++++ src/Magnum/Platform/Sdl2Application.h | 166 ++++++++++++++++++++++++ 2 files changed, 198 insertions(+) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 37012a120..0e8a1dcea 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -33,6 +33,7 @@ #endif #include "Magnum/Version.h" +#include "Magnum/Math/Range.h" #include "Magnum/Platform/Context.h" #include "Magnum/Platform/ScreenedApplication.hpp" @@ -383,6 +384,18 @@ void Sdl2Application::mainLoop() { break; } + #ifndef CORRADE_TARGET_EMSCRIPTEN + case SDL_TEXTINPUT: { + TextInputEvent e{event.text.text}; + textInputEvent(e); + } break; + + case SDL_TEXTEDITING: { + TextEditingEvent e{event.edit.text, event.edit.start, event.edit.length}; + textEditingEvent(e); + } break; + #endif + case SDL_QUIT: #ifndef CORRADE_TARGET_EMSCRIPTEN _flags |= Flag::Exit; @@ -438,6 +451,20 @@ void Sdl2Application::setMouseLocked(bool enabled) { #endif } +#ifndef CORRADE_TARGET_EMSCRIPTEN +void Sdl2Application::startTextInput(const Range2Di& rect) { + SDL_StartTextInput(); + if(!rect.size().isZero()) { + SDL_Rect r{rect.min().x(), rect.min().y(), rect.sizeX(), rect.sizeY()}; + SDL_SetTextInputRect(&r); + } +} + +void Sdl2Application::startTextInput() { + startTextInput({}); +} +#endif + void Sdl2Application::tickEvent() { /* If this got called, the tick event is not implemented by user and thus we don't need to call it ever again */ @@ -451,6 +478,11 @@ void Sdl2Application::mousePressEvent(MouseEvent&) {} void Sdl2Application::mouseReleaseEvent(MouseEvent&) {} void Sdl2Application::mouseMoveEvent(MouseMoveEvent&) {} +#ifndef CORRADE_TARGET_EMSCRIPTEN +void Sdl2Application::textInputEvent(TextInputEvent&) {} +void Sdl2Application::textEditingEvent(TextEditingEvent&) {} +#endif + Sdl2Application::Configuration::Configuration(): #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_IOS) _title("Magnum SDL2 Application"), diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index d98d488b8..714e607ea 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -330,6 +330,10 @@ class Sdl2Application { class KeyEvent; class MouseEvent; class MouseMoveEvent; + #ifndef CORRADE_TARGET_EMSCRIPTEN + class TextInputEvent; + class TextEditingEvent; + #endif /** * @brief Default constructor @@ -571,6 +575,69 @@ class Sdl2Application { /*@}*/ + #ifndef CORRADE_TARGET_EMSCRIPTEN + /** @{ @name Text input handling */ + public: + /** + * @brief Whether text input is active + * + * If text input is active, text input events go to @ref textInputEvent() + * and @ref textEditingEvent(). + * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". + * @see @ref startTextInput(), @ref stopTextInput() + */ + bool isTextInputActive() { return SDL_IsTextInputActive(); } + + /** + * @brief Start text input + * + * Starts text input that will go to @ref textInputEvent() and + * @ref textEditingEvent(). The @p rect defines an area where the text + * is being displayed, for example to hint the system where to place + * on-screen keyboard. Ignored if empty. + * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". + * @see @ref stopTextInput(), @ref isTextInputActive(), + */ + #ifdef DOXYGEN_GENERATING_OUTPUT + void startTextInput(const Range2Di& rect = {}); + #else + /* To avoid including the type in header */ + void startTextInput(const Range2Di& rect); + void startTextInput(); + #endif + + /** + * @brief Stop text input + * + * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". + * @see @ref startTextInput(), @ref isTextInputActive(), @ref textInputEvent() + * @ref textEditingEvent() + */ + void stopTextInput() { SDL_StopTextInput(); } + + #ifdef DOXYGEN_GENERATING_OUTPUT + protected: + #else + private: + #endif + /** + * @brief Text input event + * + * Called when text input is active and the text is being input. + * @see @ref isTextInputActive() + */ + virtual void textInputEvent(TextInputEvent& event); + + /** + * @brief Text editing event + * + * Called when text input is active and the text is being edited. + */ + virtual void textEditingEvent(TextEditingEvent& event); + + /*@}*/ + #endif + private: enum class Flag: UnsignedByte { Redraw = 1 << 0, @@ -1123,6 +1190,105 @@ class Sdl2Application::MouseMoveEvent: public Sdl2Application::InputEvent { Modifiers _modifiers; }; +#ifndef CORRADE_TARGET_EMSCRIPTEN +/** +@brief Text input event + +@note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". +@see @ref TextEditingEvent, @ref textInputEvent() +*/ +class Sdl2Application::TextInputEvent { + friend Sdl2Application; + + public: + /** @brief Copying is not allowed */ + TextInputEvent(const TextInputEvent&) = delete; + + /** @brief Moving is not allowed */ + TextInputEvent(TextInputEvent&&) = delete; + + /** @brief Copying is not allowed */ + TextInputEvent& operator=(const TextInputEvent&) = delete; + + /** @brief Moving is not allowed */ + TextInputEvent& operator=(TextInputEvent&&) = delete; + + /** @brief Whether the event is accepted */ + constexpr bool isAccepted() const { return _accepted; } + + /** + * @brief Set event as accepted + * + * If the event is ignored (i.e., not set as accepted), it might be + * propagated elsewhere, for example to another screen when using + * @ref BasicScreenedApplication "ScreenedApplication". By default is + * each event ignored and thus propagated. + */ + void setAccepted(bool accepted = true) { _accepted = accepted; } + + /** @brief Input text in UTF-8 */ + constexpr Containers::ArrayView text() const { return _text; } + + private: + constexpr TextInputEvent(Containers::ArrayView text): _text{text} {} + + Containers::ArrayView _text; + bool _accepted; +}; + +/** +@brief Text editing event + +@note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". +@see @ref textEditingEvent() +*/ +class Sdl2Application::TextEditingEvent { + friend Sdl2Application; + + public: + /** @brief Copying is not allowed */ + TextEditingEvent(const TextEditingEvent&) = delete; + + /** @brief Moving is not allowed */ + TextEditingEvent(TextEditingEvent&&) = delete; + + /** @brief Copying is not allowed */ + TextEditingEvent& operator=(const TextEditingEvent&) = delete; + + /** @brief Moving is not allowed */ + TextEditingEvent& operator=(TextEditingEvent&&) = delete; + + /** @brief Whether the event is accepted */ + constexpr bool isAccepted() const { return _accepted; } + + /** + * @brief Set event as accepted + * + * If the event is ignored (i.e., not set as accepted), it might be + * propagated elsewhere, for example to another screen when using + * @ref BasicScreenedApplication "ScreenedApplication". By default is + * each event ignored and thus propagated. + */ + void setAccepted(bool accepted = true) { _accepted = accepted; } + + /** @brief Input text in UTF-8 */ + constexpr Containers::ArrayView text() const { return _text; } + + /** @brief Location to begin editing from */ + constexpr Int start() const { return _start; } + + /** @brief Number of characters to edit from the start point */ + constexpr Int length() const { return _length; } + + private: + constexpr TextEditingEvent(Containers::ArrayView text, Int start, Int length): _text{text}, _start{start}, _length{length} {} + + Containers::ArrayView _text; + Int _start, _length; + bool _accepted; +}; +#endif + /** @hideinitializer @brief Entry point for SDL2-based applications @param className Class name From dce3880d134e4f21c58de0270f7bbc60f66750fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 16:46:14 +0200 Subject: [PATCH 243/258] Math: default-constructed Color4 should have zero alpha. Makes more sense than fully opaque black. On the other hand, creating Color4 from Color3 or separate RGB components still sets alpha to one, because that's the intuitive behavior. --- src/Magnum/Math/Color.h | 5 ++--- src/Magnum/Math/Test/ColorTest.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Math/Color.h b/src/Magnum/Math/Color.h index 98a96311d..963cfb34e 100644 --- a/src/Magnum/Math/Color.h +++ b/src/Magnum/Math/Color.h @@ -445,10 +445,9 @@ class Color4: public Vector4 { /** * @brief Default constructor * - * RGB components are set to zero, A component is set to `1.0` for - * floating-point types and maximum positive value for integral types. + * All components are set to zero. */ - constexpr /*implicit*/ Color4(): Vector4(T(0), T(0), T(0), Implementation::fullChannel()) {} + constexpr /*implicit*/ Color4(): Vector4(T(0), T(0), T(0), T(0)) {} /** @copydoc Vector::Vector(ZeroInitT) */ constexpr explicit Color4(ZeroInitT) diff --git a/src/Magnum/Math/Test/ColorTest.cpp b/src/Magnum/Math/Test/ColorTest.cpp index 5da2518aa..32f3cbc65 100644 --- a/src/Magnum/Math/Test/ColorTest.cpp +++ b/src/Magnum/Math/Test/ColorTest.cpp @@ -125,7 +125,7 @@ void ColorTest::constructDefault() { constexpr Color4 b; constexpr Color4ub c; - CORRADE_COMPARE(b, Color4(0.0f, 0.0f, 0.0f, 1.0f)); + CORRADE_COMPARE(b, Color4(0.0f, 0.0f, 0.0f, 0.0f)); CORRADE_COMPARE(c, Color4ub(0, 0, 0, 255)); } From d3b18e145b207af2044fb6f04191f9654e1123ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 17:05:18 +0200 Subject: [PATCH 244/258] Platform: oops, committed too fast. --- src/Magnum/Platform/Sdl2Application.cpp | 4 ++-- src/Magnum/Platform/Sdl2Application.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 0e8a1dcea..18c14eb4e 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -386,12 +386,12 @@ void Sdl2Application::mainLoop() { #ifndef CORRADE_TARGET_EMSCRIPTEN case SDL_TEXTINPUT: { - TextInputEvent e{event.text.text}; + TextInputEvent e{{event.text.text, std::strlen(event.text.text)}}; textInputEvent(e); } break; case SDL_TEXTEDITING: { - TextEditingEvent e{event.edit.text, event.edit.start, event.edit.length}; + TextEditingEvent e{{event.edit.text, std::strlen(event.text.text)}, event.edit.start, event.edit.length}; textEditingEvent(e); } break; #endif diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index 714e607ea..38e92bd52 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -31,6 +31,7 @@ #include #include +#include #include #include "Magnum/Magnum.h" @@ -1230,7 +1231,7 @@ class Sdl2Application::TextInputEvent { constexpr Containers::ArrayView text() const { return _text; } private: - constexpr TextInputEvent(Containers::ArrayView text): _text{text} {} + constexpr TextInputEvent(Containers::ArrayView text): _text{text}, _accepted{false} {} Containers::ArrayView _text; bool _accepted; @@ -1281,7 +1282,7 @@ class Sdl2Application::TextEditingEvent { constexpr Int length() const { return _length; } private: - constexpr TextEditingEvent(Containers::ArrayView text, Int start, Int length): _text{text}, _start{start}, _length{length} {} + constexpr TextEditingEvent(Containers::ArrayView text, Int start, Int length): _text{text}, _start{start}, _length{length}, _accepted{false} {} Containers::ArrayView _text; Int _start, _length; From fc489ff457d4229e000bfba13291ae431cc90c25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 17:06:30 +0200 Subject: [PATCH 245/258] Math: oops, part 2. --- src/Magnum/Math/Test/ColorTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/Math/Test/ColorTest.cpp b/src/Magnum/Math/Test/ColorTest.cpp index 32f3cbc65..f393416c1 100644 --- a/src/Magnum/Math/Test/ColorTest.cpp +++ b/src/Magnum/Math/Test/ColorTest.cpp @@ -126,7 +126,7 @@ void ColorTest::constructDefault() { constexpr Color4 b; constexpr Color4ub c; CORRADE_COMPARE(b, Color4(0.0f, 0.0f, 0.0f, 0.0f)); - CORRADE_COMPARE(c, Color4ub(0, 0, 0, 255)); + CORRADE_COMPARE(c, Color4ub(0, 0, 0, 0)); } void ColorTest::constructZero() { From 774481b682d56faa3aeff527312c9b582a800566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 17:38:25 +0200 Subject: [PATCH 246/258] Platform: MOAR keys in Sdl2Application. And reordered GlfwApplication key enum to be consistent with the rest. --- src/Magnum/Platform/GlfwApplication.h | 22 ++++++++++++---------- src/Magnum/Platform/Sdl2Application.h | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/Magnum/Platform/GlfwApplication.h b/src/Magnum/Platform/GlfwApplication.h index 3b9dd98b6..77e82bf72 100644 --- a/src/Magnum/Platform/GlfwApplication.h +++ b/src/Magnum/Platform/GlfwApplication.h @@ -577,10 +577,21 @@ class GlfwApplication::KeyEvent: public GlfwApplication::InputEvent { enum class Key: Int { Unknown = GLFW_KEY_UNKNOWN, /**< Unknown key */ + Enter = GLFW_KEY_ENTER, /**< Enter */ + Esc = GLFW_KEY_ESCAPE, /**< Escape */ + Up = GLFW_KEY_UP, /**< Up arrow */ Down = GLFW_KEY_DOWN, /**< Down arrow */ Left = GLFW_KEY_LEFT, /**< Left arrow */ Right = GLFW_KEY_RIGHT, /**< Right arrow */ + Home = GLFW_KEY_HOME, /**< Home */ + End = GLFW_KEY_END, /**< End */ + PageUp = GLFW_KEY_PAGE_UP, /**< Page up */ + PageDown = GLFW_KEY_PAGE_DOWN, /**< Page down */ + Backspace = GLFW_KEY_BACKSPACE, /**< Backspace */ + Insert = GLFW_KEY_INSERT, /**< Insert */ + Delete = GLFW_KEY_DELETE, /**< Delete */ + F1 = GLFW_KEY_F1, /**< F1 */ F2 = GLFW_KEY_F2, /**< F2 */ F3 = GLFW_KEY_F3, /**< F3 */ @@ -593,12 +604,9 @@ class GlfwApplication::KeyEvent: public GlfwApplication::InputEvent { F10 = GLFW_KEY_F10, /**< F10 */ F11 = GLFW_KEY_F11, /**< F11 */ F12 = GLFW_KEY_F12, /**< F12 */ - Home = GLFW_KEY_HOME, /**< Home */ - End = GLFW_KEY_END, /**< End */ - PageUp = GLFW_KEY_PAGE_UP, /**< Page up */ - PageDown = GLFW_KEY_PAGE_DOWN, /**< Page down */ Space = ' ', /**< Space */ + Tab = '\t', /**< Tab */ Comma = ',', /**< Comma */ Period = '.', /**< Period */ Minus = '-', /**< Minus */ @@ -647,12 +655,6 @@ class GlfwApplication::KeyEvent: public GlfwApplication::InputEvent { Z = 'z', /**< Letter Z */ /* Function keys */ - Esc = GLFW_KEY_ESCAPE, /**< Escape */ - Enter = GLFW_KEY_ENTER, /**< Enter */ - Tab = GLFW_KEY_TAB, /**< Tab */ - Backspace = GLFW_KEY_BACKSPACE, /**< Backspace */ - Insert = GLFW_KEY_INSERT, /**< Insert */ - Delete = GLFW_KEY_DELETE, /**< Delete */ CapsLock = GLFW_KEY_CAPS_LOCK, /**< Caps lock */ ScrollLock = GLFW_KEY_SCROLL_LOCK, /**< Scroll lock */ NumLock = GLFW_KEY_NUM_LOCK, /**< Num lock */ diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index 38e92bd52..ea14d4a76 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -1004,6 +1004,8 @@ class Sdl2Application::KeyEvent: public Sdl2Application::InputEvent { * @see @ref key() */ enum class Key: SDL_Keycode { + Unknown = SDLK_UNKNOWN, /**< Unknown key */ + Enter = SDLK_RETURN, /**< Enter */ Esc = SDLK_ESCAPE, /**< Escape */ @@ -1011,6 +1013,14 @@ class Sdl2Application::KeyEvent: public Sdl2Application::InputEvent { Down = SDLK_DOWN, /**< Down arrow */ Left = SDLK_LEFT, /**< Left arrow */ Right = SDLK_RIGHT, /**< Right arrow */ + Home = SDLK_HOME, /**< Home */ + End = SDLK_END, /**< End */ + PageUp = SDLK_PAGEUP, /**< Page up */ + PageDown = SDLK_PAGEDOWN, /**< Page down */ + Backspace = SDLK_BACKSPACE, /**< Backspace */ + Insert = SDLK_INSERT, /**< Insert */ + Delete = SDLK_DELETE, /**< Delete */ + F1 = SDLK_F1, /**< F1 */ F2 = SDLK_F2, /**< F2 */ F3 = SDLK_F3, /**< F3 */ @@ -1023,18 +1033,16 @@ class Sdl2Application::KeyEvent: public Sdl2Application::InputEvent { F10 = SDLK_F10, /**< F10 */ F11 = SDLK_F11, /**< F11 */ F12 = SDLK_F12, /**< F12 */ - Home = SDLK_HOME, /**< Home */ - End = SDLK_END, /**< End */ - PageUp = SDLK_PAGEUP, /**< Page up */ - PageDown = SDLK_PAGEDOWN, /**< Page down */ Space = SDLK_SPACE, /**< Space */ + Tab = SDLK_TAB, /**< Tab */ Comma = SDLK_COMMA, /**< Comma */ Period = SDLK_PERIOD, /**< Period */ Minus = SDLK_MINUS, /**< Minus */ Plus = SDLK_PLUS, /**< Plus */ Slash = SDLK_SLASH, /**< Slash */ Percent = SDLK_PERCENT, /**< Percent */ + Semicolon = SDLK_SEMICOLON, /**< Semicolon */ Equal = SDLK_EQUALS, /**< Equal */ Zero = SDLK_0, /**< Zero */ From 6255fc1d012f5f3321f9c29619975004f5a6b3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Apr 2016 00:15:48 +0200 Subject: [PATCH 247/258] doc: fix old documentation about default Color4 having full alpha. --- doc/matrix-vector.dox | 19 ++++++++----------- doc/types.dox | 3 ++- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/doc/matrix-vector.dox b/doc/matrix-vector.dox index a35cece4e..70e629b48 100644 --- a/doc/matrix-vector.dox +++ b/doc/matrix-vector.dox @@ -56,29 +56,26 @@ most specialized type known to make subsequent operations more convenient -- columns of RectangularMatrix are returned as Vector, but when accessing columns of e.g. Matrix3, they are returned as Vector3. -There are also even more specialized subclasses, e.g. @ref Color3 and -@ref Color4 for color handling and conversion. +There are also even more specialized subclasses, e.g. @ref Math::Color3 and +@ref Math::Color4 for color handling and conversion. Commonly used types have convenience aliases in @ref Magnum namespace, so you -can write e.g. `Vector3i` instead of `Math::Vector3`. See @ref types and -namespace documentation for more information. +can write e.g. @ref Vector3i instead of @ref Math::Vector3 "Math::Vector3". +See @ref types and namespace documentation for more information. @section matrix-vector-construction Constructing matrices and vectors Default constructors of @ref Math::RectangularMatrix and @ref Math::Vector (and -@ref Math::Vector2, @ref Math::Vector3, @ref Math::Vector4, @ref Color3) create -zero-filled objects. @ref Math::Matrix (and @ref Math::Matrix3, @ref Math::Matrix4) -is by default constructed as identity matrix. @ref Color4 has alpha value set -to opaque. +@ref Math::Vector2, @ref Math::Vector3, @ref Math::Vector4, @ref Math::Color3, +@ref Math::Color4) create zero-filled objects. @ref Math::Matrix (and +@ref Math::Matrix3, @ref Math::Matrix4) is by default constructed as identity +matrix. @code Matrix2x3 a; // zero-filled Vector3i b; // zero-filled Matrix3 identity; // diagonal set to 1 Matrix3 zero(Matrix::Zero); // zero-filled - -Color4 black1; // {0.0f, 0.0f, 0.0f, 1.0f} -Color4ub black2; // {0, 0, 0, 255} @endcode Most common and most efficient way to create vector is to pass all values to diff --git a/doc/types.dox b/doc/types.dox index 0c750a0a2..71d0df520 100644 --- a/doc/types.dox +++ b/doc/types.dox @@ -87,7 +87,8 @@ underlying type. | @ref Matrix4x3 or @ref Matrix4x3d | `mat4x3` or `dmat4x3` | Any super- or sub-class of the same size and underlying type can be used -equivalently (e.g. @ref Math::Vector or @ref Color3 instead of @ref Vector3). +equivalently (e.g. @ref Math::Vector "Math::Vector" or @ref Color3 +instead of @ref Vector3). @section types-binary Binary representation From 5d2cec9e1ce0c2469e93710bb9e2caf6ad3c6aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Apr 2016 00:16:20 +0200 Subject: [PATCH 248/258] Doc++ --- doc/namespaces.dox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/namespaces.dox b/doc/namespaces.dox index a6af136b4..b8e993080 100644 --- a/doc/namespaces.dox +++ b/doc/namespaces.dox @@ -24,7 +24,7 @@ */ /** @dir magnum/src/Magnum - * @brief Namespace @ref Magnum (part of @ref building "Magnum library") + * @brief Namespace @ref Magnum (part of @ref building "Magnum library"), @ref Magnum::Extensions */ /** @namespace Magnum @brief Root namespace From 3da4870aa07ca665995e1a02777a65e084cbefe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Apr 2016 00:30:44 +0200 Subject: [PATCH 249/258] Math: minor cleanup. --- src/Magnum/Math/Test/DualQuaternionTest.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Magnum/Math/Test/DualQuaternionTest.cpp b/src/Magnum/Math/Test/DualQuaternionTest.cpp index 6bc0ab916..a5106ba22 100644 --- a/src/Magnum/Math/Test/DualQuaternionTest.cpp +++ b/src/Magnum/Math/Test/DualQuaternionTest.cpp @@ -410,7 +410,6 @@ void DualQuaternionTest::debug() { } void DualQuaternionTest::sclerp() { - const DualQuaternion from = DualQuaternion::translation(Vector3{20.0f, .0f, .0f})*DualQuaternion::rotation(180.0_degf, Vector3{.0f, 1.0f, .0f}); const DualQuaternion to = DualQuaternion::translation(Vector3{42.0f, 42.0f, 42.0f})*DualQuaternion::rotation(75.0_degf, Vector3{1.0f, .0f, .0f}); From 52f2d297ca9e29920f8fab4cedb33c2e7648e628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Apr 2016 00:17:26 +0200 Subject: [PATCH 250/258] Math: put angle literals into dedicated Literals namespace. Similarly as it is done in STL for C++14 literals, the user has to explicitly put them to scope with `using` keyword to avoid accidental collisions. If MAGNUM_BUILD_DEPRECATED is set, they are still brought to the root namespace, but that will be removed in a future release. --- doc/namespaces.dox | 11 ++++++++- doc/types.dox | 5 +++- src/Magnum/Audio/Test/SourceTest.cpp | 2 ++ src/Magnum/Magnum.h | 27 ++++++++++++--------- src/Magnum/Math/Angle.h | 18 +++++++++++--- src/Magnum/Math/Test/AngleTest.cpp | 2 ++ src/Magnum/Math/Test/DualQuaternionTest.cpp | 2 ++ src/Magnum/Math/Test/DualTest.cpp | 2 ++ src/Magnum/Trade/CameraData.h | 2 +- 9 files changed, 53 insertions(+), 18 deletions(-) diff --git a/doc/namespaces.dox b/doc/namespaces.dox index b8e993080..0964b018d 100644 --- a/doc/namespaces.dox +++ b/doc/namespaces.dox @@ -54,7 +54,7 @@ information. */ /** @dir Magnum/Math - * @brief Namespace @ref Magnum::Math + * @brief Namespace @ref Magnum::Math, @ref Magnum::Math::Literals */ /** @namespace Magnum::Math @brief Math library @@ -65,6 +65,15 @@ This library is built as part of Magnum by default. To use it, you need to find `Magnum` package and link to `Magnum::Magnum` target. See @ref building, @ref cmake, @ref matrix-vector and @ref transformations for more information. */ +/** @namespace Magnum::Math::Literals +@brief Math literals + +Literals for easy construction of angle and color values. + +This library is built as part of Magnum by default. To use it, you need to +find `Magnum` package and link to `Magnum::Magnum` target. See @ref building +and @ref cmake for more information. +*/ /** @dir Magnum/Math/Algorithms * @brief Namespace @ref Magnum::Math::Algorithms diff --git a/doc/types.dox b/doc/types.dox index 71d0df520..c510c8b2c 100644 --- a/doc/types.dox +++ b/doc/types.dox @@ -117,8 +117,11 @@ usability impact in practice. These classes are *not* implicitly constructible or convertible from/to @ref Float or @ref Double, you have to either construct/convert them explicitly -or use custom `_degf`/`_deg` and `_radf`/`_rad` literals: +or use custom `_degf`/`_deg` and `_radf`/`_rad` literals that are provided in +the @ref Math::Literals namespace: @code +using namespace Math::Literals; + //Deg a = 60.0f // error, no implicit conversion from Float Deg a = 60.0_degf; // okay diff --git a/src/Magnum/Audio/Test/SourceTest.cpp b/src/Magnum/Audio/Test/SourceTest.cpp index a6a2e6316..563d66c52 100644 --- a/src/Magnum/Audio/Test/SourceTest.cpp +++ b/src/Magnum/Audio/Test/SourceTest.cpp @@ -144,6 +144,8 @@ void SourceTest::minGain() { } void SourceTest::coneAnglesAndGain() { + using namespace Math::Literals; + Source source; constexpr auto outerAngle = 12.0_degf; constexpr auto innerAngle = 21.0_degf; diff --git a/src/Magnum/Magnum.h b/src/Magnum/Magnum.h index 45e1dd5df..ad4cc9ed4 100644 --- a/src/Magnum/Magnum.h +++ b/src/Magnum/Magnum.h @@ -48,12 +48,16 @@ namespace Math { #ifndef DOXYGEN_GENERATING_OUTPUT template struct Constants; - #ifndef MAGNUM_TARGET_GLES - constexpr Rad operator "" _rad(long double); - constexpr Deg operator "" _deg(long double); - #endif - constexpr Rad operator "" _radf(long double); - constexpr Deg operator "" _degf(long double); + #ifdef MAGNUM_BUILD_DEPRECATED + namespace Literals { + #ifndef MAGNUM_TARGET_GLES + constexpr Rad operator "" _rad(long double); + constexpr Deg operator "" _deg(long double); + #endif + constexpr Rad operator "" _radf(long double); + constexpr Deg operator "" _degf(long double); + #endif + } #endif } @@ -434,13 +438,14 @@ typedef Math::Range3D Range3Dd; /*@}*/ #endif -/* Using angle literals from Math namespace */ +#ifdef MAGNUM_BUILD_DEPRECATED #ifndef MAGNUM_TARGET_GLES -using Math::operator "" _deg; -using Math::operator "" _rad; +using Math::Literals::operator "" _deg; +using Math::Literals::operator "" _rad; +#endif +using Math::Literals::operator "" _degf; +using Math::Literals::operator "" _radf; #endif -using Math::operator "" _degf; -using Math::operator "" _radf; /* Forward declarations for all types in root namespace */ diff --git a/src/Magnum/Math/Angle.h b/src/Magnum/Math/Angle.h index b6a0e3a8d..c5d40cdf4 100644 --- a/src/Magnum/Math/Angle.h +++ b/src/Magnum/Math/Angle.h @@ -49,6 +49,8 @@ conversion less error-prone. You can enter the value either by using literal: @code +using namespace Literals; + auto degrees = 60.0_degf; // type is Deg auto radians = 1.047_rad; // type is Rad @endcode @@ -151,8 +153,10 @@ template class Deg: public Unit { constexpr /*implicit*/ Deg(Unit value); }; +namespace Literals { + #ifndef MAGNUM_TARGET_GLES -/** @relatesalso Deg +/** @relatesalso Magnum::Math::Deg @brief Double-precision degree value literal Example usage: @@ -166,7 +170,7 @@ Double cosine = Math::cos(1.047_rad); // cosine = 0.5 constexpr Deg operator "" _deg(long double value) { return Deg(Double(value)); } #endif -/** @relatesalso Deg +/** @relatesalso Magnum::Math::Deg @brief Single-precision degree value literal Example usage: @@ -178,6 +182,8 @@ Float tangent = Math::tan(1.047_radf); // tangent = 1.732f */ constexpr Deg operator "" _degf(long double value) { return Deg(Float(value)); } +} + /** @brief Angle in radians @@ -214,8 +220,10 @@ template class Rad: public Unit { constexpr /*implicit*/ Rad(Unit value); }; +namespace Literals { + #ifndef MAGNUM_TARGET_GLES -/** @relatesalso Rad +/** @relatesalso Magnum::Math::Rad @brief Double-precision radian value literal See @link operator""_deg() @endlink for more information. @@ -225,7 +233,7 @@ See @link operator""_deg() @endlink for more information. constexpr Rad operator "" _rad(long double value) { return Rad(Double(value)); } #endif -/** @relatesalso Rad +/** @relatesalso Magnum::Math::Rad @brief Single-precision radian value literal See @link operator""_degf() @endlink for more information. @@ -233,6 +241,8 @@ See @link operator""_degf() @endlink for more information. */ constexpr Rad operator "" _radf(long double value) { return Rad(Float(value)); } +} + template constexpr Deg::Deg(Unit value): Unit(T(180)*T(value)/Math::Constants::pi()) {} template constexpr Rad::Rad(Unit value): Unit(T(value)*Math::Constants::pi()/T(180)) {} diff --git a/src/Magnum/Math/Test/AngleTest.cpp b/src/Magnum/Math/Test/AngleTest.cpp index 764ee8d3c..43843e70a 100644 --- a/src/Magnum/Math/Test/AngleTest.cpp +++ b/src/Magnum/Math/Test/AngleTest.cpp @@ -121,6 +121,8 @@ void AngleTest::constructNoInit() { } void AngleTest::literals() { + using namespace Literals; + #ifndef MAGNUM_TARGET_GLES constexpr auto a = 25.0_deg; CORRADE_VERIFY((std::is_same::value)); diff --git a/src/Magnum/Math/Test/DualQuaternionTest.cpp b/src/Magnum/Math/Test/DualQuaternionTest.cpp index a5106ba22..7d8884026 100644 --- a/src/Magnum/Math/Test/DualQuaternionTest.cpp +++ b/src/Magnum/Math/Test/DualQuaternionTest.cpp @@ -101,6 +101,8 @@ typedef Math::DualQuaternion DualQuaternion; typedef Math::Quaternion Quaternion; typedef Math::Vector3 Vector3; +using namespace Literals; + DualQuaternionTest::DualQuaternionTest() { addTests({&DualQuaternionTest::construct, &DualQuaternionTest::constructVectorScalar, diff --git a/src/Magnum/Math/Test/DualTest.cpp b/src/Magnum/Math/Test/DualTest.cpp index 8eeb4aae8..c99cebcbf 100644 --- a/src/Magnum/Math/Test/DualTest.cpp +++ b/src/Magnum/Math/Test/DualTest.cpp @@ -67,6 +67,8 @@ typedef Math::Deg Deg; typedef Math::Rad Rad; typedef Math::Constants Constants; +using namespace Literals; + DualTest::DualTest() { addTests({&DualTest::construct, &DualTest::constructDefault, diff --git a/src/Magnum/Trade/CameraData.h b/src/Magnum/Trade/CameraData.h index e56f45eaa..7daa4acd2 100644 --- a/src/Magnum/Trade/CameraData.h +++ b/src/Magnum/Trade/CameraData.h @@ -77,7 +77,7 @@ class CameraData { }; inline CameraData::CameraData(const Rad fov, const Float near, const Float far, const void* const importerState) noexcept: - _fov{fov != fov ? Rad{35.0_degf} : fov}, + _fov{fov != fov ? Rad{Deg{35.0f}} : fov}, _near{near != near ? 0.01f : near}, _far{far != far ? 100.0f : far}, _importerState{importerState} {} From c5f64c2663dd08b81bebe42539e82557e887d58b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Apr 2016 00:30:18 +0200 Subject: [PATCH 251/258] Math: 8-bit and float RGB and RGBA literals. Shiny! --- doc/matrix-vector.dox | 32 +++++++++++++++ src/Magnum/Math/Color.h | 62 +++++++++++++++++++++++++++++- src/Magnum/Math/Test/ColorTest.cpp | 20 ++++++++++ 3 files changed, 112 insertions(+), 2 deletions(-) diff --git a/doc/matrix-vector.dox b/doc/matrix-vector.dox index 70e629b48..fef01297e 100644 --- a/doc/matrix-vector.dox +++ b/doc/matrix-vector.dox @@ -98,6 +98,14 @@ Vector3i fill(10); // {10, 10, 10} auto diag2 = Matrix3::fromDiagonal({3.0f, 2.0f, 1.0f}); @endcode +There are also shortcuts to create a vector with all but one component set to +zero or one, useful for transformations: +@code +auto x = Vector3::xAxis(); // {1.0f, 0.0f, 0.0f} +auto y = Vector2::yAxis(3.0f); // {0.0f, 3.0f} +auto z = Vector3::zScale(3.0f); // {1.0f, 1.0f, 3.0f} +@endcode + It is possible to create matrices from other matrices and vectors with the same row count; vectors from vector and scalar: @code @@ -121,6 +129,30 @@ Math::Matrix2x3::from(mat) *= 2; // mat == { 4, 8, 12, 2, 6, 10 } Note that, unlike constructors, this function has no way to check whether the array is long enough to contain all elements, so use with caution. +To make handling of colors easier, their behavior is a bit different with a +richer feature set. Implicit construction of @ref Color4 from @ref Color3 will +set the alpha to full value (thus `1.0f` for @ref Color4 and `255` for +@ref Color4ub): +@code +Color4 a = Color3{0.2f, 0.7f, 0.5f}; // {0.2f, 0.7f, 0.5f, 1.0f} +Color4ub b = Color3ub{0x33, 0xb2, 0x7f}; // {0x33, 0xb2, 0x7f, 0xff} +@endcode + +Similarly to axes in vectors, you can create single color shades too, or create +a RGB color from HSV representation: +@code +auto green = Color3::green(); // {0.0f, 1.0f, 0.0f} +auto cyan = Color4::cyan(0.5f, 0.95f); // {0.5f, 1.0f, 1.0f, 0.95f} +auto fadedRed = Color3::fromHSV(219.0_degf, 0.50f, 0.57f) +@endcode + +Lastly, namespace @ref Math::Literals provides convenient `_rgb`/`_rgbf` and +`_rgba`/`_rgbaf` literals for entering colors in hex representation: +@code +Color3ub a = 0x33b27f_rgb; // {0x33, 0xb2, 0x7f} +Color4 b = 0x33b27fcc_rgbaf; // {0.2f, 0.7f, 0.5f, 0.8f} +@endcode + @section matrix-vector-component-access Accessing matrix and vector components Column vectors of matrices and vector components can be accessed using square diff --git a/src/Magnum/Math/Color.h b/src/Magnum/Math/Color.h index 963cfb34e..137ccc121 100644 --- a/src/Magnum/Math/Color.h +++ b/src/Magnum/Math/Color.h @@ -151,7 +151,8 @@ Conversion from and to HSV is done always using floating-point types, so hue is always in range in range @f$ [0.0, 360.0] @f$, saturation and value in range @f$ [0.0, 1.0] @f$. -@see @ref Color4, @ref Magnum::Color3, @ref Magnum::Color3ub +@see @link operator""_rgb() @endlink, @link operator""_rgbf() @endlink, + @ref Color4, @ref Magnum::Color3, @ref Magnum::Color3ub */ /* Not using template specialization because some internal functions are impossible to explicitly instantiate */ @@ -352,7 +353,8 @@ MAGNUM_VECTORn_OPERATOR_IMPLEMENTATION(3, Color3) @brief Four-component (RGBA) color See @ref Color3 for more information. -@see @ref Magnum::Color4, @ref Magnum::Color4ub +@see @link operator""_rgba() @endlink, @link operator""_rgbaf() @endlink, + @ref Magnum::Color4, @ref Magnum::Color4ub */ /* Not using template specialization because some internal functions are impossible to explicitly instantiate */ @@ -532,6 +534,62 @@ class Color4: public Vector4 { MAGNUM_VECTORn_OPERATOR_IMPLEMENTATION(4, Color4) #endif +namespace Literals { + +/** @relatesalso Magnum::Math::Color3 +@brief 8bit-per-channel RGB literal + +Example usage: +@code +Color3ub a = 0x33b27f_rgb; // {0x33, 0xb2, 0x7f} +@endcode +@see @link operator""_rgba() @endlink, @link operator""_rgbf() @endlink +*/ +constexpr Color3 operator "" _rgb(unsigned long long value) { + return {UnsignedByte(value >> 16), UnsignedByte(value >> 8), UnsignedByte(value)}; +} + +/** @relatesalso Magnum::Math::Color4 +@brief 8bit-per-channel RGBA literal + +Example usage: +@code +Color4ub a = 0x33b27fcc_rgba; // {0x33, 0xb2, 0x7f, 0xcc} +@endcode +@see @link operator""_rgb() @endlink, @link operator""_rgbaf() @endlink +*/ +constexpr Color4 operator "" _rgba(unsigned long long value) { + return {UnsignedByte(value >> 24), UnsignedByte(value >> 16), UnsignedByte(value >> 8), UnsignedByte(value)}; +} + +/** @relatesalso Magnum::Math::Color3 +@brief Float RGB literal + +Example usage: +@code +Color3 a = 0x33b27f_rgbf; // {0.2f, 0.7f, 0.5f} +@endcode +@see @link operator""_rgbaf() @endlink, @link operator""_rgb() @endlink +*/ +inline Color3 operator "" _rgbf(unsigned long long value) { + return Math::normalize>(Color3{UnsignedByte(value >> 16), UnsignedByte(value >> 8), UnsignedByte(value)}); +} + +/** @relatesalso Magnum::Math::Color4 +@brief Float RGBA literal + +Example usage: +@code +Color4 a = 0x33b27fcc_rgbaf; // {0.2f, 0.7f, 0.5f, 0.8f} +@endcode +@see @link operator""_rgbf() @endlink, @link operator""_rgbaf() @endlink +*/ +inline Color4 operator "" _rgbaf(unsigned long long value) { + return Math::normalize>(Color4{UnsignedByte(value >> 24), UnsignedByte(value >> 16), UnsignedByte(value >> 8), UnsignedByte(value)}); +} + +} + /** @debugoperator{Magnum::Math::Color3} */ template inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Color3& value) { return debug << static_cast&>(value); diff --git a/src/Magnum/Math/Test/ColorTest.cpp b/src/Magnum/Math/Test/ColorTest.cpp index f393416c1..378f8d567 100644 --- a/src/Magnum/Math/Test/ColorTest.cpp +++ b/src/Magnum/Math/Test/ColorTest.cpp @@ -44,6 +44,8 @@ struct ColorTest: Corrade::TestSuite::Tester { void constructNormalization(); void constructCopy(); + void literals(); + void colors(); void fromHue(); @@ -73,6 +75,8 @@ typedef Math::Color4 Color4ub; typedef Math::Deg Deg; +using namespace Literals; + ColorTest::ColorTest() { addTests({&ColorTest::construct, &ColorTest::constructDefault, @@ -84,6 +88,8 @@ ColorTest::ColorTest() { &ColorTest::constructNormalization, &ColorTest::constructCopy, + &ColorTest::literals, + &ColorTest::colors, &ColorTest::fromHue, @@ -217,6 +223,20 @@ void ColorTest::constructCopy() { CORRADE_COMPARE(d, Color4(1.0f, 0.5f, 0.75f, 0.25f)); } +void ColorTest::literals() { + using namespace Literals; + + constexpr Color3ub a = 0x33b27f_rgb; + CORRADE_COMPARE(a, (Color3ub{0x33, 0xb2, 0x7f})); + + constexpr Color4ub b = 0x33b27fcc_rgba; + CORRADE_COMPARE(b, (Color4ub{0x33, 0xb2, 0x7f, 0xcc})); + + /* Not constexpr yet */ + CORRADE_COMPARE(0x33b27f_rgbf, (Color3{0.2f, 0.7f, 0.5f})); + CORRADE_COMPARE(0x33b27fcc_rgbaf, (Color4{0.2f, 0.7f, 0.5f, 0.8f})); +} + void ColorTest::colors() { CORRADE_COMPARE(Color3ub::red(75), Color3ub(75, 0, 0)); CORRADE_COMPARE(Color3ub::green(75), Color3ub(0, 75, 0)); From 62176eac1eab86c70d551a2d1c466d29dfad427e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Apr 2016 00:43:40 +0200 Subject: [PATCH 252/258] Math: oh I screwed up again! I blame my Python calculator :P --- src/Magnum/Math/Test/ColorTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Math/Test/ColorTest.cpp b/src/Magnum/Math/Test/ColorTest.cpp index 378f8d567..8140b757a 100644 --- a/src/Magnum/Math/Test/ColorTest.cpp +++ b/src/Magnum/Math/Test/ColorTest.cpp @@ -233,8 +233,8 @@ void ColorTest::literals() { CORRADE_COMPARE(b, (Color4ub{0x33, 0xb2, 0x7f, 0xcc})); /* Not constexpr yet */ - CORRADE_COMPARE(0x33b27f_rgbf, (Color3{0.2f, 0.7f, 0.5f})); - CORRADE_COMPARE(0x33b27fcc_rgbaf, (Color4{0.2f, 0.7f, 0.5f, 0.8f})); + CORRADE_COMPARE(0x33b27f_rgbf, (Color3{0.2, 0.698039f, 0.498039f})); + CORRADE_COMPARE(0x33b27fcc_rgbaf, (Color4{0.2, 0.698039f, 0.498039f, 0.8f})); } void ColorTest::colors() { From 683fd63416949541b39d44a022883c6d0b123f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Apr 2016 23:53:52 +0200 Subject: [PATCH 253/258] Fix build on ES. :( --- src/Magnum/Magnum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/Magnum.h b/src/Magnum/Magnum.h index ad4cc9ed4..a55936625 100644 --- a/src/Magnum/Magnum.h +++ b/src/Magnum/Magnum.h @@ -56,9 +56,9 @@ namespace Math { #endif constexpr Rad operator "" _radf(long double); constexpr Deg operator "" _degf(long double); - #endif } #endif + #endif } /* Bring whole Corrade namespace */ From 8d3fb52a7f67921c33afd62ee27396a9b8c3ab6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 25 Apr 2016 11:11:23 +0200 Subject: [PATCH 254/258] Platform: split text input rect setup into separate function. * It might change during the text editing process and thus we need to reposition it. * And it's also not possible to connect a parameter-less signal to it on Clang, which is unfortunate. --- src/Magnum/Platform/Sdl2Application.cpp | 13 +++---------- src/Magnum/Platform/Sdl2Application.h | 21 +++++++++++---------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 18c14eb4e..70c2f00ea 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -452,16 +452,9 @@ void Sdl2Application::setMouseLocked(bool enabled) { } #ifndef CORRADE_TARGET_EMSCRIPTEN -void Sdl2Application::startTextInput(const Range2Di& rect) { - SDL_StartTextInput(); - if(!rect.size().isZero()) { - SDL_Rect r{rect.min().x(), rect.min().y(), rect.sizeX(), rect.sizeY()}; - SDL_SetTextInputRect(&r); - } -} - -void Sdl2Application::startTextInput() { - startTextInput({}); +void Sdl2Application::setTextInputRect(const Range2Di& rect) { + SDL_Rect r{rect.min().x(), rect.min().y(), rect.sizeX(), rect.sizeY()}; + SDL_SetTextInputRect(&r); } #endif diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index ea14d4a76..a04f63102 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -593,19 +593,12 @@ class Sdl2Application { * @brief Start text input * * Starts text input that will go to @ref textInputEvent() and - * @ref textEditingEvent(). The @p rect defines an area where the text - * is being displayed, for example to hint the system where to place - * on-screen keyboard. Ignored if empty. + * @ref textEditingEvent(). * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". * @see @ref stopTextInput(), @ref isTextInputActive(), + * @ref setTextInputRect() */ - #ifdef DOXYGEN_GENERATING_OUTPUT - void startTextInput(const Range2Di& rect = {}); - #else - /* To avoid including the type in header */ - void startTextInput(const Range2Di& rect); - void startTextInput(); - #endif + void startTextInput() { SDL_StartTextInput(); } /** * @brief Stop text input @@ -616,6 +609,14 @@ class Sdl2Application { */ void stopTextInput() { SDL_StopTextInput(); } + /** + * @brief Set text input rectangle + * + * The @p rect defines an area where the text is being displayed, for + * example to hint the system where to place on-screen keyboard. + */ + void setTextInputRect(const Range2Di& rect); + #ifdef DOXYGEN_GENERATING_OUTPUT protected: #else From a4fbea42d0ddf8c7ba4325a93ce88e1680360b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 25 Apr 2016 11:36:13 +0200 Subject: [PATCH 255/258] Math: proper implementation of Vector::isZero() for integers. The thing is: * Doing std::abs() and comparing to some epsilon value is crazy thing to do with integers. * When using unsigned integers, Clang rightfully complained that calling std::abs() on these is a sign of insanity. This fixes it too. --- src/Magnum/Math/Test/VectorTest.cpp | 14 +++++++++++--- src/Magnum/Math/TypeTraits.h | 6 ------ src/Magnum/Math/Vector.h | 16 +++++++++++++++- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/Magnum/Math/Test/VectorTest.cpp b/src/Magnum/Math/Test/VectorTest.cpp index 5ce3e22a1..64c6ec747 100644 --- a/src/Magnum/Math/Test/VectorTest.cpp +++ b/src/Magnum/Math/Test/VectorTest.cpp @@ -68,7 +68,8 @@ struct VectorTest: Corrade::TestSuite::Tester { void constructCopy(); void convert(); - void isZero(); + void isZeroFloat(); + void isZeroInteger(); void isNormalized(); void data(); @@ -125,7 +126,8 @@ VectorTest::VectorTest() { &VectorTest::constructCopy, &VectorTest::convert, - &VectorTest::isZero, + &VectorTest::isZeroFloat, + &VectorTest::isZeroInteger, &VectorTest::isNormalized, &VectorTest::data, @@ -256,11 +258,17 @@ void VectorTest::convert() { CORRADE_VERIFY(!(std::is_convertible::value)); } -void VectorTest::isZero() { +void VectorTest::isZeroFloat() { CORRADE_VERIFY(!Vector3(0.01f, 0.0f, 0.0f).isZero()); + CORRADE_VERIFY(Vector3(0.0f, Math::TypeTraits::epsilon()/2.0f, 0.0f).isZero()); CORRADE_VERIFY(Vector3(0.0f, 0.0f, 0.0f).isZero()); } +void VectorTest::isZeroInteger() { + CORRADE_VERIFY(!(Math::Vector<3, Int>{0, 1, 0}.isZero())); + CORRADE_VERIFY((Math::Vector<3, Int>{0, 0, 0}.isZero())); +} + void VectorTest::isNormalized() { CORRADE_VERIFY(!Vector3(1.0f, 2.0f, -1.0f).isNormalized()); CORRADE_VERIFY(Vector3(0.0f, 1.0f, 0.0f).isNormalized()); diff --git a/src/Magnum/Math/TypeTraits.h b/src/Magnum/Math/TypeTraits.h index 9c22105a9..7a081dc94 100644 --- a/src/Magnum/Math/TypeTraits.h +++ b/src/Magnum/Math/TypeTraits.h @@ -198,12 +198,6 @@ template<> struct TypeTraits: Implementation::TypeTraitsFloatingPoi namespace Implementation { -/* Proper comparison should be with epsilon^2, but the value is not - representable in given precision. Comparing to epsilon instead. */ -template inline bool isZeroSquared(T lengthSquared) { - return std::abs(lengthSquared) < TypeTraits::epsilon(); -} - /* Comparing squared length to 1 is not sufficient to compare within range [1 - epsilon, 1 + epsilon], as e.g. Quaternion with dot() = 1 + 1e-7 when converted to matrix has column vectors with dot() = 1 + 1e-6, which is just diff --git a/src/Magnum/Math/Vector.h b/src/Magnum/Math/Vector.h index cc10cccc3..8d8fc5bcf 100644 --- a/src/Magnum/Math/Vector.h +++ b/src/Magnum/Math/Vector.h @@ -54,6 +54,20 @@ namespace Implementation { template T lerp(const T& a, const T& b, U t) { return T((U(1) - t)*a + t*b); } + + template struct IsZero; + template<> struct IsZero { + template bool operator()(const Vector& vec) const { + /* Proper comparison should be with epsilon^2, but the value is not + representable in given precision. Comparing to epsilon instead. */ + return std::abs(vec.dot()) < TypeTraits::epsilon(); + } + }; + template<> struct IsZero { + template bool operator()(const Vector& vec) const { + return vec == Vector{}; + } + }; } /** @relatesalso Vector @@ -262,7 +276,7 @@ template class Vector { * @see @ref dot(), @ref normalized() */ bool isZero() const { - return Implementation::isZeroSquared(dot()); + return Implementation::IsZero::value>{}(*this); } /** From fcb72775249877ca6ef8588ea4c79fca2932701b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 28 Apr 2016 08:37:35 +0200 Subject: [PATCH 256/258] Platform: added Sdl2Application::windowSize(). --- src/Magnum/Platform/Sdl2Application.cpp | 6 ++++++ src/Magnum/Platform/Sdl2Application.h | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 70c2f00ea..aeb6b981c 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -273,6 +273,12 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { return true; } +Vector2i Sdl2Application::windowSize() { + Vector2i size; + SDL_GetWindowSize(_window, &size.x(), &size.y()); + return size; +} + void Sdl2Application::swapBuffers() { #ifndef CORRADE_TARGET_EMSCRIPTEN SDL_GL_SwapWindow(_window); diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index a04f63102..7c3c34277 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -421,6 +421,15 @@ class Sdl2Application { /** @{ @name Screen handling */ + /** + * @brief Window size + * + * Window size to which all input event coordinates can be related. + * Note that especially on HiDPI systems the reported window size might + * not be the same as framebuffer size. + */ + Vector2i windowSize(); + /** * @brief Swap buffers * From 7fecf73492a2a1c6e39e948bad13e284d225c81e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 1 May 2016 21:41:30 +0200 Subject: [PATCH 257/258] Math: minor cleanup. --- src/Magnum/Math/BoolVector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/Math/BoolVector.h b/src/Magnum/Math/BoolVector.h index 006dbff80..40cf5e3f4 100644 --- a/src/Magnum/Math/BoolVector.h +++ b/src/Magnum/Math/BoolVector.h @@ -227,7 +227,7 @@ template Corrade::Utility::Debug& operator<<(Corrade::Utility: return debug << Corrade::Utility::Debug::nospace << ")"; } -template inline bool BoolVector::operator==(const BoolVector< size >& other) const { +template inline bool BoolVector::operator==(const BoolVector& other) const { for(std::size_t i = 0; i != size/8; ++i) if(_data[i] != other._data[i]) return false; From 9fa0d8c796bc84299fd5771ea426b4d40b11c665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 1 May 2016 21:41:44 +0200 Subject: [PATCH 258/258] Math: fix lerp() with BoolVector. For some reason I swapped the order and took from the second parameter when the value was 0. Probably because of the ?: operator. --- src/Magnum/Math/Functions.h | 4 ++-- src/Magnum/Math/Test/FunctionsTest.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Math/Functions.h b/src/Magnum/Math/Functions.h index cdc137185..3c3ff7b57 100644 --- a/src/Magnum/Math/Functions.h +++ b/src/Magnum/Math/Functions.h @@ -453,7 +453,7 @@ component-wise selection from either @p a or @p b based on values in @p t. template inline Vector lerp(const Vector& a, const Vector& b, const BoolVector& t) { Vector out{NoInit}; for(std::size_t i = 0; i != size; ++i) - out[i] = t[i] ? a[i] : b[i]; + out[i] = t[i] ? b[i] : a[i]; return out; } @@ -461,7 +461,7 @@ template inline Vector lerp(const Vector inline BoolVector lerp(const BoolVector& a, const BoolVector& b, const BoolVector& t) { BoolVector out; for(std::size_t i = 0; i != size; ++i) - out.set(i, t[i] ? a[i] : b[i]); + out.set(i, t[i] ? b[i] : a[i]); return out; } diff --git a/src/Magnum/Math/Test/FunctionsTest.cpp b/src/Magnum/Math/Test/FunctionsTest.cpp index 7ab9d204a..836aa9703 100644 --- a/src/Magnum/Math/Test/FunctionsTest.cpp +++ b/src/Magnum/Math/Test/FunctionsTest.cpp @@ -251,8 +251,8 @@ void FunctionsTest::lerp() { } void FunctionsTest::lerpBool() { - CORRADE_COMPARE(Math::lerp(Vector3i{1, 2, 3}, Vector3i{5, 6, 7}, BoolVector<3>(5)), (Vector3i{1, 6, 3})); - CORRADE_COMPARE(Math::lerp(BoolVector<3>{false}, BoolVector<3>{true}, BoolVector<3>(5)), BoolVector<3>{2}); + CORRADE_COMPARE(Math::lerp(Vector3i{1, 2, 3}, Vector3i{5, 6, 7}, BoolVector<3>(5)), (Vector3i{5, 2, 7})); + CORRADE_COMPARE(Math::lerp(BoolVector<3>{false}, BoolVector<3>{true}, BoolVector<3>(5)), BoolVector<3>{5}); } void FunctionsTest::lerpInverted() {