From 8f13362f7a9f602a7dc7e05c5ec0c2bd32d48deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 28 Nov 2012 16:24:29 +0100 Subject: [PATCH 1/7] Allow attribute-less Mesh. For e.g. fullscreen triangle with no vertex data. --- src/Mesh.cpp | 2 +- src/Mesh.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Mesh.cpp b/src/Mesh.cpp index 49956a899..621642dd1 100644 --- a/src/Mesh.cpp +++ b/src/Mesh.cpp @@ -111,7 +111,7 @@ void Mesh::bindVAO(GLuint vao) { } void Mesh::bind() { - CORRADE_ASSERT((_vertexCount == 0) == attributes.empty(), "Mesh: vertex count is non-zero, but no attributes are bound", ); + CORRADE_ASSERT((_vertexCount != 0) || !attributes.empty(), "Mesh: attributes are bound but vertex count is zero", ); (this->*bindImplementation)(); } diff --git a/src/Mesh.h b/src/Mesh.h index 369d47a66..a7bcc2286 100644 --- a/src/Mesh.h +++ b/src/Mesh.h @@ -404,8 +404,9 @@ class MAGNUM_EXPORT Mesh { * * Default is zero. * @attention All bound attributes are reset after calling this - * function, so you must call - * addVertexBuffer()/addInterleavedVertexBuffer() afterwards. + * function, so if your mesh has any vertex attributes, be sure + * to call addVertexBuffer()/addInterleavedVertexBuffer() + * afterwards. * @see MeshTools::interleave() */ Mesh* setVertexCount(GLsizei vertexCount); From a9d2062efe2d776d1e5ecbf688872b40598c65b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 28 Nov 2012 16:26:50 +0100 Subject: [PATCH 2/7] More checks for sanity of Matrix4::rotation(). These should be true for all rotation matrices. --- src/Math/Test/Matrix4Test.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Math/Test/Matrix4Test.cpp b/src/Math/Test/Matrix4Test.cpp index a1e8c4cbc..7ecac7095 100644 --- a/src/Math/Test/Matrix4Test.cpp +++ b/src/Math/Test/Matrix4Test.cpp @@ -160,9 +160,13 @@ void Matrix4Test::rotationPart() { ); Matrix4 rotation = Matrix4::rotation(deg(-74.0f), Vector3(-1.0f, 2.0f, 2.0f).normalized()); + CORRADE_COMPARE(rotation.rotation().determinant(), 1.0f); + CORRADE_COMPARE(rotation.rotation()*rotation.rotation().transposed(), Matrix3()); CORRADE_COMPARE(rotation.rotation(), expectedRotationPart); Matrix4 rotationTransformed = Matrix4::translation({2.0f, 5.0f, -3.0f})*rotation*Matrix4::scaling(Vector3(9.0f)); + CORRADE_COMPARE(rotationTransformed.rotation().determinant(), 1.0f); + CORRADE_COMPARE(rotationTransformed.rotation()*rotationTransformed.rotation().transposed(), Matrix3()); CORRADE_COMPARE(rotationTransformed.rotation(), expectedRotationPart); } From b1025b7bc01daaac8aa67a7eb992cc1e12e2f674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 29 Nov 2012 16:48:25 +0100 Subject: [PATCH 3/7] Updated FindCorrade.cmake from Corrade repository. --- modules/FindCorrade.cmake | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/modules/FindCorrade.cmake b/modules/FindCorrade.cmake index 178e3b2ba..6c196f700 100644 --- a/modules/FindCorrade.cmake +++ b/modules/FindCorrade.cmake @@ -5,10 +5,20 @@ # This module tries to find Corrade library and then defines: # CORRADE_FOUND - True if Corrade library is found # CORRADE_INCLUDE_DIR - Include dir for Corrade -# CORRADE_LIBRARIES - All Corrade libraries -# CORRADE_UTILITY_LIBRARY - Corrade Utility library -# CORRADE_PLUGINMANAGER_LIBRARY - Corrade Plugin manager library +# CORRADE_UTILITY_LIBRARIES - Corrade Utility library and dependent +# libraries +# CORRADE_PLUGINMANAGER_LIBRARIES - Corrade Plugin manager library and +# dependent libraries +# CORRADE_TESTSUITE_LIBRARIES - Corrade TestSuite library and dependent +# libraries # CORRADE_RC_EXECUTABLE - Corrade resource compiler executable +# Additionally these variables are defined for internal usage: +# CORRADE_UTILITY_LIBRARY - Corrade Utility library (w/o +# dependencies) +# CORRADE_PLUGINMANAGER_LIBRARY - Corrade Plugin manager library (w/o +# dependencies) +# CORRADE_TESTSUITE_LIBRARY - Corrade TestSuite library (w/o +# dependencies) # If Corrade library is found, these macros and functions are defined: # # @@ -17,8 +27,9 @@ # sources... # [LIBRARIES libraries...]) # Test name is also executable name. You can also specify libraries to link -# with instead of using target_link_libraries(). Note that the -# enable_testing() must be called explicitly. +# with instead of using target_link_libraries(). CORRADE_TESTSUITE_LIBRARIES +# are linked atuomatically to each test. Note that the enable_testing() +# function must be called explicitly. # # # Add QtTest unit test. @@ -98,6 +109,7 @@ # Libraries find_library(CORRADE_UTILITY_LIBRARY CorradeUtility) find_library(CORRADE_PLUGINMANAGER_LIBRARY CorradePluginManager) +find_library(CORRADE_TESTSUITE_LIBRARY CorradeTestSuite) # RC executable find_program(CORRADE_RC_EXECUTABLE corrade-rc) @@ -111,6 +123,7 @@ include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Corrade DEFAULT_MSG CORRADE_UTILITY_LIBRARY CORRADE_PLUGINMANAGER_LIBRARY + CORRADE_TESTSUITE_LIBRARY CORRADE_INCLUDE_DIR CORRADE_RC_EXECUTABLE) @@ -118,6 +131,19 @@ if(NOT CORRADE_FOUND) return() endif() +# Configuration +file(READ ${CORRADE_INCLUDE_DIR}/corradeConfigure.h _corradeConfigure) + +# Compatibility? +string(FIND "${_corradeConfigure}" "#define CORRADE_GCC46_COMPATIBILITY" _GCC46_COMPATIBILITY) +if(NOT _GCC46_COMPATIBILITY EQUAL -1) + set(CORRADE_GCC46_COMPATIBILITY 1) +endif() + +set(CORRADE_UTILITY_LIBRARIES ${CORRADE_UTILITY_LIBRARY}) +set(CORRADE_PLUGINMANAGER_LIBRARIES ${CORRADE_PLUGINMANAGER_LIBRARY} ${CORRADE_UTILITY_LIBRARIES}) +set(CORRADE_TESTSUITE_LIBRARIES ${CORRADE_TESTSUITE_LIBRARY} ${CORRADE_UTILITY_LIBRARIES}) +mark_as_advanced(CORRADE_UTILITY_LIBRARY CORRADE_PLUGINMANAGER_LIBRARY CORRADE_TESTSUITE_LIBRARY) + include(CorradeMacros) include(CorradeLibSuffix) -set(CORRADE_LIBRARIES ${CORRADE_UTILITY_LIBRARY} ${CORRADE_PLUGINMANAGER_LIBRARY}) From 67f2e0fc7fee11a95eeaa3872c3b5576efa33e21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 28 Nov 2012 20:30:28 +0100 Subject: [PATCH 4/7] GCC 4.6 compatibility is now handled by Corrade. --- CMakeLists.txt | 5 ---- modules/FindMagnum.cmake | 6 ----- src/CMakeLists.txt | 1 - src/IndexedMesh.h | 2 ++ src/Magnum.h | 1 + src/Physics/AxisAlignedBox.h | 2 +- src/Physics/Box.h | 2 +- src/Physics/Capsule.h | 2 +- .../Implementation/AbstractBoxRenderer.h | 2 +- .../Implementation/AxisAlignedBoxRenderer.h | 2 +- src/Physics/Implementation/BoxRenderer.h | 2 +- src/Physics/Line.h | 2 +- src/Physics/Plane.h | 2 +- src/Physics/Point.h | 2 +- src/Physics/ShapeGroup.h | 2 +- src/Physics/Sphere.h | 2 +- src/SceneGraph/AbstractCamera.h | 4 ++-- src/SceneGraph/AbstractFeature.h | 4 ++-- src/SceneGraph/AbstractGroupedFeature.h | 4 ++-- src/SceneGraph/AbstractObject.h | 6 ++--- src/SceneGraph/AbstractTransformation.h | 4 ++-- src/SceneGraph/Drawable.h | 10 ++++---- src/SceneGraph/FeatureGroup.h | 4 ++-- src/SceneGraph/SceneGraph.h | 18 +++++++------- src/Test/ResourceManagerTest.cpp | 2 ++ src/magnumCompatibility.h | 24 ------------------- src/magnumConfigure.h.cmake | 1 - 27 files changed, 43 insertions(+), 75 deletions(-) delete mode 100644 src/magnumCompatibility.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fd72c8ec..5c54c7c86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,8 +4,6 @@ project(Magnum) include(CMakeDependentOption) -option(GCC46_COMPATIBILITY "Enable compatibility mode for GCC 4.6 (might disable some features)" OFF) - option(TARGET_GLES "Build for OpenGL ES instead of desktop OpenGL" OFF) cmake_dependent_option(TARGET_GLES2 "Build for OpenGL ES 2" ON "TARGET_GLES" OFF) @@ -55,9 +53,6 @@ endif() if(TARGET_GLES2) set(MAGNUM_TARGET_GLES2 1) endif() -if(GCC46_COMPATIBILITY) - set(MAGNUM_GCC46_COMPATIBILITY 1) -endif() # Installation paths set(MAGNUM_LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 951afd188..c3f68d972 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -67,12 +67,6 @@ find_path(MAGNUM_INCLUDE_DIR # Configuration file(READ ${MAGNUM_INCLUDE_DIR}/magnumConfigure.h _magnumConfigure) -# Compatibility? -string(FIND "${_magnumConfigure}" "#define MAGNUM_GCC46_COMPATIBILITY" _GCC46_COMPATIBILITY) -if(NOT _GCC46_COMPATIBILITY EQUAL -1) - set(MAGNUM_GCC46_COMPATIBILITY 1) -endif() - # Built for specific target? string(FIND "${_magnumConfigure}" "#define MAGNUM_TARGET_GLES" _TARGET_GLES) if(NOT _TARGET_GLES EQUAL -1) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bbb9506dc..4e9051cd8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -79,7 +79,6 @@ set(Magnum_HEADERS Timeline.h TypeTraits.h - magnumCompatibility.h magnumVisibility.h) # Desktop-only headers diff --git a/src/IndexedMesh.h b/src/IndexedMesh.h index bac40636e..0d5bfd045 100644 --- a/src/IndexedMesh.h +++ b/src/IndexedMesh.h @@ -21,6 +21,8 @@ #include "Mesh.h" +#include "corradeCompatibility.h" + namespace Magnum { /** diff --git a/src/Magnum.h b/src/Magnum.h index 363d6d97c..6635feb97 100644 --- a/src/Magnum.h +++ b/src/Magnum.h @@ -21,6 +21,7 @@ #include +#include "corradeConfigure.h" #include "magnumConfigure.h" #ifndef MAGNUM_TARGET_GLES diff --git a/src/Physics/AxisAlignedBox.h b/src/Physics/AxisAlignedBox.h index b94a1c70e..15f96d1c3 100644 --- a/src/Physics/AxisAlignedBox.h +++ b/src/Physics/AxisAlignedBox.h @@ -22,7 +22,7 @@ #include "Math/Vector3.h" #include "AbstractShape.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { diff --git a/src/Physics/Box.h b/src/Physics/Box.h index 828f9e2af..272236540 100644 --- a/src/Physics/Box.h +++ b/src/Physics/Box.h @@ -23,7 +23,7 @@ #include "Math/Matrix4.h" #include "AbstractShape.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { diff --git a/src/Physics/Capsule.h b/src/Physics/Capsule.h index f279985de..e2ff9da69 100644 --- a/src/Physics/Capsule.h +++ b/src/Physics/Capsule.h @@ -23,7 +23,7 @@ #include "AbstractShape.h" #include "Physics.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { diff --git a/src/Physics/Implementation/AbstractBoxRenderer.h b/src/Physics/Implementation/AbstractBoxRenderer.h index 87c57687e..f6ed912f7 100644 --- a/src/Physics/Implementation/AbstractBoxRenderer.h +++ b/src/Physics/Implementation/AbstractBoxRenderer.h @@ -17,7 +17,7 @@ #include "AbstractDebugRenderer.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { diff --git a/src/Physics/Implementation/AxisAlignedBoxRenderer.h b/src/Physics/Implementation/AxisAlignedBoxRenderer.h index 5ee7062ec..7eae09acf 100644 --- a/src/Physics/Implementation/AxisAlignedBoxRenderer.h +++ b/src/Physics/Implementation/AxisAlignedBoxRenderer.h @@ -19,7 +19,7 @@ #include "Physics/AxisAlignedBox.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { namespace Implementation { diff --git a/src/Physics/Implementation/BoxRenderer.h b/src/Physics/Implementation/BoxRenderer.h index 4513155c1..ef67869fd 100644 --- a/src/Physics/Implementation/BoxRenderer.h +++ b/src/Physics/Implementation/BoxRenderer.h @@ -19,7 +19,7 @@ #include "Physics/Box.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { namespace Implementation { diff --git a/src/Physics/Line.h b/src/Physics/Line.h index 9246133a4..9230be376 100644 --- a/src/Physics/Line.h +++ b/src/Physics/Line.h @@ -22,7 +22,7 @@ #include "Math/Vector3.h" #include "AbstractShape.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { diff --git a/src/Physics/Plane.h b/src/Physics/Plane.h index 4a622ec58..07cc7ad68 100644 --- a/src/Physics/Plane.h +++ b/src/Physics/Plane.h @@ -23,7 +23,7 @@ #include "AbstractShape.h" #include "Physics.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { diff --git a/src/Physics/Point.h b/src/Physics/Point.h index 5c8e48574..741874ad6 100644 --- a/src/Physics/Point.h +++ b/src/Physics/Point.h @@ -22,7 +22,7 @@ #include "Math/Vector3.h" #include "AbstractShape.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { diff --git a/src/Physics/ShapeGroup.h b/src/Physics/ShapeGroup.h index 88fd7bd1b..d1ed8bce6 100644 --- a/src/Physics/ShapeGroup.h +++ b/src/Physics/ShapeGroup.h @@ -24,7 +24,7 @@ #include #include -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { diff --git a/src/Physics/Sphere.h b/src/Physics/Sphere.h index 083fea64e..24b4dd074 100644 --- a/src/Physics/Sphere.h +++ b/src/Physics/Sphere.h @@ -23,7 +23,7 @@ #include "AbstractShape.h" #include "Physics.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { diff --git a/src/SceneGraph/AbstractCamera.h b/src/SceneGraph/AbstractCamera.h index e5a3793f6..8af0eec73 100644 --- a/src/SceneGraph/AbstractCamera.h +++ b/src/SceneGraph/AbstractCamera.h @@ -173,7 +173,7 @@ for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractCamera2D = AbstractCamera<2, T>; #endif #else @@ -190,7 +190,7 @@ for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractCamera3D = AbstractCamera<3, T>; #endif #else diff --git a/src/SceneGraph/AbstractFeature.h b/src/SceneGraph/AbstractFeature.h index 9e29b77a6..4506c2d4f 100644 --- a/src/SceneGraph/AbstractFeature.h +++ b/src/SceneGraph/AbstractFeature.h @@ -294,7 +294,7 @@ for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractFeature2D = AbstractFeature<2, T>; #endif #else @@ -311,7 +311,7 @@ for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractFeature3D = AbstractFeature<3, T>; #endif #else diff --git a/src/SceneGraph/AbstractGroupedFeature.h b/src/SceneGraph/AbstractGroupedFeature.h index c88379183..ffe33b1be 100644 --- a/src/SceneGraph/AbstractGroupedFeature.h +++ b/src/SceneGraph/AbstractGroupedFeature.h @@ -103,7 +103,7 @@ AbstractGroupedFeature for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractGroupedFeature2D = AbstractGroupedFeature<2, Derived, T>; #endif #else @@ -121,7 +121,7 @@ AbstractGroupedFeature for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractGroupedFeature3D = AbstractGroupedFeature<3, Derived, T>; #endif #else diff --git a/src/SceneGraph/AbstractObject.h b/src/SceneGraph/AbstractObject.h index 695ee1efe..08f9a4ac5 100644 --- a/src/SceneGraph/AbstractObject.h +++ b/src/SceneGraph/AbstractObject.h @@ -25,8 +25,6 @@ #include "DimensionTraits.h" #include "SceneGraph.h" -#include "magnumCompatibility.h" - namespace Magnum { namespace SceneGraph { /** @@ -190,7 +188,7 @@ for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractObject2D = AbstractObject<2, T>; #endif #else @@ -207,7 +205,7 @@ for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractObject3D = AbstractObject<3, T>; #endif #else diff --git a/src/SceneGraph/AbstractTransformation.h b/src/SceneGraph/AbstractTransformation.h index 31dc26409..718d6c09f 100644 --- a/src/SceneGraph/AbstractTransformation.h +++ b/src/SceneGraph/AbstractTransformation.h @@ -149,7 +149,7 @@ AbstractTransformation for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractTransformation2D = AbstractTransformation<2, T>; #endif #else @@ -167,7 +167,7 @@ AbstractTransformation for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractTransformation3D = AbstractTransformation<3, T>; #endif #else diff --git a/src/SceneGraph/Drawable.h b/src/SceneGraph/Drawable.h index 983d48716..9eaca737b 100644 --- a/src/SceneGraph/Drawable.h +++ b/src/SceneGraph/Drawable.h @@ -108,7 +108,7 @@ information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using Drawable2D = Drawable<2, T>; #endif #else @@ -125,7 +125,7 @@ information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using Drawable3D = Drawable<3, T>; #endif #else @@ -139,7 +139,7 @@ See Drawable for more information. @see DrawableGroup2D, DrawableGroup3D @todoc Remove workaround when Doxygen supports alias template */ -#if !defined(MAGNUM_GCC46_COMPATIBILITY) && !defined(DOXYGEN_GENERATING_OUTPUT) +#if !defined(CORRADE_GCC46_COMPATIBILITY) && !defined(DOXYGEN_GENERATING_OUTPUT) template using DrawableGroup = FeatureGroup, T>; #else #ifndef DOXYGEN_GENERATING_OUTPUT @@ -160,7 +160,7 @@ more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using DrawableGroup2D = DrawableGroup<2, T>; #endif #else @@ -177,7 +177,7 @@ more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using DrawableGroup3D = DrawableGroup<3, T>; #endif #else diff --git a/src/SceneGraph/FeatureGroup.h b/src/SceneGraph/FeatureGroup.h index a6c32c703..6ff5cd9c7 100644 --- a/src/SceneGraph/FeatureGroup.h +++ b/src/SceneGraph/FeatureGroup.h @@ -119,7 +119,7 @@ AbstractGroupedFeature for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using FeatureGroup2D = FeatureGroup<2, Feature, T>; #endif #else @@ -137,7 +137,7 @@ AbstractGroupedFeature for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using FeatureGroup3D = FeatureGroup<3, Feature, T>; #endif #else diff --git a/src/SceneGraph/SceneGraph.h b/src/SceneGraph/SceneGraph.h index d6a5337f0..e8e7bd6ad 100644 --- a/src/SceneGraph/SceneGraph.h +++ b/src/SceneGraph/SceneGraph.h @@ -23,30 +23,32 @@ #include "Magnum.h" +#include "corradeCompatibility.h" + namespace Magnum { namespace SceneGraph { enum class AspectRatioPolicy: std::uint8_t; template class AbstractCamera; -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractCamera2D = AbstractCamera<2, T>; template using AbstractCamera3D = AbstractCamera<3, T>; #endif template class AbstractFeature; -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractFeature2D = AbstractFeature<2, T>; template using AbstractFeature3D = AbstractFeature<3, T>; #endif template class AbstractGroupedFeature; -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractGroupedFeature2D = AbstractGroupedFeature<2, Derived, T>; template using AbstractGroupedFeature3D = AbstractGroupedFeature<3, Derived, T>; #endif template class AbstractObject; -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractObject2D = AbstractObject<2, T>; template using AbstractObject3D = AbstractObject<3, T>; #endif @@ -54,7 +56,7 @@ template using AbstractObject3D = AbstractObject<3, T>; enum class TransformationType: std::uint8_t; template class AbstractTransformation; -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractTransformation2D = AbstractTransformation<2, T>; template using AbstractTransformation3D = AbstractTransformation<3, T>; #endif @@ -68,18 +70,18 @@ template class Camera2D; template class Camera3D; template class Drawable; -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using Drawable2D = Drawable<2, T>; template using Drawable3D = Drawable<3, T>; #endif template class FeatureGroup; -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using FeatureGroup2D = FeatureGroup<2, Feature, T>; template using FeatureGroup3D = FeatureGroup<3, Feature, T>; #endif -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using DrawableGroup = FeatureGroup, T>; template using DrawableGroup2D = DrawableGroup<2, T>; template using DrawableGroup3D = DrawableGroup<3, T>; diff --git a/src/Test/ResourceManagerTest.cpp b/src/Test/ResourceManagerTest.cpp index 9b87ea360..bd73a6b5b 100644 --- a/src/Test/ResourceManagerTest.cpp +++ b/src/Test/ResourceManagerTest.cpp @@ -20,6 +20,8 @@ #include "AbstractResourceLoader.h" #include "ResourceManager.h" +#include "corradeCompatibility.h" + using namespace std; using namespace Corrade::Utility; diff --git a/src/magnumCompatibility.h b/src/magnumCompatibility.h deleted file mode 100644 index c69691732..000000000 --- a/src/magnumCompatibility.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef magnumCompatibility_h -#define magnumCompatibility_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - This file is part of Magnum. - - Magnum is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - Magnum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License version 3 for more details. -*/ - -#include "magnumConfigure.h" - -#ifdef MAGNUM_GCC46_COMPATIBILITY -#define override -#endif - -#endif diff --git a/src/magnumConfigure.h.cmake b/src/magnumConfigure.h.cmake index 3296b3c10..5738c3961 100644 --- a/src/magnumConfigure.h.cmake +++ b/src/magnumConfigure.h.cmake @@ -1,4 +1,3 @@ #cmakedefine MAGNUM_TARGET_NACL #cmakedefine MAGNUM_TARGET_GLES #cmakedefine MAGNUM_TARGET_GLES2 -#cmakedefine MAGNUM_GCC46_COMPATIBILITY From 265f1be2417412be7865366e4a7ea5ea0ceddcc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 28 Nov 2012 20:31:04 +0100 Subject: [PATCH 5/7] Forward declaration cleanup. --- src/Physics/Implementation/AbstractBoxRenderer.h | 6 +----- src/Physics/Implementation/AbstractDebugRenderer.h | 12 ++---------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/Physics/Implementation/AbstractBoxRenderer.h b/src/Physics/Implementation/AbstractBoxRenderer.h index f6ed912f7..2c7bcea28 100644 --- a/src/Physics/Implementation/AbstractBoxRenderer.h +++ b/src/Physics/Implementation/AbstractBoxRenderer.h @@ -19,11 +19,7 @@ #include "corradeCompatibility.h" -namespace Magnum { - -class Buffer; - -namespace Physics { namespace Implementation { +namespace Magnum { namespace Physics { namespace Implementation { template class AbstractBoxRenderer: public AbstractDebugRenderer { public: diff --git a/src/Physics/Implementation/AbstractDebugRenderer.h b/src/Physics/Implementation/AbstractDebugRenderer.h index 3d699899b..04e7a8a6b 100644 --- a/src/Physics/Implementation/AbstractDebugRenderer.h +++ b/src/Physics/Implementation/AbstractDebugRenderer.h @@ -18,17 +18,9 @@ #include "DimensionTraits.h" #include "ResourceManager.h" #include "SceneGraph/SceneGraph.h" +#include "Shaders/Shaders.h" -namespace Magnum { - -class AbstractShaderProgram; -class Mesh; - -namespace Shaders { - template class FlatShader; -} - -namespace Physics { namespace Implementation { +namespace Magnum { namespace Physics { namespace Implementation { struct Options; From 6c5d96d6452bdaad78c52091ad595b902dc91575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 28 Nov 2012 20:31:19 +0100 Subject: [PATCH 6/7] Adapted to Corrade changes. --- src/Context.cpp | 4 ++-- src/Platform/AbstractXApplication.h | 2 -- src/Platform/EglContextHandler.h | 2 +- src/Platform/GlutApplication.h | 2 -- src/Platform/GlxContextHandler.h | 2 +- src/Platform/NaClApplication.h | 2 +- src/Platform/Sdl2Application.h | 2 -- 7 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/Context.cpp b/src/Context.cpp index b620e5812..8b43039bb 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include "AbstractShaderProgram.h" #include "AbstractTexture.h" @@ -253,7 +253,7 @@ Context::Context() { /* Don't crash when glGetString() returns nullptr */ const char* e = reinterpret_cast(glGetString(GL_EXTENSIONS)); if(e) { - vector extensions = Corrade::Utility::split(e, ' '); + vector extensions = Corrade::Utility::String::split(e, ' '); for(const string& extension: extensions) { auto found = futureExtensions.find(extension); if(found != futureExtensions.end()) { diff --git a/src/Platform/AbstractXApplication.h b/src/Platform/AbstractXApplication.h index aef67aef4..783f7c479 100644 --- a/src/Platform/AbstractXApplication.h +++ b/src/Platform/AbstractXApplication.h @@ -32,8 +32,6 @@ #include "Math/Vector2.h" #include "AbstractContextHandler.h" -#include "magnumCompatibility.h" - namespace Magnum { class Context; diff --git a/src/Platform/EglContextHandler.h b/src/Platform/EglContextHandler.h index 1198695d0..878e5d3ab 100644 --- a/src/Platform/EglContextHandler.h +++ b/src/Platform/EglContextHandler.h @@ -31,7 +31,7 @@ #include "AbstractContextHandler.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Platform { diff --git a/src/Platform/GlutApplication.h b/src/Platform/GlutApplication.h index d476ebcc6..07e5c4572 100644 --- a/src/Platform/GlutApplication.h +++ b/src/Platform/GlutApplication.h @@ -26,8 +26,6 @@ #include -#include "magnumCompatibility.h" - namespace Magnum { class Context; diff --git a/src/Platform/GlxContextHandler.h b/src/Platform/GlxContextHandler.h index e59eb8083..8922f9bf5 100644 --- a/src/Platform/GlxContextHandler.h +++ b/src/Platform/GlxContextHandler.h @@ -27,7 +27,7 @@ #include "AbstractContextHandler.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Platform { diff --git a/src/Platform/NaClApplication.h b/src/Platform/NaClApplication.h index 7a32d68cf..aabdb6c9a 100644 --- a/src/Platform/NaClApplication.h +++ b/src/Platform/NaClApplication.h @@ -31,7 +31,7 @@ #include "Math/Vector2.h" #include "Magnum.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace pp { class Graphics3D; diff --git a/src/Platform/Sdl2Application.h b/src/Platform/Sdl2Application.h index ab3eb217d..c7b634d31 100644 --- a/src/Platform/Sdl2Application.h +++ b/src/Platform/Sdl2Application.h @@ -26,8 +26,6 @@ #include #include -#include "magnumCompatibility.h" - namespace Magnum { class Context; From 1482dd9f504d3e9504db1ba0b92e333f1c278e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 29 Nov 2012 16:48:49 +0100 Subject: [PATCH 7/7] FindMagnum.cmake: Don't expose *_LIBRARY and *_INCLUDE_DIR to users. --- modules/FindMagnum.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index c3f68d972..52d1bd474 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -184,16 +184,17 @@ foreach(component ${Magnum_FIND_COMPONENTS}) find_path(_MAGNUM_${_COMPONENT}_INCLUDE_DIR NAMES ${_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES} PATHS ${MAGNUM_INCLUDE_DIR}/${_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX}) - - # Don't expose this variable to end users - mark_as_advanced(FORCE _MAGNUM_${_COMPONENT}_INCLUDE_DIR) endif() # 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}) set(MAGNUM_${_COMPONENT}_INCLUDE_DIRS ${_MAGNUM_${_COMPONENT}_INCLUDE_DIRS}) + set(Magnum_${component}_FOUND TRUE) + + # Don't expose variables w/o dependencies to end users + mark_as_advanced(FORCE MAGNUM_${_COMPONENT}_LIBRARY _MAGNUM_${_COMPONENT}_INCLUDE_DIR) else() set(Magnum_${component}_FOUND FALSE) endif()